[7708] in Athena Bugs

home help back first fref pref prev next nref lref last post

RT kernel hd.c and scsi.c don't need -Hvolatile

daemon@ATHENA.MIT.EDU (John Carr)
Sun Jun 30 17:43:48 1991

To: bugs@ATHENA.MIT.EDU, probe@ATHENA.MIT.EDU
Date: Sun, 30 Jun 91 17:43:24 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>


In the RT kernel config file, ca/hd.c and ca/scsi.c don't need the
"device-driver" declaration.  The effect of "device-driver" is to add
-Hvolatile to the compile flags.  hd.c already has "volatile" declarations,
so -Hvolatile does no good and makes the code slower.  I have added the
volatile declarations to scsi.c (patch follows; it also includes unrelated
changes to remove obsolete debugging code).

I have been running for many months with these changes.

*** /source/bsd-4.3/rt/sys/caio/scsi.c	Thu Jul 13 01:16:03 1989
--- scsi.c	Sun Jun 30 17:41:15 1991
***************
*** 64,74 ****
  #include	"../machine/dkio.h"
  #include	"../machine/debug.h"
  
- #ifdef FINDITRASH
- #include	"../h/inode.h"
- #include	"../h/fs.h"
- #endif FINDITRASH
- 
  /*
   * minor device uses following bits
   *
--- 64,69 ----
***************
*** 528,541 ****
          0		/* chanrelse */
  };
  
- #ifdef FINDITRASH
- struct scfs {
- 	unsigned	fs_bsize;
- 	unsigned	inode_start;
- 	unsigned	inode_end;
- } scfs[NSC*8];
- #endif FINDITRASH
- 
  /*
   * generic names for required spl's
   */
--- 523,528 ----
***************
*** 745,757 ****
  
  #define scsiwaitvalid(a,b,c) scsiwait (a | SCSI_ST_VALID, b | SCSI_ST_VALID, c)
  
- u_char scsi_dummy;		/* global to keep hc happy */
- 
  scsiprobe(reg,ic)
  register caddr_t reg;
  register struct iocc_ctlr *ic;
  {
!         register struct scsidevice *scsiaddr;
          register int result;
          u_short err;
          u_short err2;
--- 732,742 ----
  
  #define scsiwaitvalid(a,b,c) scsiwait (a | SCSI_ST_VALID, b | SCSI_ST_VALID, c)
  
  scsiprobe(reg,ic)
  register caddr_t reg;
  register struct iocc_ctlr *ic;
  {
! 	register volatile struct scsidevice *scsiaddr;
  	register int result;
  	u_short err;
  	u_short err2;
***************
*** 766,772 ****
  		scsiaddr->scsi_config &= ~SCSI_CF_IEN;
  	}
  		
!         scsiaddr = (struct scsidevice *) reg;
  
  	/* Magic Reset procedure that documentation says needs to be 
  	 * done before any other command can be done after a hardware
--- 751,757 ----
  		scsiaddr->scsi_config &= ~SCSI_CF_IEN;
  	}
  		
! 	scsiaddr = (volatile struct scsidevice *) reg;
  
  	/* Magic Reset procedure that documentation says needs to be 
  	 * done before any other command can be done after a hardware
***************
*** 784,796 ****
  		return (PROBE_BAD);
  
  	/* 8 bit read Clears status register */
! 	scsi_dummy = *(char *) &scsiaddr->scsi_status;
  
  	/* Wait for scsi to become not busy */
  	timeout = MAX_WAIT_COUNT;
  	while (scsiaddr->scsi_status & SCSI_ST_BUSY) {
  		/* Clear status register */
! 		scsi_dummy = *(char *) &scsiaddr->scsi_status;
  		if (--timeout)
  			break;
  	}
--- 769,781 ----
  		return (PROBE_BAD);
  
  	/* 8 bit read Clears status register */
! 	*(volatile char *) &scsiaddr->scsi_status;
  
  	/* Wait for scsi to become not busy */
  	timeout = MAX_WAIT_COUNT;
  	while (scsiaddr->scsi_status & SCSI_ST_BUSY) {
  		/* Clear status register */
! 		*(volatile char *) &scsiaddr->scsi_status;
  		if (--timeout)
  			break;
  	}
***************
*** 856,862 ****
  		DELAY (10000000);
          }
  	/* 8 bit read Clears status register */
