- Timestamp:
- Jun 22, 2017, 7:58:20 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/hal_types.h
r32 r34 54 54 55 55 typedef uint64_t vaddr_t; // XXX 56 typedef uint64_t pt_entry_t; // XXX 56 57 57 58 /*************************************************************************** … … 144 145 typedef struct cache_line_s 145 146 { 146 147 148 149 150 147 union 148 { 149 uint32_t values[CONFIG_CACHE_LINE_SIZE>>2]; 150 uint32_t value; 151 }; 151 152 } 152 153 __attribute__((packed)) cacheline_t; 153 154 154 /*************************************************************************** 155 * Address types and macros !!! hardware dependant !!! 155 #define CACHELINE_ALIGNED __attribute__((aligned(CONFIG_CACHE_LINE_SIZE))) 156 157 /*************************************************************************** 158 * Address types and macros !!! hardware dependent !!! 156 159 *************************************************************************** 157 * An extended pointer a 64 bits integer, structured in two fields :160 * An extended pointer is a 64 bits integer, structured in two fields : 158 161 * - cxy : cluster identifier. 159 162 * - ptr : pointer in the virtual space of a single cluster. 160 163 * 161 * In TSAR (MIPS32), the kernel virtual space has 4 Gbytes per cluster162 * - the cxy field occupies bits[ 47:32]163 * - the ptr field occupies bits[ 31:0]164 * In Intel 64 bits, the kernel virtual space has 256 Tbytes per cluster 165 * - the cxy field occupies bits[63:48] 166 * - the ptr field occupies bits[47:0] 164 167 *************************************************************************** 165 168 * A physical address is a 64 bits integer, structured in two fields : … … 167 170 * - lpa : local physical address inside cluster. 168 171 * 169 * In TSAR (MIPS32), the physical space has 4Gbytes per cluster.170 * - the cxy field occupies bits[ 39:32]171 * - the lpa field occupies bits[ 31:0]172 **************************************************************************/ 173 174 typedef uint 32_t reg_t; // core register175 176 typedef uint64_t xptr_t; // extended pointer177 178 typedef uint16_t cxy_t; // cluster identifier179 180 typedef uint64_t paddr_t; // global physical address181 182 typedef uint 32_t lpa_t;// local physical address183 184 typedef uint64_t intptr_t; // local pointer stored as integer185 186 typedef uint 32_t ppn_t;// Physical Page Number187 188 typedef uint 32_t vpn_t;// Virtual Page number172 * In Intel 64 bits, the physical space has 256 Gbytes 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 register 178 179 typedef uint64_t xptr_t; // extended pointer 180 181 typedef uint16_t cxy_t; // cluster identifier 182 183 typedef uint64_t paddr_t; // global physical address (64 bits) 184 185 typedef uint64_t lpa_t; // local physical address 186 187 typedef uint64_t intptr_t; // local pointer stored as integer 188 189 typedef uint64_t ppn_t; // Physical Page Number 190 191 typedef uint64_t vpn_t; // Virtual Page number 189 192 190 193 #define XPTR_NULL 0 191 194 192 #define PTR_MASK 0x0000 0000FFFFFFFFULL193 194 #define GET_CXY(xp) ((cxy_t)((xp) >> 32))195 196 #define GET_PTR(xp) ((void*)( uint32_t)((xp) & PTR_MASK))197 198 #define XPTR(cxy,ptr) (((uint64_t)(cxy) << 32) | (((uint32_t)(ptr)) & PTR_MASK))199 200 #define LPA_MASK 0 x00000000FFFFFFFFULL201 202 #define CXY_FROM_PADDR(paddr) ((cxy_t)((paddr) >> 32))195 #define PTR_MASK 0x0000FFFFFFFFFFFFULL 196 197 #define GET_CXY(xp) ((cxy_t)((xp) >> 48)) 198 199 #define GET_PTR(xp) ((void*)((xp) & PTR_MASK)) 200 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 206 204 207 #define LPA_FROM_PADDR(paddr) (lpa_t)((paddr & LPA_MASK) 205 208 206 #define PADDR(cxy,lpa) (((uint64_t)(cxy) << 32) | (((uint64_t)(lpa)) & LPA_MASK)) 207 208 209 #define PADDR(cxy,lad) (((uint64_t)(cxy) << 48) | (((uint64_t)(ptr)) & LPA_MASK)) 209 210 210 211 #endif /* HAL_TYPES_H_ */
Note: See TracChangeset
for help on using the changeset viewer.