]> xenbits.xensource.com Git - seabios.git/commitdiff
vgabios: Make sure exported structs use PACKED.
authorKevin O'Connor <kevin@koconnor.net>
Wed, 5 Feb 2014 23:49:44 +0000 (18:49 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 5 Feb 2014 23:59:56 +0000 (18:59 -0500)
Commit ca668640 introduced structs for data returned from the
handle_101b and handle_101c calls.  However, the structs were not
declared as packed and that caused incorrect behavior for
handle_101b.  This was seen to break some old DOS programs (Win3 setup
and DISPLAY.SYS).  This patch adds in the necessary PACKED declaration
to the structs.

The 'struct saveBDAstate' remains un-packed, as it does not appear
that its contents are documented.  (And, its format already differs
from what was in the previous "lgpl vgabios".)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
vgasrc/stdvga.c
vgasrc/vgabios.c

index e0661f14cea8a4185738ae0a8067a9db75c9e2f8..c94ec06043266e93d973ff5e252601e3ff1fa9ad 100644 (file)
@@ -338,7 +338,7 @@ struct saveVideoHardware {
     u8 grdc_regs[9];
     u16 crtc_addr;
     u8 plane_latch[4];
-};
+} PACKED;
 
 static void
 stdvga_save_hw_state(u16 seg, struct saveVideoHardware *info)
@@ -412,7 +412,7 @@ struct saveDACcolors {
     u8 pelmask;
     u8 dac[768];
     u8 color_select;
-};
+} PACKED;
 
 static void
 stdvga_save_dac_state(u16 seg, struct saveDACcolors *info)
index 57f1c1f369293d7095c5a6b3cefe8d5a477a686c..f70b2b6130510c62cbe49d6bda69e7aff191b934 100644 (file)
@@ -1114,7 +1114,7 @@ struct funcInfo {
     u8 save_flags;
     u8 disp_info;
     u8 reserved_34[12];
-};
+} PACKED;
 
 static void
 handle_101b(struct bregs *regs)