1: /*
   2:  * Copyright (c) 1986 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)seg.h	1.2 (2.11BSD GTE) 1/1/93
   7:  */
   8: 
   9: #ifndef _SEG_
  10: #define _SEG_
  11: 
  12: /*
  13:  * Access abilities
  14:  */
  15: #define RO  02      /* Read only */
  16: #define RW  06      /* Read and write */
  17: #define NOACC   0       /* Abort all accesses */
  18: #define ACCESS  07      /* Mask for access field */
  19: #define ED  010     /* Extension direction */
  20: #define TX  020     /* Software: text segment */
  21: #define ABS 040     /* Software: absolute address */
  22: 
  23: #ifndef SUPERVISOR
  24: u_short *ka6;           /* nonseparate:  KISA6; separate:  KDSA6 */
  25: u_int   kdsa6;          /* saved KDSA6, if any */
  26: #endif
  27: 
  28: /*
  29:  * Addresses and bits for DEC's KT-11
  30:  * and macros for remapping kernel data space.
  31:  */
  32: #define UISD    ((u_short *) 0177600)   /* first user I-space descriptor */
  33: #define UDSD    ((u_short *) 0177620)   /* first user D-space descriptor */
  34: 
  35: #ifdef  ENABLE34
  36: #	define DEC_UISA7  ((u_short *) 0177656)
  37:     extern u_short *UISA, *UDSA, *KISA0, *KDSA1, *KDSA2, *KDSA5, *KDSA6;
  38: #else
  39: #	define UISA   ((u_short *) 0177640)   /* first user I-space address */
  40: #	define UDSA   ((u_short *) 0177660)   /* first user D-space address */
  41: #endif
  42: 
  43: #ifndef ENABLE34
  44: #	define KISA0  ((u_short *) 0172340)
  45: #	define KISA1  ((u_short *) 0172342)
  46: #	define KISA5  ((u_short *) 0172352)
  47: #	define KISA6  ((u_short *) 0172354)
  48: #	define SSR3   ((u_short *) 0172516)
  49: #endif
  50: 
  51: #define SISD0   ((u_short *) 0172200)
  52: #define SDSD0   ((u_short *) 0172220)
  53: #define SISA0   ((u_short *) 0172240)
  54: #define SDSA0   ((u_short *) 0172260)
  55: #define KISD1   ((u_short *) 0172302)
  56: #define KISD5   ((u_short *) 0172312)
  57: #define KISD6   ((u_short *) 0172314)
  58: 
  59: #ifdef KERN_NONSEP
  60: #	ifndef ENABLE34
  61: #		define KDSA5 KISA5
  62: #		define KDSA6 KISA6
  63: #	endif !ENABLE34
  64: #	define KDSD5  KISD5
  65: #	define KDSD6  KISD6
  66: #else
  67: #	ifndef ENABLE34
  68: #		define   SDSA5   ((u_short *) 0172272)
  69: #		define   SDSA6   ((u_short *) 0172274)
  70: #		define  KDSA5    ((u_short *) 0172372)
  71: #		define  KDSA6    ((u_short *) 0172374)
  72: #	endif !ENABLE34
  73: #	define SDSD5  ((u_short *) 0172232)
  74: #	define SDSD6  ((u_short *) 0172234)
  75: #	define KDSD5  ((u_short *) 0172332)
  76: #	define KDSD6  ((u_short *) 0172334)
  77: #endif
  78: 
  79: /* start of possibly mapped area; see machdep.c */
  80: #ifndef SUPERVISOR
  81: #define REMAP_AREA  ((caddr_t)&proc[0])
  82: #endif
  83: #define SEG5        ((caddr_t) 0120000)
  84: #define SEG6        ((caddr_t) 0140000)
  85: #define SEG7        ((caddr_t) 0160000)
  86: 
  87: #ifdef COMMENT
  88:  * Macros for resetting the kernel segmentation registers to map in
  89:  * out-of-address space data.  If KDSA5 is used for kernel data space
  90:  * only proc, file and text tables are allowed in that range.  Routines
  91:  * can repoint KDSA5 to map in data such as buffers or clists without
  92:  * raising processor priority by calling these macros.  Copy (in mch.s) uses
  93:  * two registers, KDSA5 and 6. If KDSA6 is in use, the prototype register
  94:  * kdsa6 will be non-zero, and the kernel will be running on a temporary stack
  95:  * in bss.  Interrupt routines that access any of the structures in this range
  96:  * or the u. must call savemap (in machdep.c) to save the current mapping
  97:  * information in a local structure and restore it before returning.
  98:  *
  99:  * USAGE:
 100:  *  To repoint KDSA5 from the top level,
 101:  *      mapseg5(addr, desc);    /* KDSA5 now points at addr */
 102:  *      ...
 103:  *      normalseg5();       /* normal mapping */
 104:  *
 105:  *  To repoint KDSA5 from interrupt or top level,
 106:  *      segm saveregs;
 107:  *      saveseg5(saveregs); /* save previous mapping of segment 5 */
 108:  *      mapseg5(addr, desc);    /* KDSA5 now points at addr */
 109:  *      ...
 110:  *      restorseg5(saveregs);   /* restore previous mapping */
 111:  *
 112:  *  To access proc, text, file or user structures from interrupt level,
 113:  *      mapinfo map;        /* save ALL mapping information, */
 114:  *      savemap(map);       /* restore normal mapping of KA5 */
 115:  *      ...         /* and 6 */
 116:  *      restormap(map);     /* restore previous mapping */
 117: #endif /* COMMENT */
 118: 
 119: /*
 120:  * Structure to hold a saved PAR/PDR pair.
 121:  */
 122: struct segm_reg {
 123:     u_int   se_desc;
 124:     u_int   se_addr;
 125: };
 126: typedef struct segm_reg segm;
 127: typedef struct segm_reg mapinfo[2]; /* KA5, KA6 */
 128: 
 129: #ifndef DIAGNOSTIC
 130: #	define    mapout(bp)  normalseg5()
 131: #endif
 132: 
 133: /* use segment 5 to access the given address. */
 134: #ifdef SUPERVISOR
 135: #define mapseg5(addr,desc) { \
 136:     *SDSD5 = desc; \
 137:     *SDSA5 = addr; \
 138: }
 139: #else
 140: #define mapseg5(addr,desc) { \
 141:     *KDSD5 = desc; \
 142:     *KDSA5 = addr; \
 143: }
 144: #endif
 145: 
 146: /* save the previous contents of KDSA5/KDSD5. */
 147: #ifdef SUPERVISOR
 148: #define saveseg5(save) { \
 149:     save.se_addr = *SDSA5; \
 150:     save.se_desc = *SDSD5; \
 151: }
 152: #else
 153: #define saveseg5(save) { \
 154:     save.se_addr = *KDSA5; \
 155:     save.se_desc = *KDSD5; \
 156: }
 157: #endif
 158: 
 159: /* restore normal kernel map for seg5. */
 160:     extern segm seg5;       /* prototype KDSA5, KDSD5 */
 161: #define normalseg5()    restorseg5(seg5)
 162: 
 163: /* restore the previous contents of KDSA5/KDSD5. */
 164: #ifdef SUPERVISOR
 165: #define restorseg5(save) { \
 166:     *SDSD5 = save.se_desc; \
 167:     *SDSA5 = save.se_addr; \
 168: }
 169: #else
 170: #define restorseg5(save) { \
 171:     *KDSD5 = save.se_desc; \
 172:     *KDSA5 = save.se_addr; \
 173: }
 174: caddr_t mapin();
 175: #endif
 176: #endif /* _SEG_ */

