diff options
author | Marius Strobl <marius@FreeBSD.org> | 2008-04-09 21:14:01 +0000 |
---|---|---|
committer | Marius Strobl <marius@FreeBSD.org> | 2008-04-09 21:14:01 +0000 |
commit | a6c165e468ee204a605022f7b53f16ab9449f5b2 (patch) | |
tree | 1a0585a3468b8630f7c1e6631925680487e3468b /sys/sparc64 | |
parent | 046f4eba8ce6f48a9940ceea68059080ca1492ab (diff) | |
download | src-a6c165e468ee204a605022f7b53f16ab9449f5b2.tar.gz src-a6c165e468ee204a605022f7b53f16ab9449f5b2.zip |
- 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]
Notes
Notes:
svn path=/head/; revision=178048
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/include/intr_machdep.h | 3 | ||||
-rw-r--r-- | sys/sparc64/include/smp.h | 1 | ||||
-rw-r--r-- | sys/sparc64/sparc64/intr_machdep.c | 3 | ||||
-rw-r--r-- | sys/sparc64/sparc64/mp_machdep.c | 10 |
4 files changed, 15 insertions, 2 deletions
diff --git a/sys/sparc64/include/intr_machdep.h b/sys/sparc64/include/intr_machdep.h index 1a9209fdeaca..12badfbf943b 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 01127e83adc3..3e1d9ac27ff0 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 d5e3e0442354..f2dfa482bda9 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 165341d6e268..d9bebcca761a 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; |