summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>1997-08-31 19:42:31 +0000
committerse <se@FreeBSD.org>1997-08-31 19:42:31 +0000
commit03cddbd34b70cc97fbd01ca3734fbb044adeefc4 (patch)
treedfbed9a504c3ec8659b346a9561991de940dfefc
parenteae32024a1436d66df36919d7e597c000ea4f123 (diff)
downloadFreeBSD-src-03cddbd34b70cc97fbd01ca3734fbb044adeefc4.zip
FreeBSD-src-03cddbd34b70cc97fbd01ca3734fbb044adeefc4.tar.gz
Prepare for 64bit programming environment (e.g. Alpha):
Use "ncrcmd" or "u_int32_t" instead of "u_long", where appropriate. Submitted by: Gerard Roudier <groudier@club-internet.fr>
-rw-r--r--sys/pci/ncr.c64
-rw-r--r--sys/pci/ncrreg.h26
2 files changed, 45 insertions, 45 deletions
diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c
index 2379741..1b3fc74 100644
--- a/sys/pci/ncr.c
+++ b/sys/pci/ncr.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: ncr.c,v 1.106 1997/08/31 19:35:52 se Exp $
+** $Id: ncr.c,v 1.107 1997/08/31 19:36:56 se Exp $
**
** Device driver for the NCR 53C810 PCI-SCSI-Controller.
**
@@ -323,7 +323,7 @@
#define INB_OFF(o) *( ((u_char *) np->reg) + (o) )
#define INW_OFF(o) *((u_short *) ( ((u_char *) np->reg) + (o)) )
-#define INL_OFF(o) *((u_long *) ( ((u_char *) np->reg) + (o)) )
+#define INL_OFF(o) *((u_int32_t *) ( ((u_char *) np->reg) + (o)) )
#endif
@@ -469,8 +469,8 @@ typedef struct lcb * lcb_p;
typedef struct ccb * ccb_p;
struct link {
- u_long l_cmd;
- u_long l_paddr;
+ ncrcmd l_cmd;
+ ncrcmd l_paddr;
};
struct usrcmd {
@@ -732,9 +732,9 @@ struct head {
** the last transfer command.
*/
- u_long savep;
- u_long lastp;
- u_long goalp;
+ u_int32_t savep;
+ u_int32_t lastp;
+ u_int32_t goalp;
/*
** The virtual address of the ccb
@@ -910,7 +910,7 @@ struct ccb {
** the rest of the data.
*/
- u_long patch[8];
+ ncrcmd patch[8];
/*
** The general SCSI driver provides a
@@ -1102,7 +1102,7 @@ struct ncb {
/*
** Start queue.
*/
- u_long squeue [MAX_START];
+ u_int32_t squeue [MAX_START];
u_short squeueput;
u_short actccbs;
@@ -1148,7 +1148,7 @@ struct ncb {
*/
u_char msgout[8];
u_char msgin [8];
- u_long lastmsg;
+ u_int32_t lastmsg;
/*
** Buffer for STATUS_IN phase.
@@ -1340,7 +1340,7 @@ static void ncr_attach (pcici_t tag, int unit);
static char ident[] =
- "\n$Id: ncr.c,v 1.106 1997/08/31 19:35:52 se Exp $\n";
+ "\n$Id: ncr.c,v 1.107 1997/08/31 19:36:56 se Exp $\n";
static const u_long ncr_version = NCR_VERSION * 11
+ (u_long) sizeof (struct ncb) * 7
@@ -3757,7 +3757,7 @@ static void ncr_attach (pcici_t config_id, int unit)
** Allocate structure for script relocation.
*/
if (np->vaddr2 != NULL) {
- np->script = np->vaddr2;
+ np->script = (struct script *) np->vaddr2;
np->p_script = np->paddr2;
#ifdef __FreeBSD__
} else if (sizeof (struct script) > PAGE_SIZE) {
@@ -5590,7 +5590,7 @@ static void ncr_timeout (void *arg)
static void ncr_log_hard_error(ncb_p np, u_short sist, u_char dstat)
{
- u_long dsp;
+ u_int32_t dsp;
int script_ofs;
int script_size;
char *script_name;
@@ -5998,14 +5998,14 @@ void ncr_int_sto (ncb_p np)
static void ncr_int_ma (ncb_p np, u_char dstat)
{
- u_long dbc;
- u_long rest;
- u_long dsa;
- u_long dsp;
- u_long nxtdsp;
- u_long *vdsp;
- u_long oadr, olen;
- u_long *tblp, *newcmd;
+ u_int32_t dbc;
+ u_int32_t rest;
+ u_int32_t dsa;
+ u_int32_t dsp;
+ u_int32_t nxtdsp;
+ u_int32_t *vdsp;
+ u_int32_t oadr, olen;
+ u_int32_t *tblp, *newcmd;
u_char cmd, sbcl, ss0, ss2, ctest5;
u_short delta;
ccb_p cp;
@@ -6076,10 +6076,10 @@ static void ncr_int_ma (ncb_p np, u_char dstat)
nxtdsp = vdsp[3];
} else if (dsp > np->p_script &&
dsp <= np->p_script + sizeof(struct script)) {
- vdsp = (u_long *) ((char*)np->script - np->p_script + dsp -8);
+ vdsp = (u_int32_t *) ((char*)np->script - np->p_script + dsp-8);
nxtdsp = dsp;
} else {
- vdsp = (u_long *) ((char*)np->scripth - np->p_scripth+ dsp -8);
+ vdsp = (u_int32_t *) ((char*)np->scripth - np->p_scripth+dsp-8);
nxtdsp = dsp;
};
@@ -6105,11 +6105,11 @@ static void ncr_int_ma (ncb_p np, u_char dstat)
oadr = vdsp[1];
if (cmd & 0x10) { /* Table indirect */
- tblp = (u_long*) ((char*) &cp->phys + oadr);
+ tblp = (u_int32_t *) ((char*) &cp->phys + oadr);
olen = tblp[0];
oadr = tblp[1];
} else {
- tblp = (u_long*) 0;
+ tblp = (u_int32_t *) 0;
olen = vdsp[0] & 0xffffff;
};
@@ -7213,13 +7213,13 @@ static int ncr_scatter
#ifndef NCR_IOMAPPED
static int ncr_regtest (struct ncb* np)
{
- register volatile u_long data, *addr;
+ register volatile u_int32_t data, *addr;
/*
** ncr registers may NOT be cached.
** write 0xffffffff to a read only register area,
** and try to read it back.
*/
- addr = (volatile u_long*) &np->reg->nc_dstat;
+ addr = (volatile u_int32_t *) &np->reg->nc_dstat;
data = 0xffffffff;
*addr= data;
data = *addr;
@@ -7238,8 +7238,8 @@ static int ncr_regtest (struct ncb* np)
static int ncr_snooptest (struct ncb* np)
{
- u_long ncr_rd, ncr_wr, ncr_bk, host_rd, host_wr, pc, err=0;
- int i;
+ u_int32_t ncr_rd, ncr_wr, ncr_bk, host_rd, host_wr, pc;
+ int i, err=0;
#ifndef NCR_IOMAPPED
err |= ncr_regtest (np);
if (err) return (err);
@@ -7293,9 +7293,9 @@ static int ncr_snooptest (struct ncb* np)
*/
if (pc != NCB_SCRIPTH_PHYS (np, snoopend)+8) {
printf ("CACHE TEST FAILED: script execution failed.\n");
- printf ("\tstart=%08x, pc=%08x, end=%08x\n",
- NCB_SCRIPTH_PHYS (np, snooptest), pc,
- NCB_SCRIPTH_PHYS (np, snoopend) +8);
+ printf ("start=%08lx, pc=%08lx, end=%08lx\n",
+ (u_long) NCB_SCRIPTH_PHYS (np, snooptest), (u_long) pc,
+ (u_long) NCB_SCRIPTH_PHYS (np, snoopend) +8);
return (0x40);
};
/*
diff --git a/sys/pci/ncrreg.h b/sys/pci/ncrreg.h
index c28fdb9..b8ecb33 100644
--- a/sys/pci/ncrreg.h
+++ b/sys/pci/ncrreg.h
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: ncrreg.h,v 1.9 1997/08/06 20:25:54 se Exp $
+** $Id: ncrreg.h,v 1.10 1997/08/24 06:24:51 se Exp $
**
** Device driver for the NCR 53C810 PCI-SCSI-Controller.
**
@@ -124,7 +124,7 @@ struct ncr_reg {
#define OLF1 0x20 /* sta: data in SODL register msb[W]*/
#define LDSC 0x02 /* sta: disconnect & reconnect */
-/*10*/ u_long nc_dsa; /* --> Base page */
+/*10*/ u_int32_t nc_dsa; /* --> Base page */
/*14*/ u_char nc_istat; /* --> Main Command and status */
#define CABRT 0x80 /* cmd: abort current operation */
@@ -152,7 +152,7 @@ struct ncr_reg {
#define FM 0x02 /* mod: fetch pin mode */
#define WRIE 0x01 /* mod: write and invalidate enable */
-/*1c*/ u_long nc_temp; /* ### Temporary stack */
+/*1c*/ u_int32_t nc_temp; /* ### Temporary stack */
/*20*/ u_char nc_dfifo;
/*21*/ u_char nc_ctest4;
@@ -163,11 +163,11 @@ struct ncr_reg {
#define DFS 0x20 /* mod: dma fifo size */
/*23*/ u_char nc_ctest6;
-/*24*/ u_long nc_dbc; /* ### Byte count and command */
-/*28*/ u_long nc_dnad; /* ### Next command register */
-/*2c*/ u_long nc_dsp; /* --> Script Pointer */
-/*30*/ u_long nc_dsps; /* --> Script pointer save/opcode#2 */
-/*34*/ u_long nc_scratcha; /* ??? Temporary register a */
+/*24*/ u_int32_t nc_dbc; /* ### Byte count and command */
+/*28*/ u_int32_t nc_dnad; /* ### Next command register */
+/*2c*/ u_int32_t nc_dsp; /* --> Script Pointer */
+/*30*/ u_int32_t nc_dsps; /* --> Script pointer save/opcode#2 */
+/*34*/ u_int32_t nc_scratcha; /* ??? Temporary register a */
/*38*/ u_char nc_dmode;
#define BL_2 0x80 /* mod: burst length shift value +2 */
@@ -189,7 +189,7 @@ struct ncr_reg {
#define IRQD 0x02 /* mod: irq disable */
#define NOCOM 0x01 /* cmd: protect sfbr while reselect */
-/*3c*/ u_long nc_adder;
+/*3c*/ u_int32_t nc_adder;
/*40*/ u_short nc_sien; /* -->: interrupt enable */
/*42*/ u_short nc_sist; /* <--: interrupt status */
@@ -262,7 +262,7 @@ struct ncr_reg {
#define TARGET_MODE 0
#endif
-typedef unsigned long ncrcmd;
+typedef u_int32_t ncrcmd;
/*-----------------------------------------------------------
**
@@ -303,8 +303,8 @@ typedef unsigned long ncrcmd;
#define SCR_MOVE_TBL (0x18000000 ^ (TARGET_MODE << 1ul))
struct scr_tblmove {
- u_long size;
- u_long addr;
+ u_int32_t size;
+ u_int32_t addr;
};
/*-----------------------------------------------------------
@@ -335,7 +335,7 @@ struct scr_tblsel {
};
#define SCR_JMP_REL 0x04000000
-#define SCR_ID(id) (((u_long)(id)) << 16)
+#define SCR_ID(id) (((u_int32_t)(id)) << 16)
/*-----------------------------------------------------------
**
OpenPOWER on IntegriCloud