ARM V8 Exception Vector Table

ARM V8 Exception Vector TableAmong them, el0_sync is the entry address for system synchronous exceptions; el0_irq is the entry address for interrupt exceptions; first, look at synchronous exceptions, where el0_svc is the exception caused by the system call svc;kernel_entry 0: indicates that this is a kernel jump from el0 to el1, performing register saving for user space, mainly saved at the top of the kernel stack in cpu_resgs【31】 pc, sp, and pstatARM V8 Exception Vector TableARM V8 Exception Vector Tablesys_call_table: system call tablew8: the lower 32 bits of x8, used to pass the system call number during the system calltsk, #TSK_TI_FLAGS: this flag task’s thread_info->flags can be used to track system calls, mainly parameters like pid, etc.blr x16: jump instruction, jumps to the corresponding system call execution;ARM V8 Exception Vector TableThis is the return from the system call, the return value is placed in x0;Then use kernel_exit to restore the context of user space;Now let’s look at interrupts:ARM V8 Exception Vector TableInterrupts can also be traced, but config needs to be set up; then execute irq_handler, which is an assembly macroARM V8 Exception Vector TableARM V8 Exception Vector TableJump to a function, this function is a global pointer, so during initialization, the interrupt controller’s handling function should be initialized to this pointer, which should be a function registered for handling the interrupt controller during some interrupt controller initialization; we found one in the s3c24XX interrupt controller;ARM V8 Exception Vector TableFinally, through a series of registered callbacks;ARM V8 Exception Vector TableARM V8 Exception Vector TableARM V8 Exception Vector TableFinally found the entry point for the generic interrupt callback in the system; used to manage the data structure of registered interrupts; from here we can see that irq is mapped through the cpu regs during the interrupt through the interrupt controller; the remaining is the general interrupt handling logic at the system level; you can refer to “深入linux设备驱动程序内核机制”ARM V8 Exception Vector TableARM V8 Exception Vector TableFrom this call, if there is no task switch occurring in the kernel, returning to user space and interrupt return does not involve task switching, but in the interrupt or kernel state, it is possible to change the task’s state, thus causing task scheduling; we will understand this better when looking at task scheduling later;

Leave a Comment