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

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.cpp.

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 24 of file rtc.cpp.

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 30 of file rtc.cpp.

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 35 of file rtc.cpp.

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 98 of file rtc.cpp.

Referenced by platform_startup_late().

+ Here is the call graph for this function:

◆ rtc_init()

void rtc_init ( )

Definition at line 107 of file rtc.cpp.

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",
.ticks = 0,
.frequency = 1000,
}

Definition at line 14 of file rtc.cpp.

Referenced by rtc_init(), and rtc_irq_handler().

◆ RTC_STATUS_REG_B

const u8 RTC_STATUS_REG_B = 0x0B
static

Definition at line 20 of file rtc.cpp.

Referenced by rtc_init().

◆ CMOS_PORT_ADDRESS

const u8 CMOS_PORT_ADDRESS = 0x70
static

Definition at line 21 of file rtc.cpp.

Referenced by rtc_init(), and rtc_read_reg().

◆ CMOS_PORT_DATA

const u8 CMOS_PORT_DATA = 0x71
static

Definition at line 22 of file rtc.cpp.

Referenced by rtc_init(), and rtc_read_reg().