summaryrefslogtreecommitdiff
path: root/src/dev/disk_image.cc
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2007-07-23 21:51:38 -0700
committerNathan Binkert <nate@binkert.org>2007-07-23 21:51:38 -0700
commitabc76f20cb98c90e8dab416dd16dfd4a954013ba (patch)
treef3131e68a09c1b4537e17df5b14df21df53746e4 /src/dev/disk_image.cc
parent552097b92e37fb4c0fd27960afe0a03c02894f11 (diff)
downloadgem5-abc76f20cb98c90e8dab416dd16dfd4a954013ba.tar.xz
Major changes to how SimObjects are created and initialized. Almost all
creation and initialization now happens in python. Parameter objects are generated and initialized by python. The .ini file is now solely for debugging purposes and is not used in construction of the objects in any way. --HG-- extra : convert_revision : 7e722873e417cb3d696f2e34c35ff488b7bff4ed
Diffstat (limited to 'src/dev/disk_image.cc')
-rw-r--r--src/dev/disk_image.cc56
1 files changed, 9 insertions, 47 deletions
diff --git a/src/dev/disk_image.cc b/src/dev/disk_image.cc
index f70d2ccdb..1cccf3a0f 100644
--- a/src/dev/disk_image.cc
+++ b/src/dev/disk_image.cc
@@ -45,7 +45,8 @@
#include "base/misc.hh"
#include "base/trace.hh"
#include "dev/disk_image.hh"
-#include "sim/builder.hh"
+#include "params/CowDiskImage.hh"
+#include "params/RawDiskImage.hh"
#include "sim/sim_exit.hh"
#include "sim/byteswap.hh"
@@ -143,30 +144,12 @@ RawDiskImage::write(const uint8_t *data, off_t offset)
return stream.tellp() - pos;
}
-DEFINE_SIM_OBJECT_CLASS_NAME("DiskImage", DiskImage)
-
-BEGIN_DECLARE_SIM_OBJECT_PARAMS(RawDiskImage)
-
- Param<string> image_file;
- Param<bool> read_only;
-
-END_DECLARE_SIM_OBJECT_PARAMS(RawDiskImage)
-
-BEGIN_INIT_SIM_OBJECT_PARAMS(RawDiskImage)
-
- INIT_PARAM(image_file, "disk image file"),
- INIT_PARAM_DFLT(read_only, "read only image", false)
-
-END_INIT_SIM_OBJECT_PARAMS(RawDiskImage)
-
-
-CREATE_SIM_OBJECT(RawDiskImage)
+RawDiskImage *
+RawDiskImageParams::create()
{
- return new RawDiskImage(getInstanceName(), image_file, read_only);
+ return new RawDiskImage(name, image_file, read_only);
}
-REGISTER_SIM_OBJECT("RawDiskImage", RawDiskImage)
-
////////////////////////////////////////////////////////////////////////
//
// Copy on Write Disk image
@@ -440,33 +423,12 @@ CowDiskImage::unserialize(Checkpoint *cp, const string &section)
open(cowFilename);
}
-BEGIN_DECLARE_SIM_OBJECT_PARAMS(CowDiskImage)
-
- SimObjectParam<DiskImage *> child;
- Param<string> image_file;
- Param<int> table_size;
- Param<bool> read_only;
-
-END_DECLARE_SIM_OBJECT_PARAMS(CowDiskImage)
-
-BEGIN_INIT_SIM_OBJECT_PARAMS(CowDiskImage)
-
- INIT_PARAM(child, "child image"),
- INIT_PARAM_DFLT(image_file, "disk image file", ""),
- INIT_PARAM_DFLT(table_size, "initial table size", 65536),
- INIT_PARAM_DFLT(read_only, "don't write back to the copy-on-write file",
- true)
-
-END_INIT_SIM_OBJECT_PARAMS(CowDiskImage)
-
-
-CREATE_SIM_OBJECT(CowDiskImage)
+CowDiskImage *
+CowDiskImageParams::create()
{
if (((string)image_file).empty())
- return new CowDiskImage(getInstanceName(), child, table_size);
+ return new CowDiskImage(name, child, table_size);
else
- return new CowDiskImage(getInstanceName(), child, table_size,
+ return new CowDiskImage(name, child, table_size,
image_file, read_only);
}
-
-REGISTER_SIM_OBJECT("CowDiskImage", CowDiskImage)