/DragonOS/kernel/src/arch/x86_64/interrupt/ |
H A D | trap.rs | 115 unsafe extern "C" fn do_divide_error(regs: &'static TrapFrame, error_code: u64) { in do_divide_error() 119 regs.rsp, in do_divide_error() 120 regs.rip, in do_divide_error() 129 unsafe extern "C" fn do_debug(regs: &'static mut TrapFrame, error_code: u64) { in do_debug() 133 regs.rsp, in do_debug() 134 regs.rip, in do_debug() 138 DebugException::handle(regs).unwrap(); in do_debug() 143 unsafe extern "C" fn do_nmi(regs: &'static TrapFrame, error_code: u64) { in do_nmi() 147 regs.rsp, in do_nmi() 148 regs.rip, in do_nmi() [all …]
|
/DragonOS/kernel/src/arch/riscv64/process/ |
H A D | syscall.rs | 13 regs: &mut TrapFrame, in arch_do_execve() 21 regs.a0 = param.init_info().args.len(); in arch_do_execve() 22 regs.a1 = argv_ptr.data(); in arch_do_execve() 25 regs.sp = user_sp.data(); in arch_do_execve() 27 regs.epc = load_result.entry_point().data(); in arch_do_execve() 28 regs.status.update_spp(SPP::User); in arch_do_execve() 29 regs.status.update_fs(FS::Clean); in arch_do_execve() 30 regs.status.update_sum(true); in arch_do_execve()
|
H A D | mod.rs | 424 fn save(&mut self, regs: &mut TrapFrame) { in save() 425 if regs.status.fs() == riscv::register::sstatus::FS::Dirty { in save() 427 self.do_clean(regs); in save() 431 fn restore(&mut self, regs: &mut TrapFrame) { in restore() 432 if regs.status.fs() != riscv::register::sstatus::FS::Off { in restore() 434 self.do_clean(regs); in restore() 438 fn do_clean(&mut self, regs: &mut TrapFrame) { in do_clean() 439 regs.status.update_fs(riscv::register::sstatus::FS::Clean); in do_clean()
|
/DragonOS/kernel/src/arch/x86_64/process/ |
H A D | syscall.rs | 19 regs: &mut TrapFrame, in arch_do_execve() 29 regs.rdi = param.init_info().args.len() as u64; in arch_do_execve() 30 regs.rsi = argv_ptr.data() as u64; in arch_do_execve() 34 regs.rsp = user_sp.data() as u64; in arch_do_execve() 35 regs.rbp = user_sp.data() as u64; in arch_do_execve() 36 regs.rip = load_result.entry_point().data() as u64; in arch_do_execve() 38 regs.cs = USER_CS.bits() as u64; in arch_do_execve() 39 regs.ds = USER_DS.bits() as u64; in arch_do_execve() 40 regs.ss = USER_DS.bits() as u64; in arch_do_execve() 41 regs.es = 0; in arch_do_execve() [all …]
|
/DragonOS/kernel/src/debug/kprobe/ |
H A D | test.rs | 14 fn pre_handler(regs: &dyn ProbeArgs) { in pre_handler() 15 let pt_regs = regs.as_any().downcast_ref::<TrapFrame>().unwrap(); in pre_handler() 22 fn post_handler(regs: &dyn ProbeArgs) { in post_handler() 23 let pt_regs = regs.as_any().downcast_ref::<TrapFrame>().unwrap(); in post_handler() 30 fn fault_handler(regs: &dyn ProbeArgs) { in fault_handler() 31 let pt_regs = regs.as_any().downcast_ref::<TrapFrame>().unwrap(); in fault_handler() 52 let new_pre_handler = |regs: &dyn ProbeArgs| { in kprobe_test() 53 let pt_regs = regs.as_any().downcast_ref::<TrapFrame>().unwrap(); in kprobe_test()
|
/DragonOS/kernel/src/debug/traceback/ |
H A D | traceback.c | 47 void traceback(struct pt_regs *regs) in traceback() argument 50 if (verify_area(regs->rbp, 0)) in traceback() 52 …K, "Kernel traceback: Fault in userland. pid=%ld, rbp=%#018lx\n", rs_current_pcb_pid(), regs->rbp); in traceback() 56 uint64_t *rbp = (uint64_t *)regs->rbp; in traceback() 63 uint64_t ret_addr = regs->rip; in traceback() 72 if ((uint64_t)(rbp) >= rs_current_pcb_thread_rbp() || ((uint64_t)rbp < regs->rsp)) in traceback()
|
H A D | traceback.h | 17 void traceback(struct pt_regs *regs);
|
/DragonOS/kernel/src/arch/x86_64/driver/ |
H A D | hpet.rs | 122 let (inner_guard, regs) = unsafe { self.hpet_regs_mut() }; in hpet_enable() 123 let freq = regs.frequency(); in hpet_enable() 130 if unlikely(regs.timers_num() == 0) { in hpet_enable() 134 unsafe { regs.write_main_counter_value(0) }; in hpet_enable() 159 let (inner_guard, regs) = unsafe { self.hpet_regs_mut() }; in hpet_enable() 162 unsafe { regs.write_general_config(3) }; in hpet_enable() 218 let regs = unsafe { inner.registers_ptr.as_ref() }; in hpet_regs() localVariable 219 return (inner, regs); in hpet_regs() 224 let regs = unsafe { inner.registers_ptr.as_mut() }; in hpet_regs_mut() localVariable 225 return (inner, regs); in hpet_regs_mut() [all …]
|
/DragonOS/user/apps/test_kvm/ |
H A D | main.c | 104 struct kvm_regs regs = {0}; in main() local 105 regs.rip = user_entry; in main() 106 regs.rsp = 0x3000; // stack address in main() 107 regs.rflags = 0x2; // in x86 the 0x2 bit should always be set in main() 108 ioctl(vcpufd, KVM_SET_REGS, ®s); // set registers in main()
|
/DragonOS/kernel/src/arch/x86_64/mm/ |
H A D | fault.rs | 71 regs: &'static TrapFrame, in show_fault_oops() 88 if address.data() < X86_64MMArch::PAGE_SIZE && !regs.is_from_user() { in show_fault_oops() 114 if regs.is_from_user() { in show_fault_oops() 136 regs: &'static TrapFrame, in page_fault_oops() 140 if regs.is_from_user() { in page_fault_oops() 141 Self::show_fault_oops(regs, error_code, address); in page_fault_oops() 176 regs: &'static TrapFrame, in do_user_addr_fault() 180 let rflags = RFlags::from_bits_truncate(regs.rflags); in do_user_addr_fault() 188 Self::page_fault_oops(regs, error_code, address); in do_user_addr_fault() 199 Self::page_fault_oops(regs, error_code, address); in do_user_addr_fault() [all …]
|
/DragonOS/kernel/src/process/ |
H A D | ptrace.h | 39 static inline int user_mode(struct pt_regs *regs) in user_mode() argument 41 return !!(regs->cs & 3); in user_mode()
|
H A D | syscall.rs | 156 regs: &mut TrapFrame, in do_execve() 197 Self::arch_do_execve(regs, ¶m, &load_result, user_sp, argv_ptr) in do_execve()
|
/DragonOS/docs/kernel/debug/ |
H A D | traceback.md | 11 ### `void traceback(struct pt_regs * regs)` 19 ##### regs l4subsection
|
/DragonOS/kernel/crates/rbpf/src/ |
H A D | stack.rs | 47 pub fn save_registers(&mut self, regs: &[u64]) { in save_registers() 48 self.saved_registers.copy_from_slice(regs); in save_registers()
|
/DragonOS/kernel/src/arch/riscv64/syscall/ |
H A D | mod.rs | 15 ($val:expr, $regs:expr, $show:expr) => {{ 17 $regs.a0 = ret;
|
/DragonOS/kernel/src/driver/irqchip/ |
H A D | riscv_sifive_plic.rs | 76 regs: VirtAddr, field 83 regs: VirtAddr, in new() 90 regs, in new() 269 (plic_chip_data.regs in irq_unmask() 292 (plic_chip_data.regs in irq_mask() 494 (priv_data.regs + PlicIrqChip::PRIORITY_BASE + x * PlicIrqChip::PRIORITY_PER_ID) in do_riscv_sifive_plic_init() 520 priv_data.regs + PlicIrqChip::CONTEXT_BASE + i * PlicIrqChip::CONTEXT_SIZE; in do_riscv_sifive_plic_init() 521 handler_inner.enable_base = priv_data.regs in do_riscv_sifive_plic_init()
|
/DragonOS/kernel/src/arch/x86_64/syscall/ |
H A D | mod.rs | 50 ($val:expr, $regs:expr, $show:expr) => {{ 52 $regs.rax = ret as u64;
|
/DragonOS/user/apps/test_ebpf/syscall_ebpf/syscall_ebpf-ebpf/src/ |
H A D | main.rs | 16 &*ctx.regs in try_syscall_ebpf()
|
/DragonOS/kernel/src/arch/x86_64/kvm/vmx/ |
H A D | vcpu.rs | 64 pub regs: [usize; NR_VCPU_REGS], // 通用寄存器 field 160 regs: [0; NR_VCPU_REGS], in new() 254 self.vcpu_ctx.regs[VcpuRegIndex::Rsp as usize] as u64, in vmcs_init_guest() 260 self.vcpu_ctx.regs[VcpuRegIndex::Rsp as usize] as u64 in vmcs_init_guest() 410 pub fn set_regs(&mut self, regs: VcpuContextFrame) -> Result<(), SystemError> { in set_regs() 411 self.vcpu_ctx = regs; in set_regs()
|
/DragonOS/kernel/src/virt/kvm/ |
H A D | vcpu_dev.rs | 183 kvm_regs.rip, kvm_regs.rflags, kvm_regs.regs[6], kvm_regs.regs[0], in ioctl()
|
/DragonOS/docs/community/ChangeLog/V0.1.x/ |
H A D | V0.1.9.md | 1468 * refactor segment regs initialization
|