summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorMasao Uebayashi <uebayasi@cvs.openbsd.org>2013-06-12 01:07:34 +0000
committerMasao Uebayashi <uebayasi@cvs.openbsd.org>2013-06-12 01:07:34 +0000
commitc8010ecb5bad0d5b2d1ca303437ca5dd281451c5 (patch)
tree29e2164ccdb17c00b3d829a8b28abcb4363bc721 /sys/dev/pci
parentc8198f7a7f1b48b34dd32a736391f297e41cb895 (diff)
Don't rely on __attribute__((__aligned__(x))) GCC extension. Explicitly pad descriptors.
No binary change.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_vmx.c4
-rw-r--r--sys/dev/pci/if_vmxreg.h12
2 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/pci/if_vmx.c b/sys/dev/pci/if_vmx.c
index dfa23ca4489..900c944d39f 100644
--- a/sys/dev/pci/if_vmx.c
+++ b/sys/dev/pci/if_vmx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vmx.c,v 1.8 2013/06/12 00:19:36 uebayasi Exp $ */
+/* $OpenBSD: if_vmx.c,v 1.9 2013/06/12 01:07:33 uebayasi Exp $ */
/*
* Copyright (c) 2013 Tsubai Masanari
@@ -296,7 +296,7 @@ vmxnet3_dma_init(struct vmxnet3_softc *sc)
u_int major, minor, release_code, rev;
qs_len = NTXQUEUE * sizeof *ts + NRXQUEUE * sizeof *rs;
- ts = dma_allocmem(sc, qs_len, 128, &qs_pa);
+ ts = dma_allocmem(sc, qs_len, VMXNET3_DMADESC_ALIGN, &qs_pa);
if (ts == NULL)
return -1;
for (queue = 0; queue < NTXQUEUE; queue++)
diff --git a/sys/dev/pci/if_vmxreg.h b/sys/dev/pci/if_vmxreg.h
index 50b4fd97b0c..efb4d65a9d0 100644
--- a/sys/dev/pci/if_vmxreg.h
+++ b/sys/dev/pci/if_vmxreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vmxreg.h,v 1.1 2013/05/31 20:14:19 uebayasi Exp $ */
+/* $OpenBSD: if_vmxreg.h,v 1.2 2013/06/12 01:07:33 uebayasi Exp $ */
/*
* Copyright (c) 2013 Tsubai Masanari
@@ -77,7 +77,7 @@ struct UPT1_RxStats {
#define VMXNET3_CMD_GET_MACL 0xf00d0003
#define VMXNET3_CMD_GET_MACH 0xf00d0004
-#define __aligned(x) __attribute__((__aligned__(x)))
+#define VMXNET3_DMADESC_ALIGN 128
struct vmxnet3_txdesc {
u_int64_t addr;
@@ -261,7 +261,9 @@ struct vmxnet3_txq_shared {
u_int32_t error;
struct UPT1_TxStats stats;
-} __packed __aligned(128);
+
+ u_int8_t pad3[88];
+} __packed;
struct vmxnet3_rxq_shared {
u_int8_t update_rxhead;
@@ -283,4 +285,6 @@ struct vmxnet3_rxq_shared {
u_int32_t error;
struct UPT1_RxStats stats;
-} __packed __aligned(128);
+
+ u_int8_t pad4[88];
+} __packed;