Fix emunand SMC behaviors
This commit is contained in:
@@ -70,6 +70,13 @@ static inline uintptr_t get_physical_address(const void *vaddr) {
|
||||
return (PAR & 1) ? 0ull : (PAR & MASK2L(40, 12)) | ((uintptr_t)vaddr & MASKL(12));
|
||||
}
|
||||
|
||||
static inline uintptr_t get_physical_address_el0(const uintptr_t el0_vaddr) {
|
||||
uintptr_t PAR;
|
||||
__asm__ __volatile__ ("at s1e0r, %0" :: "r"(el0_vaddr));
|
||||
__asm__ __volatile__ ("mrs %0, par_el1" : "=r"(PAR));
|
||||
return (PAR & 1) ? 0ull : (PAR & MASK2L(40, 12)) | ((uintptr_t)el0_vaddr & MASKL(12));
|
||||
}
|
||||
|
||||
static inline uint32_t read32le(const volatile void *dword, size_t offset) {
|
||||
return *(uint32_t *)((uintptr_t)dword + offset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user