Make ASTs per-process.

This commit is contained in:
thorpej 2001-01-19 18:51:17 +00:00
parent 88e7f62500
commit e9d4801895
6 changed files with 24 additions and 21 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.2 2000/12/13 03:16:37 mycroft Exp $
# $NetBSD: genassym.cf,v 1.3 2001/01/19 18:51:17 thorpej Exp $
#
# Copyright (c) 1994, 1995 Gordon W. Ross
@ -123,6 +123,7 @@ define P_CPU offsetof(struct proc, p_cpu)
define P_MD_FLAGS offsetof(struct proc, p_md.md_flags)
define P_MD_PCBPADDR offsetof(struct proc, p_md.md_pcbpaddr)
define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall)
define P_MD_ASTPENDING offsetof(struct proc, p_md.md_astpending)
define PH_LINK offsetof(struct prochd, ph_link)
define PH_RLINK offsetof(struct prochd, ph_rlink)
@ -172,5 +173,4 @@ define CPU_INFO_FPCURPROC offsetof(struct cpu_info, ci_fpcurproc)
define CPU_INFO_CURPCB offsetof(struct cpu_info, ci_curpcb)
define CPU_INFO_IDLE_PCB_PADDR offsetof(struct cpu_info, ci_idle_pcb_paddr)
define CPU_INFO_WANT_RESCHED offsetof(struct cpu_info, ci_want_resched)
define CPU_INFO_ASTPENDING offsetof(struct cpu_info, ci_astpending)
define CPU_INFO_SIZEOF sizeof(struct cpu_info)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ipifuncs.c,v 1.23 2000/11/22 08:39:48 thorpej Exp $ */
/* $NetBSD: ipifuncs.c,v 1.24 2001/01/19 18:51:17 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.23 2000/11/22 08:39:48 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.24 2001/01/19 18:51:17 thorpej Exp $");
/*
* Interprocessor interrupt handlers.
@ -285,7 +285,8 @@ void
alpha_ipi_ast(struct cpu_info *ci, struct trapframe *framep)
{
aston(ci);
if (ci->ci_curproc != NULL)
aston(ci->ci_curproc);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.87 2000/12/13 03:16:37 mycroft Exp $ */
/* $NetBSD: locore.s,v 1.88 2001/01/19 18:51:17 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
#include <machine/asm.h>
__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.87 2000/12/13 03:16:37 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.88 2001/01/19 18:51:17 thorpej Exp $");
#include "assym.h"
@ -325,16 +325,15 @@ LEAF(exception_return, 1) /* XXX should be NESTED */
/* GET_CPUINFO clobbers v0, t0, t8...t11. */
GET_CPUINFO
ldq t2, CPU_INFO_ASTPENDING(v0) /* AST pending? */
ldq t1, CPU_INFO_CURPROC(v0)
ldl t2, P_MD_ASTPENDING(t1) /* AST pending? */
bne t2, 6f /* yes */
/* no: return & deal with FP */
/*
* We are going back to usermode. Enable the FPU based on whether
* the current proc is fpcurproc. v0 already contains the cpu_info
* pointer from above.
* the current proc is fpcurproc.
*/
ldq t1, CPU_INFO_CURPROC(v0)
ldq t2, CPU_INFO_FPCURPROC(v0)
cmpeq t1, t2, t1
mov zero, a0
@ -364,7 +363,7 @@ LEAF(exception_return, 1) /* XXX should be NESTED */
br 2b
/* We've got an AST */
6: stq zero, CPU_INFO_ASTPENDING(v0) /* no AST pending */
6: stl zero, P_MD_ASTPENDING(t1) /* no AST pending */
ldiq a0, ALPHA_PSL_IPL_0 /* drop IPL to zero */
call_pal PAL_OSF1_swpipl

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.49 2000/12/13 00:46:31 mycroft Exp $ */
/* $NetBSD: cpu.h,v 1.50 2001/01/19 18:51:18 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@ -127,7 +127,6 @@ struct cpu_info {
paddr_t ci_idle_pcb_paddr; /* PA of idle PCB */
struct cpu_softc *ci_softc; /* pointer to our device */
u_long ci_want_resched; /* preempt current process */
u_long ci_astpending; /* AST is pending */
u_long ci_intrdepth; /* interrupt trap depth */
struct trapframe *ci_db_regs; /* registers for debuggers */
#if defined(MULTIPROCESSOR)
@ -207,7 +206,8 @@ struct clockframe {
#define need_resched(ci) \
do { \
(ci)->ci_want_resched = 1; \
aston(ci); \
if ((ci)->ci_curproc != NULL) \
aston((ci)->ci_curproc); \
} while (/*CONSTCOND*/0)
/*
@ -218,14 +218,14 @@ do { \
#define need_proftick(p) \
do { \
(p)->p_flag |= P_OWEUPC; \
aston((p)->p_cpu); \
aston(p); \
} while (/*CONSTCOND*/0)
/*
* Notify the current process (p) that it has a signal pending,
* process as soon as possible.
*/
#define signotify(p) aston((p)->p_cpu)
#define signotify(p) aston(p)
/*
* XXXSMP
@ -233,7 +233,7 @@ do { \
* it sees a normal kernel entry? I guess letting it happen later
* follows the `asynchronous' part of the name...
*/
#define aston(ci) ((ci)->ci_astpending = 1)
#define aston(p) ((p)->p_md.md_astpending = 1)
#endif /* _KERNEL */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: proc.h,v 1.8 2000/12/14 00:41:50 mycroft Exp $ */
/* $NetBSD: proc.h,v 1.9 2001/01/19 18:51:18 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@ -37,7 +37,9 @@ struct mdproc {
u_long md_flags;
struct trapframe *md_tf; /* trap/syscall registers */
struct pcb *md_pcbpaddr; /* phys addr of the pcb */
void (*md_syscall) __P((struct proc *, u_int64_t, struct trapframe *));
/* this process's syscall vector */
void (*md_syscall)(struct proc *, u_int64_t, struct trapframe *);
__volatile int md_astpending; /* AST pending for this process */
};
#define MDP_FPUSED 0x0001 /* Process used the FPU */

View File

@ -1,4 +1,4 @@
/* $NetBSD: types.h,v 1.19 2001/01/14 23:50:29 thorpej Exp $ */
/* $NetBSD: types.h,v 1.20 2001/01/19 18:51:18 thorpej Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -78,5 +78,6 @@ typedef int64_t register_t;
#define __HAVE_CPU_COUNTER
#define __HAVE_SYSCALL_INTERN
#define __HAVE_MINIMAL_EMUL
#define __HAVE_AST_PERPROC
#endif /* _MACHTYPES_H_ */