diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-03-26 19:21:20 +0000 |
---|---|---|
committer | <> | 2014-05-08 15:03:54 +0000 |
commit | fb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch) | |
tree | c2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Devices/PC/BIOS/bios.c | |
parent | 58ed4748338f9466599adfc8a9171280ed99e23f (diff) | |
download | VirtualBox-master.tar.gz |
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Devices/PC/BIOS/bios.c')
-rw-r--r-- | src/VBox/Devices/PC/BIOS/bios.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/VBox/Devices/PC/BIOS/bios.c b/src/VBox/Devices/PC/BIOS/bios.c index 83a98d20..66bf8dda 100644 --- a/src/VBox/Devices/PC/BIOS/bios.c +++ b/src/VBox/Devices/PC/BIOS/bios.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2011 Oracle Corporation + * Copyright (C) 2006-2012 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -80,14 +80,22 @@ void write_dword(uint16_t seg, uint16_t offset, uint32_t data) uint8_t inb_cmos(uint8_t cmos_reg) { - outb(0x70, cmos_reg); - return inb(0x71); + uint8_t cmos_port = 0x70; + + if (cmos_reg >= 0x80) + cmos_port += 2; + outb(cmos_port, cmos_reg); + return inb(cmos_port + 1); } void outb_cmos(uint8_t cmos_reg, uint8_t val) { - outb(0x70, cmos_reg); - outb(0x71, val); + uint8_t cmos_port = 0x70; + + if (cmos_reg >= 0x80) + cmos_port += 2; + outb(cmos_port, cmos_reg); + outb(cmos_port + 1, val); } void BIOSCALL dummy_isr_function(pusha_regs_t regs, uint16_t es, @@ -99,7 +107,7 @@ void BIOSCALL dummy_isr_function(pusha_regs_t regs, uint16_t es, // interrupt so it will generally be called only once for each unexpected // interrupt level. uint8_t isrA, isrB, imr, last_int = 0xFF; - + outb(PIC_MASTER, PIC_CMD_RD_ISR); // Read master ISR isrA = inb(PIC_MASTER); if (isrA) { @@ -174,7 +182,7 @@ void BIOSCALL print_bios_banner(void) char *bios_conf; /* Avoid using preprocessing directives within macro arguments. */ - bios_conf = + bios_conf = #ifdef __WATCOMC__ "watcom " #endif |