summaryrefslogtreecommitdiff
path: root/sys/dev
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/dev
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/dev')
-rw-r--r--sys/dev/ic/bhareg.h78
-rw-r--r--sys/dev/ic/gdtvar.h7
-rw-r--r--sys/dev/ic/i82596reg.h31
-rw-r--r--sys/dev/ic/stireg.h106
-rw-r--r--sys/dev/ic/twereg.h24
-rw-r--r--sys/dev/ic/vgareg.h12
-rw-r--r--sys/dev/pcmcia/if_rayreg.h44
7 files changed, 137 insertions, 165 deletions
diff --git a/sys/dev/ic/bhareg.h b/sys/dev/ic/bhareg.h
index f78e273c1eb..4bf84004e09 100644
--- a/sys/dev/ic/bhareg.h
+++ b/sys/dev/ic/bhareg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bhareg.h,v 1.3 2008/06/26 05:42:15 ray Exp $ */
+/* $OpenBSD: bhareg.h,v 1.4 2008/09/01 17:30:56 deraadt Exp $ */
/* $NetBSD: bhareg.h,v 1.12 1998/08/17 00:26:33 mycroft Exp $ */
/*-
@@ -139,13 +139,11 @@ typedef u_int8_t physlen[4];
#define BHA_INTR_MBOA 0x02 /* MBX out empty */
#define BHA_INTR_MBIF 0x01 /* MBX in full */
-#pragma pack(1)
-
struct bha_mbx_out {
physaddr ccb_addr;
u_int8_t reserved[3];
u_int8_t cmd;
-};
+} __packed;
struct bha_mbx_in {
physaddr ccb_addr;
@@ -153,7 +151,7 @@ struct bha_mbx_in {
u_int8_t target_stat;
u_int8_t reserved;
u_int8_t comp_stat;
-};
+} __packed;
/*
* mbo.cmd values
@@ -184,7 +182,7 @@ WARNING...THIS WON'T WORK(won't fit on 1 page)
struct bha_scat_gath {
physlen seg_len;
physaddr seg_addr;
-};
+} __packed;
struct bha_ccb {
u_int8_t opcode;
@@ -253,7 +251,7 @@ struct bha_ccb {
* Its contents are loaded into "scat_gath" above.
*/
bus_dmamap_t dmamap_xfer;
-};
+} __packed;
/*
* opcode fields
@@ -300,7 +298,7 @@ struct bha_extended_inquire {
struct {
u_char opcode;
u_char len;
- } cmd;
+ } __packed cmd;
struct {
u_char bus_type; /* Type of bus connected to */
#define BHA_BUS_TYPE_24BIT 'A' /* ISA bus */
@@ -321,13 +319,13 @@ struct bha_extended_inquire {
#define BHA_SCSI_ULTRA 0x08 /* host adapter supports Ultra */
#define BHA_SCSI_TERMINATION 0x10 /* host adapter supports smart
termination */
- } reply;
-};
+ } __packed reply;
+} __packed;
struct bha_config {
struct {
u_char opcode;
- } cmd;
+ } __packed cmd;
struct {
u_char chan;
u_char intr;
@@ -338,64 +336,64 @@ struct bha_config {
u_char :5,
scsi_dev :3;
#endif
- } reply;
-};
+ } __packed reply;
+} __packed;
struct bha_toggle {
struct {
u_char opcode;
u_char enable;
- } cmd;
-};
+ } __packed cmd;
+} __packed;
struct bha_mailbox {
struct {
u_char opcode;
u_char nmbx;
physaddr addr;
- } cmd;
-};
+ } __packed cmd;
+} __packed;
struct bha_model {
struct {
u_char opcode;
u_char len;
- } cmd;
+ } __packed cmd;
struct {
u_char id[4]; /* i.e bt742a -> '7','4','2','A' */
u_char version[2]; /* i.e Board Revision 'H' -> 'H', 0x00 */
- } reply;
-};
+ } __packed reply;
+} __packed;
struct bha_revision {
struct {
u_char opcode;
- } cmd;
+ } __packed cmd;
struct {
u_char board_type;
u_char custom_feature;
char firm_revision;
u_char firm_version;
- } reply;
-};
+ } __packed reply;
+} __packed;
struct bha_digit {
struct {
u_char opcode;
- } cmd;
+ } __packed cmd;
struct {
u_char digit;
- } reply;
-};
+ } __packed reply;
+} __packed;
struct bha_devices {
struct {
u_char opcode;
- } cmd;
+ } __packed cmd;
struct {
u_char lun_map[8];
- } reply;
-};
+ } __packed reply;
+} __packed;
struct bha_sync {
#if BYTE_ORDER == LITTLE_ENDIAN
@@ -407,7 +405,7 @@ struct bha_sync {
period :3,
offset :4;
#endif
-};
+} __packed;
struct bha_setup_reply {
#if BYTE_ORDER == LITTLE_ENDIAN
@@ -427,7 +425,7 @@ struct bha_setup_reply {
/* doesn't make sense with 32bit addresses */
struct bha_sync sync[8];
u_int8_t disc_sts;
-};
+} __packed;
/* additional reply data supplied by wide controllers */
struct bha_setup_reply_wide {
@@ -441,38 +439,36 @@ struct bha_setup_reply_wide {
u_int8_t reserved;
u_int8_t high_wide_allowed;
u_int8_t high_wide_active;
-};
+} __packed;
struct bha_setup {
struct {
u_char opcode;
u_char len;
- } cmd;
+ } __packed cmd;
struct bha_setup_reply reply;
struct bha_setup_reply_wide reply_w; /* for wide controllers */
-};
+} __packed;
struct bha_period_reply {
u_char period[8];
-};
+} __packed;
struct bha_period {
struct {
u_char opcode;
u_char len;
- } cmd;
+ } __packed cmd;
struct bha_period_reply reply;
struct bha_period_reply reply_w; /* for wide controllers */
-};
+} __packed;
struct bha_isadisable {
struct {
u_char opcode;
u_char modifier;
- } cmd;
-};
-
-#pragma pack()
+ } __packed cmd;
+} __packed;
/*
* bha_isadisable.modifier parameters
diff --git a/sys/dev/ic/gdtvar.h b/sys/dev/ic/gdtvar.h
index fef1a9f1edf..2b4fa865bf2 100644
--- a/sys/dev/ic/gdtvar.h
+++ b/sys/dev/ic/gdtvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: gdtvar.h,v 1.14 2007/11/11 14:03:35 krw Exp $ */
+/* $OpenBSD: gdtvar.h,v 1.15 2008/09/01 17:30:56 deraadt Exp $ */
/*
* Copyright (c) 1999, 2000 Niklas Hallqvist. All rights reserved.
@@ -38,9 +38,6 @@ struct gdt_dummy {
int x;
};
-/* XXX Is this pragma necessary? */
-#pragma pack(1)
-
#define GDT_SCRATCH_SZ 4096
#define GDT_IOCTL_GENERAL _IOWR('B', 33, gdt_ucmd_t) /* general IOCTL */
@@ -198,8 +195,6 @@ typedef struct gdt_statist {
u_int16_t sg_count_max;
} gdt_statist_t;
-#pragma pack()
-
#ifdef _KERNEL
/* Debugging */
diff --git a/sys/dev/ic/i82596reg.h b/sys/dev/ic/i82596reg.h
index 61322f703b2..93eb7d2e240 100644
--- a/sys/dev/ic/i82596reg.h
+++ b/sys/dev/ic/i82596reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82596reg.h,v 1.5 2008/06/26 05:42:15 ray Exp $ */
+/* $OpenBSD: i82596reg.h,v 1.6 2008/09/01 17:30:56 deraadt Exp $ */
/* $NetBSD: i82586reg.h,v 1.7 1998/02/28 01:07:45 pk Exp $ */
/*-
@@ -77,8 +77,6 @@
* We use integer offsets exclusively to access the i82586/596 data structures.
*/
-#pragma pack(1)
-
/*
* This is the master configuration block.
* It tells the hardware where all the rest of the stuff is.
@@ -88,7 +86,8 @@ struct __ie_sys_conf_ptr {
u_int8_t ie_bus_use; // true if 8-bit only
u_int8_t mbz2[5]; // must be zero
u_int32_t ie_iscp_ptr; // 24-bit physaddr of ISCP
-};
+} __packed;
+
*/
#define IE_SCP_SZ 12 /* keep paragraph alignment */
#define IE_SCP_BUS_USE(base) ((base) + 2)
@@ -111,7 +110,7 @@ struct __ie_int_sys_conf_ptr {
u_int8_t mbz;
u_int16_t ie_scb_offset; // 16-bit physaddr of next struct
caddr_t ie_base; // 24-bit physaddr for all 16-bit vars
-};
+} __packed;
*/
#define IE_ISCP_SZ 16
#define IE_ISCP_BUSY(base) ((base) + 0)
@@ -143,7 +142,7 @@ struct __ie_sys_ctl_block {
u_int16_t ie_err_align; // Alignment errors
u_int16_t ie_err_resource; // Resource errors
u_int16_t ie_err_overrun; // Overrun errors
-};
+} __packed;
*/
#define IE_SCB_SZ 16
#define IE_SCB_STATUS(base) ((base) + 0)
@@ -209,7 +208,7 @@ struct __ie_recv_frame_desc {
struct __ie_en_addr src; // source ether
u_int16_t ie_length; // 802 length/Ether type
u_short mbz; // must be zero
-};
+} __packed;
*/
#define IE_RFRAME_SZ 24
#define IE_RFRAME_ADDR(base,i) ((base) + (i) * 64)
@@ -249,7 +248,7 @@ struct __ie_recv_buf_desc {
caddr_t ie_rbd_buffer; // 24-pointer to buffer for this RBD
u_int16_t ie_rbd_length; // length of the buffer
u_int16_t mbz; // must be zero
-};
+} __packed;
*/
#define IE_RBD_SZ 12
#define IE_RBD_ADDR(base,i) ((base) + (i) * 32)
@@ -274,7 +273,7 @@ struct __ie_cmd_common {
u_int16_t ie_cmd_status; // status of this command
u_int16_t ie_cmd_cmd; // command word
u_int16_t ie_cmd_link; // link to next command
-};
+} __packed;
*/
#define IE_CMD_COMMON_SZ 6
#define IE_CMD_COMMON_STATUS(base) ((base) + 0)
@@ -320,7 +319,7 @@ struct __ie_xmit_cmd {
u_int16_t ie_xmit_desc; // pointer to buffer descriptor
struct __ie_en_addr ie_xmit_addr; // destination address
u_int16_t ie_xmit_length; // 802.3 length/Ether type field
-};
+} __packed;
*/
#define IE_CMD_XMIT_SZ (IE_CMD_COMMON_SZ + 10)
#define IE_CMD_XMIT_ADDR(base,i) ((base) + (i) * 32)
@@ -353,7 +352,7 @@ struct __ie_xmit_buf {
u_int16_t ie_xmit_flags; // see below
u_int16_t ie_xmit_next; // 16-pointer to next desc
caddr_t ie_xmit_buf; // 24-pointer to the actual buffer
-};
+} __packed;
*/
#define IE_XBD_SZ 8
#define IE_XBD_ADDR(base,i) ((base) + (i) * 32)
@@ -376,7 +375,7 @@ struct __ie_mcast_cmd {
// size (in bytes) of multicast addresses
u_int16_t ie_mcast_bytes;
struct __ie_en_addr ie_mcast_addrs[IE_MAXMCAST + 1];// space for them
-};
+} __packed;
*/
#define IE_CMD_MCAST_SZ (IE_CMD_COMMON_SZ + 2 /* + XXX */)
#define IE_CMD_MCAST_BYTES(base) ((base) + IE_CMD_COMMON_SZ + 0)
@@ -389,7 +388,7 @@ struct __ie_tdr_cmd {
struct __ie_cmd_common com; // common part
#define ie_tdr_status com.ie_cmd_status
u_short ie_tdr_time; // error bits and time
-};
+} __packed;
*/
#define IE_CMD_TDR_SZ (IE_CMD_COMMON_SZ + 2)
#define IE_CMD_TDR_TIME(base) ((base) + IE_CMD_COMMON_SZ + 0)
@@ -409,7 +408,7 @@ struct __ie_iasetup_cmd {
struct __ie_cmd_common com;
#define ie_iasetup_status com.ie_cmd_status
struct __ie_en_addr ie_address;
-};
+} __packed;
*/
#define IE_CMD_IAS_SZ (IE_CMD_COMMON_SZ + 6)
#define IE_CMD_IAS_EADDR(base) ((base) + IE_CMD_COMMON_SZ + 0)
@@ -433,7 +432,7 @@ struct __ie_config_cmd {
u_int8_t ie_crs_cdt; // CSMA/CD parameters (0x0)
u_int8_t ie_min_len; // min frame length (0x40)
u_int8_t ie_junk; // stuff for 82596 (0xff)
-};
+} __packed;
*/
#define IE_CMD_CFG_SZ (IE_CMD_COMMON_SZ + 12)
#define IE_CMD_CFG_CNT(base) ((base) + IE_CMD_COMMON_SZ + 0)
@@ -448,5 +447,3 @@ struct __ie_config_cmd {
#define IE_CMD_CFG_CRSCDT(base) ((base) + IE_CMD_COMMON_SZ + 9)
#define IE_CMD_CFG_MINLEN(base) ((base) + IE_CMD_COMMON_SZ + 10)
#define IE_CMD_CFG_JUNK(base) ((base) + IE_CMD_COMMON_SZ + 11)
-
-#pragma pack()
diff --git a/sys/dev/ic/stireg.h b/sys/dev/ic/stireg.h
index 08b2e5f6aef..e9c83b7eced 100644
--- a/sys/dev/ic/stireg.h
+++ b/sys/dev/ic/stireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stireg.h,v 1.11 2005/10/29 11:54:07 miod Exp $ */
+/* $OpenBSD: stireg.h,v 1.12 2008/09/01 17:30:56 deraadt Exp $ */
/*
* Copyright (c) 2000 Michael Shalayeff
@@ -111,8 +111,6 @@
#define STI_COLOUR_BLUE 6
#define STI_COLOUR_MAGENTA 7
-#pragma pack(1)
-
/* LSB high */
struct sti_dd {
u_int32_t dd_type; /* 0x00 device type */
@@ -156,7 +154,7 @@ struct sti_dd {
servers w/o accel */
u_int32_t dd_pacode[16]; /* 0x40 routines for pa-risc */
u_int32_t dd_altcode[16]; /* 0x80 routines for m68k/i386 */
-};
+} __packed;
#define STI_REVISION(maj, min) (((maj) << 4) | ((min) & 0x0f))
@@ -168,7 +166,7 @@ struct sti_region {
u_int btlb : 1; /* should use BTLB if available */
u_int last : 1; /* last region in the list */
u_int length :14; /* size in pages */
-};
+} __packed;
struct sti_font {
u_int16_t first;
@@ -183,7 +181,7 @@ struct sti_font {
u_int8_t uheight;
u_int8_t uoffset;
u_int8_t unused[2];
-};
+} __packed;
struct sti_fontcfg {
u_int16_t first;
@@ -194,7 +192,7 @@ struct sti_fontcfg {
u_int8_t bpc;
u_int8_t uheight;
u_int8_t uoffset;
-};
+} __packed;
typedef struct sti_ecfg {
u_int8_t current_monitor;
@@ -203,7 +201,7 @@ typedef struct sti_ecfg {
u_int32_t freq_ref;
u_int32_t *addr; /* memory block of size dd_stimemreq */
void *future;
-} *sti_ecfg_t;
+} __packed *sti_ecfg_t;
typedef struct sti_cfg {
u_int32_t text_planes;
@@ -217,7 +215,7 @@ typedef struct sti_cfg {
u_int32_t reent_level;
u_int32_t *save_addr;
sti_ecfg_t ext_cfg;
-} *sti_cfg_t;
+} __packed *sti_cfg_t;
/* routine types */
@@ -243,25 +241,25 @@ typedef struct sti_initflags {
#define STI_INITF_SCMT 0x00040000 /* change current monitor type */
#define STI_INITF_RIE 0x00020000 /* retain int enables */
void *future;
-} *sti_initflags_t;
+} __packed *sti_initflags_t;
typedef struct sti_einitin {
u_int8_t mon_type;
u_int8_t pad;
u_int16_t inflight; /* possible on pci */
void *future;
-} *sti_einitin_t;
+} __packed *sti_einitin_t;
typedef struct sti_initin {
u_int32_t text_planes; /* number of planes for text */
sti_einitin_t ext_in;
-} *sti_initin_t;
+} __packed *sti_initin_t;
typedef struct sti_initout {
int32_t errno;
u_int32_t text_planes; /* number of planes used for text */
void *future;
-} *sti_initout_t;
+} __packed *sti_initout_t;
STI_DEP(init);
@@ -271,17 +269,17 @@ typedef struct sti_mgmtflags {
#define STI_MGMTF_SAVE 0x40000000
#define STI_MGMTF_RALL 0x20000000 /* restore all display planes */
void *future;
-} *sti_mgmtflags_t;
+} __packed *sti_mgmtflags_t;
typedef struct sti_mgmtin {
void *addr;
void *future;
-} *sti_mgmtin_t;
+} __packed *sti_mgmtin_t;
typedef struct sti_mgmtout {
int32_t errno;
void *future;
-} *sti_mgmtout_t;
+} __packed *sti_mgmtout_t;
STI_DEP(mgmt);
@@ -290,7 +288,7 @@ typedef struct sti_unpmvflags {
#define STI_UNPMVF_WAIT 0x80000000
#define STI_UNPMVF_NTXT 0x40000000 /* intp non-text planes */
void *future;
-} *sti_unpmvflags_t;
+} __packed *sti_unpmvflags_t;
typedef struct sti_unpmvin {
u_int32_t *font_addr; /* font */
@@ -299,12 +297,12 @@ typedef struct sti_unpmvin {
u_int8_t bg_colour;
u_int16_t x, y;
void *future;
-} *sti_unpmvin_t;
+} __packed *sti_unpmvin_t;
typedef struct sti_unpmvout {
u_int32_t errno;
void *future;
-} *sti_unpmvout_t;
+} __packed *sti_unpmvout_t;
STI_DEP(unpmv);
@@ -315,7 +313,7 @@ typedef struct sti_blkmvflags {
#define STI_BLKMVF_CLR 0x20000000 /* clear on move */
#define STI_BLKMVF_NTXT 0x10000000 /* move in non-text planes */
void *future;
-} *sti_blkmvflags_t;
+} __packed *sti_blkmvflags_t;
typedef struct sti_blkmvin {
u_int8_t fg_colour;
@@ -324,12 +322,12 @@ typedef struct sti_blkmvin {
u_int16_t width, height;
u_int16_t pad;
void *future;
-} *sti_blkmvin_t;
+} __packed *sti_blkmvin_t;
typedef struct sti_blkmvout {
u_int32_t errno;
void *future;
-} *sti_blkmvout_t;
+} __packed *sti_blkmvout_t;
STI_DEP(blkmv);
@@ -338,17 +336,17 @@ typedef struct sti_testflags {
#define STI_TESTF_WAIT 0x80000000
#define STI_TESTF_ETST 0x40000000
void *future;
-} *sti_testflags_t;
+} __packed *sti_testflags_t;
typedef struct sti_testin {
void *future;
-} *sti_testin_t;
+} __packed *sti_testin_t;
typedef struct sti_testout {
u_int32_t errno;
u_int32_t result;
void *future;
-} *sti_testout_t;
+} __packed *sti_testout_t;
STI_DEP(test);
@@ -369,7 +367,7 @@ typedef struct sti_exhdlflags {
#define STI_EXHDLF_EIC 0x00080000 /* end int cycle */
#define STI_EXHDLF_RIE 0x00040000 /* reset do not clear int enables */
void *future;
-} *sti_exhdlflags_t;
+} __packed *sti_exhdlflags_t;
typedef struct sti_eexhdlin {
u_int32_t eim_addr;
@@ -377,7 +375,7 @@ typedef struct sti_eexhdlin {
u_int32_t iem; /* enable mask */
u_int32_t icm; /* clear mask */
void *future;
-} *sti_eexhdlin_t;
+} __packed *sti_eexhdlin_t;
typedef struct sti_exhdlint {
u_int32_t flags;
@@ -390,12 +388,12 @@ typedef struct sti_exhdlint {
#define STI_EXHDLINT_BDC 0x02000000 /* buffered dma complete */
#define STI_EXHDLINT_UDPC 0x01000000 /* unbuf priv dma complete */
#define STI_EXHDLINT_BDPC 0x00800000 /* buffered priv dma complete */
-} *sti_exhdlint_t;
+} __packed *sti_exhdlint_t;
typedef struct sti_exhdlin {
sti_exhdlint_t addr;
sti_eexhdlin_t ext;
-} *sti_exhdlin_t;
+} __packed *sti_exhdlin_t;
typedef struct sti_eexhdlout {
u_int32_t eim_addr;
@@ -403,7 +401,7 @@ typedef struct sti_eexhdlout {
u_int32_t iem; /* enable mask */
u_int32_t icm; /* clear mask */
void *future;
-} *sti_eexhdlout_t;
+} __packed *sti_eexhdlout_t;
typedef struct sti_exhdlout {
u_int32_t errno;
@@ -412,7 +410,7 @@ typedef struct sti_exhdlout {
#define STI_EXHDLO_IP 0x40000000 /* there is int pending */
#define STI_EXHDLO_IE 0x20000000 /* global enable set */
sti_eexhdlout_t ext;
-} *sti_exhdlout_t;
+} __packed *sti_exhdlout_t;
STI_DEP(exhdl);
@@ -420,17 +418,17 @@ typedef struct sti_inqconfflags {
u_int32_t flags;
#define STI_INQCONFF_WAIT 0x80000000
void *future;
-} *sti_inqconfflags_t;
+} __packed *sti_inqconfflags_t;
typedef struct sti_inqconfin {
void *future;
-} *sti_inqconfin_t;
+} __packed *sti_inqconfin_t;
typedef struct sti_einqconfout {
u_int32_t crt_config[3];
u_int32_t crt_hw[3];
void *future;
-} *sti_einqconfout_t;
+} __packed *sti_einqconfout_t;
typedef struct sti_inqconfout {
u_int32_t errno;
@@ -457,7 +455,7 @@ typedef struct sti_inqconfout {
"\020\001y2x\002hwblkmv\003ahw\004int\005gonoff\006aonoff\007vary"\
"\010oddb\011flush\012dma\013vdma\016yuv1\017yuv2"
sti_einqconfout_t ext;
-} *sti_inqconfout_t;
+} __packed *sti_inqconfout_t;
STI_DEP(inqconf);
@@ -465,18 +463,18 @@ typedef struct sti_scmentflags {
u_int32_t flags;
#define STI_SCMENTF_WAIT 0x80000000
void *future;
-} *sti_scmentflags_t;
+} __packed *sti_scmentflags_t;
typedef struct sti_scmentin {
u_int32_t entry;
u_int32_t value;
void *future;
-} *sti_scmentin_t;
+} __packed *sti_scmentin_t;
typedef struct sti_scmentout {
u_int32_t errno;
void *future;
-} *sti_scmentout_t;
+} __packed *sti_scmentout_t;
STI_DEP(scment);
@@ -489,7 +487,7 @@ typedef struct sti_dmacflags {
#define STI_DMACF_MRK 0x08000000 /* write a marker */
#define STI_DMACF_ABRT 0x04000000 /* abort dma xfer */
void *future;
-} *sti_dmacflags_t;
+} __packed *sti_dmacflags_t;
typedef struct sti_dmacin {
u_int32_t pa_upper;
@@ -498,12 +496,12 @@ typedef struct sti_dmacin {
u_int32_t mrk_data;
u_int32_t mrk_off;
void *future;
-} *sti_dmacin_t;
+} __packed *sti_dmacin_t;
typedef struct sti_dmacout {
u_int32_t errno;
void *future;
-} *sti_dmacout_t;
+} __packed *sti_dmacout_t;
STI_DEP(dmac);
@@ -519,7 +517,7 @@ typedef struct sti_flowcflags {
#define STI_FLOWCF_CSWC 0x01000000 /* cs write coarse */
#define STI_FLOWCF_CSWQ 0x00800000 /* cs write fifo */
void *future;
-} *sti_flowcflags_t;
+} __packed *sti_flowcflags_t;
typedef struct sti_flowcin {
u_int32_t retry;
@@ -530,14 +528,14 @@ typedef struct sti_flowcin {
u_int32_t cscv; /* cs coarse value */
u_int32_t csqc; /* cs fifo count */
void *future;
-} *sti_flowcin_t;
+} __packed *sti_flowcin_t;
typedef struct sti_flowcout {
u_int32_t errno;
u_int32_t retry_result;
u_int32_t fifo_size;
void *future;
-} *sti_flowcout_t;
+} __packed *sti_flowcout_t;
STI_DEP(flowc);
@@ -546,19 +544,19 @@ typedef struct sti_utimingflags {
#define STI_UTIMF_WAIT 0x80000000
#define STI_UTIMF_HKS 0x40000000 /* has kbuf_size */
void *future;
-} *sti_utimingflags_t;
+} __packed *sti_utimingflags_t;
typedef struct sti_utimingin {
void *data;
void *kbuf;
void *future;
-} *sti_utimingin_t;
+} __packed *sti_utimingin_t;
typedef struct sti_utimingout {
u_int32_t errno;
u_int32_t kbuf_size; /* buffer required size */
void *future;
-} *sti_utimingout_t;
+} __packed *sti_utimingout_t;
STI_DEP(utiming);
@@ -571,17 +569,17 @@ typedef struct sti_pmgrflags {
#define STI_UTIMF_BUFF 0x02000000
#define STI_UTIMF_IBUFF 0x01000000
void *future;
-} *sti_pmgrflags_t;
+} __packed *sti_pmgrflags_t;
typedef struct sti_pmgrin {
u_int32_t reserved[4];
void *future;
-} *sti_pmgrin_t;
+} __packed *sti_pmgrin_t;
typedef struct sti_pmgrout {
int32_t errno;
void *future;
-} *sti_pmgrout_t;
+} __packed *sti_pmgrout_t;
STI_DEP(pmgr);
@@ -589,21 +587,19 @@ typedef struct sti_utilflags {
u_int32_t flags;
#define STI_UTILF_ROOT 0x80000000 /* was called as root */
void *future;
-} *sti_utilflags_t;
+} __packed *sti_utilflags_t;
typedef struct sti_utilin {
u_int32_t in_size;
u_int32_t out_size;
u_int8_t *buf;
-} *sti_utilin_t;
+} __packed *sti_utilin_t;
typedef struct sti_utilout {
int32_t errno;
void *future;
-} *sti_utilout_t;
+} __packed *sti_utilout_t;
STI_DEP(util);
-#pragma pack()
-
#endif /* _IC_STIREG_H_ */
diff --git a/sys/dev/ic/twereg.h b/sys/dev/ic/twereg.h
index 12e1e18ec57..53d24492caa 100644
--- a/sys/dev/ic/twereg.h
+++ b/sys/dev/ic/twereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: twereg.h,v 1.8 2007/04/10 17:47:55 miod Exp $ */
+/* $OpenBSD: twereg.h,v 1.9 2008/09/01 17:30:56 deraadt Exp $ */
/*
* Copyright (c) 2000 Michael Shalayeff
@@ -146,20 +146,18 @@
/* TWE_AEN_ 0x0000 * dunno what this is (yet) */
#define TWE_AEN_QFULL 0x00ff
-#pragma pack(1)
-
/* struct definitions */
struct twe_param {
u_int16_t table_id;
u_int8_t param_id;
u_int8_t param_size;
u_int8_t data[1];
-};
+} __packed;
struct twe_segs {
u_int32_t twes_addr;
u_int32_t twes_len;
-};
+} __packed;
struct twe_cmd {
u_int16_t cmd_op;
@@ -175,17 +173,17 @@ struct twe_cmd {
u_int32_t lba;
struct twe_segs segs[TWE_MAXOFFSETS];
u_int32_t pad;
- } _cmd_io;
+ } __packed _cmd_io;
#define cmd_io _._cmd_io
struct {
u_int16_t count;
struct twe_segs segs[TWE_MAXOFFSETS];
- } _cmd_param;
+ } __packed _cmd_param;
#define cmd_param _._cmd_param
struct {
u_int16_t msgcr;
u_int32_t rdy_q_ptr;
- } _cmd_init;
+ } __packed _cmd_init;
#define cmd_init _._cmd_init
struct {
u_int8_t action;
@@ -193,7 +191,7 @@ struct twe_cmd {
#define TWE_HSWAP_ADDCBOD 1
#define TWE_HSWAP_ADDSPARE 2
u_int8_t port;
- } _cmd_aport;
+ } __packed _cmd_aport;
#define cmd_hswap _._cmd_hswap
struct {
u_int8_t feature;
@@ -202,7 +200,7 @@ struct twe_cmd {
u_int8_t mode;
u_int16_t units;
u_int16_t persist;
- } _cmd_ata;
+ } __packed _cmd_ata;
#define cmd_ata _._cmd_ata
u_int16_t cmd_status;
struct {
@@ -213,9 +211,7 @@ struct twe_cmd {
#define TWE_REBUILD_STARTU 5
#define TWE_REBUILD_CS 0x80
u_int8_t subunit; /* raid10 lu rebuild */
- } _cmd_rebuild;
+ } __packed _cmd_rebuild;
#define cmd_rebuild _._cmd_rebuild
} _;
-}; /* 512 bytes */
-
-#pragma pack()
+} __packed; /* 512 bytes */
diff --git a/sys/dev/ic/vgareg.h b/sys/dev/ic/vgareg.h
index b151b63eaa5..bcaee1c3059 100644
--- a/sys/dev/ic/vgareg.h
+++ b/sys/dev/ic/vgareg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vgareg.h,v 1.3 2004/04/02 04:39:50 deraadt Exp $ */
+/* $OpenBSD: vgareg.h,v 1.4 2008/09/01 17:30:56 deraadt Exp $ */
/* $NetBSD: vgareg.h,v 1.2 1998/05/28 16:48:41 drochner Exp $ */
/*
@@ -27,20 +27,18 @@
*
*/
-#pragma pack(1)
-
struct reg_vgaattr { /* indexed via port 0x3c0 */
u_int8_t palette[16];
u_int8_t mode, overscan, colplen, horpixpan;
u_int8_t colreset, misc;
-};
+} __packed;
#define VGA_ATC_INDEX 0
#define VGA_ATC_DATAW 0
#define VGA_ATC_DATAR 1
struct reg_vgats { /* indexed via port 0x3c4 */
u_int8_t syncreset, mode, wrplmask, fontsel, memmode;
-};
+} __packed;
#define VGA_TS_INDEX 4
#define VGA_TS_DATA 5
@@ -48,8 +46,6 @@ struct reg_vgagdc { /* indexed via port 0x3ce */
u_int8_t setres, ensetres, colorcomp, rotfunc;
u_int8_t rdplanesel, mode, misc, colorcare;
u_int8_t bitmask;
-};
+} __packed;
#define VGA_GDC_INDEX 0xe
#define VGA_GDC_DATA 0xf
-
-#pragma pack()
diff --git a/sys/dev/pcmcia/if_rayreg.h b/sys/dev/pcmcia/if_rayreg.h
index e60d7c8da5e..6d0ef462fd0 100644
--- a/sys/dev/pcmcia/if_rayreg.h
+++ b/sys/dev/pcmcia/if_rayreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rayreg.h,v 1.7 2003/12/12 02:36:07 mcbride Exp $ */
+/* $OpenBSD: if_rayreg.h,v 1.8 2008/09/01 17:30:56 deraadt Exp $ */
/* $NetBSD: if_rayreg.h,v 1.3 2000/08/10 11:48:46 ad Exp $ */
/*
@@ -32,8 +32,6 @@
#define RAY_MAXSSIDLEN 32
-#pragma pack(1)
-
/*
* CCR registers
*/
@@ -154,7 +152,7 @@ struct ray_ecf_startup {
u_int8_t e_asic_version;
u_int8_t e_tib_size;
u_int8_t e_resv1[29];
-};
+} __packed;
#define RAY_ECFS_RESERVED0 0x01
#define RAY_ECFS_PROC_SELF_TEST 0x02
@@ -176,7 +174,7 @@ struct ray_csc {
u_int16_t csc_mrx_cksum; /* " on cksum error */
u_int16_t csc_rx_hcksum; /* " on header cksum error */
u_int8_t csc_rx_noise; /* average RSL measurement */
-};
+} __packed;
/* status area */
struct ray_status {
@@ -186,7 +184,7 @@ struct ray_status {
u_int8_t st_calc_cis_cksum;
u_int8_t st_ecf_spare[7];
u_int8_t st_japan_callsign[12];
-};
+} __packed;
/*
* Host to ECF data formats
@@ -226,7 +224,7 @@ struct ray_startup_params_head {
/*48*/ u_int8_t sp_country_code;
/*49*/ u_int8_t sp_hop_seq;
/*4a*/ u_int8_t sp_hop_seq_len; /* no longer supported */
-};
+} __packed;
/* build 5 tail to the startup params */
struct ray_startup_params_tail_5 {
@@ -244,7 +242,7 @@ struct ray_startup_params_tail_5 {
u_int8_t sp_privacy_must_start;
u_int8_t sp_privacy_can_join;
u_int8_t sp_basic_rate_set[8];
-};
+} __packed;
/* build 4 (webgear) tail to the startup params */
struct ray_startup_params_tail_4 {
@@ -259,7 +257,7 @@ struct ray_startup_params_tail_4 {
u_int8_t sp_test_min_chan;
u_int8_t sp_test_max_chan;
/* more bytes in build 5 */
-};
+} __packed;
/*
* Parameter IDs for the update/report param commands and values if
@@ -415,7 +413,7 @@ struct ray_cmd {
u_int8_t c_status; /* ccs generic header */
u_int8_t c_cmd; /* " */
u_int8_t c_link; /* " */
-};
+} __packed;
#define RAY_CCS_STATUS_FREE 0x0
#define RAY_CCS_STATUS_BUSY 0x1
@@ -430,7 +428,7 @@ struct ray_cmd_update {
u_int8_t c_paramid;
u_int8_t c_nparam;
u_int8_t c_failcause;
-};
+} __packed;
/* RAY_CMD_REPORT_PARAMS */
struct ray_cmd_report {
@@ -441,7 +439,7 @@ struct ray_cmd_report {
u_int8_t c_nparam;
u_int8_t c_failcause;
u_int8_t c_len;
-};
+} __packed;
/* RAY_CMD_UPDATE_MCAST */
struct ray_cmd_update_mcast {
@@ -449,7 +447,7 @@ struct ray_cmd_update_mcast {
u_int8_t c_cmd; /* " */
u_int8_t c_link; /* " */
u_int8_t c_nmcast;
-};
+} __packed;
/* RAY_CMD_UPDATE_APM */
struct ray_cmd_udpate_apm {
@@ -457,7 +455,7 @@ struct ray_cmd_udpate_apm {
u_int8_t c_cmd; /* " */
u_int8_t c_link; /* " */
u_int8_t c_mode;
-};
+} __packed;
/* RAY_CMD_START_NET and RAY_CMD_JOIN_NET */
struct ray_cmd_net {
@@ -469,7 +467,7 @@ struct ray_cmd_net {
u_int8_t c_inited;
u_int8_t c_def_txrate;
u_int8_t c_encrypt;
-};
+} __packed;
/* parameters passwd in h2e section when c_upd_param is set in ray_cmd_net */
struct ray_net_params {
@@ -477,7 +475,7 @@ struct ray_net_params {
u_int8_t p_ssid[32];
u_int8_t p_privacy_must_start;
u_int8_t p_privacy_can_join;
-};
+} __packed;
/* RAY_CMD_UPDATE_ASSOC */
struct ray_cmd_update_assoc {
@@ -486,7 +484,7 @@ struct ray_cmd_update_assoc {
u_int8_t c_link; /* " */
u_int8_t c_astatus;
u_int8_t c_aid[2];
-};
+} __packed;
/* RAY_CMD_TX_REQ */
struct ray_cmd_tx {
@@ -500,7 +498,7 @@ struct ray_cmd_tx {
u_int8_t c_apm_mode;
u_int8_t c_nretry;
u_int8_t c_antenna;
-};
+} __packed;
/* RAY_CMD_TX_REQ (for build 4) */
struct ray_cmd_tx_4 {
@@ -513,7 +511,7 @@ struct ray_cmd_tx_4 {
u_int8_t c_apm_mode;
u_int8_t c_nretry;
u_int8_t c_antenna;
-};
+} __packed;
/* RAY_CMD_DUMP_MEM */
struct ray_cmd_dump_mem {
@@ -523,7 +521,7 @@ struct ray_cmd_dump_mem {
u_int8_t c_memtype;
u_int8_t c_memp[2];
u_int8_t c_len;
-};
+} __packed;
/* RAY_CMD_START_TIMER */
struct ray_cmd_start_timer {
@@ -531,7 +529,7 @@ struct ray_cmd_start_timer {
u_int8_t c_cmd; /* " */
u_int8_t c_link; /* " */
u_int8_t c_duration[2];
-};
+} __packed;
struct ray_cmd_rx {
u_int8_t c_status; /* ccs generic header */
@@ -544,9 +542,7 @@ struct ray_cmd_rx {
u_int8_t c_pktlen[2]; /* total packet length */
u_int8_t c_antenna; /* antenna with best reception */
u_int8_t c_updbss; /* only 1 for beacon messages */
-};
-
-#pragma pack()
+} __packed;
#define RAY_TX_PHY_SIZE 0x4