X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=coreboot.git;a=blobdiff_plain;f=src%2Finclude%2Fpc80%2Fmc146818rtc.h;h=24dac2c098dcc39aad769fabd141b82457440813;hp=3e5a61a7067aacf7f7619011b2362ec87b27fcaf;hb=654f2934653ee5ca4bd43217abbc49a9140c8ad0;hpb=9ec8ed8a40c5c5aff8053693dd2ecd403034605b diff --git a/src/include/pc80/mc146818rtc.h b/src/include/pc80/mc146818rtc.h index 3e5a61a70..24dac2c09 100644 --- a/src/include/pc80/mc146818rtc.h +++ b/src/include/pc80/mc146818rtc.h @@ -104,6 +104,22 @@ static inline void cmos_write(unsigned char val, unsigned char addr) outb(addr, RTC_BASE_PORT + offs + 0); outb(val, RTC_BASE_PORT + offs + 1); } + +static inline u32 cmos_read32(u8 offset) +{ + u32 value = 0; + u8 i; + for (i = 0; i < sizeof(value); ++i) + value |= cmos_read(offset + i) << (i << 3); + return value; +} + +static inline void cmos_write32(u8 offset, u32 value) +{ + u8 i; + for (i = 0; i < sizeof(value); ++i) + cmos_write((value >> (i << 3)) & 0xff, offset + i); +} #endif #if !defined(__ROMCC__)