From 02bd40d552f6c3f56db43ea63f06ae4312a8e48a Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Sat, 27 Jan 2007 15:38:04 -0500 Subject: While I'm waiting for legion to run make m5 compile with a few more compilers SConstruct: src/SConscript: Add flags for Intel CC while i'm at it src/base/compiler.hh: the _Pragma stuff needst to be called this way unless someone happens to have a cleaner way src/base/cprintf_formats.hh: add std:: where appropriate src/base/statistics.hh: use this->map since icc was getting confused about std::map vs the locally defined map src/cpu/static_inst.hh: Add some more dummy returns where needed src/mem/packet.hh: add more dummy returns where needed src/sim/host.hh: use limits to come up with max tick --HG-- extra : convert_revision : 08e9f7898b29fb9d063136529afb9b6abceab60c --- src/sim/host.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/sim') diff --git a/src/sim/host.hh b/src/sim/host.hh index 8b1ddbfe7..93a5fe7f2 100644 --- a/src/sim/host.hh +++ b/src/sim/host.hh @@ -38,6 +38,8 @@ #define __HOST_HH__ #include +#include + /** uint64_t constant */ #define ULL(N) ((uint64_t)N##ULL) @@ -56,7 +58,7 @@ typedef int64_t Counter; */ typedef int64_t Tick; -const Tick MaxTick = (1LL << 63) - 1; +const Tick MaxTick = std::numeric_limits::max(); /** * Address type -- cgit v1.2.3 From 37795b104d93a48b319074fbef770d88820d554a Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sun, 28 Jan 2007 10:26:59 -0800 Subject: Stick the conversion of python to unix time with all of the other param code so that other functions can use it as well. --HG-- extra : convert_revision : a8becdeadc70af0b64bff5b0770788dfba6e1857 --- src/sim/param.cc | 24 ++++++++++++++++++++++++ src/sim/param.hh | 1 + 2 files changed, 25 insertions(+) (limited to 'src/sim') diff --git a/src/sim/param.cc b/src/sim/param.cc index b1c50946b..5cc69b161 100644 --- a/src/sim/param.cc +++ b/src/sim/param.cc @@ -777,3 +777,27 @@ ParamContext::describeAllContexts(ostream &os) os << endl; } } + +void +parseTime(const std::vector &time, struct tm *tm) +{ + memset(tm, 0, sizeof(struct tm)); + + // UNIX is years since 1900 + tm->tm_year = time[0] - 1900; + + // Python starts at 1, UNIX starts at 0 + tm->tm_mon = time[1] - 1; + tm->tm_mday = time[2]; + tm->tm_hour = time[3]; + tm->tm_min = time[4]; + tm->tm_sec = time[5]; + + // Python has 0 as Monday, UNIX is 0 as sunday + tm->tm_wday = time[6] + 1; + if (tm->tm_wday > 6) + tm->tm_wday -= 7; + + // Python starts at 1, Unix starts at 0 + tm->tm_yday = time[7] - 1; +} diff --git a/src/sim/param.hh b/src/sim/param.hh index 2aa0456da..8a4670e27 100644 --- a/src/sim/param.hh +++ b/src/sim/param.hh @@ -781,4 +781,5 @@ SimObjectVectorParam::showType(std::ostream &os) const \ template bool parseParam(const std::string &str, T &data); template void showParam(std::ostream &os, const T &data); +void parseTime(const std::vector &time, struct tm *tm); #endif // _SIM_PARAM_HH_ -- cgit v1.2.3