4 #define PORT_CMOS_INDEX 0x0070
5 #define PORT_CMOS_DATA 0x0071
7 // PORT_CMOS_INDEX nmi disable bit
8 #define NMI_DISABLE_BIT 0x80
10 // Standard BIOS RTC chip entries
11 #define CMOS_RTC_SECONDS 0x00
12 #define CMOS_RTC_SECONDS_ALARM 0x01
13 #define CMOS_RTC_MINUTES 0x02
14 #define CMOS_RTC_MINUTES_ALARM 0x03
15 #define CMOS_RTC_HOURS 0x04
16 #define CMOS_RTC_HOURS_ALARM 0x05
17 #define CMOS_RTC_DAY_WEEK 0x06
18 #define CMOS_RTC_DAY_MONTH 0x07
19 #define CMOS_RTC_MONTH 0x08
20 #define CMOS_RTC_YEAR 0x09
21 #define CMOS_STATUS_A 0x0a
22 #define CMOS_STATUS_B 0x0b
23 #define CMOS_STATUS_C 0x0c
24 #define CMOS_STATUS_D 0x0d
25 #define CMOS_RESET_CODE 0x0f
27 // QEMU cmos config fields. DO NOT ADD MORE. (All new content should
28 // be passed via the fw_cfg "file" interface.)
29 #define CMOS_FLOPPY_DRIVE_TYPE 0x10
30 #define CMOS_DISK_DATA 0x12
31 #define CMOS_EQUIPMENT_INFO 0x14
32 #define CMOS_DISK_DRIVE1_TYPE 0x19
33 #define CMOS_DISK_DRIVE2_TYPE 0x1a
34 #define CMOS_DISK_DRIVE1_CYL 0x1b
35 #define CMOS_DISK_DRIVE2_CYL 0x24
36 #define CMOS_MEM_EXTMEM_LOW 0x30
37 #define CMOS_MEM_EXTMEM_HIGH 0x31
38 #define CMOS_CENTURY 0x32
39 #define CMOS_MEM_EXTMEM2_LOW 0x34
40 #define CMOS_MEM_EXTMEM2_HIGH 0x35
41 #define CMOS_BIOS_BOOTFLAG1 0x38
42 #define CMOS_BIOS_DISKTRANSFLAG 0x39
43 #define CMOS_BIOS_BOOTFLAG2 0x3d
44 #define CMOS_MEM_HIGHMEM_LOW 0x5b
45 #define CMOS_MEM_HIGHMEM_MID 0x5c
46 #define CMOS_MEM_HIGHMEM_HIGH 0x5d
47 #define CMOS_BIOS_SMP_COUNT 0x5f
50 #define RTC_A_UIP 0x80
52 #define RTC_B_SET 0x80
53 #define RTC_B_PIE 0x40
54 #define RTC_B_AIE 0x20
55 #define RTC_B_UIE 0x10
56 #define RTC_B_BIN 0x04
57 #define RTC_B_24HR 0x02
58 #define RTC_B_DSE 0x01
62 #include "types.h" // u8
65 u8 rtc_read(u8 index);
66 void rtc_write(u8 index, u8 val);
67 void rtc_mask(u8 index, u8 off, u8 on);
68 int rtc_updating(void);
71 void rtc_release(void);
73 #endif // !__ASSEMBLY__