MOS Source Code
Loading...
Searching...
No Matches
rtc.c File Reference
+ Include dependency graph for rtc.c:

Go to the source code of this file.

Macros

#define CURRENT_YEAR   2024
 
#define bcd_to_binary(val)
 

Functions

u8 rtc_read_reg (x86_port_t reg)
 
u8 rtc_is_update_in_progress ()
 
void rtc_read_time (timeval_t *time)
 
bool rtc_irq_handler (u32 irq, void *data)
 
void rtc_init ()
 

Variables

static clocksource_t rtc_clocksource
 
static const u8 RTC_STATUS_REG_B = 0x0B
 
static const u8 CMOS_PORT_ADDRESS = 0x70
 
static const u8 CMOS_PORT_DATA = 0x71
 

Macro Definition Documentation

◆ CURRENT_YEAR

#define CURRENT_YEAR   2024

Definition at line 3 of file rtc.c.

Referenced by rtc_read_time().

◆ bcd_to_binary

#define bcd_to_binary ( val)
Value:
(((val) & 0x0F) + ((val) / 16) * 10)

Referenced by rtc_read_time().

Function Documentation

◆ rtc_read_reg()

u8 rtc_read_reg ( x86_port_t reg)

Definition at line 25 of file rtc.c.

Referenced by rtc_init(), rtc_irq_handler(), rtc_is_update_in_progress(), and rtc_read_time().

+ Here is the call graph for this function:

◆ rtc_is_update_in_progress()

u8 rtc_is_update_in_progress ( )

Definition at line 31 of file rtc.c.

Referenced by rtc_read_time().

+ Here is the call graph for this function:

◆ rtc_read_time()

void rtc_read_time ( timeval_t * time)

Definition at line 36 of file rtc.c.

Referenced by platform_get_time().

+ Here is the call graph for this function:

◆ rtc_irq_handler()

bool rtc_irq_handler ( u32 irq,
void * data )

Definition at line 99 of file rtc.c.

Referenced by platform_startup_late().

+ Here is the call graph for this function:

◆ rtc_init()

void rtc_init ( )

Definition at line 108 of file rtc.c.

Referenced by platform_startup_late().

+ Here is the call graph for this function:

Variable Documentation

◆ rtc_clocksource

clocksource_t rtc_clocksource
static
Initial value:
= {
.name = "rtc",
.frequency = 1000,
.ticks = 0,
}
#define LIST_NODE_INIT(container)
Definition list.h:41
static clocksource_t rtc_clocksource
Definition rtc.c:14

Definition at line 14 of file rtc.c.

Referenced by rtc_init(), and rtc_irq_handler().

◆ RTC_STATUS_REG_B

const u8 RTC_STATUS_REG_B = 0x0B
static

Definition at line 21 of file rtc.c.

Referenced by rtc_init().

◆ CMOS_PORT_ADDRESS

const u8 CMOS_PORT_ADDRESS = 0x70
static

Definition at line 22 of file rtc.c.

Referenced by rtc_init(), and rtc_read_reg().

◆ CMOS_PORT_DATA

const u8 CMOS_PORT_DATA = 0x71
static

Definition at line 23 of file rtc.c.

Referenced by rtc_init(), and rtc_read_reg().