summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/kern/linux/linux.cc10
-rw-r--r--src/kern/linux/linux.hh1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/kern/linux/linux.cc b/src/kern/linux/linux.cc
index bd0b4d09a..d571b81a1 100644
--- a/src/kern/linux/linux.cc
+++ b/src/kern/linux/linux.cc
@@ -55,6 +55,9 @@ Linux::openSpecialFile(std::string path, Process *process,
} else if (path.compare(0, 11, "/etc/passwd") == 0) {
data = Linux::etcPasswd(process, tc);
matched = true;
+ } else if (path.compare(0, 30, "/sys/devices/system/cpu/online") == 0) {
+ data = Linux::cpuOnline(process, tc);
+ matched = true;
}
if (matched) {
@@ -87,3 +90,10 @@ Linux::etcPasswd(Process *process, ThreadContext *tc)
return csprintf("gem5-user:x:1000:1000:gem5-user,,,:%s:/bin/bash\n",
process->getcwd());
}
+
+std::string
+Linux::cpuOnline(Process *process, ThreadContext *tc)
+{
+ return csprintf("0-%d\n",
+ tc->getSystemPtr()->numContexts() - 1);
+}
diff --git a/src/kern/linux/linux.hh b/src/kern/linux/linux.hh
index b24ee3895..a1df99467 100644
--- a/src/kern/linux/linux.hh
+++ b/src/kern/linux/linux.hh
@@ -227,6 +227,7 @@ class Linux : public OperatingSystem
ThreadContext *tc);
static std::string procMeminfo(Process *process, ThreadContext *tc);
static std::string etcPasswd(Process *process, ThreadContext *tc);
+ static std::string cpuOnline(Process *process, ThreadContext *tc);
// For futex system call
static const unsigned TGT_FUTEX_WAIT = 0;