Stop using omisc.h and move relevant functions to better places

while converting them to C++

base/intmath.hh:
    Add some functions that were previously defined elsewhere in C
base/misc.cc:
    Use the C++ version of memUsage, and sort #includes
sim/prog.cc:
    Stop using the old macro versions of various functions and use
    the new ones defined in intmath.hh
sim/sim_events.cc:
    Stop using the old C versions of various functions and use
    the new ones defined in hostinfo.hh

--HG--
extra : convert_revision : 15d1f24d2aff4254c745eea6070cb230dd37b8d2
This commit is contained in:
Nathan Binkert
2003-10-10 09:53:16 -04:00
parent a2b619df6d
commit f4e2b3fa77
6 changed files with 135 additions and 7 deletions

View File

@@ -36,6 +36,7 @@
#include "prog.hh"
#include "eio.hh"
#include "intmath.hh"
#include "thread.hh"
#include "fake_syscall.hh"
#include "object_file.hh"
@@ -251,7 +252,7 @@ LiveProcess::LiveProcess(const string &name,
text_size = objFile->textSize();
data_base = objFile->dataBase();
data_size = objFile->dataSize() + objFile->bssSize();
brk_point = ROUND_UP(data_base + data_size, VMPageSize);
brk_point = RoundUp<uint64_t>(data_base + data_size, VMPageSize);
// load object file into target memory
objFile->loadSections(memory);

View File

@@ -30,6 +30,7 @@
#include "cpu.hh"
#include "eventq.hh"
#include "hostinfo.hh"
#include "sim_events.hh"
#include "sim_exit.hh"
#include "sim_stats.hh"
@@ -122,7 +123,7 @@ CheckSwapEvent::process()
long swap;
/* returns free swap in KBytes */
swap = proc_info("/proc/meminfo", "SwapFree:");
swap = procInfo("/proc/meminfo", "SwapFree:");
if (swap < 1000)
ccprintf(cerr, "\a\a\aWarning! Swap space is low (%d)\n", swap);