home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / p6k705a.zip / P6K7MTRR.h < prev    next >
C/C++ Source or Header  |  2000-10-03  |  4KB  |  89 lines

  1. /* P6K7MTRR.h  definitions for DosDevIOCtl() using P6K7MTRR.sys
  2.    Copyright 1999-2000 January June / ûΘë╛òP(Yotogi-Hime) / Beliefia Productions. */
  3.  
  4. #ifndef __P6K7MTRR
  5. #define __P6K7MTRR
  6.  
  7. /* device name */
  8. #define DEVNAME_P6K7MTRR "\\DEV\\P6MTRR$"
  9.  
  10. /* IOCtl category & functions */
  11. #define IOCTL_P6K7MTRR                0xc4
  12. #define P6K7MTRR_QRYMTRRCAP           0x60  /* Query MTRR capabilities */
  13. #define P6K7MTRR_QRYMTRRDEFTYPE       0x61  /* Query MTRR default type */
  14. #define P6K7MTRR_QRYMTRRFIXEDRANGE    0x62  /* Query MTRR fixed ranges */
  15. #define P6K7MTRR_QRYMTRRVARIABLERANGE 0x63  /* Query MTRR variable range */
  16. #define P6K7MTRR_SETMTRR2DEFAULT      0x40  /* Set MTRRs to default setting (v0.05+) */
  17. #define P6K7MTRR_SETMTRRDEFTYPE       0x41  /* Set MTRR default type */
  18. #define P6K7MTRR_SETMTRRFIXEDRANGE    0x42  /* Set MTRR fixed ranges */
  19. #define P6K7MTRR_SETMTRRVARIABLERANGE 0x43  /* Set MTRR variable range */
  20.  
  21. /* Memory types */
  22. #define P6K7MTRR_MEMTYPE_UNCACHEABLE    0  /* Uncacheable, strong write ordered */
  23. #define P6K7MTRR_MEMTYPE_WRITECOMBINING 1  /* Write-combining, weak write ordered */
  24. #define P6K7MTRR_MEMTYPE_WRITETHROUGH   4  /* Write-through, strong write ordered */
  25. #define P6K7MTRR_MEMTYPE_WRITEPROTECTED 5  /* Write-protected, no write operations */
  26. #define P6K7MTRR_MEMTYPE_WRITEBACK      6  /* Write-back, no write ordered */
  27.  
  28. /* P6/K7 MTRR capabilities
  29.      for P6K7MTRR_QRYMTRRCAP */
  30. typedef struct
  31. {
  32.     UINT VCNT:8;  /* # of MTRR variable ranges */
  33.     UINT FIX:1;   /* MTRR fixed range support flag, 1 if supported */
  34.     UINT :1;
  35.     UINT WC:1;    /* Write-combining support flag, 1 if supported */
  36.     UINT :21;
  37.     UINT :32;
  38. } P6K7MTRRCAPDATA;
  39.  
  40. /* P6/K7 MTRR default type
  41.      for P6K7MTRR_QRYMTRRDEFTYPE / P6K7MTRR_SETMTRRDEFTYPE */
  42. typedef struct
  43. {
  44.     UINT Type:8;     /* Default memory type, must be one of P6K7MTRR_MEMTYPE_* */
  45.     UINT :2;
  46.     UINT FE:1;       /* MTRR fixed range enabled flag, 1 if enabled */
  47.     UINT E:1;        /* MTRR enabled flag, 1 if enabled (but cannot be 0 because of restriction of P6K7MTRR.sys) */
  48.     UINT :20;
  49.     UINT :32;
  50. } P6K7MTRRDEFTYPEDATA;  /* Other bits should be 0 when set */
  51.  
  52. /* P6/K7 MTRR fixed ranges
  53.      for P6K7MTRR_QRYMTRRFIXEDRANGE / P6K7MTRR_SETMTRRFIXEDRANGE */
  54. typedef struct
  55. {
  56.     UCHAR Range_00000_64K[8];  /* Memory types, 00000-7FFFF, 64k each */
  57.     UCHAR Range_80000_16K[8];  /* Memory types, 80000-9FFFF, 16k each */
  58.     UCHAR Range_A0000_16K[8];  /* Memory types, A0000-BFFFF, 16k each */
  59.     UCHAR Range_C0000_4K[8];   /* Memory types, C0000-C7FFF, 4k each */
  60.     UCHAR Range_C8000_4K[8];   /* Memory types, C8000-CFFFF, 4k each */
  61.     UCHAR Range_D0000_4K[8];   /* Memory types, D0000-D7FFF, 4k each */
  62.     UCHAR Range_D8000_4K[8];   /* Memory types, D8000-DFFFF, 4k each */
  63.     UCHAR Range_E0000_4K[8];   /* Memory types, E0000-E7FFF, 4k each */
  64.     UCHAR Range_E8000_4K[8];   /* Memory types, E8000-EFFFF, 4k each */
  65.     UCHAR Range_F0000_4K[8];   /* Memory types, F0000-F7FFF, 4k each */
  66.     UCHAR Range_F8000_4K[8];   /* Memory types, F8000-FFFFF, 4k each */
  67. } P6K7MTRRFIXEDRANGEDATA;  /* Each of memory types must be one of P6K7MTRR_MEMTYPE_* */
  68.  
  69. /* P6/K7 MTRR variable range
  70.      for P6K7MTRR_QRYMTRRVARIABLERANGE / P6K7MTRR_SETMTRRVARIABLERANGE */
  71. typedef struct
  72. {
  73.     UCHAR Index;  /* Index of MTRR variable range, must be between 0 to P6K7MTRRCAPDATA.VCNT-1 */
  74. } P6K7MTRRVARIABLERANGEPARM;
  75. typedef struct
  76. {
  77.     UINT Type:8;       /* Memory type, must be one of P6K7MTRR_MEMTYPE_* */
  78.     UINT :4;
  79.     UINT PhysBase:24;  /* Physical Memory base, most 24bits of 36bits */
  80.     UINT :28;
  81.     UINT :11;
  82.     UINT V:1;          /* Valid flag, 0(invalid) or 1(valid) */
  83.     UINT PhysMask:24;  /* Physical memory mask, most 24bits of 36bits */
  84.     UINT :28;
  85. } P6K7MTRRVARIABLERANGEDATA;  /* Other bits should be 0 when set */
  86.  
  87. #endif
  88.  
  89.