summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2001-01-20 02:30:58 +0000
committerjake <jake@FreeBSD.org>2001-01-20 02:30:58 +0000
commitea36052df59c348dde3964aba7a7421e3d8fb1d3 (patch)
tree8cd3a5f0f20ad2ded10cec3befd3a3ee7aca5631 /sys
parent0fbfe85a3cf3589f4e05372bfa862cefce00e2aa (diff)
downloadFreeBSD-src-ea36052df59c348dde3964aba7a7421e3d8fb1d3.zip
FreeBSD-src-ea36052df59c348dde3964aba7a7421e3d8fb1d3.tar.gz
- Make npx_intr INTR_MPSAFE and move acquiring Giant into the
function itself. - Remove a hack to allow acquiring Giant from the npx asm trap vector.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/exception.S2
-rw-r--r--sys/amd64/amd64/exception.s2
-rw-r--r--sys/amd64/amd64/fpu.c6
-rw-r--r--sys/amd64/isa/npx.c6
-rw-r--r--sys/i386/i386/exception.s2
-rw-r--r--sys/i386/include/asnames.h2
-rw-r--r--sys/i386/isa/npx.c6
-rw-r--r--sys/kern/kern_mutex.c20
-rw-r--r--sys/kern/subr_turnstile.c20
-rw-r--r--sys/kern/subr_witness.c20
10 files changed, 15 insertions, 71 deletions
diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S
index bc5e2e3..99b91d0 100644
--- a/sys/amd64/amd64/exception.S
+++ b/sys/amd64/amd64/exception.S
@@ -174,9 +174,7 @@ IDTVEC(fpu)
MPLOCKED incl _cnt+V_TRAP
pushl $0 /* dummy unit to finish intr frame */
- call __mtx_enter_giant_def
call _npx_intr
- call __mtx_exit_giant_def
addl $4,%esp
incb PCPU(INTR_NESTING_LEVEL)
diff --git a/sys/amd64/amd64/exception.s b/sys/amd64/amd64/exception.s
index bc5e2e3..99b91d0 100644
--- a/sys/amd64/amd64/exception.s
+++ b/sys/amd64/amd64/exception.s
@@ -174,9 +174,7 @@ IDTVEC(fpu)
MPLOCKED incl _cnt+V_TRAP
pushl $0 /* dummy unit to finish intr frame */
- call __mtx_enter_giant_def
call _npx_intr
- call __mtx_exit_giant_def
addl $4,%esp
incb PCPU(INTR_NESTING_LEVEL)
diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c
index 52d45ed..7c6c4f0 100644
--- a/sys/amd64/amd64/fpu.c
+++ b/sys/amd64/amd64/fpu.c
@@ -47,6 +47,7 @@
#include <sys/module.h>
#include <sys/sysctl.h>
#include <sys/proc.h>
+#include <sys/mutex.h>
#include <machine/bus.h>
#include <sys/rman.h>
#ifdef NPX_DEBUG
@@ -389,7 +390,8 @@ npx_probe1(dev)
if (r == 0)
panic("npx: can't get IRQ");
BUS_SETUP_INTR(device_get_parent(dev),
- dev, r, INTR_TYPE_MISC,
+ dev, r,
+ INTR_TYPE_MISC | INTR_MPSAFE,
npx_intr, 0, &intr);
if (intr == 0)
panic("npx: can't create intr");
@@ -722,6 +724,7 @@ npx_intr(dummy)
u_short control;
struct intrframe *frame;
+ mtx_enter(&Giant, MTX_DEF);
if (PCPU_GET(npxproc) == NULL || !npx_exists) {
printf("npxintr: npxproc = %p, curproc = %p, npx_exists = %d\n",
PCPU_GET(npxproc), curproc, npx_exists);
@@ -780,6 +783,7 @@ npx_intr(dummy)
*/
psignal(curproc, SIGFPE);
}
+ mtx_exit(&Giant, MTX_DEF);
}
/*
diff --git a/sys/amd64/isa/npx.c b/sys/amd64/isa/npx.c
index 52d45ed..7c6c4f0 100644
--- a/sys/amd64/isa/npx.c
+++ b/sys/amd64/isa/npx.c
@@ -47,6 +47,7 @@
#include <sys/module.h>
#include <sys/sysctl.h>
#include <sys/proc.h>
+#include <sys/mutex.h>
#include <machine/bus.h>
#include <sys/rman.h>
#ifdef NPX_DEBUG
@@ -389,7 +390,8 @@ npx_probe1(dev)
if (r == 0)
panic("npx: can't get IRQ");
BUS_SETUP_INTR(device_get_parent(dev),
- dev, r, INTR_TYPE_MISC,
+ dev, r,
+ INTR_TYPE_MISC | INTR_MPSAFE,
npx_intr, 0, &intr);
if (intr == 0)
panic("npx: can't create intr");
@@ -722,6 +724,7 @@ npx_intr(dummy)
u_short control;
struct intrframe *frame;
+ mtx_enter(&Giant, MTX_DEF);
if (PCPU_GET(npxproc) == NULL || !npx_exists) {
printf("npxintr: npxproc = %p, curproc = %p, npx_exists = %d\n",
PCPU_GET(npxproc), curproc, npx_exists);
@@ -780,6 +783,7 @@ npx_intr(dummy)
*/
psignal(curproc, SIGFPE);
}
+ mtx_exit(&Giant, MTX_DEF);
}
/*
diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s
index bc5e2e3..99b91d0 100644
--- a/sys/i386/i386/exception.s
+++ b/sys/i386/i386/exception.s
@@ -174,9 +174,7 @@ IDTVEC(fpu)
MPLOCKED incl _cnt+V_TRAP
pushl $0 /* dummy unit to finish intr frame */
- call __mtx_enter_giant_def
call _npx_intr
- call __mtx_exit_giant_def
addl $4,%esp
incb PCPU(INTR_NESTING_LEVEL)
diff --git a/sys/i386/include/asnames.h b/sys/i386/include/asnames.h
index 2cad36b..26c5469 100644
--- a/sys/i386/include/asnames.h
+++ b/sys/i386/include/asnames.h
@@ -257,8 +257,6 @@
#define _mp_gdtbase mp_gdtbase
#define _mp_lock mp_lock
#define _mp_ncpus mp_ncpus
-#define __mtx_enter_giant_def _mtx_enter_giant_def
-#define __mtx_exit_giant_def _mtx_exit_giant_def
#define _mul64 mul64
#define _nfs_diskless nfs_diskless
#define _nfs_diskless_valid nfs_diskless_valid
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index 52d45ed..7c6c4f0 100644
--- a/sys/i386/isa/npx.c
+++ b/sys/i386/isa/npx.c
@@ -47,6 +47,7 @@
#include <sys/module.h>
#include <sys/sysctl.h>
#include <sys/proc.h>
+#include <sys/mutex.h>
#include <machine/bus.h>
#include <sys/rman.h>
#ifdef NPX_DEBUG
@@ -389,7 +390,8 @@ npx_probe1(dev)
if (r == 0)
panic("npx: can't get IRQ");
BUS_SETUP_INTR(device_get_parent(dev),
- dev, r, INTR_TYPE_MISC,
+ dev, r,
+ INTR_TYPE_MISC | INTR_MPSAFE,
npx_intr, 0, &intr);
if (intr == 0)
panic("npx: can't create intr");
@@ -722,6 +724,7 @@ npx_intr(dummy)
u_short control;
struct intrframe *frame;
+ mtx_enter(&Giant, MTX_DEF);
if (PCPU_GET(npxproc) == NULL || !npx_exists) {
printf("npxintr: npxproc = %p, curproc = %p, npx_exists = %d\n",
PCPU_GET(npxproc), curproc, npx_exists);
@@ -780,6 +783,7 @@ npx_intr(dummy)
*/
psignal(curproc, SIGFPE);
}
+ mtx_exit(&Giant, MTX_DEF);
}
/*
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index da8f197..0d42519 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -100,8 +100,6 @@ static struct mtx all_mtx = { MTX_UNOWNED, 0, 0, "All mutexes queue head",
static int mtx_cur_cnt;
static int mtx_max_cnt;
-void _mtx_enter_giant_def(void);
-void _mtx_exit_giant_def(void);
static void propagate_priority(struct proc *);
#define mtx_unowned(m) ((m)->mtx_lock == MTX_UNOWNED)
@@ -111,24 +109,6 @@ static void propagate_priority(struct proc *);
#define RETIP(x) *(((uintptr_t *)(&x)) - 1)
#define SET_PRIO(p, pri) (p)->p_priority = (pri)
-/*
- * XXX Temporary, for use from assembly language
- */
-
-void
-_mtx_enter_giant_def(void)
-{
-
- mtx_enter(&Giant, MTX_DEF);
-}
-
-void
-_mtx_exit_giant_def(void)
-{
-
- mtx_exit(&Giant, MTX_DEF);
-}
-
static void
propagate_priority(struct proc *p)
{
diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c
index da8f197..0d42519 100644
--- a/sys/kern/subr_turnstile.c
+++ b/sys/kern/subr_turnstile.c
@@ -100,8 +100,6 @@ static struct mtx all_mtx = { MTX_UNOWNED, 0, 0, "All mutexes queue head",
static int mtx_cur_cnt;
static int mtx_max_cnt;
-void _mtx_enter_giant_def(void);
-void _mtx_exit_giant_def(void);
static void propagate_priority(struct proc *);
#define mtx_unowned(m) ((m)->mtx_lock == MTX_UNOWNED)
@@ -111,24 +109,6 @@ static void propagate_priority(struct proc *);
#define RETIP(x) *(((uintptr_t *)(&x)) - 1)
#define SET_PRIO(p, pri) (p)->p_priority = (pri)
-/*
- * XXX Temporary, for use from assembly language
- */
-
-void
-_mtx_enter_giant_def(void)
-{
-
- mtx_enter(&Giant, MTX_DEF);
-}
-
-void
-_mtx_exit_giant_def(void)
-{
-
- mtx_exit(&Giant, MTX_DEF);
-}
-
static void
propagate_priority(struct proc *p)
{
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index da8f197..0d42519 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -100,8 +100,6 @@ static struct mtx all_mtx = { MTX_UNOWNED, 0, 0, "All mutexes queue head",
static int mtx_cur_cnt;
static int mtx_max_cnt;
-void _mtx_enter_giant_def(void);
-void _mtx_exit_giant_def(void);
static void propagate_priority(struct proc *);
#define mtx_unowned(m) ((m)->mtx_lock == MTX_UNOWNED)
@@ -111,24 +109,6 @@ static void propagate_priority(struct proc *);
#define RETIP(x) *(((uintptr_t *)(&x)) - 1)
#define SET_PRIO(p, pri) (p)->p_priority = (pri)
-/*
- * XXX Temporary, for use from assembly language
- */
-
-void
-_mtx_enter_giant_def(void)
-{
-
- mtx_enter(&Giant, MTX_DEF);
-}
-
-void
-_mtx_exit_giant_def(void)
-{
-
- mtx_exit(&Giant, MTX_DEF);
-}
-
static void
propagate_priority(struct proc *p)
{
OpenPOWER on IntegriCloud