Skip to content

Commit

Permalink
Remove unused RM7000 ICR handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
vhankala committed Apr 29, 2021
1 parent 4a3da90 commit 4cab4d0
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 75 deletions.
4 changes: 2 additions & 2 deletions sys/arch/mips64/include/frame.h
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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. */
Expand Down
3 changes: 2 additions & 1 deletion sys/arch/mips64/include/pcb.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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 */
Expand Down
18 changes: 1 addition & 17 deletions sys/arch/mips64/mips64/context.S
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
/*
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 1 addition & 11 deletions sys/arch/mips64/mips64/cp0access.S
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand Down
34 changes: 1 addition & 33 deletions sys/arch/mips64/mips64/exception.S
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions sys/arch/mips64/mips64/interrupt.c
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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);

Expand Down
3 changes: 1 addition & 2 deletions sys/arch/mips64/mips64/mips64_machdep.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 2 additions & 5 deletions sys/arch/mips64/mips64/vm_machdep.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 4cab4d0

Please sign in to comment.