]> xenbits.xensource.com Git - seabios.git/commitdiff
EBDA cleanups.
authorKevin O'Connor <kevin@koconnor.net>
Mon, 14 May 2012 02:58:08 +0000 (22:58 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 20 May 2012 22:11:09 +0000 (18:11 -0400)
Clean up includes of biosvar.h.

Rename GET/SET_EBDA2 to GET/SET_EBDA - nearly all users use the
extended form now anyway.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 files changed:
src/acpi.c
src/ahci.c
src/biosvar.h
src/bootsplash.c
src/memmap.c
src/mouse.c
src/mtrr.c
src/pcibios.c
src/pciinit.c
src/pirtable.c
src/post.c
src/smbios.c
src/xen.h

index 30888b9ae5a39c7c6b16a1091708d2b404ec97fa..53871836c26cff5df48461a52208ba5430ae6bd8 100644 (file)
@@ -8,9 +8,9 @@
 #include "acpi.h" // struct rsdp_descriptor
 #include "util.h" // memcpy
 #include "pci.h" // pci_find_init_device
-#include "biosvar.h" // GET_EBDA
 #include "pci_ids.h" // PCI_VENDOR_ID_INTEL
 #include "pci_regs.h" // PCI_INTERRUPT_LINE
+#include "ioport.h" // inl
 #include "paravirt.h"
 
 /****************************************************/
index 4abfec5f542d46b80c82d272aacaaa056f2392c9..1176dcc48d9439fdddfc3d5477d4a1c71ade4d90 100644 (file)
@@ -7,7 +7,7 @@
 #include "types.h" // u8
 #include "ioport.h" // inb
 #include "util.h" // dprintf
-#include "biosvar.h" // GET_EBDA
+#include "biosvar.h" // GET_GLOBAL
 #include "pci.h" // foreachpci
 #include "pci_ids.h" // PCI_CLASS_STORAGE_OTHER
 #include "pci_regs.h" // PCI_INTERRUPT_LINE
index a0e11a81a56c75742d9683a5fa87184a1c7694b2..fb56f7349a5fbc7b452dced00cc0d1ed0e85b909 100644 (file)
@@ -198,14 +198,10 @@ get_ebda_ptr(void)
     ASSERT32FLAT();
     return MAKE_FLATPTR(get_ebda_seg(), 0);
 }
-#define GET_EBDA2(eseg, var)                                            \
+#define GET_EBDA(eseg, var)                                             \
     GET_FARVAR(eseg, ((struct extended_bios_data_area_s *)0)->var)
-#define SET_EBDA2(eseg, var, val)                                       \
+#define SET_EBDA(eseg, var, val)                                        \
     SET_FARVAR(eseg, ((struct extended_bios_data_area_s *)0)->var, (val))
