Module Name:    src
Committed By:   jakllsch
Date:           Tue Jul 20 18:50:48 UTC 2010

Modified Files:
        src/sys/dev/ic: ahcisata_core.c ahcisatareg.h ahcisatavar.h

Log Message:
Convert ahcisata(4) to C99 exact-width integer types.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ic/ahcisatareg.h \
    src/sys/dev/ic/ahcisatavar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.26 src/sys/dev/ic/ahcisata_core.c:1.27
--- src/sys/dev/ic/ahcisata_core.c:1.26	Wed Apr  7 17:51:16 2010
+++ src/sys/dev/ic/ahcisata_core.c	Tue Jul 20 18:50:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.26 2010/04/07 17:51:16 jakllsch Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.27 2010/07/20 18:50:48 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.26 2010/04/07 17:51:16 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.27 2010/07/20 18:50:48 jakllsch Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -142,7 +142,7 @@
 void
 ahci_setup_ports(struct ahci_softc *sc)
 {
-	u_int32_t ahci_ports;
+	uint32_t ahci_ports;
 	int i, port;
 	
 	ahci_ports = AHCI_READ(sc, AHCI_PI);
@@ -161,7 +161,7 @@
 void
 ahci_reprobe_drives(struct ahci_softc *sc)
 {
-	u_int32_t ahci_ports;
+	uint32_t ahci_ports;
 	int i, port;
 	struct ahci_channel *achp;
 	struct ata_channel *chp;
@@ -208,7 +208,7 @@
 void
 ahci_attach(struct ahci_softc *sc)
 {
-	u_int32_t ahci_cap, ahci_rev, ahci_ports;
+	uint32_t ahci_cap, ahci_rev, ahci_ports;
 	int i, j, port;
 	struct ahci_channel *achp;
 	struct ata_channel *chp;
@@ -412,7 +412,7 @@
 ahci_intr(void *v)
 {
 	struct ahci_softc *sc = v;
-	u_int32_t is;
+	uint32_t is;
 	int i, r = 0;
 
 	while ((is = AHCI_READ(sc, AHCI_IS))) {
@@ -430,7 +430,7 @@
 void
 ahci_intr_port(struct ahci_softc *sc, struct ahci_channel *achp)
 {
-	u_int32_t is, tfd;
+	uint32_t is, tfd;
 	struct ata_channel *chp = &achp->ata_channel;
 	struct ata_xfer *xfer = chp->ch_queue->active_xfer;
 	int slot;
@@ -556,7 +556,7 @@
 	struct ahci_softc *sc = (struct ahci_softc *)chp->ch_atac;
 	struct ahci_channel *achp = (struct ahci_channel *)chp;
 	int i, s;
-	u_int32_t sig;
+	uint32_t sig;
 
 	/* XXX This should be done by other code. */
 	for (i = 0; i < chp->ch_ndrive; i++) {

Index: src/sys/dev/ic/ahcisatareg.h
diff -u src/sys/dev/ic/ahcisatareg.h:1.5 src/sys/dev/ic/ahcisatareg.h:1.6
--- src/sys/dev/ic/ahcisatareg.h:1.5	Mon Oct 19 18:41:12 2009
+++ src/sys/dev/ic/ahcisatareg.h	Tue Jul 20 18:50:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisatareg.h,v 1.5 2009/10/19 18:41:12 bouyer Exp $	*/
+/*	$NetBSD: ahcisatareg.h,v 1.6 2010/07/20 18:50:48 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -34,10 +34,10 @@
 /* in-memory structures used by the controller */
 /* physical region descriptor: points to a region of data (max 4MB) */
 struct ahci_dma_prd {
-	u_int32_t prd_dba; /* data base address (64 bits) */
-	u_int32_t prd_dbau;
-	u_int32_t prd_res; /* reserved */
-	u_int32_t prd_dbc; /* data byte count */
+	uint32_t prd_dba; /* data base address (64 bits) */
+	uint32_t prd_dbau;
+	uint32_t prd_res; /* reserved */
+	uint32_t prd_dbc; /* data byte count */
 #define AHCI_PRD_DBC_MASK 0x003fffff
 #define AHCI_PRD_DBC_IPC  0x80000000 /* interrupt on completion */
 } __packed;
@@ -46,9 +46,9 @@
 
 /* command table: describe a command to send to drive */
 struct ahci_cmd_tbl {
-	u_int8_t cmdt_cfis[64]; /* command FIS */
-	u_int8_t cmdt_acmd[16]; /* ATAPI command */
-	u_int8_t cmdt_res[48]; /* reserved */
+	uint8_t cmdt_cfis[64]; /* command FIS */
+	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;
 
@@ -63,7 +63,7 @@
  * of theses.
  */
 struct ahci_cmd_header {
-	u_int16_t cmdh_flags;
+	uint16_t cmdh_flags;
 #define AHCI_CMDH_F_PMP_MASK	0xf000 /* port multiplier port */
 #define AHCI_CMDH_F_PMP_SHIFT	12
 #define AHCI_CMDH_F_CBSY	0x0400 /* clear BSY on R_OK */
@@ -74,23 +74,23 @@
 #define AHCI_CMDH_F_A		0x0020 /* ATAPI */
 #define AHCI_CMDH_F_CFL_MASK	0x001f /* command FIS length (in dw) */
 #define AHCI_CMDH_F_CFL_SHIFT	0
-	u_int16_t cmdh_prdtl;	/* number of cmdt_prd */
-	u_int32_t cmdh_prdbc;	/* physical region descriptor byte count */
-	u_int32_t cmdh_cmdtba;	/* phys. addr. of cmd_tbl */
-	u_int32_t cmdh_cmdtbau;	/* (64bits, 128bytes aligned) */
-	u_int32_t cmdh_res[4];	/* reserved */
+	uint16_t cmdh_prdtl;	/* number of cmdt_prd */
+	uint32_t cmdh_prdbc;	/* physical region descriptor byte count */
+	uint32_t cmdh_cmdtba;	/* phys. addr. of cmd_tbl */
+	uint32_t cmdh_cmdtbau;	/* (64bits, 128bytes aligned) */
+	uint32_t cmdh_res[4];	/* reserved */
 } __packed;
 
 #define AHCI_CMDH_SIZE (sizeof(struct ahci_cmd_header) * AHCI_MAX_CMDS)
 
 /* received FIS: where the HBA stores various type of FIS it receives */
 struct ahci_r_fis {
-	u_int8_t rfis_dsfis[32]; /* DMA setup FIS */
-	u_int8_t rfis_psfis[32]; /* PIO setup FIS */
-	u_int8_t rfis_rfis[24]; /* D2H register FIS */
-	u_int8_t rfis_sdbfis[8]; /* set device bit FIS */
-	u_int8_t rfis_ukfis[64]; /* unknown FIS */
-	u_int8_t rfis_res[96];
+	uint8_t rfis_dsfis[32];	/* DMA setup FIS */
+	uint8_t rfis_psfis[32]; /* PIO setup FIS */
+	uint8_t rfis_rfis[24];  /* D2H register FIS */
+	uint8_t rfis_sdbfis[8]; /* set device bit FIS */
+	uint8_t rfis_ukfis[64]; /* unknown FIS */
+	uint8_t rfis_res[96];   /* reserved */
 } __packed;
 
 #define AHCI_RFIS_SIZE (sizeof(struct ahci_r_fis))
Index: src/sys/dev/ic/ahcisatavar.h
diff -u src/sys/dev/ic/ahcisatavar.h:1.5 src/sys/dev/ic/ahcisatavar.h:1.6
--- src/sys/dev/ic/ahcisatavar.h:1.5	Mon Oct 19 18:41:12 2009
+++ src/sys/dev/ic/ahcisatavar.h	Tue Jul 20 18:50:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisatavar.h,v 1.5 2009/10/19 18:41:12 bouyer Exp $	*/
+/*	$NetBSD: ahcisatavar.h,v 1.6 2010/07/20 18:50:48 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -69,7 +69,7 @@
 		struct ahci_cmd_tbl *ahcic_cmd_tbl[AHCI_MAX_CMDS];
 		bus_addr_t ahcic_bus_cmd_tbl[AHCI_MAX_CMDS];
 		bus_dmamap_t ahcic_datad[AHCI_MAX_CMDS];
-		u_int32_t  ahcic_cmds_active; /* active commands */
+		uint32_t  ahcic_cmds_active; /* active commands */
 	} sc_channels[AHCI_MAX_PORTS];
 };
 

Reply via email to