x
This commit is contained in:
parent
f30488793b
commit
e559fd2c5a
1 changed files with 6 additions and 3 deletions
9
lapic.c
9
lapic.c
|
@ -171,7 +171,8 @@ lapicstartap(uchar apicid, uint addr)
|
||||||
#define MONTH 0x08
|
#define MONTH 0x08
|
||||||
#define YEAR 0x09
|
#define YEAR 0x09
|
||||||
|
|
||||||
static uint cmos_read(uint reg)
|
static uint
|
||||||
|
cmos_read(uint reg)
|
||||||
{
|
{
|
||||||
outb(CMOS_PORT, reg);
|
outb(CMOS_PORT, reg);
|
||||||
microdelay(200);
|
microdelay(200);
|
||||||
|
@ -179,7 +180,8 @@ static uint cmos_read(uint reg)
|
||||||
return inb(CMOS_RETURN);
|
return inb(CMOS_RETURN);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fill_rtcdate(struct rtcdate *r)
|
static void
|
||||||
|
fill_rtcdate(struct rtcdate *r)
|
||||||
{
|
{
|
||||||
r->second = cmos_read(SECS);
|
r->second = cmos_read(SECS);
|
||||||
r->minute = cmos_read(MINS);
|
r->minute = cmos_read(MINS);
|
||||||
|
@ -190,7 +192,8 @@ static void fill_rtcdate(struct rtcdate *r)
|
||||||
}
|
}
|
||||||
|
|
||||||
// qemu seems to use 24-hour GWT and the values are BCD encoded
|
// qemu seems to use 24-hour GWT and the values are BCD encoded
|
||||||
void cmostime(struct rtcdate *r)
|
void
|
||||||
|
cmostime(struct rtcdate *r)
|
||||||
{
|
{
|
||||||
struct rtcdate t1, t2;
|
struct rtcdate t1, t2;
|
||||||
int sb, bcd;
|
int sb, bcd;
|
||||||
|
|
Loading…
Reference in a new issue