baremetal: move aarch64 el.c into dump_regs.c

Also start disassembling registers nicely dump_regs so we can have a
single executable to handle all register queries.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-27 00:00:01 +00:00
parent 3527c8df5b
commit 8eb312c58d
5 changed files with 47 additions and 60 deletions

View File

@@ -4,12 +4,14 @@
int main(void) {
uint32_t cpsr;
__asm__ ("mrs %0, cpsr" : "=r" (cpsr) : :);
printf("cpsr %" PRIx32 "\n", cpsr);
printf("CPSR 0x%" PRIX32 "\n", cpsr);
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-exception-levels */
printf("CPSR.M 0x%" PRIX32 "\n", cpsr & 0xF);
/* TODO this is blowing up an exception, how to I read from it? */
/*uint32_t mvfr1;*/
/*__asm__ ("vmrs %0, mvfr1" : "=r" (mvfr1) : :);*/
/*printf("mvfr1 %" PRIx32 "\n", mvfr1);*/
/*printf("MVFR1 0x%" PRIX32 "\n", mvfr1);*/
return 0;
}

View File

@@ -1,11 +0,0 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-exception-levels */
#include <stdio.h>
#include <inttypes.h>
int main(void) {
uint32_t cpsr;
__asm__ ("mrs %0, CPSR" : "=r" (cpsr) : :);
printf("%" PRIu32 "\n", cpsr & 0x1F);
return 0;
}