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

ub_inited defined in line 53; used 2 times

Defined struct's

ubmap defined in line 4; used 32 times

Defined macros

BUF_UBADDR defined in line 17; used 4 times
btoub defined in line 22; used 3 times
nubreg defined in line 27; used 1 times
pointubreg defined in line 42; never used
setubregno defined in line 32; used 3 times

Usage of this include

Last modified: 1983-09-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 721
Valid CSS Valid XHTML 1.0 Strict