Use the arm64 ttbr macro to define the ASID shift

Now we have a macro to descrive the arm64 TTBR registers use it in the
ASID_TO_OPERAND pmap macro.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Andrew Turner 2022-01-05 14:30:40 +00:00
parent 0accd72674
commit 459e0b92e8

View File

@ -146,10 +146,9 @@ extern struct pmap kernel_pmap_store;
#define ASID_RESERVED_FOR_PID_0 0
#define ASID_RESERVED_FOR_EFI 1
#define ASID_FIRST_AVAILABLE (ASID_RESERVED_FOR_EFI + 1)
#define ASID_TO_OPERAND_SHIFT 48
#define ASID_TO_OPERAND(asid) ({ \
KASSERT((asid) != -1, ("invalid ASID")); \
(uint64_t)(asid) << ASID_TO_OPERAND_SHIFT; \
(uint64_t)(asid) << TTBR_ASID_SHIFT; \
})
extern vm_offset_t virtual_avail;