[grub4dos] Rename grub4dos__drive_mapping to WV_S_GRUB4DOS_DRIVE_MAPPING
authorShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sun, 2 Jan 2011 05:43:52 +0000 (00:43 -0500)
committerShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sun, 2 Jan 2011 05:45:07 +0000 (00:45 -0500)
src/include/grub4dos.h
src/winvblock/filedisk/grub4dos.c
src/winvblock/ramdisk/grub4dos.c

index 0129f25..2a8a3f1 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright (C) 2009, Shao Miller <shao.miller@yrdsb.edu.on.ca>.
+ * Copyright (C) 2009-2011, Shao Miller <shao.miller@yrdsb.edu.on.ca>.
  *
  * This file is part of WinVBlock, derived from WinAoE.
  *
 /**
  * @file
  *
- * GRUB4DOS disk specifics
- *
+ * GRUB4DOS disk specifics.
  */
 
 /* From GRUB4DOS 0.4.4's stage2/shared.h */
-winvblock__def_struct ( grub4dos__drive_mapping )
-{
-  winvblock__uint8 SourceDrive;
-  winvblock__uint8 DestDrive;
-  winvblock__uint8 MaxHead;
-  winvblock__uint8 MaxSector:6;
-  winvblock__uint8 RestrictionX:1;
-  winvblock__uint16 DestMaxCylinder:13;
-  winvblock__uint16 SourceODD:1;
-  winvblock__uint16 DestODD:1;
-  winvblock__uint16 DestLBASupport:1;
-  winvblock__uint8 DestMaxHead;
-  winvblock__uint8 DestMaxSector:6;
-  winvblock__uint8 RestrictionY:1;
-  winvblock__uint8 InSituOption:1;
-  winvblock__uint64 SectorStart;
-  winvblock__uint64 SectorCount;
-};
+typedef struct WV_GRUB4DOS_DRIVE_MAPPING {
+    winvblock__uint8 SourceDrive;
+    winvblock__uint8 DestDrive;
+    winvblock__uint8 MaxHead;
+    winvblock__uint8 MaxSector:6;
+    winvblock__uint8 RestrictionX:1;
+    winvblock__uint16 DestMaxCylinder:13;
+    winvblock__uint16 SourceODD:1;
+    winvblock__uint16 DestODD:1;
+    winvblock__uint16 DestLBASupport:1;
+    winvblock__uint8 DestMaxHead;
+    winvblock__uint8 DestMaxSector:6;
+    winvblock__uint8 RestrictionY:1;
+    winvblock__uint8 InSituOption:1;
+    winvblock__uint64 SectorStart;
+    winvblock__uint64 SectorCount;
+  } WV_S_GRUB4DOS_DRIVE_MAPPING, * WV_SP_GRUB4DOS_DRIVE_MAPPING;
 
 extern void ramdisk_grub4dos__find (
   void
index a5f32ac..21bf504 100644 (file)
@@ -312,7 +312,7 @@ filedisk_grub4dos__find (
   WV_SP_PROBE_INT_VECTOR InterruptVector;
   winvblock__uint32 Int13Hook;
   WV_SP_PROBE_SAFE_MBR_HOOK SafeMbrHookPtr;
-  grub4dos__drive_mapping_ptr Grub4DosDriveMapSlotPtr;
+  WV_SP_GRUB4DOS_DRIVE_MAPPING Grub4DosDriveMapSlotPtr;
   winvblock__uint32 i;
   winvblock__bool FoundGrub4DosMapping = FALSE;
   WV_SP_FILEDISK_T filedisk_ptr;
@@ -342,11 +342,11 @@ filedisk_grub4dos__find (
          InterruptVector = &SafeMbrHookPtr->PrevHook;
          continue;
        }
-      Grub4DosDriveMapSlotPtr =
-       ( grub4dos__drive_mapping_ptr ) ( PhysicalMemory +
-                                         ( ( ( winvblock__uint32 )
-                                             InterruptVector->
-                                             Segment ) << 4 ) + 0x20 );
+      Grub4DosDriveMapSlotPtr = (WV_SP_GRUB4DOS_DRIVE_MAPPING) (
+          PhysicalMemory +
+          (((winvblock__uint32) InterruptVector->Segment) << 4)
+          + 0x20
+        );
       /*
        * Search for parameter blocks, which are disguised as
        * GRUB4DOS RAM disk mappings for 2048-byte memory regions
index bf52c32..56f5a57 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright (C) 2009-2010, Shao Miller <shao.miller@yrdsb.edu.on.ca>.
+ * Copyright (C) 2009-2011, Shao Miller <shao.miller@yrdsb.edu.on.ca>.
  *
  * This file is part of WinVBlock, derived from WinAoE.
  *
@@ -48,7 +48,7 @@ ramdisk_grub4dos__find (
   WV_SP_PROBE_INT_VECTOR InterruptVector;
   winvblock__uint32 Int13Hook;
   WV_SP_PROBE_SAFE_MBR_HOOK SafeMbrHookPtr;
-  grub4dos__drive_mapping_ptr Grub4DosDriveMapSlotPtr;
+  WV_SP_GRUB4DOS_DRIVE_MAPPING Grub4DosDriveMapSlotPtr;
   winvblock__uint32 i = 8;
   winvblock__bool FoundGrub4DosMapping = FALSE;
   ramdisk__type_ptr ramdisk_ptr;
@@ -77,11 +77,11 @@ ramdisk_grub4dos__find (
          InterruptVector = &SafeMbrHookPtr->PrevHook;
          continue;
        }
-      Grub4DosDriveMapSlotPtr =
-       ( grub4dos__drive_mapping_ptr ) ( PhysicalMemory +
-                                         ( ( ( winvblock__uint32 )
-                                             InterruptVector->
-                                             Segment ) << 4 ) + 0x20 );
+      Grub4DosDriveMapSlotPtr = (WV_SP_GRUB4DOS_DRIVE_MAPPING) (
+          PhysicalMemory +
+          (((winvblock__uint32) InterruptVector->Segment) << 4) +
+          0x20
+        );
       while ( i-- )
        {
          DBG ( "GRUB4DOS SourceDrive: 0x%02x\n",