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:
Andreas Sandberg
2017-07-20 11:58:06 +01:00
parent 74d3f8a176
commit 20de3bb759
24 changed files with 75 additions and 38 deletions

View File

@@ -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')

View File

@@ -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"

View File

@@ -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?

View File

@@ -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"

View File

@@ -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;

View File

@@ -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;

View File

@@ -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"

View File

@@ -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
View 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')

View File

@@ -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"

View File

@@ -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")

View File

@@ -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"

View File

@@ -37,7 +37,7 @@
* Authors: Andreas Sandberg
*/
#include "dev/serial.hh"
#include "dev/serial/serial.hh"
#include "base/misc.hh"
#include "params/SerialDevice.hh"

View File

@@ -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;

View File

@@ -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"

View File

@@ -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),

View File

@@ -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;

View File

@@ -32,7 +32,7 @@
* Implements a 8250 UART
*/
#include "dev/uart8250.hh"
#include "dev/serial/uart8250.hh"
#include <string>
#include <vector>

View File

@@ -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

View File

@@ -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;

View File

@@ -42,7 +42,6 @@
#include "dev/virtio/base.hh"
#include "dev/storage/disk_image.hh"
#include "dev/terminal.hh"
struct VirtIOBlockParams;

View File

@@ -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;

View File

@@ -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"