- 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.
This commit is contained in:
Jake Burkholder 2001-01-20 02:30:58 +00:00
parent 074a4a2c84
commit c1ef8aac9e
10 changed files with 15 additions and 71 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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);
}
/*

View File

@ -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);
}
/*

View File

@ -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)

View File

@ -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

View File

@ -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);
}
/*

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{