|
|
1.1 root 1: /* ioinit.c - ioinit, iosetvec */
2:
3: #include <conf.h>
4: #include <kernel.h>
5: #include <iodisp.h>
6: #include <io.h>
7:
8: /*------------------------------------------------------------------------
9: * ioinit -- standard interrupt vector and dispatch initialization
10: *------------------------------------------------------------------------
11: */
12: ioinit(descrp)
13: int descrp;
14: {
15: int minor;
16:
17: if (isbaddev(descrp) )
18: return(SYSERR);
19: minor = devtab[descrp].dvminor;
20: iosetvec(descrp, minor, minor);
21: return(OK);
22: }
23:
24: /*------------------------------------------------------------------------
25: * iosetvec - fill in interrupt vectors and dispatch table entries
26: *------------------------------------------------------------------------
27: */
28: iosetvec(descrp, incode, outcode)
29: int descrp;
30: int incode;
31: int outcode;
32: {
33: struct devsw *devptr;
34: struct intmap *map;
35: int *vptr;
36:
37: if (isbaddev(descrp))
38: return(SYSERR);
39: devptr = &devtab[descrp];
40: map = &intmap[devptr->dvnum]; /* fill in interrupt dispatch */
41: map->iin = devptr->dviint; /* map with addresses of high-*/
42: map->icode = incode; /* level input and output */
43: map->iout = devptr->dvoint; /* interrupt handlers and */
44: map->ocode = outcode; /* minor device numbers */
45: vptr = (int *)devptr->dvivec;
46: if (vptr != (int *)NULL)
47: *vptr = INTVECI+(descrp*2*DVECSIZE);/* fill in input interrupt*/
48: vptr = (int *)devptr->dvovec;
49: if (vptr != (int *)NULL)
50: *vptr = INTVECO+(descrp*2*DVECSIZE);/* fill in outpt interrupt*/
51: return(OK);
52: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.