Move variables from assembler to C code.
[seabios.git] / src / disk.c
index 87ccdde3a706a582c708f3e45a7f9a4a57565f16..13cb1f3f60790069c5734faf34215678750d944c 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 "disk.h" // floppy_13
 #include "biosvar.h" // SET_BDA
  ****************************************************************/
 
 void
-__disk_ret(const char *fname, int lineno, struct bregs *regs, u8 code)
+__disk_ret(struct bregs *regs, u32 linecode, const char *fname)
 {
+    u8 code = linecode;
     SET_BDA(disk_last_status, code);
     if (code)
-        __set_code_fail(fname, lineno, regs, code);
+        __set_code_fail(regs, linecode, fname);
     else
         set_code_success(regs);
 }
 
 static void
-__disk_stub(const char *fname, int lineno, struct bregs *regs)
+__disk_stub(struct bregs *regs, int lineno, const char *fname)
 {
-    __debug_stub(fname, lineno, regs);
-    __disk_ret(fname, lineno, regs, DISK_RET_SUCCESS);
+    __debug_stub(regs, lineno, fname);
+    __disk_ret(regs, DISK_RET_SUCCESS | (lineno << 8), fname);
 }
 
-#define DISK_STUB(regs) \
-    __disk_stub(__func__, __LINE__, (regs))
+#define DISK_STUB(regs)                         \
+    __disk_stub((regs), __LINE__, __func__)
 
 static int
 __send_disk_op(struct disk_op_s *op_p, u16 op_s)
@@ -711,3 +712,6 @@ handle_76()
     SET_BDA(disk_interrupt_flag, 0xff);
     eoi_pic2();
 }
+
+// Old Fixed Disk Parameter Table (newer tables are in the ebda).
+struct fdpt_s OldFDPT VAR16FIXED(0xe401);