! 	scsi_dummy = *(char *) &scsiaddr->scsi_status;
  
  	SCSI_INT11_SEMA = (u_char) 0;
  	SCSI_INT12_SEMA = (u_char) 0;
--- 841,847 ----
  		DELAY (10000000);
  	}
  	/* 8 bit read Clears status register */
! 	*(volatile char *) &scsiaddr->scsi_status;
  
  	SCSI_INT11_SEMA = (u_char) 0;
  	SCSI_INT12_SEMA = (u_char) 0;
***************
*** 872,878 ****
  		printf("scc%d: Timeout waiting for adapter ROM read!!!\n",
  			ic->ic_ctlr);
  		/* 8 bit read Clears status register */
! 		scsi_dummy = *(char *) &scsiaddr->scsi_status;
  		goto leave;
  	}
  
--- 857,863 ----
  		printf("scc%d: Timeout waiting for adapter ROM read!!!\n",
  			ic->ic_ctlr);
  		/* 8 bit read Clears status register */
! 		*(volatile char *) &scsiaddr->scsi_status;
  		goto leave;
  	}
  
***************
*** 898,904 ****
  	}
  
  	/* 8 bit read Clears status register */
! 	scsi_dummy = *(char *) &scsiaddr->scsi_status;
  
  
  	goto leave;
--- 883,889 ----
  	}
  
  	/* 8 bit read Clears status register */
! 	*(volatile char *) &scsiaddr->scsi_status;
  
  
  	goto leave;
***************
*** 909,920 ****
          scsiaddr->scsi_config &= ~SCSI_CF_IEN;
  
  	/* Clear status register */
! 	scsi_dummy = *(char *) &scsiaddr->scsi_status;
  
  	/* Clear interrupt semaphore */
  	SCSI_INT11_SEMA = (u_char) 0;
  	SCSI_INT12_SEMA = (u_char) 0;
  
          return(result);
  }
  
--- 894,908 ----
  	scsiaddr->scsi_config &= ~SCSI_CF_IEN;
  
  	/* Clear status register */
! 	*(volatile char *) &scsiaddr->scsi_status;
  
  	/* Clear interrupt semaphore */
  	SCSI_INT11_SEMA = (u_char) 0;
  	SCSI_INT12_SEMA = (u_char) 0;
  
+ 	/* Set locked flag in ic_tab */
+ 	ic->ic_tab.b_flags |= B_LOCKED;
+ 
  	return(result);
  }
  
***************
*** 932,938 ****
  
  
  scsislave(iod, scsiaddr)
