- Timestamp:
- Jun 22, 2017, 3:09:26 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/hal_types.h
r35 r38 162 162 * - ptr : pointer in the virtual space of a single cluster. 163 163 * 164 * In Intel 64 bits, the kernel virtual space has 256 Tbytes per cluster165 * - the cxy field occupies bits[63: 48]166 * - the ptr field occupies bits[ 47:0]164 * In Intel 64 bits, the kernel virtual space has 4 Gbytes per cluster 165 * - the cxy field occupies bits[63:32] 166 * - the ptr field occupies bits[31:0] 167 167 *************************************************************************** 168 168 * A physical address is a 64 bits integer, structured in two fields : … … 170 170 * - lpa : local physical address inside cluster. 171 171 * 172 * In Intel 64 bits, the physical space has 256Gbytes per cluster.173 * - the cxy field occupies bits[ 63:48]174 * - the lpa field occupies bits[ 47:0]175 **************************************************************************/ 176 177 typedef uint64_t reg_t; // core register172 * In Intel 64 bits, the physical space has 8 Gbytes per cluster. 173 * - the cxy field occupies bits[35:33] 174 * - the lpa field occupies bits[32:0] 175 **************************************************************************/ 176 177 typedef uint64_t reg_t; // core register 178 178 179 179 typedef uint64_t xptr_t; // extended pointer … … 193 193 #define XPTR_NULL 0 194 194 195 #define PTR_MASK 0x0000FFFFFFFFFFFFULL 196 197 #define GET_CXY(xp) ((cxy_t)((xp) >> 48)) 195 #define PTR_MASK 0x00000000FFFFFFFFULL 196 197 #define PTR_SHIFT 32 198 199 #define GET_CXY(xp) ((cxy_t)((xp) >> PTR_SHIFT)) 198 200 199 201 #define GET_PTR(xp) ((void*)((xp) & PTR_MASK)) 200 202 201 #define XPTR(cxy,ptr) (((uint64_t)(cxy) << 48) | (((uint64_t)(ptr)) & PTR_MASK)) 202 203 #define LPA_MASK 0X0000FFFFFFFFFFFFULL 204 205 #define CXY_FROM_PADDR(paddr) ((cxy_t)((paddr) >> 48)) 203 #define XPTR(cxy,ptr) (((uint64_t)(cxy) << PTR_SHIFT) | (((uint64_t)(ptr)) & PTR_MASK)) 204 205 206 207 #define LPA_MASK 0x00000001FFFFFFFFULL 208 209 #define LPA_SHIFT 33 210 211 #define CXY_FROM_PADDR(paddr) ((cxy_t)((paddr) >> LPA_SHIFT)) 206 212 207 213 #define LPA_FROM_PADDR(paddr) (lpa_t)((paddr & LPA_MASK) 208 214 209 #define PADDR(cxy,lad) (((uint64_t)(cxy) << 48) | (((uint64_t)(ptr)) & LPA_MASK))215 #define PADDR(cxy,lad) (((uint64_t)(cxy) << LPA_SHIFT) | (((uint64_t)(ptr)) & LPA_MASK)) 210 216 211 217 #endif /* HAL_TYPES_H_ */
Note: See TracChangeset
for help on using the changeset viewer.