Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/sparc64 UltraSPARC-IIIi CPUs select the BUS...



details:   https://anonhg.NetBSD.org/src/rev/e66097e206b0
branches:  trunk
changeset: 750830:e66097e206b0
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Fri Jan 15 23:57:07 2010 +0000

description:
UltraSPARC-IIIi CPUs select the BUSY/NACK pair in the interrupt
vector dispatch status register based on the lower two bits of the
ITID.

>From OpenBSD and details are described in the section 10.4.3 of
UltraSPARC IIIi Processor User's Manual.

diffstat:

 sys/arch/sparc64/sparc64/ipifuncs.c |  20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diffs (58 lines):

diff -r 203332666c30 -r e66097e206b0 sys/arch/sparc64/sparc64/ipifuncs.c
--- a/sys/arch/sparc64/sparc64/ipifuncs.c       Fri Jan 15 23:55:55 2010 +0000
+++ b/sys/arch/sparc64/sparc64/ipifuncs.c       Fri Jan 15 23:57:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipifuncs.c,v 1.25 2009/11/30 01:45:04 mrg Exp $ */
+/*     $NetBSD: ipifuncs.c,v 1.26 2010/01/15 23:57:07 nakayama Exp $ */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.25 2009/11/30 01:45:04 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.26 2010/01/15 23:57:07 nakayama Exp $");
 
 #include "opt_ddb.h"
 
@@ -188,11 +188,19 @@
 void
 sparc64_send_ipi(int upaid, ipifunc_t func, uint64_t arg1, uint64_t arg2)
 {
-       int i, ik;
+       int i, ik, shift = 0;
        uint64_t intr_func;
 
        KASSERT(upaid != curcpu()->ci_cpuid);
-       if (ldxa(0, ASR_IDSR) & IDSR_BUSY)
+
+       /*
+        * UltraSPARC-IIIi CPUs select the BUSY/NACK pair based on the
+        * lower two bits of the ITID.
+        */
+       if (((getver() & VER_IMPL) >> VER_IMPL_SHIFT) == IMPL_JALAPENO)
+               shift = (upaid & 0x3) * 2;
+
+       if (ldxa(0, ASR_IDSR) & (IDSR_BUSY << shift))
                panic("recursive IPI?");
 
        intr_func = (uint64_t)(u_long)func;
@@ -211,7 +219,7 @@
                membar_sync();
 
                for (ik = 0; ik < 1000000; ik++) {
-                       if (ldxa(0, ASR_IDSR) & IDSR_BUSY)
+                       if (ldxa(0, ASR_IDSR) & (IDSR_BUSY << shift))
                                continue;
                        else
                                break;
@@ -221,7 +229,7 @@
                if (ik == 1000000)
                        break;
 
-               if ((ldxa(0, ASR_IDSR) & IDSR_NACK) == 0)
+               if ((ldxa(0, ASR_IDSR) & (IDSR_NACK << shift)) == 0)
                        return;
                /*
                 * Wait for a while with enabling interrupts to avoid



Home | Main Index | Thread Index | Old Index