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

  1. /* i386.h - 80386 processor specific header file
  2.  * $Version: 1.1 $
  3.  * Copyright 1990 Intel Corporation, ALL RIGHTS RESERVED.
  4.  */
  5.  
  6. #if !defined(_I386_)
  7. #define _I386_
  8.  
  9. #include <i286.h>
  10.  
  11. #pragma _builtin_("getcontrolregister"==41)
  12. unsigned int    getcontrolregister( const unsigned char );
  13.  
  14. #pragma _builtin_("setcontrolregister"==42)
  15. void    setcontrolregister( const unsigned char, unsigned int );
  16.  
  17. #define CR0_EXTENSION_TYPE    0x0010
  18. #define CR0_PAGING_ENABLED    0x8000
  19.  
  20. #pragma _builtin_("getdebugregister"==43)
  21. unsigned int    getdebugregister( const unsigned char );
  22.  
  23. #pragma _builtin_("setdebugregister"==44)
  24. void    setdebugregister( const unsigned char, unsigned int );
  25.  
  26. #pragma _builtin_("gettestregister"==45)
  27. unsigned int    gettestregister( const unsigned char );
  28.  
  29. #pragma _builtin_("settestregister"==46)
  30. void    settestregister( const unsigned char, unsigned int );
  31.  
  32. #pragma _builtin_("inhword"==67)
  33. unsigned short inhword(unsigned short port);
  34.  
  35. #pragma _builtin_("outhword"==68)
  36. void    outhword(unsigned short  port,
  37.                 unsigned short  value);
  38.  
  39. #pragma _builtin_("blockinhword"==69)
  40. void    blockinhword(    unsigned short  port,
  41.                         unsigned short *destination,
  42.                         unsigned int    count);
  43.  
  44. #pragma _builtin_("blockouthword"==70)
  45. void    blockouthword(   unsigned short          port,
  46.                         unsigned short const      *source,
  47.                         unsigned int            count);
  48.  
  49.  
  50. #pragma ALIGN("i387_protected_addr")
  51. struct i387_protected_addr
  52. {
  53.         unsigned    ip_offset    : 32;
  54.         unsigned    cs_sel        : 16;
  55.         unsigned    opcode        : 11, : 5;
  56.         unsigned    op_offset    : 32;
  57.         unsigned    op_sel        : 16, : 16;
  58. };
  59.  
  60. #pragma ALIGN("i387_real_address")
  61. struct i387_real_address
  62. {
  63.         unsigned    ip1        : 16, : 16;
  64.         unsigned    opcode        : 11, : 1;
  65.         unsigned    ip2        : 16, : 4;
  66.         unsigned    op1        : 16, : 16, : 12;
  67.         unsigned    op2        : 16, : 4;
  68. };
  69.  
  70. union i387_address
  71. {
  72.         struct i387_real_address real;
  73.         struct i387_protected_addr prot;
  74. };
  75.  
  76. #pragma ALIGN("i387_environment")
  77. struct i387_environment
  78. {
  79.         unsigned                control: 16, : 16;
  80.         unsigned                status : 16, : 16;
  81.         unsigned                tag    : 16, : 16;
  82.         union i387_address      ptrs_n_opcode;
  83. };
  84.  
  85. struct i387_state
  86. {
  87.         struct i387_environment environment;
  88.         tempreal_t              stack[8];
  89. };
  90.  
  91. #if _ARCHITECTURE_ >= 386
  92. #pragma _builtin_("saverealstatus"==18)
  93. void    saverealstatus(struct i387_state *savearea);
  94.  
  95. #pragma _builtin_("restorerealstatus"==19)
  96. void    restorerealstatus(struct i387_state const *savearea);
  97. #endif
  98.  
  99. #define FLAG_RESUME        0x10000
  100. #define FLAG_VM            0x20000
  101.  
  102. #pragma _builtin_("word_rol"==78)
  103. unsigned int    word_rol(unsigned int, unsigned int);
  104.  
  105. #pragma _builtin_("word_ror"==79)
  106. unsigned int    word_ror(unsigned int, unsigned int);
  107.  
  108. #endif
  109.