-#define GET_EBDA(var)                           \
-    GET_EBDA2(get_ebda_seg(), var)
-#define SET_EBDA(var, val)                      \
-    SET_EBDA2(get_ebda_seg(), var, (val))
 
 
 /****************************************************************
index 76b72c13ab6f26404f753bbbeac915734269ef02..f85f73498b1f3329563f10dacddfcc02b6f60aee 100644 (file)
@@ -10,7 +10,6 @@
 #include "config.h" // CONFIG_*
 #include "util.h" // dprintf
 #include "jpeg.h" // splash
-#include "biosvar.h" // SET_EBDA
 #include "paravirt.h" // romfile_find
 #include "vbe.h" // struct vbe_info
 #include "bmp.h"
index 56865b45813e8683e5b4e9480a65ba6085e04372..3783518900256a0fb12646da3f30e8b2dd2120c7 100644 (file)
@@ -5,8 +5,8 @@
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "memmap.h" // struct e820entry
+#include "config.h" // CONFIG_*
 #include "util.h" // dprintf.h
-#include "biosvar.h" // SET_EBDA
 
 
 /****************************************************************
index e26cf694ca5bcc37791d533c564071f1ee863efd..237c8ff943a7fe3a0bc93204b2e2d8e2660b4580 100644 (file)
@@ -52,7 +52,8 @@ mouse_15c20000(struct bregs *regs)
 static void
 mouse_15c20001(struct bregs *regs)
 {
-    u8 mouse_flags_2 = GET_EBDA(mouse_flag2);
+    u16 ebda_seg = get_ebda_seg();
+    u8 mouse_flags_2 = GET_EBDA(ebda_seg, mouse_flag2);
     if ((mouse_flags_2 & 0x80) == 0) {
         set_code_invalid(regs, RET_ENOHANDLER);
         return;
@@ -158,8 +159,8 @@ mouse_15c205(struct bregs *regs)
         return;
     }
     u16 ebda_seg = get_ebda_seg();
-    SET_EBDA2(ebda_seg, mouse_flag1, 0x00);
-    SET_EBDA2(ebda_seg, mouse_flag2, regs->bh);
+    SET_EBDA(ebda_seg, mouse_flag1, 0x00);
+    SET_EBDA(ebda_seg, mouse_flag2, regs->bh);
 
     // Reset Mouse
     mouse_15c201(regs);
@@ -227,7 +228,7 @@ mouse_15c207(struct bregs *regs)
 {
     struct segoff_s farptr = SEGOFF(regs->es, regs->bx);
     u16 ebda_seg = get_ebda_seg();
-    u8 mouse_flags_2 = GET_EBDA2(ebda_seg, mouse_flag2);
+    u8 mouse_flags_2 = GET_EBDA(ebda_seg, mouse_flag2);
     if (! farptr.segoff) {
         /* remove handler */
         if ((mouse_flags_2 & 0x80) != 0) {
@@ -238,8 +239,8 @@ mouse_15c207(struct bregs *regs)
         /* install handler */
         mouse_flags_2 |= 0x80;
     }
-    SET_EBDA2(ebda_seg, mouse_flag2, mouse_flags_2);
-    SET_EBDA2(ebda_seg, far_call_pointer, farptr);
+    SET_EBDA(ebda_seg, mouse_flag2, mouse_flags_2);
+    SET_EBDA(ebda_seg, far_call_pointer, farptr);
     set_code_success(regs);
 }
 
@@ -279,8 +280,8 @@ process_mouse(u8 data)
         return;
 
     u16 ebda_seg = get_ebda_seg();
-    u8 mouse_flags_1 = GET_EBDA2(ebda_seg, mouse_flag1);
-    u8 mouse_flags_2 = GET_EBDA2(ebda_seg, mouse_flag2);
+    u8 mouse_flags_1 = GET_EBDA(ebda_seg, mouse_flag1);
+    u8 mouse_flags_2 = GET_EBDA(ebda_seg, mouse_flag2);
 
     if (! (mouse_flags_2 & 0x80))
         // far call handler not installed
@@ -288,20 +289,20 @@ process_mouse(u8 data)
 
     u8 package_count = mouse_flags_2 & 0x07;
     u8 index = mouse_flags_1 & 0x07;
-    SET_EBDA2(ebda_seg, mouse_data[index], data);
+    SET_EBDA(ebda_seg, mouse_data[index], data);
 
     if ((index+1) < package_count) {
         mouse_flags_1++;
-        SET_EBDA2(ebda_seg, mouse_flag1, mouse_flags_1);
+        SET_EBDA(ebda_seg, mouse_flag1, mouse_flags_1);
         return;
     }
 
-    u16 status = GET_EBDA2(ebda_seg, mouse_data[0]);
-    u16 X      = GET_EBDA2(ebda_seg, mouse_data[1]);
-    u16 Y      = GET_EBDA2(ebda_seg, mouse_data[2]);
-    SET_EBDA2(ebda_seg, mouse_flag1, 0);
+    u16 status = GET_EBDA(ebda_seg, mouse_data[0]);
+    u16 X      = GET_EBDA(ebda_seg, mouse_data[1]);
+    u16 Y      = GET_EBDA(ebda_seg, mouse_data[2]);
+    SET_EBDA(ebda_seg, mouse_flag1, 0);
 
