Created
September 17, 2023 05:40
-
-
Save pepepper/a08dba425231084b48cc5d050d95dc01 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned int PhysicalRead(unsigned int addr){ | |
unsigned int ret; | |
asm volatile( | |
"mrc p15,0,r10,c1,c0,0\n" // read ctrl regs | |
"mov r9,r10\n" | |
"bic r10, r10, #1\n" | |
"mcr p15,0,r10,c1,c0,0\n"// disable MMU | |
"ldr %0, [%1]\n" | |
"mcr p15,0,r9,c1,c0,0\n" // enable MMU | |
:"=r" (ret): "r" (addr):"r10","r9" | |
); | |
return ret; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment