AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
rtc.c File Reference

The date and time: the virt machine's PL031 real time clock, which counts seconds since the epoch. More...

#include <core/system.h>
#include <core/types.h>
#include <cpu/io.h>
#include <platform/virt.h>

Go to the source code of this file.

Macros

#define RTC_DR   0x000

Functions

int arch_time_get (struct timespec *ts)
 Reads the date and time from the real time clock.

Detailed Description

The date and time: the virt machine's PL031 real time clock, which counts seconds since the epoch.

Definition in file rtc.c.

Macro Definition Documentation

◆ RTC_DR

#define RTC_DR   0x000

Definition at line 11 of file rtc.c.

Referenced by arch_time_get().

Function Documentation

◆ arch_time_get()

int arch_time_get ( struct timespec * ts)

Reads the date and time from the real time clock.

Parameters
tsset to the time since the epoch, to the second (tv_nsec is 0)
Returns
0

Definition at line 16 of file rtc.c.

References arch_time_get(), RTC_DR, timespec::tv_nsec, timespec::tv_sec, VIRT_REG, and VIRT_RTC.

Referenced by arch_time_get(), gettime(), and time_resync().