From e786f1bc9e99d14d7ff6a938e84c5bfe448c84a5 Mon Sep 17 00:00:00 2001 From: miod Date: Mon, 8 Apr 2024 20:07:53 +0000 Subject: [PATCH] Remove unused tf_fault and tf_kstack members from struct trapframe. These fields were (seldom) written to but never used for anything. ok kettenis@ --- sys/arch/sparc64/include/frame.h | 10 ++-------- sys/arch/sparc64/sparc64/db_trace.c | 7 +++---- sys/arch/sparc64/sparc64/genassym.cf | 4 +--- sys/arch/sparc64/sparc64/locore.s | 11 ++++------- 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/sys/arch/sparc64/include/frame.h b/sys/arch/sparc64/include/frame.h index 8d9542356f4..a5e39c6d0c9 100644 --- a/sys/arch/sparc64/include/frame.h +++ b/sys/arch/sparc64/include/frame.h @@ -1,4 +1,4 @@ -/* $OpenBSD: frame.h,v 1.10 2024/03/29 21:04:37 miod Exp $ */ +/* $OpenBSD: frame.h,v 1.11 2024/04/08 20:07:53 miod Exp $ */ /* $NetBSD: frame.h,v 1.9 2001/03/04 09:28:35 mrg Exp $ */ /* @@ -84,18 +84,12 @@ struct frame { #define v9next_frame(f) ((struct frame*)(f->fr_fp+BIAS)) /* - * The v9 trapframe. Since we don't get a free register window with - * each trap we need some way to keep track of pending traps. We use - * tf_fault to save the faulting address for memory faults and tf_kstack - * to thread trapframes on the kernel stack(s). If tf_kstack == 0 then - * this is the lowest level trap; we came from user mode. + * The v9 trapframe. */ struct trapframe { int64_t tf_tstate; /* tstate register */ int64_t tf_pc; /* return pc */ int64_t tf_npc; /* return npc */ - int64_t tf_fault; /* faulting addr -- need somewhere to save it */ - int64_t tf_kstack; /* kernel stack of prev tf */ int tf_y; /* %y register -- 32-bits */ short tf_tt; /* What type of trap this was */ char tf_pil; /* What IRQ we're handling */ diff --git a/sys/arch/sparc64/sparc64/db_trace.c b/sys/arch/sparc64/sparc64/db_trace.c index 4ca435b68a7..d00ef526a52 100644 --- a/sys/arch/sparc64/sparc64/db_trace.c +++ b/sys/arch/sparc64/sparc64/db_trace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_trace.c,v 1.26 2024/02/13 09:29:39 claudio Exp $ */ +/* $OpenBSD: db_trace.c,v 1.27 2024/04/08 20:07:53 miod Exp $ */ /* $NetBSD: db_trace.c,v 1.23 2001/07/10 06:06:16 eeh Exp $ */ /* @@ -299,10 +299,9 @@ db_dump_trap(db_expr_t addr, int have_addr, db_expr_t count, char *modif) tf, (unsigned long long)tf->tf_tstate, (unsigned long long)tf->tf_pc, (unsigned long long)tf->tf_npc); - db_printf("y: %x\tpil: %d\toldpil: %d\tfault: %llx\tkstack: %llx\ttt: %x\nGlobals:\n", + db_printf("y: %x\tpil: %d\toldpil: %d\ttt: %x\nGlobals:\n", (int)tf->tf_y, (int)tf->tf_pil, (int)tf->tf_oldpil, - (unsigned long long)tf->tf_fault, - (unsigned long long)tf->tf_kstack, (int)tf->tf_tt); + (int)tf->tf_tt); db_printf("%016llx %016llx %016llx %016llx\n", (unsigned long long)tf->tf_global[0], (unsigned long long)tf->tf_global[1], diff --git a/sys/arch/sparc64/sparc64/genassym.cf b/sys/arch/sparc64/sparc64/genassym.cf index ec32585dd56..3ca1274764e 100644 --- a/sys/arch/sparc64/sparc64/genassym.cf +++ b/sys/arch/sparc64/sparc64/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.44 2024/03/29 21:27:53 miod Exp $ +# $OpenBSD: genassym.cf,v 1.45 2024/04/08 20:07:53 miod Exp $ # $NetBSD: genassym.cf,v 1.23 2001/08/08 00:09:30 eeh Exp $ # @@ -167,8 +167,6 @@ struct trapframe member tf_tstate member tf_pc member tf_npc -member tf_fault -member tf_kstack member tf_y member tf_pil member tf_oldpil diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s index 0ad706197c3..e3d67e37e29 100644 --- a/sys/arch/sparc64/sparc64/locore.s +++ b/sys/arch/sparc64/sparc64/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.219 2024/04/08 20:07:07 miod Exp $ */ +/* $OpenBSD: locore.s,v 1.220 2024/04/08 20:07:53 miod Exp $ */ /* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */ /* @@ -1805,7 +1805,6 @@ datafault: TRAP_SETUP -CC64FSZ-TF_SIZE Ldatafault_internal: INCR uvmexp+V_FAULTS ! uvmexp.faults++ (clobbers %o0,%o1,%o2) should not fault -! ldx [%sp + CC64FSZ + BIAS + TF_FAULT], %g1 ! DEBUG make sure this has not changed mov %g1, %o0 ! Move these to the out regs so we can save the globals mov %g2, %o4 mov %g3, %o5 @@ -2835,10 +2834,9 @@ softtrap: GET_CPCB(%g7) set USPACE-CC64FSZ-TF_SIZE-BIAS, %g5 add %g7, %g5, %g6 - stx %g1, [%g6 + CC64FSZ + BIAS + TF_FAULT] ! Generate a new trapframe - stx %i0, [%g6 + CC64FSZ + BIAS + TF_O + (0*8)] ! but don't bother with - stx %i1, [%g6 + CC64FSZ + BIAS + TF_O + (1*8)] ! locals and ins - stx %i2, [%g6 + CC64FSZ + BIAS + TF_O + (2*8)] + stx %i0, [%g6 + CC64FSZ + BIAS + TF_O + (0*8)] ! Generate a new trapframe + stx %i1, [%g6 + CC64FSZ + BIAS + TF_O + (1*8)] ! but don't bother with + stx %i2, [%g6 + CC64FSZ + BIAS + TF_O + (2*8)] ! locals and ins stx %i3, [%g6 + CC64FSZ + BIAS + TF_O + (3*8)] stx %i4, [%g6 + CC64FSZ + BIAS + TF_O + (4*8)] stx %i5, [%g6 + CC64FSZ + BIAS + TF_O + (5*8)] @@ -3356,7 +3354,6 @@ sparc_interrupt: stx %l1, [%sp + CC64FSZ + BIAS + TF_PC] btst TSTATE_PRIV, %l0 ! User mode? stx %l2, [%sp + CC64FSZ + BIAS + TF_NPC] - stx %fp, [%sp + CC64FSZ + BIAS + TF_KSTACK] ! old frame pointer sub %l5, 0x40, %l6 ! Convert to interrupt level stb %l6, [%sp + CC64FSZ + BIAS + TF_PIL] ! set up intrframe/clockframe -- 2.20.1