home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / gate.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  1.3 KB  |  38 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8.  
  9. #ident    "@(#)head.sys:gate.h    1.3"
  10.  
  11. /*
  12.  *  Call/Interrupt/Trap Gate table descriptions
  13.  */
  14.  
  15. struct gate {
  16.     unsigned short g_looff;    /* low word of offset */
  17.     unsigned short g_sel;    /* selector */
  18.     unsigned char g_wcount;    /* word count */
  19.     unsigned char g_type;    /* type of gate and access rights */
  20.     unsigned short g_hioff;    /* high word of the offset */
  21. };
  22.  
  23. /* access rights field for gates */
  24.  
  25. #define GATE_UACC 0xE0            /* present and dpl = 3 */
  26. #define GATE_KACC 0x80            /* present and dpl = 0 */
  27. #define GATE_386INT 0xE            /* 386 int gate */
  28. #define GATE_386TRP 0xF            /* 386 trap gate */
  29. #define GATE_TSS 0x5            /* TSS gate */
  30.  
  31. /* make an interrupt gate */
  32. #define MKINTG(rtn) {(short)rtn&0xFFFF, (short)KCS_SEL, (char)0, \
  33.          (char)(GATE_KACC|GATE_386INT), (short)((rtn&0xFFFF0000)>>16) } 
  34. #define MKKTRPG(rtn) {(short)rtn&0xFFFF, (short)KCS_SEL, (char)0, \
  35.          (char)(GATE_KACC|GATE_386TRP), (short)((rtn&0xFFFF0000)>>16) } 
  36. #define MKUTRPG(rtn) {(short)rtn&0xFFFF, (short)KCS_SEL, (char)0, \
  37.          (char)(GATE_UACC|GATE_386TRP), (short)((rtn&0xFFFF0000)>>16) } 
  38.