mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-07 09:54:47 -04:00
Rewrite the memory map-related code...
...other style fixes, etc.
This commit is contained in:
parent
bda9dcbe73
commit
c7d83c6eb6
26 changed files with 603 additions and 442 deletions
|
@ -11,7 +11,7 @@
|
|||
#define ALIGN(m) __attribute__((aligned(m)))
|
||||
#define PACKED __attribute__((packed))
|
||||
|
||||
#define INLINE_UNROLL __attribute__((always_inline, optimize("unroll-all-loops")))
|
||||
#define ALINLINE __attribute__((always_inline))
|
||||
|
||||
void panic(uint32_t code);
|
||||
void generic_panic(void);
|
||||
|
@ -21,7 +21,7 @@ static inline uintptr_t get_physical_address(const void *vaddr) {
|
|||
uintptr_t PAR;
|
||||
__asm__ __volatile__ ("at s1e3r, %0" :: "r"(vaddr));
|
||||
__asm__ __volatile__ ("mrs %0, par_el1" : "=r"(PAR));
|
||||
return (PAR & 1) ? 0ULL : (PAR & 0x00000FFFFFFFF000ULL) | ((uintptr_t)vaddr & 0xFFF);
|
||||
return (PAR & 1) ? 0ull : (PAR & 0x00000FFFFFFFF000ull) | ((uintptr_t)vaddr & 0xFFF);
|
||||
}
|
||||
|
||||
static inline uint32_t read32le(const volatile void *dword, size_t offset) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue