grml...
[seabios.git] / src / pnpbios.c
index 21d140a7eff2bdd9ee760cc68944030ff3d2a0f0..b1bebc9bf7c5f3a35d86e4b9704dc9f185204991 100644 (file)
@@ -2,7 +2,7 @@
 //
 // Copyright (C) 2008  Kevin O'Connor <kevin@koconnor.net>
 //
-// 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 "util.h" // checksum
 #include "config.h" // BUILD_BIOS_ADDR
@@ -25,10 +25,10 @@ struct pnpheader {
 } PACKED;
 
 extern struct pnpheader PNPHEADER;
-extern const char pnp_string[];
+extern char pnp_string[];
 
 #if CONFIG_PNPBIOS
-struct pnpheader PNPHEADER __aligned(16) VAR16 = {
+struct pnpheader PNPHEADER __aligned(16) VAR16EXPORT = {
     .signature = PNP_SIGNATURE,
     .version = 0x10,
     .length = sizeof(PNPHEADER),
@@ -41,7 +41,7 @@ struct pnpheader PNPHEADER __aligned(16) VAR16 = {
 // We need a copy of this string in the 0xf000 segment, but we are not
 // actually a PnP BIOS, so make sure it is *not* aligned, so OSes will
 // not see it if they scan.
-const char pnp_string[] __aligned(2) VAR16 = " $PnP";
+char pnp_string[] __aligned(2) VAR16VISIBLE = " $PnP";
 #endif
 
 #define FUNCTION_NOT_SUPPORTED 0x82
@@ -78,7 +78,7 @@ handle_pnp(u16 *args)
 }
 
 u16
-get_pnp_offset()
+get_pnp_offset(void)
 {
     if (! CONFIG_PNPBIOS)
         return (u32)pnp_string + 1 - BUILD_BIOS_ADDR;
@@ -86,11 +86,11 @@ get_pnp_offset()
 }
 
 // romlayout.S
-extern void entry_pnp_real();
-extern void entry_pnp_prot();
+extern void entry_pnp_real(void);
+extern void entry_pnp_prot(void);
 
 void
-pnp_setup()
+pnp_setup(void)
 {
     if (! CONFIG_PNPBIOS)
         return;
@@ -99,5 +99,5 @@ pnp_setup()
 
     PNPHEADER.real_ip = (u32)entry_pnp_real - BUILD_BIOS_ADDR;
     PNPHEADER.prot_ip = (u32)entry_pnp_prot - BUILD_BIOS_ADDR;
-    PNPHEADER.checksum = -checksum((u8*)&PNPHEADER, sizeof(PNPHEADER));
+    PNPHEADER.checksum -= checksum(&PNPHEADER, sizeof(PNPHEADER));
 }