From 4cab4d088292be52219d2bc81b319c8d49f72efd Mon Sep 17 00:00:00 2001 From: visa Date: Thu, 29 Apr 2021 12:49:19 +0000 Subject: [PATCH] Remove unused RM7000 ICR handling. --- sys/arch/mips64/include/frame.h | 4 +-- sys/arch/mips64/include/pcb.h | 3 ++- sys/arch/mips64/mips64/context.S | 18 +------------ sys/arch/mips64/mips64/cp0access.S | 12 +-------- sys/arch/mips64/mips64/exception.S | 34 +------------------------ sys/arch/mips64/mips64/interrupt.c | 5 +--- sys/arch/mips64/mips64/mips64_machdep.c | 3 +-- sys/arch/mips64/mips64/vm_machdep.c | 7 ++--- 8 files changed, 11 insertions(+), 75 deletions(-) diff --git a/sys/arch/mips64/include/frame.h b/sys/arch/mips64/include/frame.h index ab32612e8ee..23f90dbec51 100644 --- a/sys/arch/mips64/include/frame.h +++ b/sys/arch/mips64/include/frame.h @@ -1,4 +1,4 @@ -/* $OpenBSD: frame.h,v 1.7 2016/03/06 19:42:27 mpi Exp $ */ +/* $OpenBSD: frame.h,v 1.8 2021/04/29 12:49:19 visa Exp $ */ /* * Copyright (c) 1998-2003 Opsycon AB (www.opsycon.se) @@ -71,7 +71,7 @@ struct trapframe { register_t badvaddr; register_t cause; register_t pc; - register_t ic; + register_t ic; /* unused, was RM7000 ICR */ register_t ipl; /* From here and on, only saved user processes. */ diff --git a/sys/arch/mips64/include/pcb.h b/sys/arch/mips64/include/pcb.h index b16749101d9..aa0f1261039 100644 --- a/sys/arch/mips64/include/pcb.h +++ b/sys/arch/mips64/include/pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcb.h,v 1.8 2016/03/06 19:42:27 mpi Exp $ */ +/* $OpenBSD: pcb.h,v 1.9 2021/04/29 12:49:19 visa Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -48,6 +48,7 @@ struct pcb { struct trapframe pcb_regs; /* saved CPU and registers */ struct { + /* val[12] is unused, was RM7000 ICR */ register_t val[13]; } pcb_context; /* kernel context for resume */ int pcb_onfault; /* for copyin/copyout faults */ diff --git a/sys/arch/mips64/mips64/context.S b/sys/arch/mips64/mips64/context.S index 5ac1fec8afc..4fd81d21562 100644 --- a/sys/arch/mips64/mips64/context.S +++ b/sys/arch/mips64/mips64/context.S @@ -1,4 +1,4 @@ -/* $OpenBSD: context.S,v 1.61 2019/08/21 16:14:34 visa Exp $ */ +/* $OpenBSD: context.S,v 1.62 2021/04/29 12:49:19 visa Exp $ */ /* * Copyright (c) 2002-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -62,10 +62,6 @@ LEAF(savectx, 0) REG_S s8, PCB_CONTEXT+9*REGSZ(a0) REG_S ra, PCB_CONTEXT+10*REGSZ(a0) REG_S v0, PCB_CONTEXT+11*REGSZ(a0) -#ifdef RM7000_ICR - cfc0 t1, COP_0_ICR - REG_S t1, PCB_CONTEXT+12*REGSZ(a0) # save status register -#endif j ra move v0, zero END(savectx) @@ -146,10 +142,6 @@ NON_LEAF(cpu_switchto_asm, FRAMESZ(CF_SZ), ra) REG_S s8, PCB_CONTEXT+9*REGSZ(t3) REG_S ra, PCB_CONTEXT+10*REGSZ(t3) REG_S v0, PCB_CONTEXT+11*REGSZ(t3) -#ifdef RM7000_ICR - cfc0 t1, COP_0_ICR - REG_S t1, PCB_CONTEXT+12*REGSZ(t3) -#endif 1: /* @@ -342,10 +334,6 @@ ctx3: REG_L s8, PCB_CONTEXT+9*REGSZ(t3) REG_L ra, PCB_CONTEXT+10*REGSZ(t3) REG_L v0, PCB_CONTEXT+11*REGSZ(t3) -#ifdef RM7000_ICR - REG_L v1, PCB_CONTEXT+12*REGSZ(t3) - ctc0 v1, COP_0_ICR # XXX RM7000 -#endif ori v0, v0, SR_INT_ENAB MTC0 v0, COP_0_STATUS_REG MTC0_SR_IE_HAZARD @@ -395,10 +383,6 @@ LEAF(proc_trampoline, 0) PTR_L k0, CI_CURPROCPADDR(k1) RESTORE_CPU_SREG(k0, 0) RESTORE_REG(a0, PC, k0, 0) -#ifdef RM7000_ICR - RESTORE_REG(t0, IC, k0, 0) - ctc0 t0, COP_0_ICR -#endif RESTORE_CPU(k0, 0) RESTORE_REG(sp, SP, k0, 0) LI k0, 0 diff --git a/sys/arch/mips64/mips64/cp0access.S b/sys/arch/mips64/mips64/cp0access.S index 062293f7335..8c121b6d546 100644 --- a/sys/arch/mips64/mips64/cp0access.S +++ b/sys/arch/mips64/mips64/cp0access.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cp0access.S,v 1.21 2020/06/05 13:35:20 visa Exp $ */ +/* $OpenBSD: cp0access.S,v 1.22 2021/04/29 12:49:19 visa Exp $ */ /* * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -123,16 +123,6 @@ LEAF(updateimask, 0) lw t0, idle_mask not a0, a0 # 1 means masked so invert. and a0, t0 # never upgrade to higher than max -#ifdef RM7000_ICR - cfc0 v0, COP_0_ICR - li v1, ~IC_INT_MASK - and v1, v0 - sll v0, a0, 8 - and v0, IC_INT_MASK - and v0, a0, IC_INT_MASK - or v1, v0 - ctc0 v1, COP_0_ICR -#endif MFC0 v0, COP_0_STATUS_REG MFC0_HAZARD LI v1, ~SR_INT_MASK diff --git a/sys/arch/mips64/mips64/exception.S b/sys/arch/mips64/mips64/exception.S index e4067189fbe..81d55390492 100644 --- a/sys/arch/mips64/mips64/exception.S +++ b/sys/arch/mips64/mips64/exception.S @@ -1,4 +1,4 @@ -/* $OpenBSD: exception.S,v 1.41 2021/02/11 14:44:13 visa Exp $ */ +/* $OpenBSD: exception.S,v 1.42 2021/04/29 12:49:19 visa Exp $ */ /* * Copyright (c) 2002-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -199,10 +199,6 @@ NNON_LEAF(k_intr, FRAMESZ(KERN_EXC_FRAME_SIZE), ra) .mask 0x80000000, (CF_RA_OFFS - FRAMESZ(KERN_EXC_FRAME_SIZE)) PTR_SUB k0, sp, FRAMESZ(KERN_EXC_FRAME_SIZE) SAVE_CPU(k0, CF_RA_OFFS) -#ifdef RM7000_ICR - cfc0 v1, COP_0_ICR - SAVE_REG(v1, IC, k0, CF_RA_OFFS) -#endif .set at move sp, k0 # Already on kernel stack and t0, a1, ~(SR_COP_1_BIT | SR_EXL | SR_INT_ENAB | SR_KSU_MASK) @@ -214,10 +210,6 @@ NNON_LEAF(k_intr, FRAMESZ(KERN_EXC_FRAME_SIZE), ra) PTR_L a0, CF_RA_OFFS + KERN_REG_SIZE(sp) .set noat -#ifdef RM7000_ICR - RESTORE_REG(t0, IC, sp, CF_RA_OFFS) - ctc0 t0, COP_0_ICR -#endif RESTORE_CPU(sp, CF_RA_OFFS) PTR_ADDU sp, sp, FRAMESZ(KERN_EXC_FRAME_SIZE) ERET @@ -236,10 +228,6 @@ NNON_LEAF(u_intr, FRAMESZ(CF_SZ), ra) GET_CPU_INFO(k1, k0) PTR_L k0, CI_CURPROCPADDR(k1) SAVE_CPU(k0, 0) -#ifdef RM7000_ICR - cfc0 v1, COP_0_ICR - SAVE_REG(v1, IC, k0, 0) -#endif PTR_ADDU sp, k0, USPACE-FRAMESZ(CF_SZ) .set at and t0, a1, ~(SR_COP_1_BIT | SR_EXL | SR_INT_ENAB | SR_KSU_MASK) @@ -295,10 +283,6 @@ NNON_LEAF(u_intr, FRAMESZ(CF_SZ), ra) sw a3, CI_IPL(k1) .set noat RESTORE_REG(a0, PC, k0, 0) -#ifdef RM7000_ICR - RESTORE_REG(t0, IC, k0, 0) - ctc0 t0, COP_0_ICR -#endif RESTORE_CPU(k0, 0) RESTORE_REG(sp, SP, k0, 0) LI k0, 0 @@ -317,10 +301,6 @@ NNON_LEAF(k_general, FRAMESZ(KERN_EXC_FRAME_SIZE), ra) .mask 0x80000000, (CF_RA_OFFS - FRAMESZ(KERN_EXC_FRAME_SIZE)) PTR_SUB k0, sp, FRAMESZ(KERN_EXC_FRAME_SIZE) SAVE_CPU(k0, CF_RA_OFFS) -#ifdef RM7000_ICR - cfc0 v1, COP_0_ICR - SAVE_REG(v1, IC, k0, CF_RA_OFFS) -#endif #if defined(DDB) SAVE_CPU_SREG(k0, CF_RA_OFFS) #endif @@ -340,10 +320,6 @@ NNON_LEAF(k_general, FRAMESZ(KERN_EXC_FRAME_SIZE), ra) MTC0_SR_IE_HAZARD .set noat -#ifdef RM7000_ICR - RESTORE_REG(t0, IC, sp, CF_RA_OFFS) - ctc0 t0, COP_0_ICR -#endif RESTORE_REG(a0, PC, sp, CF_RA_OFFS) RESTORE_CPU(sp, CF_RA_OFFS) PTR_ADDU sp, sp, FRAMESZ(KERN_EXC_FRAME_SIZE) @@ -361,10 +337,6 @@ NNON_LEAF(u_general, FRAMESZ(CF_SZ), ra) GET_CPU_INFO(k1, k0) PTR_L k0, CI_CURPROCPADDR(k1) SAVE_CPU(k0, 0) -#ifdef RM7000_ICR - cfc0 v1, COP_0_ICR - SAVE_REG(v1, IC, k0, 0) -#endif SAVE_CPU_SREG(k0, 0) PTR_ADDU sp, k0, USPACE-FRAMESZ(CF_SZ) .set at @@ -412,10 +384,6 @@ NNON_LEAF(u_general, FRAMESZ(CF_SZ), ra) .set noat RESTORE_CPU_SREG(k0, 0) RESTORE_REG(a0, PC, k0, 0) -#ifdef RM7000_ICR - RESTORE_REG(t0, IC, k0, 0) - ctc0 t0, COP_0_ICR -#endif RESTORE_CPU(k0, 0) RESTORE_REG(sp, SP, k0, 0) LI k0, 0 diff --git a/sys/arch/mips64/mips64/interrupt.c b/sys/arch/mips64/mips64/interrupt.c index 764d887b5c5..56790da6a98 100644 --- a/sys/arch/mips64/mips64/interrupt.c +++ b/sys/arch/mips64/mips64/interrupt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interrupt.c,v 1.73 2019/09/05 05:31:38 visa Exp $ */ +/* $OpenBSD: interrupt.c,v 1.74 2021/04/29 12:49:19 visa Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -203,9 +203,6 @@ splinit() /* * Update proc0 pcb to contain proper values. */ -#ifdef RM7000_ICR - pcb->pcb_context.val[12] = (idle_mask << 8) & IC_INT_MASK; -#endif pcb->pcb_context.val[11] = (pcb->pcb_regs.sr & ~SR_INT_MASK) | (idle_mask & SR_INT_MASK); diff --git a/sys/arch/mips64/mips64/mips64_machdep.c b/sys/arch/mips64/mips64/mips64_machdep.c index 9b286c4cbd4..1803d0bbd60 100644 --- a/sys/arch/mips64/mips64/mips64_machdep.c +++ b/sys/arch/mips64/mips64/mips64_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mips64_machdep.c,v 1.35 2021/02/23 04:44:30 cheloha Exp $ */ +/* $OpenBSD: mips64_machdep.c,v 1.36 2021/04/29 12:49:19 visa Exp $ */ /* * Copyright (c) 2009, 2010, 2012 Miodrag Vallat. @@ -151,7 +151,6 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, p->p_md.md_regs->pc = pack->ep_entry & ~3; p->p_md.md_regs->t9 = pack->ep_entry & ~3; /* abicall req */ p->p_md.md_regs->sr = protosr | (idle_mask & SR_INT_MASK); - p->p_md.md_regs->ic = (idle_mask << 8) & IC_INT_MASK; if (CPU_HAS_FPU(ci)) p->p_md.md_flags &= ~MDP_FPUSED; if (ci->ci_fpuproc == p) diff --git a/sys/arch/mips64/mips64/vm_machdep.c b/sys/arch/mips64/mips64/vm_machdep.c index 824c01e339c..2a93303d13e 100644 --- a/sys/arch/mips64/mips64/vm_machdep.c +++ b/sys/arch/mips64/mips64/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.39 2019/12/20 13:34:41 visa Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.40 2021/04/29 12:49:19 visa Exp $ */ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1992, 1993 @@ -124,12 +124,9 @@ cpu_fork(struct proc *p1, struct proc *p2, void *stack, void *tcb, /* * Copy the process control block to the new proc and * create a clean stack for exit through trampoline. - * pcb_context has s0-s7, sp, s8, ra, sr, icr. + * pcb_context has s0-s7, sp, s8, ra, sr. */ if (p1 != curproc) { -#ifdef RM7000_ICR - pcb->pcb_context.val[12] = (idle_mask << 8) & IC_INT_MASK; -#endif pcb->pcb_context.val[11] = (pcb->pcb_regs.sr & ~SR_INT_MASK) | (idle_mask & SR_INT_MASK); } -- 2.20.1