Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc Add functions to set & get the interrupt targ...



details:   https://anonhg.NetBSD.org/src/rev/5c0fbd45cdc4
branches:  trunk
changeset: 542159:5c0fbd45cdc4
user:      pk <pk%NetBSD.org@localhost>
date:      Wed Jan 22 21:58:28 2003 +0000

description:
Add functions to set & get the interrupt target CPU.

diffstat:

 sys/arch/sparc/include/cpu.h |   5 ++++-
 sys/arch/sparc/sparc/intr.c  |  41 ++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 44 insertions(+), 2 deletions(-)

diffs (74 lines):

diff -r b03e1152c828 -r 5c0fbd45cdc4 sys/arch/sparc/include/cpu.h
--- a/sys/arch/sparc/include/cpu.h      Wed Jan 22 21:55:14 2003 +0000
+++ b/sys/arch/sparc/include/cpu.h      Wed Jan 22 21:58:28 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.62 2003/01/18 06:44:57 thorpej Exp $ */
+/*     $NetBSD: cpu.h,v 1.63 2003/01/22 21:58:28 pk Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -245,6 +245,9 @@
 #endif
 /* msiiep.c */
 void msiiep_swap_endian(int);
+/* intr.c */
+u_int setitr(u_int);
+u_int getitr(void);
 
 /*
  *
diff -r b03e1152c828 -r 5c0fbd45cdc4 sys/arch/sparc/sparc/intr.c
--- a/sys/arch/sparc/sparc/intr.c       Wed Jan 22 21:55:14 2003 +0000
+++ b/sys/arch/sparc/sparc/intr.c       Wed Jan 22 21:58:28 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.75 2003/01/16 16:27:48 pk Exp $ */
+/*     $NetBSD: intr.c,v 1.76 2003/01/22 21:58:28 pk Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -128,6 +128,45 @@
 }
 #endif /* DIAGNOSTIC */
 
+/*
+ * Get module ID of interrupt target.
+ */
+u_int
+getitr()
+{
+#if defined(MULTIPROCESSOR)
+       u_int v;
+
+       if (!CPU_ISSUN4M || ncpu <= 1)
+               return (0);
+
+       v = *((u_int *)ICR_ITR);
+       return (v + 8);
+#else
+       return (0);
+#endif
+}
+
+/*
+ * Set interrupt target.
+ * Return previous value.
+ */
+u_int
+setitr(u_int mid)
+{
+#if defined(MULTIPROCESSOR)
+       u_int v;
+
+       if (!CPU_ISSUN4M || ncpu <= 1)
+               return (0);
+
+       v = *((u_int *)ICR_ITR);
+       *((u_int *)ICR_ITR) = CPU_MID2CPUNO(mid);
+       return (v + 8);
+#else
+       return (0);
+#endif
+}
 
 /*
  * Process software network interrupts.



Home | Main Index | Thread Index | Old Index