Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- mapper config for 5.1 (3.6)
- */
- #define VA_BITS (48)
- #define BIT(nr) (1UL << (nr))
- #define CONFIG_ARM64_PA_BITS 48
- #define __AC(X,Y) (X##Y)
- #define _AC(X,Y) __AC(X,Y)
- #define _UL(x) (_AC(x, UL))
- #define UL(x) (_UL(x))
- #define PAGE_OFFSET (UL(0xffffffffffffffff) - \
- (UL(1) << (VA_BITS - 1)) + 1)
- #define kimage_voffset 0xfffeffffd0000000
- #define PHYS_OFFSET 0x0000000040000000
- #define PTRS_PER_PTE (1 << (PAGE_SHIFT - 3))
- #define PTRS_PER_PMD PTRS_PER_PTE
- #define PMD_BLOCK_SHIFT 21
- #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
- #define PAGE_SHIFT 12
- #define PAGE_MASK (~(PAGE_SIZE-1))
- #define PGDIR_SHIFT ARM64_HW_PGTABLE_LEVEL_SHIFT(4 - CONFIG_PGTABLE_LEVELS)
- #define ARM64_HW_PGTABLE_LEVEL_SHIFT(n) ((PAGE_SHIFT - 3) * (4 - (n)) + 3)
- #define CONFIG_PGTABLE_LEVELS 4
- #define PTRS_PER_PGD (1 << (MAX_USER_VA_BITS - PGDIR_SHIFT))
- #define MAX_USER_VA_BITS VA_BITS
- #define PHYS_MASK ((UL(1) << PHYS_MASK_SHIFT) - 1)
- #define PHYS_MASK_SHIFT (CONFIG_ARM64_PA_BITS)
- #define PMD_SHIFT ARM64_HW_PGTABLE_LEVEL_SHIFT(2)
- #define __is_lm_address(addr) (!!((addr) & BIT(VA_BITS - 1)))
- #define __lm_to_phys(addr) (((addr) & ~PAGE_OFFSET) + PHYS_OFFSET)
- #define __kimg_to_phys(addr) ((addr) - kimage_voffset)
- #define __virt_to_phys_nodebug(x) ({ \
- phys_addr_t __x = (phys_addr_t)(x); \
- __is_lm_address(__x) ? __lm_to_phys(__x) : \
- __kimg_to_phys(__x); \
- })
- inline static paddr_t kern_vtop(vaddr_t x)
- {
- return __virt_to_phys_nodebug(x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement