Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Additionally apply __aligned(8) to all __packed h...



details:   https://anonhg.NetBSD.org/src/rev/0a18d06545e9
branches:  trunk
changeset: 770814:0a18d06545e9
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Wed Nov 02 16:54:50 2011 +0000

description:
Additionally apply __aligned(8) to all __packed hardware data structures.
(The hardware actually requires much larger alignment on these structures
(128 to 1024 bytes), but 8 is big enough for the compiler to generate more
efficient code on strict alignment architectures.)

diffstat:

 sys/dev/ic/ahcisatareg.h |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 49187c062e54 -r 0a18d06545e9 sys/dev/ic/ahcisatareg.h
--- a/sys/dev/ic/ahcisatareg.h  Wed Nov 02 16:51:21 2011 +0000
+++ b/sys/dev/ic/ahcisatareg.h  Wed Nov 02 16:54:50 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahcisatareg.h,v 1.10 2011/08/20 16:10:02 jakllsch Exp $        */
+/*     $NetBSD: ahcisatareg.h,v 1.11 2011/11/02 16:54:50 jakllsch Exp $        */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -39,7 +39,7 @@
        uint32_t prd_dbc; /* data byte count */
 #define AHCI_PRD_DBC_MASK 0x003fffff
 #define AHCI_PRD_DBC_IPC  0x80000000 /* interrupt on completion */
-} __packed;
+} __packed __aligned(8);
 
 #define AHCI_NPRD ((MAXPHYS/PAGE_SIZE) + 1)
 
@@ -49,7 +49,7 @@
        uint8_t cmdt_acmd[16]; /* ATAPI command */
        uint8_t cmdt_res[48]; /* reserved */
        struct ahci_dma_prd cmdt_prd[1]; /* extended to AHCI_NPRD */
-} __packed;
+} __packed __aligned(8);
 
 #define AHCI_CMDTBL_ALIGN 0x7f
 
@@ -77,7 +77,7 @@
        uint32_t cmdh_prdbc;    /* physical region descriptor byte count */
        uint64_t cmdh_cmdtba;   /* phys. addr. of cmd_tbl, 128bytes aligned */
        uint32_t cmdh_res[4];   /* reserved */
-} __packed;
+} __packed __aligned(8);
 
 #define AHCI_CMDH_SIZE (sizeof(struct ahci_cmd_header) * AHCI_MAX_CMDS)
 
@@ -89,7 +89,7 @@
        uint8_t rfis_sdbfis[8]; /* set device bit FIS */
        uint8_t rfis_ukfis[64]; /* unknown FIS */
        uint8_t rfis_res[96];   /* reserved */
-} __packed;
+} __packed __aligned(8);
 
 #define AHCI_RFIS_SIZE (sizeof(struct ahci_r_fis))
 



Home | Main Index | Thread Index | Old Index