Draft: start lab 3

This commit is contained in:
2025-03-23 11:21:31 +08:00
parent a6dc454a4c
commit 6156975775
5 changed files with 122 additions and 1 deletions

View File

@@ -36,3 +36,15 @@ void exit(int);
(ptr = (orig_type*)((bump_type*)ptr + 1)), \
((bump_type*)ptr - 1) \
)
#define R_SYSREG(ret, reg) \
asm volatile( \
"mrs %[a], " #reg \
: [a] "=r" (ret) \
)
#define W_SYSREG(val, reg) \
asm volatile( \
"msr " #reg ", %[a]" \
: [a] "r" (val) \
)