dev: Move generic serial devices to src/dev/serial
Change-Id: I104227fc460f8b561e7375b329a541c1fce881b2 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com> Reviewed-on: https://gem5-review.googlesource.com/4291 Reviewed-by: Gabe Black <gabeblack@google.com>
This commit is contained in:
@@ -44,9 +44,6 @@ if env['TARGET_ISA'] == 'null':
|
||||
|
||||
SimObject('BadDevice.py')
|
||||
SimObject('Platform.py')
|
||||
SimObject('Serial.py')
|
||||
SimObject('Terminal.py')
|
||||
SimObject('Uart.py')
|
||||
|
||||
Source('baddev.cc')
|
||||
Source('intel_8254_timer.cc')
|
||||
@@ -54,13 +51,6 @@ Source('mc146818.cc')
|
||||
Source('pixelpump.cc')
|
||||
Source('platform.cc')
|
||||
Source('ps2.cc')
|
||||
Source('serial.cc')
|
||||
Source('terminal.cc')
|
||||
Source('uart.cc')
|
||||
Source('uart8250.cc')
|
||||
|
||||
DebugFlag('Intel8254Timer')
|
||||
DebugFlag('MC146818')
|
||||
DebugFlag('Terminal')
|
||||
DebugFlag('TerminalVerbose')
|
||||
DebugFlag('Uart')
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "dev/alpha/tsunami_io.hh"
|
||||
#include "dev/platform.hh"
|
||||
#include "dev/storage/simple_disk.hh"
|
||||
#include "dev/terminal.hh"
|
||||
#include "dev/serial/terminal.hh"
|
||||
#include "mem/packet.hh"
|
||||
#include "mem/packet_access.hh"
|
||||
#include "mem/physical.hh"
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
#include "dev/alpha/tsunami_cchip.hh"
|
||||
#include "dev/alpha/tsunami_io.hh"
|
||||
#include "dev/alpha/tsunami_pchip.hh"
|
||||
#include "dev/terminal.hh"
|
||||
|
||||
using namespace std;
|
||||
//Should this be AlphaISA?
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include "debug/GIC.hh"
|
||||
#include "debug/IPI.hh"
|
||||
#include "debug/Interrupt.hh"
|
||||
#include "dev/terminal.hh"
|
||||
#include "mem/packet.hh"
|
||||
#include "mem/packet_access.hh"
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#define __DEV_ARM_PL011_H__
|
||||
|
||||
#include "dev/arm/amba_device.hh"
|
||||
#include "dev/uart.hh"
|
||||
#include "dev/serial/uart.hh"
|
||||
|
||||
class BaseGic;
|
||||
struct Pl011Params;
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
#include "config/the_isa.hh"
|
||||
#include "cpu/intr_control.hh"
|
||||
#include "dev/arm/base_gic.hh"
|
||||
#include "dev/terminal.hh"
|
||||
#include "sim/system.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "debug/Checkpoint.hh"
|
||||
#include "debug/VGIC.hh"
|
||||
#include "dev/arm/base_gic.hh"
|
||||
#include "dev/terminal.hh"
|
||||
#include "mem/packet.hh"
|
||||
#include "mem/packet_access.hh"
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
#include "debug/Malta.hh"
|
||||
#include "dev/mips/malta_cchip.hh"
|
||||
#include "dev/mips/malta_io.hh"
|
||||
#include "dev/terminal.hh"
|
||||
#include "params/Malta.hh"
|
||||
#include "sim/system.hh"
|
||||
|
||||
|
||||
59
src/dev/serial/SConscript
Normal file
59
src/dev/serial/SConscript
Normal file
@@ -0,0 +1,59 @@
|
||||
# -*- mode:python -*-
|
||||
|
||||
# Copyright (c) 2017 ARM Limited
|
||||
# All rights reserved.
|
||||
#
|
||||
# The license below extends only to copyright in the software and shall
|
||||
# not be construed as granting a license to any other intellectual
|
||||
# property including but not limited to intellectual property relating
|
||||
# to a hardware implementation of the functionality of the software
|
||||
# licensed hereunder. You may use the software subject to the license
|
||||
# terms below provided that you ensure that this notice is replicated
|
||||
# unmodified and in its entirety in all distributions of the software,
|
||||
# modified or unmodified, in source code or in binary form.
|
||||
#
|
||||
# Copyright (c) 2006 The Regents of The University of Michigan
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met: redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer;
|
||||
# redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution;
|
||||
# neither the name of the copyright holders nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# Authors: Andreas Sandberg
|
||||
|
||||
Import('*')
|
||||
|
||||
if env['TARGET_ISA'] == 'null':
|
||||
Return()
|
||||
|
||||
SimObject('Serial.py')
|
||||
SimObject('Terminal.py')
|
||||
SimObject('Uart.py')
|
||||
|
||||
Source('serial.cc')
|
||||
Source('terminal.cc')
|
||||
Source('uart.cc')
|
||||
Source('uart8250.cc')
|
||||
|
||||
DebugFlag('Terminal')
|
||||
DebugFlag('TerminalVerbose')
|
||||
DebugFlag('Uart')
|
||||
@@ -41,8 +41,8 @@ from m5.SimObject import SimObject
|
||||
class SerialDevice(SimObject):
|
||||
type = 'SerialDevice'
|
||||
abstract = True
|
||||
cxx_header = "dev/serial.hh"
|
||||
cxx_header = "dev/serial/serial.hh"
|
||||
|
||||
class SerialNullDevice(SerialDevice):
|
||||
type = 'SerialNullDevice'
|
||||
cxx_header = "dev/serial.hh"
|
||||
cxx_header = "dev/serial/serial.hh"
|
||||
@@ -33,7 +33,7 @@ from Serial import SerialDevice
|
||||
|
||||
class Terminal(SerialDevice):
|
||||
type = 'Terminal'
|
||||
cxx_header = "dev/terminal.hh"
|
||||
cxx_header = "dev/serial/terminal.hh"
|
||||
intr_control = Param.IntrControl(Parent.any, "interrupt controller")
|
||||
port = Param.TcpPort(3456, "listen port")
|
||||
number = Param.Int(0, "terminal number")
|
||||
@@ -34,10 +34,10 @@ from Serial import SerialDevice
|
||||
class Uart(BasicPioDevice):
|
||||
type = 'Uart'
|
||||
abstract = True
|
||||
cxx_header = "dev/uart.hh"
|
||||
cxx_header = "dev/serial/uart.hh"
|
||||
platform = Param.Platform(Parent.any, "Platform this device is part of.")
|
||||
device = Param.SerialDevice(Parent.any, "The terminal")
|
||||
|
||||
class Uart8250(Uart):
|
||||
type = 'Uart8250'
|
||||
cxx_header = "dev/uart8250.hh"
|
||||
cxx_header = "dev/serial/uart8250.hh"
|
||||
@@ -37,7 +37,7 @@
|
||||
* Authors: Andreas Sandberg
|
||||
*/
|
||||
|
||||
#include "dev/serial.hh"
|
||||
#include "dev/serial/serial.hh"
|
||||
|
||||
#include "base/misc.hh"
|
||||
#include "params/SerialDevice.hh"
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <sys/termios.h>
|
||||
|
||||
#endif
|
||||
#include "dev/terminal.hh"
|
||||
#include "dev/serial/terminal.hh"
|
||||
|
||||
#include <poll.h>
|
||||
#include <unistd.h>
|
||||
@@ -62,7 +62,7 @@
|
||||
#include "debug/Terminal.hh"
|
||||
#include "debug/TerminalVerbose.hh"
|
||||
#include "dev/platform.hh"
|
||||
#include "dev/uart.hh"
|
||||
#include "dev/serial/uart.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include "base/pollevent.hh"
|
||||
#include "base/socket.hh"
|
||||
#include "cpu/intr_control.hh"
|
||||
#include "dev/serial.hh"
|
||||
#include "dev/serial/serial.hh"
|
||||
#include "params/Terminal.hh"
|
||||
#include "sim/sim_object.hh"
|
||||
|
||||
@@ -32,11 +32,7 @@
|
||||
* Implements a base class for UARTs
|
||||
*/
|
||||
|
||||
#include "dev/uart.hh"
|
||||
|
||||
#include "dev/serial.hh"
|
||||
|
||||
using namespace std;
|
||||
#include "dev/serial/uart.hh"
|
||||
|
||||
Uart::Uart(const Params *p, Addr pio_size)
|
||||
: BasicPioDevice(p, pio_size),
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#include "base/callback.hh"
|
||||
#include "dev/io_device.hh"
|
||||
#include "dev/serial.hh"
|
||||
#include "dev/serial/serial.hh"
|
||||
#include "params/Uart.hh"
|
||||
|
||||
class Platform;
|
||||
@@ -32,7 +32,7 @@
|
||||
* Implements a 8250 UART
|
||||
*/
|
||||
|
||||
#include "dev/uart8250.hh"
|
||||
#include "dev/serial/uart8250.hh"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -36,7 +36,7 @@
|
||||
#define __DEV_UART8250_HH__
|
||||
|
||||
#include "dev/io_device.hh"
|
||||
#include "dev/uart.hh"
|
||||
#include "dev/serial/uart.hh"
|
||||
#include "params/Uart8250.hh"
|
||||
|
||||
/* UART8250 Interrupt ID Register
|
||||
@@ -40,7 +40,6 @@
|
||||
|
||||
#include "config/the_isa.hh"
|
||||
#include "cpu/intr_control.hh"
|
||||
#include "dev/terminal.hh"
|
||||
#include "sim/system.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
|
||||
#include "dev/virtio/base.hh"
|
||||
#include "dev/storage/disk_image.hh"
|
||||
#include "dev/terminal.hh"
|
||||
|
||||
struct VirtIOBlockParams;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#ifndef __DEV_VIRTIO_CONSOLE_HH__
|
||||
#define __DEV_VIRTIO_CONSOLE_HH__
|
||||
|
||||
#include "dev/serial.hh"
|
||||
#include "dev/serial/serial.hh"
|
||||
#include "dev/virtio/base.hh"
|
||||
|
||||
struct VirtIOConsoleParams;
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#include "arch/x86/x86_traits.hh"
|
||||
#include "config/the_isa.hh"
|
||||
#include "cpu/intr_control.hh"
|
||||
#include "dev/terminal.hh"
|
||||
#include "dev/x86/i82094aa.hh"
|
||||
#include "dev/x86/i8254.hh"
|
||||
#include "dev/x86/i8259.hh"
|
||||
|
||||
Reference in New Issue
Block a user