File:  [XINU] / xinu / sys / dlcwrite.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:39:39 2018 UTC (8 years, 2 months ago) by root
Branches: xinu, MAIN
CVS tags: xinu-19910600, HEAD
Xinu for 68000/68010

/* dlcwrite.c - dlcwrite */

#include <conf.h>
#include <kernel.h>
#include <slu11.h>
#include <proc.h>
#include <sleep.h>
#include <dlc.h>

/*------------------------------------------------------------------------
 *  dlcwrite  --  write a block (frame) with byte-stuffing and EOB
 *------------------------------------------------------------------------
 */
dlcwrite(devptr, buff, count)
struct	devsw	*devptr;
char	*buff;
int	count;
{
	char	ps;
	struct	dlblk	*dptr;
	struct	csr	*cptr;

	if (count < 0)
		return(SYSERR);
	else if (count == 0)
		return(OK);
	disable(ps);
	dptr = devptr->dvioblk;
	if (dptr->dostate != DLOINIT) {
		restore(ps);
		return(SYSERR);
	}
	dptr->dostate = DLOREADY;
	dptr->dostart = dptr->donext = buff;
	dptr->dotot = dptr->docount = count;
	dptr->doesc = FALSE;
	(dptr->dioaddr)->ctstat = SLUENABLE;
	dptr->doproc = currpid;
	suspend(currpid);
	dptr->dostate = DLOINIT;
	restore(ps);
	return(OK);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.