Change license from GPLv3 to LGPLv3.
[seabios.git] / src / pirtable.c
index 433b889ce63efea7dca2a4f59f8f40c5708ca5d6..ad5cf272ca8cbb7284a2272a893e44068d5cc757 100644 (file)
@@ -3,16 +3,22 @@
 // Copyright (C) 2008  Kevin O'Connor <kevin@koconnor.net>
 // Copyright (C) 2002  MandrakeSoft S.A.
 //
-// This file may be distributed under the terms of the GNU GPLv3 license.
+// This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "pci.h" // struct pir_header
 #include "util.h" // checksum
+#include "biosvar.h" // SET_EBDA
+
+u16 PirOffset VAR16_32;
 
 struct pir_table {
     struct pir_header pir;
     struct pir_slot slots[6];
-} PACKED PIR_TABLE __attribute__((aligned(16))) = {
-#if CONFIG_PIRTABLE
+} PACKED;
+
+extern struct pir_table PIR_TABLE;
+#if CONFIG_PIRTABLE && !CONFIG_COREBOOT
+struct pir_table PIR_TABLE __aligned(16) VAR16_32 = {
     .pir = {
         .version = 0x0100,
         .size = sizeof(struct pir_table),
@@ -82,8 +88,8 @@ struct pir_table {
             .slot_nr = 5,
         },
     }
-#endif // CONFIG_PIRTABLE
 };
+#endif // CONFIG_PIRTABLE && !CONFIG_COREBOOT
 
 void
 create_pirtable()
@@ -91,7 +97,9 @@ create_pirtable()
     if (! CONFIG_PIRTABLE)
         return;
 
+    dprintf(3, "init PIR table\n");
+
     PIR_TABLE.pir.signature = PIR_SIGNATURE;
     PIR_TABLE.pir.checksum = -checksum((u8*)&PIR_TABLE, sizeof(PIR_TABLE));
-    SET_EBDA(pir_loc, (u32)&PIR_TABLE);
+    PirOffset = (u32)&PIR_TABLE.pir - BUILD_BIOS_ADDR;
 }