Change license from GPLv3 to LGPLv3.
[seabios.git] / src / system.c
index 7d2f2431a3eabf847bbbdc9f717e4933d1482977..9bf4a5dc76fde61c9e3a4ab33076c114a41ac548 100644 (file)
@@ -3,7 +3,7 @@
 // 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 "util.h" // irq_restore
 #include "biosvar.h" // BIOS_CONFIG_TABLE
@@ -191,7 +191,7 @@ handle_1587(struct bregs *regs)
 static void
 handle_1588(struct bregs *regs)
 {
-    u32 rs = GET_EBDA(ram_size);
+    u32 rs = GET_GLOBAL(RamSize);
 
     // According to Ralf Brown's interrupt the limit should be 15M,
     // but real machines mostly return max. 63M.
@@ -232,7 +232,7 @@ handle_15c0(struct bregs *regs)
 static void
 handle_15c1(struct bregs *regs)
 {
-    regs->es = GET_BDA(ebda_seg);
+    regs->es = get_ebda_seg();
     set_success(regs);
 }
 
@@ -246,7 +246,7 @@ handle_15e801(struct bregs *regs)
     // regs.u.r16.ax = 0;
     // regs.u.r16.bx = 0;
 
-    u32 rs = GET_EBDA(ram_size);
+    u32 rs = GET_GLOBAL(RamSize);
 
     // Get the amount of extended memory (above 1M)
     if (rs > 16*1024*1024) {
@@ -266,22 +266,24 @@ handle_15e801(struct bregs *regs)
     set_success(regs);
 }
 
-#if MODE16
 // Info on e820 map location and size.
-struct e820entry *e820_list VISIBLE16;
-int e820_count VISIBLE16;
-#endif
+struct e820entry *e820_list VAR16_32;
+int e820_count VAR16_32;
+// Amount of continuous ram under 4Gig
+u32 RamSize VAR16_32;
+// Amount of continuous ram >4Gig
+u64 RamSizeOver4G;
 
 static void
 handle_15e820(struct bregs *regs)
 {
-    int count = GET_VAR(CS, e820_count);
+    int count = GET_GLOBAL(e820_count);
     if (regs->edx != 0x534D4150 || regs->bx >= count) {
         set_code_fail(regs, RET_EUNSUPPORTED);
         return;
     }
 
-    struct e820entry *l = GET_VAR(CS, e820_list);
+    struct e820entry *l = GET_GLOBAL(e820_list);
     memcpy_far(MAKE_FARPTR(regs->es, regs->di), &l[regs->bx], sizeof(l[0]));
     if (regs->bx == count-1)
         regs->ebx = 0;
@@ -397,7 +399,6 @@ handle_75()
     // clear interrupt
     eoi_pic2();
     // legacy nmi call
-    struct bregs br;
-    memset(&br, 0, sizeof(br));
-    call16_int(0x02, &br);
+    u32 eax=0, flags;
+    call16_simpint(0x02, &eax, &flags);
 }