- Timestamp:
- Jun 22, 2017, 2:36:05 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/i386/hal_types.h
r16 r37 154 154 * - ptr : pointer in the virtual space of a single cluster. 155 155 * 156 * In Intel 64 bits, the kernel virtual space has 256 Tbytes per cluster156 * In Intel 64 bits, the kernel virtual space has 4 Gbytes per cluster 157 157 * - the cxy field occupies bits[63:48] 158 158 * - the ptr field occupies bits[47:0] … … 162 162 * - lpa : local physical address inside cluster. 163 163 * 164 * In INTEL 64 bits, the physical space has 256Gbytes per cluster.165 * - the cxy field occupies bits[ 63:48]166 * - the lpa field occupies bits[ 47:0]164 * In INTEL 64 bits, the physical space has 8 Gbytes per cluster. 165 * - the cxy field occupies bits[35:33] 166 * - the lpa field occupies bits[32:0] 167 167 **************************************************************************/ 168 168 … … 183 183 typedef uint64_t vpn_t; // Virtual Page number 184 184 185 186 185 187 #define XPTR_NULL 0 186 188 187 #define PTR_MASK 0x0000FFFFFFFFFFFFULL 188 189 #define GET_CXY(xp) ((cxy_t)((xp) >> 48)) 189 #define PTR_MASK 0x00000000FFFFFFFFULL 190 191 #define PTR_SHIFT 32 192 193 #define GET_CXY(xp) ((cxy_t)((xp) >> 32)) 190 194 191 195 #define GET_PTR(xp) ((void*)((xp) & PTR_MASK)) 192 196 193 #define XPTR(cxy,ptr) (((uint64_t)(cxy) << 48) | (((uint64_t)(ptr)) & PTR_MASK)) 194 195 #define LPA_MASK 0X0000FFFFFFFFFFFFULL 196 197 #define CXY_FROM_PADDR(paddr) ((cxy_t)((paddr) >> 48)) 197 #define XPTR(cxy,ptr) (((uint64_t)(cxy) << PTR_SHIFT) | (((uint64_t)(ptr)) & PTR_MASK)) 198 199 200 201 #define LPA_MASK 0X00000001FFFFFFFFULL 202 203 #define LPA_SHIFT 33 204 205 #define CXY_FROM_PADDR(paddr) ((cxy_t)((paddr) >> LPA_SHIFT)) 198 206 199 207 #define LPA_FROM_PADDR(paddr) (lpa_t)((paddr & LPA_MASK) 200 208 201 #define PADDR(cxy,lad) (((uint64_t)(cxy) << 48) | (((uint64_t)(ptr)) & LPA_MASK))209 #define PADDR(cxy,lad) (((uint64_t)(cxy) << LPA_SHIFT) | (((uint64_t)(ptr)) & LPA_MASK)) 202 210 203 211
Note: See TracChangeset
for help on using the changeset viewer.