]> xenbits.xensource.com Git - seabios.git/commitdiff
floppy: Introduce the floppy_dor_read() function
authorNikolay Nikolov <nickysn@users.sourceforge.net>
Sun, 4 Feb 2018 15:26:56 +0000 (17:26 +0200)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 8 Feb 2018 02:16:06 +0000 (21:16 -0500)
Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
src/hw/floppy.c

index f2577c51cf8a0b5045a265e5586ac04f8111b513..9c44a584e4c424c6f9afd2e250d18a5d0ec6e329 100644 (file)
@@ -180,6 +180,12 @@ find_floppy_type(u32 size)
 
 u8 FloppyDOR VARLOW;
 
+static inline u8
+floppy_dor_read(void)
+{
+    return GET_LOW(FloppyDOR);
+}
+
 static inline void
 floppy_dor_write(u8 val)
 {
@@ -318,7 +324,7 @@ static int
 floppy_drive_pio(u8 floppyid, int command, u8 *param)
 {
     // Enable controller if it isn't running.
-    if (!(GET_LOW(FloppyDOR) & 0x04)) {
+    if (!(floppy_dor_read() & 0x04)) {
         int ret = floppy_enable_controller();
         if (ret)
             return ret;
@@ -668,6 +674,6 @@ floppy_tick(void)
         SET_BDA(floppy_motor_counter, fcount);
         if (fcount == 0)
             // turn motor(s) off
-            floppy_dor_write(GET_LOW(FloppyDOR) & ~0xf0);
+            floppy_dor_write(floppy_dor_read() & ~0xf0);
     }
 }