Defined functions

Copy defined in line 88; never used

Defined struct's

segm_reg defined in line 122; used 4 times

Defined typedef's

Defined macros

ABS defined in line 21; used 6 times
ACCESS defined in line 18; used 1 times
DEC_UISA7 defined in line 36; never used
ED defined in line 19; used 3 times
KDSA5 defined in line 70; used 9 times
KDSA6 defined in line 71; used 5 times
KDSD5 defined in line 75; used 3 times
KDSD6 defined in line 76; never used
KISA0 defined in line 44; used 8 times
KISA1 defined in line 45; never used
KISA5 defined in line 46; used 1 times
  • in line 61
KISA6 defined in line 47; used 1 times
  • in line 62
KISD1 defined in line 55; never used
KISD5 defined in line 56; used 1 times
  • in line 64
KISD6 defined in line 57; used 1 times
  • in line 65
NOACC defined in line 17; used 3 times
REMAP_AREA defined in line 81; used 1 times
SDSA0 defined in line 54; used 1 times
SDSA5 defined in line 68; used 3 times
SDSA6 defined in line 69; never used
SDSD0 defined in line 52; used 1 times
SDSD5 defined in line 73; used 3 times
SDSD6 defined in line 74; never used
SEG6 defined in line 84; used 7 times
SEG7 defined in line 85; never used
SISA0 defined in line 53; used 1 times
SISD0 defined in line 51; used 2 times
SSR3 defined in line 48; never used
TX defined in line 20; used 4 times
UDSA defined in line 40; used 3 times
UDSD defined in line 33; used 1 times
_SEG_ defined in line 10; used 1 times
  • in line 9

Usage of this include

seg.h used 64 times
Last modified: 1993-01-02
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 4522
Valid CSS Valid XHTML 1.0 Strict