Ignore:
Timestamp:
Jul 5, 2017, 11:19:36 AM (7 years ago)
Author:
max@…
Message:

less magic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_boot.h

    r145 r147  
    108108/* -------------------------------------------------------------------------- */
    109109
     110#define VA_SIGN_MASK            0xffff000000000000
     111#define VA_SIGN_POS(va)         ((va) & ~VA_SIGN_MASK)
     112
     113#define pl1_i(VA)       (((VA_SIGN_POS(VA)) & L1_FRAME) >> L1_SHIFT)
     114#define pl2_i(VA)       (((VA_SIGN_POS(VA)) & L2_FRAME) >> L2_SHIFT)
     115#define pl3_i(VA)       (((VA_SIGN_POS(VA)) & L3_FRAME) >> L3_SHIFT)
     116#define pl4_i(VA)       (((VA_SIGN_POS(VA)) & L4_FRAME) >> L4_SHIFT)
     117
    110118#define L4_SLOT_PTE             255
    111 #define L4_SLOT_KERNBASE        480
    112 
    113 /*
    114  * L3 = (KERNBASE % NBPD_L4) / NBPD_L3
    115  * L2 = (KERNBASE % NBPD_L3) / NBPD_L2
    116  */
    117 #define L3_SLOT_KERNBASE        0
    118 #define L2_SLOT_KERNBASE        0
     119#define L4_SLOT_KERNBASE        pl4_i(KERNBASE)
     120#define L3_SLOT_KERNBASE        (pl3_i(KERNBASE) % 512)
     121#define L2_SLOT_KERNBASE        (pl2_i(KERNBASE) % 512)
    119122
    120123#define PDIR_SLOT_PTE   L4_SLOT_PTE
Note: See TracChangeset for help on using the changeset viewer.