mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 19:51:35 +01:00
baremetal: some quick fixes
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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) \
|
||||||
|
|||||||
Reference in New Issue
Block a user