1: /*
2: * Structure to access UNIBUS map registers.
3: */
4: struct ubmap {
5: short ub_lo;
6: short ub_hi;
7: };
8:
9: #define UBMAP ((struct ubmap *) 0170200)
10: #define UBPAGE 020000 /* size of UNIBUS map segment */
11:
12: /*
13: * BUF_UBADDR is the UNIBUS address of buffers
14: * if we have a UNIBUS map, as distinguished from bpaddr,
15: * which is the physical address in clicks.
16: */
17: #define BUF_UBADDR 020000
18:
19: /*
20: * Bytes to UNIBUS pages.
21: */
22: #define btoub(b) ((((long)(b)) + ((long)(UBPAGE - 1))) / ((long)UBPAGE))
23:
24: /*
25: * Number of UNIBUS registers required by n objects of size s.
26: */
27: #define nubreg(n,s) btoub(((long) (n)) * ((long) (s)))
28:
29: /*
30: * Set UNIBUS register r to point at physical address p (in bytes).
31: */
32: #define setubregno(r,p) { \
33: UBMAP[r].ub_lo = loint(p); \
34: UBMAP[r].ub_hi = hiint(p); \
35: }
36:
37: /*
38: * Point the appropriate UNIBUS register at a kernel
39: * virtual data address (in clicks). V must be less
40: * than btoc(248K) (not currently used).
41: */
42: #define pointubreg(v,sep) { \
43: ubadr_t x; \
44: short regno; \
45: regno = ((v) >> 7) & 037; \
46: x = (ubadr_t) (v) & ~01; \
47: setubregno(regno, x); \
48: }
49:
50: #ifdef KERNEL
51: extern bool_t ubmap; /* Do we have UNIBUS map registers? */
52: #ifdef UCB_NET
53: int ub_inited; /* UNIBUS map initialized yet? */
54: #endif
55: #endif
Defined variables
Defined struct's
ubmap
defined in line
4; used 32 times
Defined macros
UBMAP
defined in line
9; used 18 times
UBPAGE
defined in line
10; used 13 times
btoub
defined in line
22; used 3 times
Usage of this include