summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2008-04-09 21:14:01 +0000
committermarius <marius@FreeBSD.org>2008-04-09 21:14:01 +0000
commit90e772efe6e4587d47fd85078f52573d0b8f1cad (patch)
tree1a0585a3468b8630f7c1e6631925680487e3468b /sys/sparc64
parente69cacb9b4b8899f70fb2541b66f3704e956c079 (diff)
downloadFreeBSD-src-90e772efe6e4587d47fd85078f52573d0b8f1cad.zip
FreeBSD-src-90e772efe6e4587d47fd85078f52573d0b8f1cad.tar.gz
- Add support for IPI_PREEMPT. [1]
- Add my copyright to mp_machdep.c for having implemented support for USIII and up and some fixes. Obtained from: sun4v (modulo style(9) bugs) [1]
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/include/intr_machdep.h3
-rw-r--r--sys/sparc64/include/smp.h1
-rw-r--r--sys/sparc64/sparc64/intr_machdep.c3
-rw-r--r--sys/sparc64/sparc64/mp_machdep.c10
4 files changed, 15 insertions, 2 deletions
diff --git a/sys/sparc64/include/intr_machdep.h b/sys/sparc64/include/intr_machdep.h
index 1a9209f..12badfb 100644
--- a/sys/sparc64/include/intr_machdep.h
+++ b/sys/sparc64/include/intr_machdep.h
@@ -33,7 +33,7 @@
#define PIL_MAX (1 << 4)
#define IV_MAX (1 << 11)
-#define IV_NAMLEN 1024
+#define IV_NAMLEN 1024
#define IR_FREE (PIL_MAX * 2)
@@ -46,6 +46,7 @@
#define PIL_RENDEZVOUS 3 /* smp rendezvous ipi */
#define PIL_AST 4 /* ast ipi */
#define PIL_STOP 5 /* stop cpu ipi */
+#define PIL_PREEMPT 6 /* preempt idle thread cpu ipi */
#define PIL_FAST 13 /* fast interrupts */
#define PIL_TICK 14
diff --git a/sys/sparc64/include/smp.h b/sys/sparc64/include/smp.h
index 01127e8..3e1d9ac 100644
--- a/sys/sparc64/include/smp.h
+++ b/sys/sparc64/include/smp.h
@@ -51,6 +51,7 @@
#define IPI_AST PIL_AST
#define IPI_RENDEZVOUS PIL_RENDEZVOUS
+#define IPI_PREEMPT PIL_PREEMPT
#define IPI_STOP PIL_STOP
#define IPI_RETRIES 5000
diff --git a/sys/sparc64/sparc64/intr_machdep.c b/sys/sparc64/sparc64/intr_machdep.c
index d5e3e04..f2dfa48 100644
--- a/sys/sparc64/sparc64/intr_machdep.c
+++ b/sys/sparc64/sparc64/intr_machdep.c
@@ -95,7 +95,8 @@ static const char *pil_names[] = {
"rndzvs", /* PIL_RENDEZVOUS */
"ast", /* PIL_AST */
"stop", /* PIL_STOP */
- "stray", "stray", "stray", "stray", "stray", "stray", "stray",
+ "preempt", /* PIL_PREEMPT */
+ "stray", "stray", "stray", "stray", "stray", "stray",
"fast", /* PIL_FAST */
"tick", /* PIL_TICK */
};
diff --git a/sys/sparc64/sparc64/mp_machdep.c b/sys/sparc64/sparc64/mp_machdep.c
index 165341d..d9bebcc 100644
--- a/sys/sparc64/sparc64/mp_machdep.c
+++ b/sys/sparc64/sparc64/mp_machdep.c
@@ -29,6 +29,7 @@
*/
/*-
* Copyright (c) 2002 Jake Burkholder.
+ * Copyright (c) 2007 Marius Strobl <marius@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -91,6 +92,7 @@ __FBSDID("$FreeBSD$");
#include <machine/ver.h>
static ih_func_t cpu_ipi_ast;
+static ih_func_t cpu_ipi_preempt;
static ih_func_t cpu_ipi_stop;
/*
@@ -257,6 +259,7 @@ cpu_mp_start(void)
intr_setup(PIL_RENDEZVOUS, (ih_func_t *)smp_rendezvous_action,
-1, NULL, NULL);
intr_setup(PIL_STOP, cpu_ipi_stop, -1, NULL, NULL);
+ intr_setup(PIL_PREEMPT, cpu_ipi_preempt, -1, NULL, NULL);
cpuid_to_mid[curcpu] = PCPU_GET(mid);
@@ -440,6 +443,13 @@ cpu_ipi_stop(struct trapframe *tf)
}
static void
+cpu_ipi_preempt(struct trapframe *tf)
+{
+
+ sched_preempt(curthread);
+}
+
+static void
spitfire_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
{
u_int cpu;
OpenPOWER on IntegriCloud