diff options
author | jhb <jhb@FreeBSD.org> | 2001-02-10 02:20:34 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-02-10 02:20:34 +0000 |
commit | a9c84e00da6824d43126b1e221e6e6e95cc276c8 (patch) | |
tree | 2ffe447aaa792aff3416e8c400ea31e67ab643b7 /sys/amd64/include | |
parent | efcbded13731a03d5149d347fa46611d5ff0ffff (diff) | |
download | FreeBSD-src-a9c84e00da6824d43126b1e221e6e6e95cc276c8.zip FreeBSD-src-a9c84e00da6824d43126b1e221e6e6e95cc276c8.tar.gz |
- Make astpending and need_resched process attributes rather than CPU
attributes. This is needed for AST's to be properly posted in a preemptive
kernel. They are backed by two new flags in p_sflag: PS_ASTPENDING and
PS_NEEDRESCHED. They are still accesssed by their old macros:
aston(), astoff(), etc. For completeness, an astpending() macro has been
added to check for a pending AST, and clear_resched() has been added to
clear need_resched().
- Rename syscall2() on the x86 back to syscall() to be consistent with
other architectures.
Diffstat (limited to 'sys/amd64/include')
-rw-r--r-- | sys/amd64/include/cpu.h | 44 | ||||
-rw-r--r-- | sys/amd64/include/pcpu.h | 1 |
2 files changed, 7 insertions, 38 deletions
diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h index 0b99ec6..e644b50 100644 --- a/sys/amd64/include/cpu.h +++ b/sys/amd64/include/cpu.h @@ -59,32 +59,17 @@ #define cpu_getstack(p) ((p)->p_md.md_regs->tf_esp) #define cpu_setstack(p, ap) ((p)->p_md.md_regs->tf_esp = (ap)) +#define TRAPF_USERMODE(framep) \ + ((ISPL((framep)->tf_cs) == SEL_UPL) || ((framep)->tf_eflags & PSL_VM)) +#define TRAPF_PC(framep) ((framep)->tf_eip) + #define CLKF_USERMODE(framep) \ - ((ISPL((framep)->cf_cs) == SEL_UPL) || (framep->cf_eflags & PSL_VM)) + ((ISPL((framep)->cf_cs) == SEL_UPL) || ((framep)->cf_eflags & PSL_VM)) #define CLKF_INTR(framep) (curproc->p_intr_nesting_level >= 2) #define CLKF_PC(framep) ((framep)->cf_eip) /* - * astpending bits - */ -#define AST_PENDING 0x00000001 -#define AST_RESCHED 0x00000002 - -/* - * Preempt the current process if in interrupt from user mode, - * or after the current trap/syscall if in system mode. - * - * XXX: if astpending is later changed to an |= here due to more flags being - * added, we will have an atomicy problem. The type of atomicy we need is - * a non-locked orl. - */ -#define need_resched() do { \ - PCPU_SET(astpending, AST_RESCHED|AST_PENDING); \ -} while (0) -#define resched_wanted() (PCPU_GET(astpending) & AST_RESCHED) - -/* * Arrange to handle pending profiling ticks before returning to user mode. * * XXX this is now poorly named and implemented. It used to handle only a @@ -92,28 +77,13 @@ * counter in the proc table and flag isn't really necessary. */ #define need_proftick(p) do { \ - mtx_lock_spin(&sched_lock); \ + mtx_lock_spin(&sched_lock); \ (p)->p_sflag |= PS_OWEUPC; \ - mtx_unlock_spin(&sched_lock); \ aston(); \ + mtx_unlock_spin(&sched_lock); \ } while (0) /* - * Notify the current process (p) that it has a signal pending, - * process as soon as possible. - * - * XXX: aston() really needs to be an atomic (not locked, but an orl), - * in case need_resched() is set by an interrupt. But with astpending a - * per-cpu variable this is not trivial to do efficiently. For now we blow - * it off (asynchronous need_resched() conflicts are not critical). - */ -#define signotify(p) aston() -#define aston() do { \ - PCPU_SET(astpending, PCPU_GET(astpending) | AST_PENDING); \ -} while (0) -#define astoff() - -/* * CTL_MACHDEP definitions. */ #define CPU_CONSDEV 1 /* dev_t: console terminal device */ diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h index 83d5103..3b7bca5 100644 --- a/sys/amd64/include/pcpu.h +++ b/sys/amd64/include/pcpu.h @@ -63,7 +63,6 @@ struct globaldata { int gd_currentldt; /* only used for USER_LDT */ u_int gd_cpuid; u_int gd_other_cpus; - u_int gd_astpending; SLIST_ENTRY(globaldata) gd_allcpu; int gd_witness_spin_check; #ifdef KTR_PERCPU |