home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: SysTools
/
SysTools.zip
/
p6k705a.zip
/
P6K7MTRR.h
< prev
next >
Wrap
C/C++ Source or Header
|
2000-10-03
|
4KB
|
89 lines
/* P6K7MTRR.h definitions for DosDevIOCtl() using P6K7MTRR.sys
Copyright 1999-2000 January June / ûΘë╛òP(Yotogi-Hime) / Beliefia Productions. */
#ifndef __P6K7MTRR
#define __P6K7MTRR
/* device name */
#define DEVNAME_P6K7MTRR "\\DEV\\P6MTRR$"
/* IOCtl category & functions */
#define IOCTL_P6K7MTRR 0xc4
#define P6K7MTRR_QRYMTRRCAP 0x60 /* Query MTRR capabilities */
#define P6K7MTRR_QRYMTRRDEFTYPE 0x61 /* Query MTRR default type */
#define P6K7MTRR_QRYMTRRFIXEDRANGE 0x62 /* Query MTRR fixed ranges */
#define P6K7MTRR_QRYMTRRVARIABLERANGE 0x63 /* Query MTRR variable range */
#define P6K7MTRR_SETMTRR2DEFAULT 0x40 /* Set MTRRs to default setting (v0.05+) */
#define P6K7MTRR_SETMTRRDEFTYPE 0x41 /* Set MTRR default type */
#define P6K7MTRR_SETMTRRFIXEDRANGE 0x42 /* Set MTRR fixed ranges */
#define P6K7MTRR_SETMTRRVARIABLERANGE 0x43 /* Set MTRR variable range */
/* Memory types */
#define P6K7MTRR_MEMTYPE_UNCACHEABLE 0 /* Uncacheable, strong write ordered */
#define P6K7MTRR_MEMTYPE_WRITECOMBINING 1 /* Write-combining, weak write ordered */
#define P6K7MTRR_MEMTYPE_WRITETHROUGH 4 /* Write-through, strong write ordered */
#define P6K7MTRR_MEMTYPE_WRITEPROTECTED 5 /* Write-protected, no write operations */
#define P6K7MTRR_MEMTYPE_WRITEBACK 6 /* Write-back, no write ordered */
/* P6/K7 MTRR capabilities
for P6K7MTRR_QRYMTRRCAP */
typedef struct
{
UINT VCNT:8; /* # of MTRR variable ranges */
UINT FIX:1; /* MTRR fixed range support flag, 1 if supported */
UINT :1;
UINT WC:1; /* Write-combining support flag, 1 if supported */
UINT :21;
UINT :32;
} P6K7MTRRCAPDATA;
/* P6/K7 MTRR default type
for P6K7MTRR_QRYMTRRDEFTYPE / P6K7MTRR_SETMTRRDEFTYPE */
typedef struct
{
UINT Type:8; /* Default memory type, must be one of P6K7MTRR_MEMTYPE_* */
UINT :2;
UINT FE:1; /* MTRR fixed range enabled flag, 1 if enabled */
UINT E:1; /* MTRR enabled flag, 1 if enabled (but cannot be 0 because of restriction of P6K7MTRR.sys) */
UINT :20;
UINT :32;
} P6K7MTRRDEFTYPEDATA; /* Other bits should be 0 when set */
/* P6/K7 MTRR fixed ranges
for P6K7MTRR_QRYMTRRFIXEDRANGE / P6K7MTRR_SETMTRRFIXEDRANGE */
typedef struct
{
UCHAR Range_00000_64K[8]; /* Memory types, 00000-7FFFF, 64k each */
UCHAR Range_80000_16K[8]; /* Memory types, 80000-9FFFF, 16k each */
UCHAR Range_A0000_16K[8]; /* Memory types, A0000-BFFFF, 16k each */
UCHAR Range_C0000_4K[8]; /* Memory types, C0000-C7FFF, 4k each */
UCHAR Range_C8000_4K[8]; /* Memory types, C8000-CFFFF, 4k each */
UCHAR Range_D0000_4K[8]; /* Memory types, D0000-D7FFF, 4k each */
UCHAR Range_D8000_4K[8]; /* Memory types, D8000-DFFFF, 4k each */
UCHAR Range_E0000_4K[8]; /* Memory types, E0000-E7FFF, 4k each */
UCHAR Range_E8000_4K[8]; /* Memory types, E8000-EFFFF, 4k each */
UCHAR Range_F0000_4K[8]; /* Memory types, F0000-F7FFF, 4k each */
UCHAR Range_F8000_4K[8]; /* Memory types, F8000-FFFFF, 4k each */
} P6K7MTRRFIXEDRANGEDATA; /* Each of memory types must be one of P6K7MTRR_MEMTYPE_* */
/* P6/K7 MTRR variable range
for P6K7MTRR_QRYMTRRVARIABLERANGE / P6K7MTRR_SETMTRRVARIABLERANGE */
typedef struct
{
UCHAR Index; /* Index of MTRR variable range, must be between 0 to P6K7MTRRCAPDATA.VCNT-1 */
} P6K7MTRRVARIABLERANGEPARM;
typedef struct
{
UINT Type:8; /* Memory type, must be one of P6K7MTRR_MEMTYPE_* */
UINT :4;
UINT PhysBase:24; /* Physical Memory base, most 24bits of 36bits */
UINT :28;
UINT :11;
UINT V:1; /* Valid flag, 0(invalid) or 1(valid) */
UINT PhysMask:24; /* Physical memory mask, most 24bits of 36bits */
UINT :28;
} P6K7MTRRVARIABLERANGEDATA; /* Other bits should be 0 when set */
#endif