00001 #ifndef PTEDEF_H 00002 #define PTEDEF_H 00003 00004 #define PTE_C_BYTES_PER_PTE 8 00005 #define PTE_C_SHIFT_SIZE 3 00006 #define PTE_M_VALID 0x1 00007 #define PTE_M_FOR 0x2 00008 #define PTE_M_FOW 0x4 00009 #define PTE_M_FOE 0x8 00010 #define PTE_M_ASM 0x10 00011 #define PTE_M_GH 0x60 00012 #define PTE_C_GROUP_OF_1 0 00013 #define PTE_C_GROUP_OF_8 1 00014 #define PTE_C_GROUP_OF_64 2 00015 #define PTE_C_GROUP_OF_512 3 00016 #define PTE_M_NO_MB 0x80 00017 #define PTE_M_PROT 0xFF00 00018 #define PTE_M_SOFTWARE 0xFFFF0000 00019 #define PTE_M_PFN 0xFFFFFFFF00000000 00020 #define PTE_M_KRE 0x100 00021 #define PTE_M_ERE 0x200 00022 #define PTE_M_SRE 0x400 00023 #define PTE_M_URE 0x800 00024 #define PTE_M_KWE 0x1000 00025 #define PTE_M_EWE 0x2000 00026 #define PTE_M_SWE 0x4000 00027 #define PTE_M_UWE 0x8000 00028 #define PTE_M_WINDOW 0x10000 00029 #define PTE_M_OWN 0x60000 00030 #define PTE_M_MODIFY 0x100000 00031 #define PTE_M_CPY 0x30000000 00032 #define PTE_M_NOX 0x40000000 00033 #define PTE_M_S0_MBZ 0x80000000 00034 #define PTE_M_TYP0 0x10000 00035 #define PTE_M_PARTIAL_SECTION 0x80000 00036 #define PTE_M_TYP1 0x100000 00037 #define PTE_M_STX 0xFFFF00000000 00038 #define PTE_M_CRF 0x1000000000000 00039 #define PTE_M_DZRO 0x2000000000000 00040 #define PTE_M_WRT 0x4000000000000 00041 #define PTE_M_PGFLPAG 0xFFFFFF00000000 00042 #define PTE_M_PGFLX 0xFF00000000000000 00043 #define PTE_M_BAKX 0xFFFFFFFF00000000 00044 #define PTE_M_GPTX 0xFFFFFFFF00000000 00045 #define PTE_C_NOPGFLPAG 255 00046 #define PTE_C_NA 0 00047 #define PTE_C_KR 0x100 00048 #define PTE_C_KW 0x1100 00049 #define PTE_C_ER 0x300 00050 #define PTE_C_EW 0x3300 00051 #define PTE_C_SR 0x700 00052 #define PTE_C_SW 0x7700 00053 #define PTE_C_UR 0xf00 00054 #define PTE_C_UW 0xff00 00055 #define PTE_C_ERKW 0x1300 00056 #define PTE_C_SRKW 0x1700 00057 #define PTE_C_SREW 0x3700 00058 #define PTE_C_URKW 0x1f00 00059 #define PTE_C_UREW 0x3f00 00060 #define PTE_C_URSW 0x7f00 00061 #define PTE_C_KOWN 0 00062 #define PTE_C_EOWN 0x20000 00063 #define PTE_C_SOWN 0x40000 00064 #define PTE_C_UOWN 0x60000 00065 #define PTE_C_COPY 0 00066 #define PTE_C_NOCOPY 0x10000000 00067 #define PTE_C_DZRO 0x20000000 00068 #define PTE_C_DZRO_L1PTE 0x1100 00069 #define PTE_C_DZRO_L2PTE 0x40001300 00070 00071 #define PTE_S_PTEDEF 16 00072 00073 #define PTE_M_SINGLE_PTE 65536 00074 00075 #define PTE_C_INDEX_SHIFT_VALUE 19 00076 #define PTE_C_FREE_BLOCK 16 00077 00078 #define PTELIST_K_LENGTH 24 00079 #define PTELIST_C_LENGTH 24 00080 00081 struct _pte { 00082 union { 00083 struct { 00084 unsigned pte_v_valid : 1; 00085 unsigned pte_v_for : 1; 00086 unsigned pte_v_fow : 1; 00087 unsigned pte_v_foe : 1; 00088 unsigned pte_v_asm : 1; 00089 unsigned pte_v_gh : 2; 00090 unsigned pte_v_no_mb : 1; 00091 unsigned pte_v_prot : 8; 00092 unsigned pte_v_software : 16; 00093 unsigned pte_v_pfn : 32; 00094 }; 00095 struct { 00096 unsigned pte_v_filler_1 : 8; 00097 unsigned pte_v_kre : 1; 00098 unsigned pte_v_ere : 1; 00099 unsigned pte_v_sre : 1; 00100 unsigned pte_v_ure : 1; 00101 unsigned pte_v_kwe : 1; 00102 unsigned pte_v_ewe : 1; 00103 unsigned pte_v_swe : 1; 00104 unsigned pte_v_uwe : 1; 00105 }; 00106 struct { 00107 unsigned pte_v_filler_2 : 16; 00108 unsigned pte_v_window : 1; 00109 unsigned pte_v_own : 2; 00110 unsigned pte_v_filler_9 : 1; 00111 unsigned pte_v_modify : 1; 00112 unsigned pte_v_filler_10 : 7; 00113 unsigned pte_v_cpy : 2; 00114 unsigned pte_v_nox : 1; 00115 unsigned pte_v_s0_mbz : 1; 00116 }; 00117 struct { 00118 unsigned pte_v_filler_3 : 16; 00119 unsigned pte_v_typ0 : 1; 00120 unsigned pte_v_filler_4 : 2; 00121 unsigned pte_v_partial_section : 1; 00122 unsigned pte_v_typ1 : 1; 00123 unsigned pte_v_fill_0_ : 3; 00124 }; 00125 union { 00126 struct { 00127 unsigned pte_v_filler_5 : 32; 00128 unsigned pte_v_stx : 16; 00129 unsigned pte_v_crf : 1; 00130 unsigned pte_v_dzro : 1; 00131 unsigned pte_v_wrt : 1; 00132 unsigned pte_v_fill_1_ : 5; 00133 }; 00134 union { 00135 struct { 00136 unsigned pte_v_filler_6 : 32; 00137 unsigned pte_v_pgflpag : 24; 00138 unsigned pte_v_pgflx : 8; 00139 }; 00140 struct { 00141 unsigned pte_v_filler_7 : 32; 00142 unsigned pte_v_bakx : 32; 00143 }; 00144 }; 00145 struct { 00146 unsigned pte_v_filler_8 : 32; 00147 unsigned pte_v_gptx : 32; 00148 }; 00149 }; 00150 }; 00151 }; 00152 00153 struct _va_pte_free { 00154 unsigned long long pte_q_index; 00155 00156 int pte_$_filler_14; 00157 unsigned int pte_l_free_count; 00158 }; 00159 00160 struct _ptelist { 00161 unsigned long long ptelist_q_head; 00162 unsigned long long ptelist_q_tail; 00163 long long ptelist_q_count; 00164 }; 00165 00166 typedef struct _pte * PTE_PQ; 00167 typedef struct _pte ** PTE_PPQ; 00168 typedef struct _ptelist * PTELIST_PQ; 00169 typedef struct _ptelist ** PTELIST_PPQ; 00170 typedef struct _va_pte_free * VA_PTE_FREE_PQ; 00171 typedef struct _va_pte_free ** VA_PTE_FREE_PPQ; 00172 00173 #if 0 00174 typedef unsigned long long PTE_PQ; 00175 typedef unsigned long long PTE_PPQ; 00176 typedef unsigned long long PTELIST_PQ; 00177 typedef unsigned long long PTELIST_PPQ; 00178 typedef unsigned long long VA_PTE_FREE_PQ; 00179 typedef unsigned long long VA_PTE_FREE_PPQ; 00180 #endif 00181 00182 #endif 00183 00184