35 #include "debug/SyscallVerbose.hh" 50 "%d: %s: generic-open: opening special file: %s\n",
56 if (path.compare(0, 13,
"/proc/meminfo") == 0) {
59 }
else if (path.compare(0, 11,
"/etc/passwd") == 0) {
62 }
else if (path.compare(0, 15,
"/proc/self/maps") == 0) {
65 }
else if (path.compare(0, 30,
"/sys/devices/system/cpu/online") == 0) {
68 }
else if (path.compare(0, 12 ,
"/dev/urandom") == 0) {
76 size_t ret M5_VAR_USED = fwrite(data.c_str(), 1, data.size(),
f);
77 assert(ret == data.size());
81 warn(
"Attempting to open special file: %s. Ignoring. Simulation may " 82 "take un-expected code path or be non-deterministic until proper " 83 "handling is implemented.\n", path.c_str());
92 return csprintf(
"MemTotal:%12d kB\nMemFree: %12d kB\n",
100 return csprintf(
"gem5-user:x:1000:1000:gem5-user,,,:%s:/bin/bash\n",
107 return process->
memState->printVmaList();
121 "%d: %s: open: generating urandom\n",
124 std::stringstream line;
126 for (
int i = 0;
i < max;
i++) {
virtual System * getSystemPtr()=0
static std::string etcPasswd(Process *process, ThreadContext *tc)
Addr freeMemSize() const
Amount of physical memory that is still free.
virtual BaseCPU * getCpuPtr()=0
static std::string devRandom(Process *process, ThreadContext *tc)
std::shared_ptr< MemState > memState
static std::string procSelfMaps(Process *process, ThreadContext *tc)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
std::enable_if< std::is_integral< T >::value, T >::type random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
Tick curTick()
The current simulated tick.
Addr memSize() const
Amount of physical memory that exists.
std::string csprintf(const char *format, const Args &...args)
static std::string cpuOnline(Process *process, ThreadContext *tc)
unsigned numContexts() const
std::string tgtCwd
The cwd members are used to track changes to the current working directory for the purpose of executi...
static int openSpecialFile(std::string path, Process *process, ThreadContext *tc)
virtual const std::string name() const
static std::string procMeminfo(Process *process, ThreadContext *tc)