MiniUnix/usr/sys/dev/devstart.c

Find at most related files.
including files from this version of Unix.

#include "../param.h"
#include "../buf.h"

/*
 * Device start routine for disks
 * and other devices that have the register
 * layout of the older DEC controllers (RF, RK, RP, TM)
 */
#define	IENABLE	0100
#define	WCOM	02
#define	RCOM	04
#define	GO	01
devstart(bp, devloc, devblk, hbcom)
struct buf *bp;
int *devloc;
{
	register int *dp;
	register struct buf *rbp;
	register int com;

	dp = devloc;
	rbp = bp;
	*dp = devblk;			/* block address */
	*--dp = rbp->b_addr;		/* buffer address */
	*--dp = rbp->b_wcount;		/* word count */
	com = (hbcom<<8) | IENABLE | GO;
	if (rbp->b_flags&B_READ)
		com =| RCOM;
	else
		com =| WCOM;
	*--dp = com;
}