From ef097ac4381ad2f14acda640ae198f04d9f7988d Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Thu, 10 Dec 2015 10:35:18 +0000 Subject: [PATCH] dev: Move i2c functionality to src/dev/i2c/ --HG-- rename : src/dev/I2C.py => src/dev/i2c/I2C.py rename : src/dev/i2cbus.cc => src/dev/i2c/bus.cc rename : src/dev/i2cbus.hh => src/dev/i2c/bus.hh rename : src/dev/i2cdev.hh => src/dev/i2c/device.hh --- src/dev/SConscript | 2 -- src/dev/{ => i2c}/I2C.py | 4 ++-- src/dev/{i2cbus.cc => i2c/bus.cc} | 3 ++- src/dev/{i2cbus.hh => i2c/bus.hh} | 9 +++++---- src/dev/{i2cdev.hh => i2c/device.hh} | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) rename src/dev/{ => i2c}/I2C.py (97%) rename src/dev/{i2cbus.cc => i2c/bus.cc} (99%) rename src/dev/{i2cbus.hh => i2c/bus.hh} (97%) rename src/dev/{i2cdev.hh => i2c/device.hh} (97%) diff --git a/src/dev/SConscript b/src/dev/SConscript index 53bb28456..4bacb3e3f 100644 --- a/src/dev/SConscript +++ b/src/dev/SConscript @@ -42,7 +42,6 @@ if env['TARGET_ISA'] == 'null': SimObject('BadDevice.py') SimObject('DiskImage.py') SimObject('Ethernet.py') -SimObject('I2C.py') SimObject('Ide.py') SimObject('Platform.py') SimObject('SimpleDisk.py') @@ -63,7 +62,6 @@ Source('multi_etherlink.cc') Source('tcp_iface.cc') Source('etherpkt.cc') Source('ethertap.cc') -Source('i2cbus.cc') Source('i8254xGBe.cc') Source('ide_ctrl.cc') Source('ide_disk.cc') diff --git a/src/dev/I2C.py b/src/dev/i2c/I2C.py similarity index 97% rename from src/dev/I2C.py rename to src/dev/i2c/I2C.py index 2ac463fbc..f249d0648 100644 --- a/src/dev/I2C.py +++ b/src/dev/i2c/I2C.py @@ -41,11 +41,11 @@ from Device import BasicPioDevice class I2CDevice(SimObject): type = 'I2CDevice' - cxx_header = "dev/i2cdev.hh" + cxx_header = "dev/i2c/device.hh" abstract = True i2c_addr = Param.UInt8("Address of device on i2c bus") class I2CBus(BasicPioDevice): type = 'I2CBus' - cxx_header = "dev/i2cbus.hh" + cxx_header = "dev/i2c/bus.hh" devices = VectorParam.I2CDevice([], "Devices") diff --git a/src/dev/i2cbus.cc b/src/dev/i2c/bus.cc similarity index 99% rename from src/dev/i2cbus.cc rename to src/dev/i2c/bus.cc index 03ca6769c..af5d6c825 100644 --- a/src/dev/i2cbus.cc +++ b/src/dev/i2c/bus.cc @@ -37,9 +37,10 @@ * Authors: Peter Enns */ -#include "dev/i2cbus.hh" +#include "dev/i2c/bus.hh" #include "debug/Checkpoint.hh" +#include "dev/i2c/device.hh" #include "mem/packet_access.hh" // clang complains about std::set being overloaded with Packet::set if diff --git a/src/dev/i2cbus.hh b/src/dev/i2c/bus.hh similarity index 97% rename from src/dev/i2cbus.hh rename to src/dev/i2c/bus.hh index 7212a59fd..d4f02b827 100644 --- a/src/dev/i2cbus.hh +++ b/src/dev/i2c/bus.hh @@ -42,15 +42,16 @@ * Implementiation of an i2c bus */ -#ifndef __DEV_I2CBUS__ -#define __DEV_I2CBUS__ +#ifndef __DEV_I2C_BUS_HH__ +#define __DEV_I2C_BUS_HH__ #include -#include "dev/i2cdev.hh" #include "dev/io_device.hh" #include "params/I2CBus.hh" +class I2CDevice; + class I2CBus : public BasicPioDevice { protected: @@ -150,4 +151,4 @@ class I2CBus : public BasicPioDevice void unserialize(CheckpointIn &cp) override; }; -#endif //__DEV_I2CBUS +#endif // __DEV_I2C_BUS_HH__ diff --git a/src/dev/i2cdev.hh b/src/dev/i2c/device.hh similarity index 97% rename from src/dev/i2cdev.hh rename to src/dev/i2c/device.hh index d101483fd..efef2bf5e 100644 --- a/src/dev/i2cdev.hh +++ b/src/dev/i2c/device.hh @@ -42,8 +42,8 @@ * All i2c devices should derive from this class. */ -#ifndef __DEV_I2CDEV__ -#define __DEV_I2CDEV__ +#ifndef __DEV_I2C_DEVICE_HH__ +#define __DEV_I2C_DEVICE_HH__ #include "base/types.hh" #include "params/I2CDevice.hh" @@ -93,4 +93,4 @@ class I2CDevice : public SimObject }; -#endif // __DEV_I2CDEV__ +#endif // __DEV_I2C_DEVICE__ -- 2.30.2