home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s038 / 10.ddi / 017.LIF / I286.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-02  |  3.4 KB  |  117 lines

  1. /* i286.h - 80286 processor specific header file
  2.  * $Version: 1.1 $
  3.  * Copyright 1988, 89, 90 Intel Corporation, ALL RIGHTS RESERVED.
  4.  */
  5.  
  6. #if !defined(_I286_)
  7. #define _I286_
  8.  
  9. #include <i186.h>
  10.  
  11. #define FLAG_IOPL        0x3000
  12. #define FLAG_NESTED        0x4000
  13.  
  14. /*** For additional interrupt handling ***/
  15. #pragma _builtin_("waitforinterrupt"==24)
  16. void    waitforinterrupt(void);
  17.  
  18. /*** For manipulation of the Task Register ***/
  19. #pragma _builtin_("gettaskregister"==25)
  20. selector        gettaskregister(void);
  21.  
  22. #pragma _builtin_("settaskregister"==26)
  23. void    settaskregister(selector value);
  24.  
  25. #if _LONG64_
  26. typedef unsigned int base_addr;
  27. #else
  28. typedef unsigned long base_addr;
  29. #endif
  30.  
  31. #pragma NOALIGN("descriptor_table_reg")
  32. struct  descriptor_table_reg
  33. {
  34.         unsigned short  limit;  /* 16 bits of limit */
  35.         base_addr base;         /* physical base address */
  36. };
  37.  
  38. /*** For manipulation of the Global Descriptor Table ***/
  39. #pragma _builtin_("saveglobaltable"==27)
  40. void    saveglobaltable(struct descriptor_table_reg *location);
  41.  
  42. #pragma _builtin_("restoreglobaltable"==28)
  43. void    restoreglobaltable(struct descriptor_table_reg const *location);
  44.  
  45. /*** For manipulation of the Interrupt Descriptor Table ***/
  46. #pragma _builtin_("saveinterrupttable"==29)
  47. void    saveinterrupttable(struct descriptor_table_reg *location);
  48.  
  49. #pragma _builtin_("restoreinterrupttable"==30)
  50. void    restoreinterrupttable(struct descriptor_table_reg const *location);
  51.  
  52. /*** For the manipulation of the Local Descriptor Table Register ***/
  53. #pragma _builtin_("getlocaltable"==31)
  54. selector        getlocaltable(void);
  55.  
  56. #pragma _builtin_("setlocaltable"==32)
  57. void    setlocaltable(selector sel);
  58.  
  59. /*** For the manipulation of the Machine Status Register ***/
  60. #define MSW_PROTECTION_ENABLE   0x0001
  61. #define MSW_MONITOR_COPROCESSOR 0x0002
  62. #define MSW_EMULATE_COPROCESSOR 0x0004
  63. #define MSW_TASK_SWITCHED       0x0008
  64.  
  65. #pragma _builtin_("getmachinestatus"==33)
  66. unsigned short  getmachinestatus(void);
  67.  
  68. #pragma _builtin_("setmachinestatus"==34)
  69. void    setmachinestatus(unsigned short value);
  70.  
  71. /*** For clearing task switched flag in machine status ***/
  72. #pragma _builtin_("cleartaskswitchedflag"==35)
  73. void    cleartaskswitchedflag(void);
  74.  
  75. /*** For segment information ***/
  76. #define AR_PRESENT      0x8000
  77. #define AR_PRIV_MASK    0x6000
  78. #define AR_PRIV_SHIFT   13
  79. #define AR_PRIVILEGE(x) (((x) & AR_PRIV_MASK) >> AR_PRIV_SHIFT)
  80. #define AR_SEGMENT      0x1000
  81.  
  82. #define AR_EXECUTABLE   0x0800
  83. #define AR_EXPAND_DOWN  0x0400
  84. #define AR_WRITABLE     0x0200
  85. #define AR_CONFORMING   0x0400
  86. #define AR_READABLE     0x0200
  87. #define AR_ACCESSED     0x0100
  88.  
  89. #define AR_386_TYPE     0x0800
  90. #define AR_GATE         0x0400
  91. #define AR_GATE_MASK    0x0300
  92. #define AR_GATE_TYPE(x) ((x) & AR_GATE_MASK)
  93. #define AR_CALL_GATE    0x0000
  94. #define AR_TASK_GATE    0x0100
  95. #define AR_INTR_GATE    0x0200
  96. #define AR_TRAP_GATE    0x0300
  97. #define AR_TSS          0x0100
  98. #define AR_BUSY         0x0200
  99.  
  100. #pragma _builtin_("getaccessrights"==36)
  101. unsigned int    getaccessrights(selector sel);
  102.  
  103. #pragma _builtin_("getsegmentlimit"==37)
  104. unsigned int    getsegmentlimit(selector sel);
  105.  
  106. #pragma _builtin_("segmentreadable"==38)
  107. int     segmentreadable(selector sel);
  108.  
  109. #pragma _builtin_("segmentwritable"==39)
  110. int     segmentwritable(selector sel);
  111.  
  112. /*** For adjusting the requested privilege level ***/
  113. #pragma _builtin_("adjustrpl"==40)
  114. selector        adjustrpl(selector sel);
  115.  
  116. #endif
  117.