! register struct scsidevice *scsiaddr;
  register struct iocc_device *iod;
  {
  	register int    unit = iod->iod_unit;
--- 920,926 ----
  
  
  scsislave(iod, scsiaddr)
! register volatile struct scsidevice *scsiaddr;
  register struct iocc_device *iod;
  {
  	register int    unit = iod->iod_unit;
***************
*** 956,962 ****
  }
  
  scsi_check_status (scsiaddr, unit, statusp)
! 	register struct scsidevice *scsiaddr;
  	register int unit;
  	register u_short *statusp;
  {
--- 944,950 ----
  }
  
  scsi_check_status (scsiaddr, unit, statusp)
! 	register volatile struct scsidevice *scsiaddr;
  	register int unit;
  	register u_short *statusp;
  {
***************
*** 968,974 ****
  	if (scsiwaitvalid(0, 0, scsiaddr)) {
  
  		/* Clear status register */
! 		scsi_dummy = *(char *) &scsiaddr->scsi_status;
  
  		return(0);
  	}
--- 956,962 ----
  	if (scsiwaitvalid(0, 0, scsiaddr)) {
  
  		/* Clear status register */
! 		*(volatile char *) &scsiaddr->scsi_status;
  
  		return(0);
  	}
***************
*** 978,984 ****
  		*statusp = status;
  
  	/* Clear status register */
! 	scsi_dummy = *(char *) &scsiaddr->scsi_status;
  
  	if (!(status & SCSI_ST_CCS_VALID)) {
  		SCSIDEBUG( SHOW_INIT,
--- 966,972 ----
  		*statusp = status;
  
  	/* Clear status register */
! 	*(volatile char *) &scsiaddr->scsi_status;
  
  	if (!(status & SCSI_ST_CCS_VALID)) {
  		SCSIDEBUG( SHOW_INIT,
***************
*** 1006,1012 ****
  	register struct iocc_ctlr *ic = iod->iod_mi;
  	register struct scsic_softc *csc = &scsic_softc [ctlr];
  	register struct scsi_softc *cs = &scsi_softc[unit];
! 	register struct scsidevice *scsiaddr = (struct scsidevice *)ic->ic_addr;
  	int	 index = SCSI200_INDEX;
  	scsi_inqinfo inq;
  	int	 result;
--- 994,1000 ----
  	register struct iocc_ctlr *ic = iod->iod_mi;
  	register struct scsic_softc *csc = &scsic_softc [ctlr];
  	register struct scsi_softc *cs = &scsi_softc[unit];
! 	register volatile struct scsidevice *scsiaddr = (volatile struct scsidevice *)ic->ic_addr;
  	int	 index = SCSI200_INDEX;
  	scsi_inqinfo inq;
  	int	 result;
***************
*** 1123,1131 ****
  
  		dk_mspw[iod->iod_dk] = mspw;
  	}
- #ifdef FINDITRASH
- 	scsi_initfs(ic,unit,st);
- #endif FINDITRASH
          return (1);
  bad:
  	printf ("scsiattach could not find sc%d\n", unit);
--- 1111,1116 ----
***************
*** 1132,1185 ****
  	return (0);
  }
  
- #ifdef FINDITRASH
- /*
-  * load the file system parameters into each partition of unit
-  */
- scsi_initfs(ic, unit, st)
- 	struct iocc_ctlr *ic;
- 	int unit;
- 	struct	 scsist *st;
- {
- 	register struct scsi_softc *sc = &scsi_softc[unit];
- 	int	i;
- 	struct fs fs;
- 	struct fs *fsp = &fs;
- 
- 	for (i=0; i < 8; i++) {
- 		if ( sc->sizes.part[i].nblocks == 0) {
- 			printf("sc%d%c: no such partition\n",unit,i+'a');
- 			scfs[unit*8 + i].inode_start = 1;
- 			scfs[unit*8 + i].inode_end = 0;
- 			return;
- 		}
- 		if ( i == 2 ) {
- 			printf("sc%dc: full disk\n",unit,i+'a');
- 			scfs[unit*8 + i].inode_start = 1;
- 			scfs[unit*8 + i].inode_end = 0;
- 			return;
- 		}
- 		if (scsird(ic, unit, SBLOCK+(sc->sizes.part[i].cyloff*st->nspc), SBSIZE, fsp) < 0) {
- 			printf("sc%d%c: fsread error\n",unit,i+'a');
- 			scfs[unit*8 + i].inode_start = 1;
- 			scfs[unit*8 + i].inode_end = 0;
- 			return;
- 		}
- 		if (fs.fs_magic != FS_MAGIC) {
- 			printf("sc%d%c: no filesystem\n",unit,i+'a');
- 			scfs[unit*8 + i].inode_start = 1;
- 			scfs[unit*8 + i].inode_end = 0;
- 			return;
- 		}
- 		scfs[unit*8 + i].inode_start = fsbtodb(fsp,itod(fsp,2));
- 		scfs[unit*8 + i].inode_end = fsbtodb(fsp,itod(fsp,2)) + 
- 				((unsigned)fs.fs_ncg*fs.fs_ipg*sizeof(struct dinode)+511)/512;
- 		scfs[unit*8 + i].fs_bsize = fs.fs_bsize;
- 	}
- }
- #endif FINDITRASH
- 
- 
  scsi_set_mode_sense(ic, unit, lun)
  register struct iocc_ctlr *ic;
  register int unit;
--- 1117,1122 ----
***************
*** 1328,1334 ****
  scsiwait(mask, compare, scsiaddr)
          unsigned char mask;
          unsigned char compare;
!         register struct scsidevice *scsiaddr;
  {
          register u_short status;
          register unsigned int count = MAX_WAIT_COUNT;
--- 1265,1271 ----
  scsiwait(mask, compare, scsiaddr)
  	unsigned char mask;
  	unsigned char compare;
! 	register volatile struct scsidevice *scsiaddr;
  {
  	register u_short status;
  	register unsigned int count = MAX_WAIT_COUNT;
***************
*** 1380,1386 ****
  	register int unit;
  {
  	register struct scsi_softc *cs = &scsi_softc[unit];
!         register struct scsidevice *scsiaddr = (struct scsidevice *)ic->ic_addr;
  	register struct scsi_tag_info *tip;
  	register struct buf *bp;
  	register u_int dir;
--- 1317,1323 ----
  	register int unit;
  {
  	register struct scsi_softc *cs = &scsi_softc[unit];
! 	register volatile struct scsidevice *scsiaddr = (volatile struct scsidevice *)ic->ic_addr;
  	register struct scsi_tag_info *tip;
  	register struct buf *bp;
  	register u_int dir;
***************
*** 1471,1477 ****
  #define INTERLEAVE	gran
  
  scsicmd(scsiaddr, unit, lun, opcode, direction, lba, tlen, bufnum, ctrl, gran, tag)
! 	register struct	scsidevice *scsiaddr;
  	register u_int	unit;
  	int lun;
  	u_char		opcode;
--- 1408,1414 ----
  #define INTERLEAVE	gran
  
  scsicmd(scsiaddr, unit, lun, opcode, direction, lba, tlen, bufnum, ctrl, gran, tag)
! 	register volatile struct scsidevice *scsiaddr;
  	register u_int	unit;
  	int lun;
  	u_char		opcode;
***************
*** 1578,1584 ****
  }
  
  scsi_sendcmd (scsiaddr, cmd, sendbuf, len, slen, tag)
! register struct scsidevice *scsiaddr;
  register u_short cmd;
  register u_char *sendbuf;
  register int len;		/* Actual number of paramater bytes */
--- 1515,1521 ----
  }
  
  scsi_sendcmd (scsiaddr, cmd, sendbuf, len, slen, tag)
! register volatile struct scsidevice *scsiaddr;
  register u_short cmd;
  register u_char *sendbuf;
  register int len;		/* Actual number of paramater bytes */
***************
*** 1628,1634 ****
  /* Reset The SCSI controler */
  scsireset(iod, scsiaddr)
          register struct iocc_device *iod;
!         register struct scsidevice *scsiaddr;
  {
          register int timeout, result;
  	u_short status;
--- 1565,1571 ----
  /* Reset The SCSI controler */
  scsireset(iod, scsiaddr)
  	register struct iocc_device *iod;
! 	register volatile struct scsidevice *scsiaddr;
  {
  	register int timeout, result;
  	u_short status;
***************
*** 1637,1643 ****
  	timeout = MAX_WAIT_COUNT;
  	while (scsiaddr->scsi_status & SCSI_ST_BUSY) {
  		/* Clear status register */
! 		scsi_dummy = *(u_char *) &scsiaddr->scsi_status;
  
  		if (--timeout)
  			break;
--- 1574,1580 ----
  	timeout = MAX_WAIT_COUNT;
  	while (scsiaddr->scsi_status & SCSI_ST_BUSY) {
  		/* Clear status register */
! 		*(volatile char *) &scsiaddr->scsi_status;
  
  		if (--timeout)
  			break;
***************
*** 1670,1676 ****
  	result = 0;
  leave:
  	/* Clear the interrupt */
! 	scsi_dummy = *(u_char *) &scsiaddr->scsi_status;
          return(result);
  }
  
--- 1607,1613 ----
  	result = 0;
  leave:
  	/* Clear the interrupt */
! 	*(volatile char *) &scsiaddr->scsi_status;
  	return(result);
  }
  
***************
*** 1681,1687 ****
          register int part = PART(dev);
  	register int size = SCSIPART(drive, part)->nblocks;
          register struct iocc_device *iod;
! 	register struct scsidevice *scsiaddr;
  
          SCSIDEBUG(SHOW_ORDWR,
  		printf("SCSI: JUST ENTERED SCSIOPEN(%x)!!\n", dev));
--- 1618,1624 ----
  	register int part = PART(dev);
  	register int size = SCSIPART(drive, part)->nblocks;
  	register struct iocc_device *iod;
! 	register volatile struct scsidevice *scsiaddr;
  
  	SCSIDEBUG(SHOW_ORDWR,
  		printf("SCSI: JUST ENTERED SCSIOPEN(%x)!!\n", dev));
***************
*** 1693,1699 ****
                  return (ENXIO);
  
  	/* Let interrupts go now */
! 	scsiaddr = (struct scsidevice *) iod->iod_mi->ic_addr;
  	scsiaddr->scsi_config |= SCSI_CF_IEN;
  
          return (0);
--- 1630,1636 ----
  		return (ENXIO);
  
  	/* Let interrupts go now */
! 	scsiaddr = (volatile struct scsidevice *) iod->iod_mi->ic_addr;
  	scsiaddr->scsi_config |= SCSI_CF_IEN;
  
  	return (0);
***************
*** 1816,1852 ****
                  iodone(bp);
                  return;
          }
- #ifdef FINDITRASH
- 	/*
- 	 * We need to look for inode trashing. This happens only on writes, and only if
- 	 * the writes are to the inode.
- 	 */
- 	if ((bp->b_flags & B_READ) == 0) {
- 		int device = minor(bp->b_dev);
- 		if ((bn >= scfs[device].inode_start) && (bn <= scfs[device].inode_end)) {
- 			/*
- 			 * well we have found an inode write, make sure that it is valid,
- 			 * check the first 2 inodes...
- 			 */
- 			struct dinode *dp = bp->b_un.b_dino;
- 			int	count;
  
- 			for(count = 0; count < 6; count++, dp++); {
- 			    if ((dp->di_mode & IFMT == 0)  && (dp->di_mode)) {
- 				printf("sc%d%c: Attempt to trash inode @ block %d with buffer=0x%x, len=%d\n",
- 					drive,part+'a',bn,bp->b_un.b_addr,bp->b_bcount);
- 				panic("scsi inode trash");
- 			    }
- 			    if (scfs[device].fs_bsize != bp->b_bcount) {
- 				printf("sc%d%c: inode write with funny size@ block %d with buffer=0x%x, len=%d\n",
- 					drive,part+'a',bn,bp->b_un.b_addr,bp->b_bcount);
- 			    }
- 			}
- 		}
- 	}
- #endif FINDITRASH
- 	 
- 
  	/* Figure out starting disk logical block number and sort on it */
          bp->b_logblk = (bn * (DEV_BSIZE / SCSI_BSIZE)) + scblkoff;
  
--- 1753,1759 ----
***************
*** 1948,1954 ****
  {
  	struct scsi_tag_info *tip;
          register struct buf *bp, *dp = 0;
!         register struct scsidevice *scsiaddr = (struct scsidevice *)ic->ic_addr;
  	register struct scsic_softc *csc = &scsic_softc[ic->ic_ctlr];
          register int unit;
          struct iocc_device *iod;
--- 1855,1861 ----
  {
  	struct scsi_tag_info *tip;
  	register struct buf *bp, *dp = 0;
! 	register volatile struct scsidevice *scsiaddr = (volatile struct scsidevice *)ic->ic_addr;
  	register struct scsic_softc *csc = &scsic_softc[ic->ic_ctlr];
  	register int unit;
  	struct iocc_device *iod;
***************
*** 2074,2080 ****
          register struct iocc_ctlr *ic;
  {
  	register struct scsic_softc *csc = &scsic_softc[ic->ic_ctlr];
! 	struct scsidevice *scsiaddr = (struct scsidevice *)ic->ic_addr;
  
  	csc->scsi_flag &= ~SCSI_DMABUSY;
  
--- 1981,1987 ----
  	register struct iocc_ctlr *ic;
  {
  	register struct scsic_softc *csc = &scsic_softc[ic->ic_ctlr];
! 	volatile struct scsidevice *scsiaddr = (volatile struct scsidevice *)ic->ic_addr;
  
  	csc->scsi_flag &= ~SCSI_DMABUSY;
  
***************
*** 2160,2166 ****
  {
  	register struct scsic_softc *csc = &scsic_softc[ic->ic_ctlr];
  	register int retval;
! 	struct scsidevice *scsiaddr = (struct scsidevice *)ic->ic_addr;
  	register char chan = ic->ic_dmachannel;
  	scsi_rwdmastack dmast;
  
--- 2067,2073 ----
  {
  	register struct scsic_softc *csc = &scsic_softc[ic->ic_ctlr];
  	register int retval;
! 	volatile struct scsidevice *scsiaddr = (volatile struct scsidevice *)ic->ic_addr;
  	register char chan = ic->ic_dmachannel;
  	scsi_rwdmastack dmast;
  
***************
*** 2170,2179 ****
  
  	/* Configure the DMA adapter hardware */
  	scsiaddr->scsi_config |=  SCSI_CF_DMAEN;
! 	scsiaddr->scsi_dma_mode = SCSI_BURST_LEN4;
! 	((struct scsidevice *)ic->ic_addr)->scsi_config = 
  	  ((chan << SCSI_CF_DMASFT) & SCSI_CF_DMASM) |
! 	  (((struct scsidevice *)ic->ic_addr)->scsi_config & ~SCSI_CF_DMASM);
  
  
  	dma_go(chan);
--- 2077,2086 ----
  
  	/* Configure the DMA adapter hardware */
  	scsiaddr->scsi_config |=  SCSI_CF_DMAEN;
! 	scsiaddr->scsi_dma_mode = SCSI_BURST_LEN8;
! 	((volatile struct scsidevice *)ic->ic_addr)->scsi_config = 
  	  ((chan << SCSI_CF_DMASFT) & SCSI_CF_DMASM) |
! 	  (((volatile struct scsidevice *)ic->ic_addr)->scsi_config & ~SCSI_CF_DMASM);
  
  
  	dma_go(chan);
***************
*** 2231,2237 ****
          register struct buf *bp, *dp;
          register struct iocc_ctlr *ic = scsiminfo[ctlr];
  	register struct scsic_softc *csc = &scsic_softc[ctlr];
!         register struct scsidevice *scsiaddr;
          register u_short status;
  	register struct scsi_softc *cs;
  
--- 2138,2144 ----
  	register struct buf *bp, *dp;
  	register struct iocc_ctlr *ic = scsiminfo[ctlr];
  	register struct scsic_softc *csc = &scsic_softc[ctlr];
! 	register volatile struct scsidevice *scsiaddr;
  	register u_short status;
  	register struct scsi_softc *cs;
  
***************
*** 2245,2251 ****
          int unit;
  
  	/* Get the status of this interrupt */
!         scsiaddr = (struct scsidevice *)ic->ic_addr;
  	status = scsiaddr->scsi_status;
  
  	/* Is this really our interrupt?? */
--- 2152,2158 ----
  	int unit;
  
  	/* Get the status of this interrupt */
! 	scsiaddr = (volatile struct scsidevice *)ic->ic_addr;
  	status = scsiaddr->scsi_status;
  
  	/* Is this really our interrupt?? */
***************
*** 2270,2276 ****
  	}
  		
  	/* Our status so Clear it now */
! 	scsi_dummy = *(u_char *) &scsiaddr->scsi_status;
  
  	/* Get tag out of status */
  	tag = status & SCSI_ST_CTM;
--- 2177,2183 ----
  	}
  		
  	/* Our status so Clear it now */
! 	*(volatile char *) &scsiaddr->scsi_status;
  
  	/* Get tag out of status */
  	tag = status & SCSI_ST_CTM;
***************
*** 2619,2625 ****
  #ifdef DEBUG
  scsistatus(bp, scsiaddr)
          register struct buf *bp;
!         register struct scsidevice *scsiaddr;
  {
          register status = scsiaddr->scsi_status;
  
--- 2526,2532 ----
  #ifdef DEBUG
  scsistatus(bp, scsiaddr)
  	register struct buf *bp;
! 	register volatile struct scsidevice *scsiaddr;
  {
  	register status = scsiaddr->scsi_status;
  
***************
*** 2832,2838 ****
  				printf("sc%d:lost int tag (%d) (%d)\n",
  					DRIVE(bp->b_dev), j, tip->tag);
  #ifdef DEBUG
! 				scsistatus(bp,(struct scsidevice *)ic->ic_addr);
  #endif DEBUG
  
  				status = scsi_cleartag(ic->ic_ctlr, tip->tag);
--- 2739,2745 ----
  				printf("sc%d:lost int tag (%d) (%d)\n",
  					DRIVE(bp->b_dev), j, tip->tag);
  #ifdef DEBUG
! 				scsistatus(bp,(volatile struct scsidevice *)ic->ic_addr);
  #endif DEBUG
  
  				status = scsi_cleartag(ic->ic_ctlr, tip->tag);
***************
*** 2949,2955 ****
  int	unit;
  u_short	status;
  struct buf *bp;
! struct scsidevice *scsiaddr;
  register scsi_sense *sen;
  {
  	register scsi_err_rec *erec;
--- 2856,2862 ----
  int	unit;
  u_short	status;
  struct buf *bp;
! volatile struct scsidevice *scsiaddr;
  register scsi_sense *sen;
  {
  	register scsi_err_rec *erec;
***************
*** 3104,3115 ****
  register int ctlr;
  u_char tag;
  {
! 	register struct scsidevice *scsiaddr;
  	u_short	 status;
  	register int s = spl_disk();
  	int	 inton = 0;
  
! 	scsiaddr = (struct scsidevice *)(scsiminfo[ctlr]->ic_addr);
  	
  	/* Disable interrupts while clearing tag */
  	if (scsiaddr->scsi_config & SCSI_CF_IEN) {
--- 3011,3022 ----
  register int ctlr;
  u_char tag;
  {
! 	register volatile struct scsidevice *scsiaddr;
  	u_short	 status;
  	register int s = spl_disk();
  	int	 inton = 0;
  
! 	scsiaddr = (volatile struct scsidevice *)(scsiminfo[ctlr]->ic_addr);
  	
  	/* Disable interrupts while clearing tag */
  	if (scsiaddr->scsi_config & SCSI_CF_IEN) {
***************
*** 3125,3131 ****
  
  	/* Save the status then Clear the interrupt */
  	status = scsiaddr->scsi_status;
! 	scsi_dummy = *(u_char *) &scsiaddr->scsi_status;
  
  	/* Enable interrupts again */
  	if (inton)
--- 3032,3038 ----
  
  	/* Save the status then Clear the interrupt */
  	status = scsiaddr->scsi_status;
! 	*(volatile char *) &scsiaddr->scsi_status;
  
  	/* Enable interrupts again */
  	if (inton)
***************
*** 3201,3207 ****
   * and build off entries for the given partitions.
   */
  scsigetpart(scsiaddr,ic,unit,st,off)
! struct scsidevice *scsiaddr;
  register struct iocc_ctlr *ic;
  register int unit;
  struct scsist *st;
--- 3108,3114 ----
   * and build off entries for the given partitions.
   */
  scsigetpart(scsiaddr,ic,unit,st,off)
! volatile struct scsidevice *scsiaddr;
  register struct iocc_ctlr *ic;
  register int unit;
  struct scsist *st;
***************
*** 3282,3290 ****
  	scsi_rd_cmd(ic,unit,lun, CMD_RS, &sense, SCSI_SENSESZ, SCSI_SENSESZ, 0);
  
  	ret = scsi_print_sense (unit,
! 		((struct scsidevice *)ic->ic_addr)->scsi_status,
  				(struct buf *)0,
! 				(struct scsidevice *)ic->ic_addr,&sense);
  
  	return (ret);
  }
--- 3189,3197 ----
  	scsi_rd_cmd(ic,unit,lun, CMD_RS, &sense, SCSI_SENSESZ, SCSI_SENSESZ, 0);
  
  	ret = scsi_print_sense (unit,
! 		((volatile struct scsidevice *)ic->ic_addr)->scsi_status,
  				(struct buf *)0,
! 				(volatile struct scsidevice *)ic->ic_addr,&sense);
  
  	return (ret);
  }
***************
*** 3330,3336 ****
  {
  	register struct scsic_softc *csc = &scsic_softc[ic->ic_ctlr];
  	register struct scsi_softc *cs = &scsi_softc[unit];
!         register struct scsidevice *scsiaddr = (struct scsidevice *)ic->ic_addr;
  	register int s = spl_disk();
  	int	 flag = 0;
  	int	 ret = BAD;
--- 3237,3243 ----
  {
  	register struct scsic_softc *csc = &scsic_softc[ic->ic_ctlr];
  	register struct scsi_softc *cs = &scsi_softc[unit];
! 	register volatile struct scsidevice *scsiaddr = (volatile struct scsidevice *)ic->ic_addr;
  	register int s = spl_disk();
  	int	 flag = 0;
  	int	 ret = BAD;
***************
*** 3399,3405 ****
  		}
  
  		/* Clear status register */
! 		scsi_dummy = *(u_char *) &scsiaddr->scsi_status;
  
  		scsi_dma_done (ic);
  	} else {
--- 3306,3312 ----
  		}
  
  		/* Clear status register */
! 		*(volatile char *) &scsiaddr->scsi_status;
  
  		scsi_dma_done (ic);
  	} else {
***************
*** 3435,3441 ****
  register int cmdlen, dmalen;
  struct scsiformat *fmt;
  {
!         register struct scsidevice *scsiaddr = (struct scsidevice *)ic->ic_addr;
  	register int s = spl_disk();
  	int	 flag = 0;
  	int	 ret = BAD;
--- 3342,3348 ----
  register int cmdlen, dmalen;
  struct scsiformat *fmt;
  {
! 	register volatile struct scsidevice *scsiaddr = (volatile struct scsidevice *)ic->ic_addr;
  	register int s = spl_disk();
  	int	 flag = 0;
  	int	 ret = BAD;
***************
*** 3480,3486 ****
  		}
  
  		/* Clear status register */
! 		scsi_dummy = *(u_char *) &scsiaddr->scsi_status;
  
  		scsi_dma_done (ic);
  	} else
--- 3387,3393 ----
  		}
  
  		/* Clear status register */
! 		*(volatile char *) &scsiaddr->scsi_status;
  
  		scsi_dma_done (ic);
  	} else
***************
*** 3566,3572 ****
  register int unit;
  register struct scsi_tag_info *tip;
  {
! 	register struct scsidevice *scsiaddr = (struct scsidevice *)ic->ic_addr;
  	register int lun;
  	register struct buf *bp = tip->bp;
  
--- 3473,3479 ----
  register int unit;
  register struct scsi_tag_info *tip;
  {
! 	register volatile struct scsidevice *scsiaddr = (volatile struct scsidevice *)ic->ic_addr;
  	register int lun;
  	register struct buf *bp = tip->bp;
  

home help back first fref pref prev next nref lref last post