diff options
author | dillon <dillon@FreeBSD.org> | 2002-03-27 05:39:23 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2002-03-27 05:39:23 +0000 |
commit | dc5aafeb94ddee4f835e390dffaecbb0eec5d5e2 (patch) | |
tree | 8233f61cf29e01829b91c6a5cf27defe60e6b8d8 /sys/amd64/include/cpufunc.h | |
parent | 9b5143f94f573dc8954cb0913f3edb055e6caf0f (diff) | |
download | FreeBSD-src-dc5aafeb94ddee4f835e390dffaecbb0eec5d5e2.zip FreeBSD-src-dc5aafeb94ddee4f835e390dffaecbb0eec5d5e2.tar.gz |
Compromise for critical*()/cpu_critical*() recommit. Cleanup the interrupt
disablement assumptions in kern_fork.c by adding another API call,
cpu_critical_fork_exit(). Cleanup the td_savecrit field by moving it
from MI to MD. Temporarily move cpu_critical*() from <arch>/include/cpufunc.h
to <arch>/<arch>/critical.c (stage-2 will clean this up).
Implement interrupt deferral for i386 that allows interrupts to remain
enabled inside critical sections. This also fixes an IPI interlock bug,
and requires uses of icu_lock to be enclosed in a true interrupt disablement.
This is the stage-1 commit. Stage-2 will occur after stage-1 has stabilized,
and will move cpu_critical*() into its own header file(s) + other things.
This commit may break non-i386 architectures in trivial ways. This should
be temporary.
Reviewed by: core
Approved by: core
Diffstat (limited to 'sys/amd64/include/cpufunc.h')
-rw-r--r-- | sys/amd64/include/cpufunc.h | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index ed1da94..2b0abcc 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -45,6 +45,8 @@ #include <sys/cdefs.h> #include <machine/psl.h> +struct thread; + __BEGIN_DECLS #define readb(va) (*(volatile u_int8_t *) (va)) #define readw(va) (*(volatile u_int16_t *) (va)) @@ -54,8 +56,6 @@ __BEGIN_DECLS #define writew(va, d) (*(volatile u_int16_t *) (va) = (d)) #define writel(va, d) (*(volatile u_int32_t *) (va) = (d)) -#define CRITICAL_FORK (read_eflags() | PSL_I) - #ifdef __GNUC__ #ifdef SWTCH_OPTIM_STATS @@ -562,22 +562,6 @@ load_dr7(u_int sel) __asm __volatile("movl %0,%%dr7" : : "r" (sel)); } -static __inline critical_t -cpu_critical_enter(void) -{ - critical_t eflags; - - eflags = read_eflags(); - disable_intr(); - return (eflags); -} - -static __inline void -cpu_critical_exit(critical_t eflags) -{ - write_eflags(eflags); -} - static __inline register_t intr_disable(void) { @@ -629,8 +613,6 @@ u_int rfs(void); u_int rgs(void); void load_fs(u_int sel); void load_gs(u_int sel); -critical_t cpu_critical_enter(void); -void cpu_critical_exit(critical_t eflags); #endif /* __GNUC__ */ @@ -642,6 +624,11 @@ u_int rcr0(void); u_int rcr3(void); u_int rcr4(void); void reset_dbregs(void); +void cpu_critical_enter(void); +void cpu_critical_exit(void); +void cpu_critical_fork_exit(void); +void cpu_thread_link(struct thread *td); + __END_DECLS #endif /* !_MACHINE_CPUFUNC_H_ */ |