Changeset 38 for trunk/hal


Ignore:
Timestamp:
Jun 22, 2017, 3:09:26 PM (8 years ago)
Author:
max@…
Message:

Use 4GB of VA per cluster, and 8GB of PA.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/hal_types.h

    r35 r38  
    162162 * - ptr : pointer in the virtual space of a single cluster.
    163163 *
    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 * 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]
    167167 ***************************************************************************
    168168 * A physical address is a 64 bits integer, structured in two fields :
     
    170170 * - lpa : local physical address inside cluster.
    171171 *
    172  * 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
     172 * 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
     177typedef uint64_t               reg_t;          // core register
    178178
    179179typedef uint64_t               xptr_t;         // extended pointer
     
    193193#define XPTR_NULL              0
    194194
    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))
    198200
    199201#define GET_PTR(xp)            ((void*)((xp) & PTR_MASK))
    200202
    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))
    206212
    207213#define LPA_FROM_PADDR(paddr)  (lpa_t)((paddr & LPA_MASK)
    208214
    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))
    210216
    211217#endif  /* HAL_TYPES_H_ */
Note: See TracChangeset for help on using the changeset viewer.