parent
026b5a66c9
commit
86eb3f4a0d
|
@ -25,9 +25,9 @@ namespace Rtc {
|
||||||
Session_client(Genode::Capability<Session> cap)
|
Session_client(Genode::Capability<Session> cap)
|
||||||
: Genode::Rpc_client<Session>(cap) {}
|
: Genode::Rpc_client<Session>(cap) {}
|
||||||
|
|
||||||
Genode::uint64_t get_current_time()
|
Genode::uint64_t current_time()
|
||||||
{
|
{
|
||||||
return call<Rpc_get_current_time>();
|
return call<Rpc_current_time>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,10 +28,10 @@ namespace Rtc {
|
||||||
/**
|
/**
|
||||||
* Get microseconds elapsed since 1.1.1970 UTC.
|
* Get microseconds elapsed since 1.1.1970 UTC.
|
||||||
*/
|
*/
|
||||||
virtual Genode::uint64_t get_current_time() = 0;
|
virtual Genode::uint64_t current_time() = 0;
|
||||||
|
|
||||||
GENODE_RPC(Rpc_get_current_time, Genode::uint64_t, get_current_time);
|
GENODE_RPC(Rpc_current_time, Genode::uint64_t, current_time);
|
||||||
GENODE_RPC_INTERFACE(Rpc_get_current_time);
|
GENODE_RPC_INTERFACE(Rpc_current_time);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ class Vfs::Rtc_file_system : public Single_file_system
|
||||||
Read_result read(Vfs_handle *vfs_handle, char *dst, file_size count,
|
Read_result read(Vfs_handle *vfs_handle, char *dst, file_size count,
|
||||||
file_size &out_count) override
|
file_size &out_count) override
|
||||||
{
|
{
|
||||||
time_t t = _rtc.get_current_time() / 1000000ULL;
|
time_t t = _rtc.current_time() / 1000000ULL;
|
||||||
|
|
||||||
struct tm *tm = localtime(&t);
|
struct tm *tm = localtime(&t);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace Rtc {
|
||||||
|
|
||||||
struct Rtc::Session_component : public Genode::Rpc_object<Session>
|
struct Rtc::Session_component : public Genode::Rpc_object<Session>
|
||||||
{
|
{
|
||||||
uint64_t get_current_time() override
|
uint64_t current_time() override
|
||||||
{
|
{
|
||||||
uint64_t ret = Rtc::get_time();
|
uint64_t ret = Rtc::get_time();
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ int main(int argc, char **argv)
|
||||||
static Timer::Connection timer;
|
static Timer::Connection timer;
|
||||||
|
|
||||||
for (unsigned i = 0; i < 4; ++i) {
|
for (unsigned i = 0; i < 4; ++i) {
|
||||||
Genode::uint64_t now = rtc.get_current_time();
|
Genode::uint64_t now = rtc.current_time();
|
||||||
|
|
||||||
Genode::printf("RTC: %llu.%06llu seconds since 1970\n",
|
Genode::printf("RTC: %llu.%06llu seconds since 1970\n",
|
||||||
now / 1000000ULL,
|
now / 1000000ULL,
|
||||||
|
|
|
@ -1133,8 +1133,8 @@ class Machine : public StaticReceiver<Machine>
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* get_current_time is in microseconds */
|
/* current_time() returns microseconds */
|
||||||
msg.wallclocktime = _rtc->get_current_time() / 1000000U * MessageTime::FREQUENCY;
|
msg.wallclocktime = _rtc->current_time() / 1000000U * MessageTime::FREQUENCY;
|
||||||
Logging::printf("Got time %llx\n", msg.wallclocktime);
|
Logging::printf("Got time %llx\n", msg.wallclocktime);
|
||||||
msg.timestamp = _unsynchronized_motherboard.clock()->clock(MessageTime::FREQUENCY);
|
msg.timestamp = _unsynchronized_motherboard.clock()->clock(MessageTime::FREQUENCY);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue