diff --git a/base/usr/include/kernel/process.h b/base/usr/include/kernel/process.h index 113be127..29cb5b61 100644 --- a/base/usr/include/kernel/process.h +++ b/base/usr/include/kernel/process.h @@ -117,7 +117,6 @@ typedef struct process { tree_node_t * tree_entry; struct regs * syscall_registers; - struct regs * interrupt_registers; list_t * wait_queue; list_t * shm_mappings; list_t * node_waits; @@ -202,8 +201,6 @@ struct ProcessorLocal { int cpu_id; union PML * current_pml; - struct regs * interrupt_registers; - #ifdef __x86_64__ int lapic_id; /* Processor information loaded at startup. */ diff --git a/kernel/arch/x86_64/idt.c b/kernel/arch/x86_64/idt.c index 62bae8d6..89444931 100644 --- a/kernel/arch/x86_64/idt.c +++ b/kernel/arch/x86_64/idt.c @@ -678,7 +678,6 @@ struct regs * isr_handler_inner(struct regs * r) { struct regs * isr_handler(struct regs * r) { int from_userspace = r->cs != 0x08; - this_core->interrupt_registers = r; if (from_userspace && this_core->current_process) { this_core->current_process->time_switch = arch_perf_timer(); diff --git a/kernel/sys/ptrace.c b/kernel/sys/ptrace.c index 7153e1b9..f5bcece3 100644 --- a/kernel/sys/ptrace.c +++ b/kernel/sys/ptrace.c @@ -248,10 +248,6 @@ long ptrace_detach(pid_t pid, int sig) { * Copies the interrupt register context of the tracee into a tracer-provided * address. The size, meaning, and layout of the data copied is architecture-dependent. * - * Currently this is either @c interrupt_registers or @c syscall_registers, depending - * on what is available. Since the tracee needs to be suspended this should represent - * the actual userspace register context when it resumes. - * * On AArch64 we also add ELR, which isn't in the interrupt or syscall register contexts, * but pushed somewhere else... * @@ -268,7 +264,7 @@ long ptrace_getregs(pid_t pid, void * data) { if (!tracee || (tracee->tracer != this_core->current_process->id) || !(tracee->flags & PROC_FLAG_SUSPENDED)) return -ESRCH; /* Copy registers */ - memcpy(data, tracee->interrupt_registers ? tracee->interrupt_registers : tracee->syscall_registers, sizeof(struct regs)); + memcpy(data, tracee->syscall_registers, sizeof(struct regs)); #ifdef __aarch64__ memcpy((char*)data + sizeof(struct regs), &tracee->thread.context.saved[10], sizeof(uintptr_t)); #endif @@ -398,7 +394,7 @@ long ptrace_singlestep(pid_t pid, int sig) { /* arch_set_singlestep? */ #if defined(__x86_64__) - struct regs * target = tracee->interrupt_registers ? tracee->interrupt_registers : tracee->syscall_registers; + struct regs * target = tracee->syscall_registers; target->rflags |= (1 << 8); #elif defined(__aarch64__) tracee->thread.context.saved[11] |= (1 << 21);