Go to the documentation of this file.
33 #ifndef __DEV_STORAGE_DISK_IMAGE_HH__
34 #define __DEV_STORAGE_DISK_IMAGE_HH__
37 #include <unordered_map>
39 #include "params/CowDiskImage.hh"
40 #include "params/DiskImage.hh"
41 #include "params/RawDiskImage.hh"
44 #define SectorSize (512)
59 virtual std::streampos
size()
const = 0;
61 virtual std::streampos
read(uint8_t *
data,
62 std::streampos
offset)
const = 0;
63 virtual std::streampos
write(
const uint8_t *
data,
64 std::streampos
offset) = 0;
86 void open(
const std::string &filename,
bool rd_only =
false);
88 std::streampos
size()
const override;
90 std::streampos
read(uint8_t *
data, std::streampos
offset)
const override;
91 std::streampos
write(
const uint8_t *
data, std::streampos
offset)
override;
129 bool open(
const std::string &file);
131 void save(
const std::string &file)
const;
137 std::streampos
size()
const override;
139 std::streampos
read(uint8_t *
data, std::streampos
offset)
const override;
140 std::streampos
write(
const uint8_t *
data, std::streampos
offset)
override;
159 #endif // __DEV_STORAGE_DISK_IMAGE_HH__
Specialization for accessing a raw disk image.
void SafeWrite(std::ofstream &stream, const void *data, int count)
virtual std::streampos write(const uint8_t *data, std::streampos offset)=0
std::streampos write(const uint8_t *data, std::streampos offset) override
void notifyFork() override
Notify a child process of a fork.
std::streampos size() const override
virtual std::streampos size() const =0
CowDiskImage(const Params *p)
void SafeWriteSwap(std::ofstream &stream, const T &data)
void SafeReadSwap(std::ifstream &stream, T &data)
Basic interface for accessing a disk image.
std::streampos size() const override
RawDiskImage(const Params *p)
std::streampos read(uint8_t *data, std::streampos offset) const override
Specialization for accessing a copy-on-write disk image layer.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void notifyFork() override
Notify a child process of a fork.
bool open(const std::string &file)
std::streampos write(const uint8_t *data, std::streampos offset) override
DiskImage(const Params *p)
RawDiskImageParams Params
CowDiskImageParams Params
static const uint32_t VersionMajor
static const uint32_t VersionMinor
virtual std::streampos read(uint8_t *data, std::streampos offset) const =0
std::ostream CheckpointOut
void open(const std::string &filename, bool rd_only=false)
void SafeRead(std::ifstream &stream, void *data, int count)
std::unordered_map< uint64_t, Sector * > SectorTable
void serialize(CheckpointOut &cp) const override
Serialize an object.
std::streampos read(uint8_t *data, std::streampos offset) const override
void initSectorTable(int hash_size)
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17