Changeset 37


Ignore:
Timestamp:
Jun 22, 2017, 2:36:05 PM (4 years ago)
Author:
alain
Message:

Adapt to paso/doble AMD machine.

File:
1 edited

Legend:

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

    r16 r37  
    154154 * - ptr : pointer in the virtual space of a single cluster.
    155155 *
    156  * In Intel 64 bits, the kernel virtual space has 256 Tbytes per cluster
     156 * In Intel 64 bits, the kernel virtual space has 4 Gbytes per cluster
    157157 * - the cxy field occupies bits[63:48]
    158158 * - the ptr field occupies bits[47:0]
     
    162162 * - lpa : local physical address inside cluster.
    163163 *
    164  * In INTEL 64 bits, the physical space has 256 Gbytes 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]
    167167 **************************************************************************/
    168168
     
    183183typedef uint64_t               vpn_t;          // Virtual Page number
    184184
     185
     186
    185187#define XPTR_NULL              0
    186188
    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))
    190194
    191195#define GET_PTR(xp)            ((void*)((xp) & PTR_MASK))
    192196
    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))
    198206
    199207#define LPA_FROM_PADDR(paddr)  (lpa_t)((paddr & LPA_MASK)
    200208
    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))
    202210
    203211
Note: See TracChangeset for help on using the changeset viewer.