Ignore:
Timestamp:
2023-01-30T18:23:45Z (23 months ago)
Author:
Jakub Jermář <jakub@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f114d40
Parents:
b1f0a14
git-author:
Colin V. Parker <cvparker@…> (2023-01-28 16:35:32)
git-committer:
Jakub Jermář <jakub@…> (2023-01-30 18:23:45)
Message:

Adjust PTE bit field definitions and sizes to match and align with 32-bit boundary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/include/arch/mm/page.h

    rb1f0a14 r0161d16  
    9494#define GET_PTL1_ADDRESS_ARCH(ptl0, i) \
    9595        ((pte_t *) ((((uint64_t) ((pte_t *) (ptl0))[(i)].addr_12_31) << 12) | \
    96             (((uint64_t) ((pte_t *) (ptl0))[(i)].addr_32_51) << 32)))
     96            (((uint64_t) ((pte_t *) (ptl0))[(i)].addr_32_62) << 32)))
    9797#define GET_PTL2_ADDRESS_ARCH(ptl1, i) \
    9898        ((pte_t *) ((((uint64_t) ((pte_t *) (ptl1))[(i)].addr_12_31) << 12) | \
    99             (((uint64_t) ((pte_t *) (ptl1))[(i)].addr_32_51) << 32)))
     99            (((uint64_t) ((pte_t *) (ptl1))[(i)].addr_32_62) << 32)))
    100100#define GET_PTL3_ADDRESS_ARCH(ptl2, i) \
    101101        ((pte_t *) ((((uint64_t) ((pte_t *) (ptl2))[(i)].addr_12_31) << 12) | \
    102             (((uint64_t) ((pte_t *) (ptl2))[(i)].addr_32_51) << 32)))
     102            (((uint64_t) ((pte_t *) (ptl2))[(i)].addr_32_62) << 32)))
    103103#define GET_FRAME_ADDRESS_ARCH(ptl3, i) \
    104104        ((uintptr_t *) \
    105105            ((((uint64_t) ((pte_t *) (ptl3))[(i)].addr_12_31) << 12) | \
    106             (((uint64_t) ((pte_t *) (ptl3))[(i)].addr_32_51) << 32)))
     106            (((uint64_t) ((pte_t *) (ptl3))[(i)].addr_32_62) << 32)))
    107107
    108108/* Set PTE address accessors for each level. */
     
    155155#define PTE_GET_FRAME_ARCH(p) \
    156156        ((((uintptr_t) (p)->addr_12_31) << 12) | \
    157             ((uintptr_t) (p)->addr_32_51 << 32))
     157            ((uintptr_t) (p)->addr_32_62 << 32))
    158158#define PTE_WRITABLE_ARCH(p) \
    159159        ((p)->writeable != 0)
     
    202202        unsigned int soft_valid : 1;  /**< Valid content even if present bit is cleared. */
    203203        unsigned int avl : 2;
    204         unsigned int addr_12_31 : 30;
    205         unsigned int addr_32_51 : 21;
     204        unsigned int addr_12_31 : 20;
     205        unsigned int addr_32_62 : 31;
    206206        unsigned int no_execute : 1;
    207207} __attribute__((packed)) pte_t;
     
    225225
    226226        p->addr_12_31 = (a >> 12) & UINT32_C(0xfffff);
    227         p->addr_32_51 = a >> 32;
     227        p->addr_32_62 = a >> 32;
    228228}
    229229
Note: See TracChangeset for help on using the changeset viewer.