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/dev/sparc/dtod.cc | 10 ++++++---- src/dev/sparc/dtod.hh | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src/dev/sparc') diff --git a/src/dev/sparc/dtod.cc b/src/dev/sparc/dtod.cc index 30c7baaf5..50e158c12 100644 --- a/src/dev/sparc/dtod.cc +++ b/src/dev/sparc/dtod.cc @@ -49,12 +49,14 @@ using namespace std; using namespace TheISA; DumbTOD::DumbTOD(Params *p) - : BasicPioDevice(p), todTime(p->init_time) + : BasicPioDevice(p) { pioSize = 0x08; struct tm tm; - gmtime_r((time_t*)&todTime, &tm); + parseTime(p->init_time, &tm); + todTime = timegm(&tm); + DPRINTFN("Real-time clock set to %s\n", asctime(&tm)); DPRINTFN("Real-time clock set to %d\n", todTime); } @@ -86,7 +88,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(DumbTOD) Param pio_latency; SimObjectParam platform; SimObjectParam system; - Param time; + VectorParam time; END_DECLARE_SIM_OBJECT_PARAMS(DumbTOD) @@ -96,7 +98,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(DumbTOD) INIT_PARAM(pio_latency, "Programmed IO latency"), INIT_PARAM(platform, "platform"), INIT_PARAM(system, "system object"), - INIT_PARAM(time, "System time to use (0 for actual time") + INIT_PARAM(time, "") END_INIT_SIM_OBJECT_PARAMS(DumbTOD) diff --git a/src/dev/sparc/dtod.hh b/src/dev/sparc/dtod.hh index 7d3a9f628..26d4ecc08 100644 --- a/src/dev/sparc/dtod.hh +++ b/src/dev/sparc/dtod.hh @@ -36,6 +36,8 @@ #ifndef __DEV_SPARC_DTOD_HH__ #define __DEV_SPARC_DTOD_HH__ +#include + #include "base/range.hh" #include "dev/io_device.hh" @@ -52,7 +54,7 @@ class DumbTOD : public BasicPioDevice public: struct Params : public BasicPioDevice::Params { - time_t init_time; + std::vector init_time; }; protected: const Params *params() const { return (const Params *)_params; } -- cgit v1.2.3