baremetal: some quick fixes

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-01-22 00:00:00 +00:00
parent 9276c60fbf
commit 7db96f405a
2 changed files with 2 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ main:
/* Read cpu id into x1. /* Read cpu id into x1.
* TODO: cores beyond 4th? * TODO: cores beyond 4th?
* Mnemonic: Main Processor ID Register
*/ */
mrs x1, mpidr_el1 mrs x1, mpidr_el1
ands x1, x1, 3 ands x1, x1, 3

View File

@@ -17,7 +17,7 @@
#define SYSREG_WRITE(type, name) \ #define SYSREG_WRITE(type, name) \
void name ## _write(type name) { \ void name ## _write(type name) { \
__asm__ __volatile__("msr " #name ", %0" : : "r" (name) : ); \ __asm__ __volatile__("msr " #name ", %0" : : "r" (name) : ); \
} \ }
#define SYSREG_READ_WRITE(name, type) \ #define SYSREG_READ_WRITE(name, type) \
SYSREG_READ(name, type) \ SYSREG_READ(name, type) \