gem5  v21.0.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Functions
disk_image.cc File Reference
#include "dev/storage/disk_image.hh"
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include <cerrno>
#include <cstring>
#include <fstream>
#include <string>
#include "base/callback.hh"
#include "base/logging.hh"
#include "base/trace.hh"
#include "debug/DiskImageRead.hh"
#include "debug/DiskImageWrite.hh"
#include "sim/byteswap.hh"
#include "sim/serialize.hh"
#include "sim/sim_exit.hh"

Go to the source code of this file.

Functions

void SafeRead (std::ifstream &stream, void *data, int count)
 
template<class T >
void SafeRead (std::ifstream &stream, T &data)
 
template<class T >
void SafeReadSwap (std::ifstream &stream, T &data)
 
void SafeWrite (std::ofstream &stream, const void *data, int count)
 
template<class T >
void SafeWrite (std::ofstream &stream, const T &data)
 
template<class T >
void SafeWriteSwap (std::ofstream &stream, const T &data)
 

Detailed Description

Disk Image Definitions

Definition in file disk_image.cc.

Function Documentation

◆ SafeRead() [1/2]

template<class T >
void SafeRead ( std::ifstream &  stream,
T &  data 
)

Definition at line 222 of file disk_image.cc.

References data, and SafeRead().

◆ SafeRead() [2/2]

void SafeRead ( std::ifstream &  stream,
void *  data,
int  count 
)

Definition at line 207 of file disk_image.cc.

References X86ISA::count, data, and panic.

Referenced by CowDiskImage::open(), SafeRead(), and SafeReadSwap().

◆ SafeReadSwap()

template<class T >
void SafeReadSwap ( std::ifstream &  stream,
T &  data 
)

Definition at line 229 of file disk_image.cc.

References data, letoh(), and SafeRead().

Referenced by CowDiskImage::open().

◆ SafeWrite() [1/2]

template<class T >
void SafeWrite ( std::ofstream &  stream,
const T &  data 
)

Definition at line 305 of file disk_image.cc.

References data, and SafeWrite().

◆ SafeWrite() [2/2]

void SafeWrite ( std::ofstream &  stream,
const void *  data,
int  count 
)

Definition at line 290 of file disk_image.cc.

References X86ISA::count, data, and panic.

Referenced by SafeWrite(), SafeWriteSwap(), and CowDiskImage::save().

◆ SafeWriteSwap()

template<class T >
void SafeWriteSwap ( std::ofstream &  stream,
const T &  data 
)

Definition at line 312 of file disk_image.cc.

References data, letoh(), and SafeWrite().

Referenced by CowDiskImage::save().


Generated on Tue Jun 22 2021 15:28:33 for gem5 by doxygen 1.8.17