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)
62 virtual std::streampos
size()
const = 0;
64 virtual std::streampos
read(uint8_t *
data,
65 std::streampos
offset)
const = 0;
66 virtual std::streampos
write(
const uint8_t *
data,
67 std::streampos
offset) = 0;
89 void open(
const std::string &filename,
bool rd_only =
false);
91 std::streampos
size()
const override;
93 std::streampos
read(uint8_t *
data, std::streampos
offset)
const override;
94 std::streampos
write(
const uint8_t *
data, std::streampos
offset)
override;
133 bool open(
const std::string &file);
135 void save(
const std::string &file)
const;
141 std::streampos
size()
const override;
143 std::streampos
read(uint8_t *
data, std::streampos
offset)
const override;
144 std::streampos
write(
const uint8_t *
data, std::streampos
offset)
override;
166 #endif // __DEV_STORAGE_DISK_IMAGE_HH__
std::streampos write(const uint8_t *data, std::streampos offset) override
RawDiskImageParams Params
std::streampos size() const override
CowDiskImage(const Params &p)
CowDiskImageParams Params
void serialize(CheckpointOut &cp) const override
Serialize an object.
DiskImage(const Params &p)
RawDiskImage(const Params &p)
std::unordered_map< uint64_t, Sector * > SectorTable
virtual std::streampos write(const uint8_t *data, std::streampos offset)=0
void notifyFork() override
Notify a child process of a fork.
void notifyFork() override
Notify a child process of a fork.
std::streampos read(uint8_t *data, std::streampos offset) const override
Basic interface for accessing a disk image.
void SafeWrite(std::ofstream &stream, const void *data, int count)
Specialization for accessing a raw disk image.
void SafeWriteSwap(std::ofstream &stream, const T &data)
void SafeRead(std::ifstream &stream, void *data, int count)
Abstract superclass for simulation objects.
static const uint32_t VersionMajor
void initSectorTable(int hash_size)
std::streampos read(uint8_t *data, std::streampos offset) const override
void open(const std::string &filename, bool rd_only=false)
virtual std::streampos size() const =0
std::streampos size() const override
virtual std::streampos read(uint8_t *data, std::streampos offset) const =0
std::ostream CheckpointOut
Specialization for accessing a copy-on-write disk image layer.
void SafeReadSwap(std::ifstream &stream, T &data)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
static const uint32_t VersionMinor
bool open(const std::string &file)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
std::streampos write(const uint8_t *data, std::streampos offset) override
Generated on Tue Sep 7 2021 14:53:47 for gem5 by doxygen 1.8.17