call riscv_v_context_nesting_start#endifmove a0, sp/*pt_regs*//** MSB of cause differentiates between * interrupts and exceptions*/bge s4, zero, 1f--bge的s4是有符号数,根据scause寄存器如果是中断则MSB为1,即负值。所以大于等于0,则是异常。/*Handle interrupts*/call do_irq--进行中断处理。j...
handler_s(size_tscause,size_tsepc,uintptr_t*regs); 此处的regs概念对应linux中的pt_regs,将上下文内容所在的地址传入处理函数。 为S模式异常处理函数添加系统调用的处理逻辑,从a7中获得当前系统调用号,从a0 - a5中获得系统调用相关的参数,本次实验中要求实现的系统调用分别为:172号系统调用SYS_GETPID,64号系统...
addi sp, sp, -(PT_SIZE_ON_STACK) /* 把通用寄存器保存到栈中 */ REG_S x1, PT_RA(sp) /* ra寄存器 */ REG_S x3, PT_GP(sp) /* gp寄存器 */ REG_S x5, PT_T0(sp) /* t0寄存器 */ REG_S x6, PT_T1(sp) /* t1寄存器 */ REG_S x7, PT_T2(sp) /* t2寄存器 */ REG_S ...
"statements"是汇编语句模板;output_regs是内联汇编的输出部分,可以理解为将要被汇编语句修改的寄存器组;input_regs是内联汇编的输入部分,即语句执行所需要的输入寄存器;clobbered_regs是破坏描述部分,代表将要被汇编语句改变(破坏)的内容。扩展内联汇编中汇编语句模版是必须要的,其它3部分则都是可选内容,以下对这些部分...
_sys_regs.sail Original file line numberDiff line numberDiffline change @@ -108,6 +108,11 @@ val sys_enable_vext = {c: "sysenable_vext", ocaml: "Platform.enable_vext", _: " /* whethermisa.b was enabled at boot */ val sys_enable_bext = {c: "sys_enable_bext", ocaml...
static void __maybe_unused show_backtrace(struct pt_regs *regs) { uintptr_t *fp = (uintptr_t *)regs->s0; unsigned count = 0; ulong ra; printf("backtrace:\n"); printf("\nbacktrace:\n"); /* there are a few entry points where the s0 register is * set to gd, so to avoid ...
@@ -343,6 +343,46 @@ struct regs_struct { #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3] #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4] #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5] + +#elif defined(__riscv) +struct regs_struct { + unsigned long regs...
chapter2 Instructions: Language of the Computer 秉承着计算机专家的一贯思路,首先介绍一下子指令;顺序一般是从简单到复杂,从普通到特殊; 主要有如下章节: 2.1 Introduction 2.2 Operations of the Computer Hardware 2.3 Operands of the Computer Hardware
Drop eviction lock when allocating PT BO - arm64: dts: rockchip: fix quartz64-a bluetooth configuration - power: supply: ip5xxx: Fix integer overflow in current_now calculation - power: supply: ab8500: Defer thermal zone probe - arm64: dts: rockchip: Fix Pine64 Quartz4-B PMIC interrupt...
irq_regs.h /usr/src/linux-headers-5.19.0-1019-generic/arch/riscv/include/generated/asm/kmap_size.h /usr/src/linux-headers-5.19.0-1019-generic/arch/riscv/include/generated/asm/kvm_para.h /usr/src/linux-headers-5.19.0-1019-generic/arch/riscv/include/generated/asm/local.h /usr/src/...