diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-10-22 18:46:49 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-10-22 18:46:49 +0000 |
commit | 59d8e7c7d9249e6cea9e3a8902a3abd9c05372ad (patch) | |
tree | 71c95be1d7796e3b2ef31b668f60a6abe34a7823 | |
parent | fbffcfc1ed227feb0a2bd7f1ba8837ebc7d5c38f (diff) |
Change the #define controlling use of RM7k/RM9k coprocessor 0 ICR to
RM7000_ICR, instead of IMASK_EXTERNAL, since they are actually different
concepts. This code remains disabled since RM7000_ICR is not defined anywhere
at the moment.
-rw-r--r-- | sys/arch/mips64/mips64/context.S | 8 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/cp0access.S | 4 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/exception.S | 22 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/interrupt.c | 4 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/vm_machdep.c | 4 |
5 files changed, 23 insertions, 19 deletions
diff --git a/sys/arch/mips64/mips64/context.S b/sys/arch/mips64/mips64/context.S index d0ea024c45b..a6f26117414 100644 --- a/sys/arch/mips64/mips64/context.S +++ b/sys/arch/mips64/mips64/context.S @@ -1,4 +1,4 @@ -/* $OpenBSD: context.S,v 1.28 2009/10/22 18:31:51 miod Exp $ */ +/* $OpenBSD: context.S,v 1.29 2009/10/22 18:46:48 miod Exp $ */ /* * Copyright (c) 2002-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -62,7 +62,7 @@ LEAF(savectx, 0) REG_S v0, PCB_CONTEXT+11*REGSZ(a0) GET_CPU_INFO(t0, t1) lw t0, CI_CPL(t0) -#ifndef IMASK_EXTERNAL +#ifdef RM7000_ICR cfc0 t1, COP_0_ICR REG_S t1, PCB_CONTEXT+12*REGSZ(a0) # save status register #endif @@ -129,7 +129,7 @@ NON_LEAF(cpu_switchto, 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) -#ifndef IMASK_EXTERNAL +#ifdef RM7000_ICR cfc0 t1, COP_0_ICR REG_S t1, PCB_CONTEXT+12*REGSZ(t3) #endif @@ -291,7 +291,7 @@ ctx3: REG_L a0, PCB_CONTEXT+13*REGSZ(t3) REG_L ra, PCB_CONTEXT+10*REGSZ(t3) REG_L v0, PCB_CONTEXT+11*REGSZ(t3) -#ifndef IMASK_EXTERNAL +#ifdef RM7000_ICR REG_L v1, PCB_CONTEXT+12*REGSZ(t3) ctc0 v1, COP_0_ICR # XXX RM7000 #endif diff --git a/sys/arch/mips64/mips64/cp0access.S b/sys/arch/mips64/mips64/cp0access.S index 9495679be34..d28fd8a7ba4 100644 --- a/sys/arch/mips64/mips64/cp0access.S +++ b/sys/arch/mips64/mips64/cp0access.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cp0access.S,v 1.9 2009/05/22 20:37:53 miod Exp $ */ +/* $OpenBSD: cp0access.S,v 1.10 2009/10/22 18:46:48 miod Exp $ */ /* * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -111,7 +111,7 @@ LEAF(updateimask, 0) lw t0, idle_mask not a0, a0 # 1 means masked so invert. and a0, t0 # never upgrade to higher than max -#ifndef IMASK_EXTERNAL +#ifdef RM7000_ICR cfc0 v0, COP_0_ICR li v1, ~IC_INT_MASK and v1, v0 diff --git a/sys/arch/mips64/mips64/exception.S b/sys/arch/mips64/mips64/exception.S index 6e49be298a5..f4d69d3fe59 100644 --- a/sys/arch/mips64/mips64/exception.S +++ b/sys/arch/mips64/mips64/exception.S @@ -1,4 +1,4 @@ -/* $OpenBSD: exception.S,v 1.24 2009/10/22 18:21:40 miod Exp $ */ +/* $OpenBSD: exception.S,v 1.25 2009/10/22 18:46:48 miod Exp $ */ /* * Copyright (c) 2002-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -173,7 +173,7 @@ 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) -#if 0 +#ifdef RM7000_ICR cfc0 v1, COP_0_ICR SAVE_REG(v1, IC, k0, CF_RA_OFFS) #endif @@ -199,7 +199,7 @@ NNON_LEAF(k_intr, FRAMESZ(KERN_EXC_FRAME_SIZE), ra) PTR_L a0, CF_RA_OFFS + KERN_REG_SIZE(sp) .set noat -#if 0 +#ifdef RM7000_ICR RESTORE_REG(t0, IC, sp, CF_RA_OFFS) ctc0 t0, COP_0_ICR #endif @@ -222,7 +222,7 @@ NNON_LEAF(u_intr, FRAMESZ(CF_SZ), ra) GET_CPU_INFO(k1, k0) PTR_L k0, CI_CURPROCPADDR(k1) SAVE_CPU(k0, 0) -#if 0 +#ifdef RM7000_ICR cfc0 v1, COP_0_ICR SAVE_REG(v1, IC, k0, 0) #endif @@ -333,7 +333,7 @@ NNON_LEAF(u_intr, FRAMESZ(CF_SZ), ra) sw a3, CI_CPL(k1) .set noat RESTORE_REG(a0, PC, k0, 0) -#if 0 +#ifdef RM7000_ICR RESTORE_REG(t0, IC, k0, 0) ctc0 t0, COP_0_ICR #endif @@ -356,7 +356,7 @@ 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) -#if 0 +#ifdef RM7000_ICR cfc0 v1, COP_0_ICR SAVE_REG(v1, IC, k0, CF_RA_OFFS) #endif @@ -380,7 +380,7 @@ NNON_LEAF(k_general, FRAMESZ(KERN_EXC_FRAME_SIZE), ra) ITLBNOPFIX .set noat -#if 0 +#ifdef RM7000_ICR RESTORE_REG(t0, IC, sp, CF_RA_OFFS) ctc0 t0, COP_0_ICR #endif @@ -402,7 +402,7 @@ NNON_LEAF(u_general, FRAMESZ(CF_SZ), ra) GET_CPU_INFO(k1, k0) PTR_L k0, CI_CURPROCPADDR(k1) SAVE_CPU(k0, 0) -#if 0 +#ifdef RM7000_ICR cfc0 v1, COP_0_ICR SAVE_REG(v1, IC, k0, 0) #endif @@ -495,7 +495,7 @@ NNON_LEAF(u_general, FRAMESZ(CF_SZ), ra) .set noat RESTORE_CPU_SREG(k0, 0) RESTORE_REG(a0, PC, k0, 0) -#if 0 +#ifdef RM7000_ICR RESTORE_REG(t0, IC, k0, 0) ctc0 t0, COP_0_ICR #endif @@ -534,7 +534,7 @@ LEAF(proc_trampoline, 0) jal s0 move a0,s1 # invoke callback. -#if 0 +#if 0 /* && defined(RM7000_ICR) */ lw t0, cpu_is_rm7k beqz t0, 1f # not an RM7K. Don't do IC reg. @@ -572,7 +572,7 @@ LEAF(proc_trampoline, 0) PTR_L k0, CI_CURPROCPADDR(k1) RESTORE_CPU_SREG(k0, 0) RESTORE_REG(a0, PC, k0, 0) -#if 0 +#ifdef RM7000_ICR RESTORE_REG(t0, IC, k0, 0) ctc0 t0, COP_0_ICR #endif diff --git a/sys/arch/mips64/mips64/interrupt.c b/sys/arch/mips64/mips64/interrupt.c index b081c776910..73cd2752d57 100644 --- a/sys/arch/mips64/mips64/interrupt.c +++ b/sys/arch/mips64/mips64/interrupt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interrupt.c,v 1.43 2009/10/22 18:22:11 miod Exp $ */ +/* $OpenBSD: interrupt.c,v 1.44 2009/10/22 18:46:48 miod Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -257,7 +257,9 @@ splinit() * Update proc0 pcb to contain proper values. */ pcb->pcb_context.val[13] = 0; /* IPL_NONE */ +#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/vm_machdep.c b/sys/arch/mips64/mips64/vm_machdep.c index 015090bfe6a..8ac4a8ffdcd 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.18 2007/10/18 04:32:25 miod Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.19 2009/10/22 18:46:48 miod Exp $ */ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1992, 1993 @@ -109,7 +109,9 @@ cpu_fork(p1, p2, stack, stacksize, func, arg) if (p1 != curproc) { pcb->pcb_context.val[13] = 0; +#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); } |