mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-30 10:38:55 +00:00
parent
615830e107
commit
8ef8e8ede9
@ -25,6 +25,9 @@ namespace Rtc {
|
||||
{
|
||||
static const char *service_name() { return "Rtc"; }
|
||||
|
||||
/**
|
||||
* Get microseconds elapsed since 1.1.1970 UTC.
|
||||
*/
|
||||
virtual Genode::uint64_t get_current_time() = 0;
|
||||
|
||||
GENODE_RPC(Rpc_get_current_time, Genode::uint64_t, get_current_time);
|
||||
|
@ -214,7 +214,8 @@ static uint64_t get_rtc_time(void)
|
||||
|
||||
PDBG("Date:%02d.%02d.%04d Time:%02d:%02d:%02d\n", day, mon, year, hour, min, sec);
|
||||
|
||||
return mktime(day, mon, year, hour, min, sec) * 1000000UL;
|
||||
/* return microseconds */
|
||||
return mktime(day, mon, year, hour, min, sec) * 1000000ULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1121,9 +1121,10 @@ class Machine : public StaticReceiver<Machine>
|
||||
return true;
|
||||
}
|
||||
}
|
||||
msg.wallclocktime = _rtc->get_current_time();
|
||||
/* get_current_time is in microseconds */
|
||||
msg.wallclocktime = _rtc->get_current_time() / 1000000U * MessageTime::FREQUENCY;
|
||||
Logging::printf("Got time %llx\n", msg.wallclocktime);
|
||||
msg.timestamp = _unsynchronized_motherboard.clock()->clock(1000000U);
|
||||
msg.timestamp = _unsynchronized_motherboard.clock()->clock(MessageTime::FREQUENCY);
|
||||
|
||||
*Genode::Thread_base::myself()->utcb() = utcb_backup;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user