Changeset View
Changeset View
Standalone View
Standalone View
head/sys/arm64/include/asm.h
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
#define UINT64_C(x) (x) | #define UINT64_C(x) (x) | ||||
#if defined(PIC) | #if defined(PIC) | ||||
#define PIC_SYM(x,y) x ## @ ## y | #define PIC_SYM(x,y) x ## @ ## y | ||||
#else | #else | ||||
#define PIC_SYM(x,y) x | #define PIC_SYM(x,y) x | ||||
#endif | #endif | ||||
/* Alias for link register x30 */ | |||||
#define lr x30 | |||||
/* | /* | ||||
* Sets the trap fault handler. The exception handler will return to the | * Sets the trap fault handler. The exception handler will return to the | ||||
* address in the handler register on a data abort or the xzr register to | * address in the handler register on a data abort or the xzr register to | ||||
* clear the handler. The tmp parameter should be a register able to hold | * clear the handler. The tmp parameter should be a register able to hold | ||||
* the temporary data. | * the temporary data. | ||||
*/ | */ | ||||
#define SET_FAULT_HANDLER(handler, tmp) \ | #define SET_FAULT_HANDLER(handler, tmp) \ | ||||
ldr tmp, [x18, #PC_CURTHREAD]; /* Load curthread */ \ | ldr tmp, [x18, #PC_CURTHREAD]; /* Load curthread */ \ | ||||
ldr tmp, [tmp, #TD_PCB]; /* Load the pcb */ \ | ldr tmp, [tmp, #TD_PCB]; /* Load the pcb */ \ | ||||
str handler, [tmp, #PCB_ONFAULT] /* Set the handler */ | str handler, [tmp, #PCB_ONFAULT] /* Set the handler */ | ||||
#endif /* _MACHINE_ASM_H_ */ | #endif /* _MACHINE_ASM_H_ */ |