Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/50335 )

Change subject: configs,dev: Rename the riscv version of VirtIOMMIO with a Riscv prefix.
......................................................................

configs,dev: Rename the riscv version of VirtIOMMIO with a Riscv prefix.

This device and the file it's in have the same name as one already
defined by arm. This is basically ok when those are mutually exclusive,
but can't coexist when both ISAs can be included at the same time. This
is because the file name would put them both under
m5.objects.VirtIOMMIO, and the name of the object itself would conflict
when importing * from m5.objects.

Change-Id: I558676b7d64cc68adb2d81b070a1816aa0bea6ba
---
M configs/example/riscv/fs_linux.py
R src/dev/riscv/RiscvVirtIOMMIO.py
M src/dev/riscv/SConscript
M src/dev/riscv/vio_mmio.cc
M src/dev/riscv/vio_mmio.hh
5 files changed, 19 insertions(+), 9 deletions(-)



diff --git a/configs/example/riscv/fs_linux.py b/configs/example/riscv/fs_linux.py
index 982dfa4..2947c1e 100644
--- a/configs/example/riscv/fs_linux.py
+++ b/configs/example/riscv/fs_linux.py
@@ -170,7 +170,7 @@
 if args.disk_image:
image = CowDiskImage(child=RawDiskImage(read_only=True), read_only=False)
     image.child.image_file = mdesc.disks()[0]
-    system.platform.disk = MmioVirtIO(
+    system.platform.disk = RiscvMmioVirtIO(
         vio=VirtIOBlock(image=image),
         interrupt_id=0x8,
         pio_size=4096,
diff --git a/src/dev/riscv/VirtIOMMIO.py b/src/dev/riscv/RiscvVirtIOMMIO.py
similarity index 95%
rename from src/dev/riscv/VirtIOMMIO.py
rename to src/dev/riscv/RiscvVirtIOMMIO.py
index 6068a53..6bdb9dd 100644
--- a/src/dev/riscv/VirtIOMMIO.py
+++ b/src/dev/riscv/RiscvVirtIOMMIO.py
@@ -42,10 +42,10 @@
 from m5.objects.PlicDevice import PlicIntDevice
 from m5.objects.VirtIO import VirtIODummyDevice

-class MmioVirtIO(PlicIntDevice):
-    type = 'MmioVirtIO'
+class RiscvMmioVirtIO(PlicIntDevice):
+    type = 'RiscvMmioVirtIO'
     cxx_header = 'dev/riscv/vio_mmio.hh'
-    cxx_class = 'gem5::MmioVirtIO'
+    cxx_class = 'gem5::RiscvISA::MmioVirtIO'
     vio = Param.VirtIODeviceBase(VirtIODummyDevice(), "VirtIO device")

     def generateDeviceTree(self, state):
diff --git a/src/dev/riscv/SConscript b/src/dev/riscv/SConscript
index 57d61c2..7de03bf 100755
--- a/src/dev/riscv/SConscript
+++ b/src/dev/riscv/SConscript
@@ -35,7 +35,7 @@
     SimObject('PlicDevice.py')
     SimObject('Plic.py')
     SimObject('RTC.py')
-    SimObject('VirtIOMMIO.py')
+    SimObject('RiscvVirtIOMMIO.py')

     DebugFlag('Clint')
     DebugFlag('Plic')
diff --git a/src/dev/riscv/vio_mmio.cc b/src/dev/riscv/vio_mmio.cc
index 9f24ede..8624a1c 100644
--- a/src/dev/riscv/vio_mmio.cc
+++ b/src/dev/riscv/vio_mmio.cc
@@ -41,12 +41,15 @@
 #include "debug/VirtIOMMIO.hh"
 #include "dev/riscv/hifive.hh"
 #include "mem/packet_access.hh"
-#include "params/MmioVirtIO.hh"
+#include "params/RiscvMmioVirtIO.hh"

 namespace gem5
 {

-MmioVirtIO::MmioVirtIO(const MmioVirtIOParams &params)
+namespace RiscvISA
+{
+
+MmioVirtIO::MmioVirtIO(const RiscvMmioVirtIOParams &params)
     : PlicIntDevice(params),
       hostFeaturesSelect(0), guestFeaturesSelect(0), pageSize(0),
       interruptStatus(0), vio(*params.vio)
@@ -274,4 +277,6 @@
     }
 }

+} // namespace RiscvISA
+
 } // namespace gem5
diff --git a/src/dev/riscv/vio_mmio.hh b/src/dev/riscv/vio_mmio.hh
index 50df354..fb9a851 100644
--- a/src/dev/riscv/vio_mmio.hh
+++ b/src/dev/riscv/vio_mmio.hh
@@ -46,12 +46,15 @@
 namespace gem5
 {

-struct MmioVirtIOParams;
+struct RiscvMmioVirtIOParams;
+
+namespace RiscvISA
+{

 class MmioVirtIO : public PlicIntDevice
 {
   public:
-    MmioVirtIO(const MmioVirtIOParams &params);
+    MmioVirtIO(const RiscvMmioVirtIOParams &params);
     virtual ~MmioVirtIO();

   protected: // BasicPioDevice
@@ -113,6 +116,8 @@
     VirtIODeviceBase &vio;
 };

+} // namespace RiscvISA
+
 } // namespace gem5

 #endif // __DEV_ARM_VIO_MMIO_HH__

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50335
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I558676b7d64cc68adb2d81b070a1816aa0bea6ba
Gerrit-Change-Number: 50335
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to