-    struct segoff_s func = GET_EBDA2(ebda_seg, far_call_pointer);
+    struct segoff_s func = GET_EBDA(ebda_seg, far_call_pointer);
     dprintf(16, "mouse farcall s=%04x x=%04x y=%04x func=%04x:%04x\n"
             , status, X, Y, func.seg, func.offset);
 
index ec3be4f3aa66fcf76eed22183ab87ce30ed92dbe..09578348c192bda7a4bc9b1ae51ebc5c56d13ebb 100644 (file)
@@ -5,7 +5,7 @@
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "util.h" // dprintf
-#include "biosvar.h" // GET_EBDA
+#include "config.h" // CONFIG_*
 #include "xen.h" // usingXen
 
 #define MSR_MTRRcap                    0x000000fe
index 8b792fb27b4ffed94f6620dba92de6bb222971ad..d10cdfd2c1d444471357e750d18e3d7448473bd8 100644 (file)
@@ -9,7 +9,7 @@
 #include "util.h" // handle_1ab1
 #include "pci.h" // pci_config_readl
 #include "bregs.h" // struct bregs
-#include "biosvar.h" // GET_EBDA
+#include "biosvar.h" // GET_GLOBAL
 #include "pci_regs.h" // PCI_VENDOR_ID
 
 // romlayout.S
index f265662d7aea3d1b77c44bb63fab97d0eff584a1..613a9c00146beb12b15e3975a84531d924c945c1 100644 (file)
@@ -7,9 +7,10 @@
 
 #include "util.h" // dprintf
 #include "pci.h" // pci_config_readl
-#include "biosvar.h" // GET_EBDA
 #include "pci_ids.h" // PCI_VENDOR_ID_INTEL
 #include "pci_regs.h" // PCI_COMMAND
+#include "ioport.h" // PORT_ATA1_CMD_BASE
+#include "config.h" // CONFIG_*
 #include "xen.h" // usingXen
 
 #define PCI_DEVICE_MEM_MIN     0x1000
index 4c3f1ffc486d7afc725f43687c63f0f1138da5d0..2c328d8bce437ac57bf52ea46f7db72330a59ce2 100644 (file)
@@ -6,8 +6,8 @@
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "pci.h" // struct pir_header
+#include "config.h" // CONFIG_*
 #include "util.h" // checksum
-#include "biosvar.h" // SET_EBDA
 
 u16 PirOffset VAR16VISIBLE;
 
index 71e69fdc5f75f9232c5dfe8af1bcb965a2b00cef..aa2915156934aeb3bd843ed315bfc6ed7f9cb2d9 100644 (file)
@@ -93,7 +93,7 @@ init_bda(void)
     memset(ebda, 0, sizeof(*ebda));
     ebda->size = esize;
 
-    add_e820((u32)MAKE_FLATPTR(ebda_seg, 0), GET_EBDA2(ebda_seg, size) * 1024
+    add_e820((u32)MAKE_FLATPTR(ebda_seg, 0), GET_EBDA(ebda_seg, size) * 1024
              , E820_RESERVED);
 }
 
index fe1e1835f6ad07797eb469f6384c203ede4319a5..20d2d4790e5debef5100b70f95eceb1645e7cc5b 100644 (file)
@@ -6,7 +6,6 @@
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "util.h" // dprintf
-#include "biosvar.h" // GET_EBDA
 #include "paravirt.h" // qemu_cfg_smbios_load_field
 #include "smbios.h" // struct smbios_entry_point
 
index dbd4a3710295195363e860ee4a70f149c79897e7..cc506a6ef96ec8daf84568a440e566740e01b223 100644 (file)
--- a/src/xen.h
+++ b/src/xen.h
@@ -1,7 +1,8 @@
 #ifndef __XEN_H
 #define __XEN_H
 
-#include "util.h"
+#include "config.h" // CONFIG_*
+#include "types.h" // u32
 
 extern u32 xen_cpuid_base;