summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include/biosvar.h
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-09-01 17:30:57 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-09-01 17:30:57 +0000
commitb5ddfff7891a756d08e42a986080abc019cf830c (patch)
tree2d2e16402c922e643d1ccadcc085c3796c7bb75d /sys/arch/amd64/include/biosvar.h
parent400b04c7f1f655a02a152b93e698f7448833e20e (diff)
Avoid #pragma pack(1) and unify everything towards using __packed.
This requires that structures defined within __packed structures must independently request that they themselves become __packed, too. worked on with toby CVS: ----------------------------------------------------------------------
Diffstat (limited to 'sys/arch/amd64/include/biosvar.h')
-rw-r--r--sys/arch/amd64/include/biosvar.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/sys/arch/amd64/include/biosvar.h b/sys/arch/amd64/include/biosvar.h
index 92e505a2532..95a86283986 100644
--- a/sys/arch/amd64/include/biosvar.h
+++ b/sys/arch/amd64/include/biosvar.h
@@ -1,5 +1,5 @@
/* XXX - DSR */
-/* $OpenBSD: biosvar.h,v 1.8 2007/12/05 19:17:14 deraadt Exp $ */
+/* $OpenBSD: biosvar.h,v 1.9 2008/09/01 17:30:55 deraadt Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -31,7 +31,6 @@
#ifndef _I386_BIOSVAR_H_
#define _I386_BIOSVAR_H_
-#pragma pack(1)
/* some boxes put apm data seg in the 2nd page */
#define BOOTARG_OFF (NBPG*2)
@@ -75,7 +74,7 @@ struct bios_romheader {
u_int32_t entry; /* initialization entry point */
u_int8_t reserved[19];
u_int16_t pnpheader; /* offset to PnP expansion header */
-} *bios_romheader_t;
+} __packed *bios_romheader_t;
/*
* BIOS32
@@ -88,20 +87,20 @@ struct bios32_header {
u_int8_t length; /* 09: header length */
u_int8_t cksum; /* 0a: modulo 256 checksum */
u_int8_t reserved[5];
-} *bios32_header_t;
+} __packed *bios32_header_t;
typedef
struct bios32_entry_info {
paddr_t bei_base;
psize_t bei_size;
paddr_t bei_entry;
-} *bios32_entry_info_t;
+} __packed *bios32_entry_info_t;
typedef
struct bios32_entry {
u_int32_t offset;
u_int16_t segment;
-} *bios32_entry_t;
+} __packed *bios32_entry_t;
#define BIOS32_START 0xe0000
#define BIOS32_SIZE 0x20000
@@ -133,7 +132,7 @@ typedef struct _bios_memmap {
u_int64_t addr; /* Beginning of block */
u_int64_t size; /* Size of block */
u_int32_t type; /* Type of block */
-} bios_memmap_t;
+} __packed bios_memmap_t;
/* Info about disk from the bios, plus the mapping from
* BIOS numbers to BSD major (driver?) number.
@@ -166,7 +165,7 @@ typedef struct _bios_diskinfo {
#define BDI_EL_TORITO 0x00000008 /* 2,048-byte sectors */
#define BDI_PICKED 0x80000000 /* kernel-only: cksum matched */
-} bios_diskinfo_t;
+} __packed bios_diskinfo_t;
#define BOOTARG_APMINFO 2
typedef struct _bios_apminfo {
@@ -179,7 +178,7 @@ typedef struct _bios_apminfo {
u_int apm_data_len;
u_int apm_entry;
u_int apm_code16_len;
-} bios_apminfo_t;
+} __packed bios_apminfo_t;
#define BOOTARG_CKSUMLEN 3 /* u_int32_t */
@@ -190,18 +189,18 @@ typedef struct _bios_pciinfo {
u_int32_t pci_rev; /* BCD Revision (%ebx) */
u_int32_t pci_entry32; /* PM entry point for PCI BIOS */
u_int32_t pci_lastbus; /* Number of last PCI bus */
-} bios_pciinfo_t;
+} __packed bios_pciinfo_t;
#define BOOTARG_CONSDEV 5
typedef struct _bios_consdev {
dev_t consdev;
int conspeed;
-} bios_consdev_t;
+} __packed bios_consdev_t;
#define BOOTARG_BOOTMAC 7
typedef struct _bios_bootmac {
char mac[6];
-} bios_bootmac_t;
+} __packed bios_bootmac_t;
#if defined(_KERNEL) || defined (_STANDALONE)
@@ -220,7 +219,7 @@ extern volatile struct BIOS_regs {
u_int32_t biosr_di;
u_int32_t biosr_ds;
u_int32_t biosr_es;
-} BIOS_regs;
+} __packed BIOS_regs;
#ifdef _KERNEL
#include <machine/bus.h>
@@ -263,5 +262,4 @@ extern bios_memmap_t *bios_memmap;
#endif /* _LOCORE */
#endif /* _KERNEL || _STANDALONE */
-#pragma pack()
#endif /* _I386_BIOSVAR_H_ */