mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 13:04:27 +01:00
failed xen attempt, refactor timer, failed svc attempt, aarch64 use gicv3
This commit is contained in:
28
baremetal/arch/aarch64/svc.c
Normal file
28
baremetal/arch/aarch64/svc.c
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "common_aarch64.h"
|
||||
|
||||
/* Masks each of the 4 exception types: Synchronous, System error,
|
||||
* IRQ and FIQ.
|
||||
*/
|
||||
SYSREG_READ_WRITE(uint32_t, daif)
|
||||
|
||||
/* Determines if we use SP0 or SPx. Default: SP0.
|
||||
* See also: https://stackoverflow.com/questions/29393677/armv8-exception-vector-significance-of-el0-sp
|
||||
*/
|
||||
SYSREG_READ_WRITE(uint32_t, spsel)
|
||||
|
||||
/* Jump to this SP if spsel == SPx. */
|
||||
SYSREG_READ_WRITE(uint64_t, sp_el1)
|
||||
|
||||
int main(void) {
|
||||
printf("daif 0x%" PRIx32 "\n", sysreg_daif_read());
|
||||
printf("spsel 0x%" PRIx32 "\n", sysreg_spsel_read());
|
||||
/* TODO this breaks execution because reading system registers that end
|
||||
* in ELx "trap", leading into an exception on the upper EL.
|
||||
*/
|
||||
/*printf("sp_el1 0x%" PRIx64 "\n", sysreg_sp_el1_read());*/
|
||||
/*SVC(0);*/
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user