summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2012-11-14 11:05:16 +0000
committeravg <avg@FreeBSD.org>2012-11-14 11:05:16 +0000
commita15bb2d1cb5f9bed1bb7e6e26c0a8b594c785c59 (patch)
treef2cbafa244b443df533187ad218320b7cad61002 /sys/boot/i386
parentf3878af120243282b5ecff86f3975f3fbb010710 (diff)
downloadFreeBSD-src-a15bb2d1cb5f9bed1bb7e6e26c0a8b594c785c59.zip
FreeBSD-src-a15bb2d1cb5f9bed1bb7e6e26c0a8b594c785c59.tar.gz
boot: use packed attribute for edd_params* structures and their substructures
The sole purpose of this change is to make sure that sizeof produces "canonical" sizes for these structures. This is to avoid triggering bugs in the BIOSes that properly handle only the canonical values of input length provided to INT 13h AH=48h. The canonical sizes are: 30 for v2, 66 for v3, etc. Buggy BIOS code probably looks like: if (input_length > 30) { /* > v2 */ assume that input length is 66 /* assume v3 or later */ } This should fix boot problems at least on Supermicro X8DT6 and possibly on P410i Smart Array Controller (as found in e.g. HP DL360 G7). Reported by: gnn, np, rstone Debugged by: rstone Discussed with: ae, np, rstone MFC after: 4 days
Diffstat (limited to 'sys/boot/i386')
-rw-r--r--sys/boot/i386/common/edd.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/boot/i386/common/edd.h b/sys/boot/i386/common/edd.h
index a33ce8f..4a204f7 100644
--- a/sys/boot/i386/common/edd.h
+++ b/sys/boot/i386/common/edd.h
@@ -62,7 +62,7 @@ struct edd_params {
uint16_t sector_size;
uint16_t edd_params_seg;
uint16_t edd_params_off;
-};
+} __packed;
struct edd_device_path_v3 {
uint16_t key;
@@ -74,12 +74,12 @@ struct edd_device_path_v3 {
uint64_t device_path;
uint8_t reserved2[1];
uint8_t checksum;
-};
+} __packed;
struct edd_params_v3 {
struct edd_params params;
struct edd_device_path_v3 device_path;
-};
+} __packed;
struct edd_device_path_v4 {
uint16_t key;
@@ -91,12 +91,12 @@ struct edd_device_path_v4 {
uint64_t device_path[2];
uint8_t reserved2[1];
uint8_t checksum;
-};
+} __packed;
struct edd_params_v4 {
struct edd_params params;
struct edd_device_path_v4 device_path;
-};
+} __packed;
#define EDD_FLAGS_DMA_BOUNDARY_HANDLING 0x0001
#define EDD_FLAGS_REMOVABLE_MEDIA 0x0002
OpenPOWER on IntegriCloud