summaryrefslogtreecommitdiff
path: root/src/sim/param.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-01-28 14:46:56 -0500
committerGabe Black <gblack@eecs.umich.edu>2007-01-28 14:46:56 -0500
commit91ca1b48e29dc8a5edcd57bf03ed9737b5de0661 (patch)
tree9a2db053cba40110ae69a2444b061c3d5ea8bdef /src/sim/param.cc
parent0358ccee23072eef0b6448e3170457037682a452 (diff)
parent37795b104d93a48b319074fbef770d88820d554a (diff)
downloadgem5-91ca1b48e29dc8a5edcd57bf03ed9737b5de0661.tar.xz
Merge zizzer:/bk/newmem
into zower.eecs.umich.edu:/eecshome/m5/newmem --HG-- extra : convert_revision : 2398e48722dd71ddf270e93bd7b387078fb30e6b
Diffstat (limited to 'src/sim/param.cc')
-rw-r--r--src/sim/param.cc24
1 files changed, 24 insertions, 0 deletions
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<int> &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;
+}