f671832d76
reducues the maintenance load for the mutex code. The only MD portions of the mutex code are in machine/mutex.h now, which include the assembly macros for handling mutexes as well as optionally overriding the mutex micro-operations. For example, we use optimized micro-ops on the x86 platform #ifndef I386_CPU. - Change the behavior of the SMP_DEBUG kernel option. In the new code, mtx_assert() only depends on INVARIANTS, allowing other kernel developers to have working mutex assertiions without having to include all of the mutex debugging code. The SMP_DEBUG kernel option has been renamed to MUTEX_DEBUG and now just controls extra mutex debugging code. - Abolish the ugly mtx_f hack. Instead, we dynamically allocate seperate mtx_debug structures on the fly in mtx_init, except for mutexes that are initiated very early in the boot process. These mutexes are declared using a special MUTEX_DECLARE() macro, and use a new flag MTX_COLD when calling mtx_init. This is still somewhat hackish, but it is less evil than the mtx_f filler struct, and the mtx struct is now the same size with and without mutex debugging code. - Add some micro-micro-operation macros for doing the actual atomic operations on the mutex mtx_lock field to make it easier for other archs to override/optimize mutex ops if needed. These new tiny ops also clean up the code in some places by replacing long atomic operation function calls that spanned 2-3 lines with a short 1-line macro call. - Don't call mi_switch() from mtx_enter_hard() when we block while trying to obtain a sleep mutex. Calling mi_switch() would bogusly release Giant before switching to the next process. Instead, inline most of the code from mi_switch() in the mtx_enter_hard() function. Note that when we finally kill Giant we can back this out and go back to calling mi_switch(). |
||
---|---|---|
.. | ||
pc | ||
_limits.h | ||
ansi.h | ||
asm.h | ||
atomic.h | ||
bootinfo.h | ||
bus_memio.h | ||
bus_pio.h | ||
bus.h | ||
clock.h | ||
clockvar.h | ||
console.h | ||
cpu.h | ||
cpufunc.h | ||
db_machdep.h | ||
efi.h | ||
elf.h | ||
endian.h | ||
exec.h | ||
float.h | ||
floatingpoint.h | ||
fpu.h | ||
frame.h | ||
globaldata.h | ||
globals.h | ||
ia64_cpu.h | ||
ieee.h | ||
ieeefp.h | ||
in_cksum.h | ||
inst.h | ||
intr.h | ||
intrcnt.h | ||
ioctl_bt848.h | ||
ioctl_fd.h | ||
ioctl_meteor.h | ||
ipl.h | ||
limits.h | ||
lock.h | ||
md_var.h | ||
mouse.h | ||
mutex.h | ||
pal.h | ||
param.h | ||
pcb.h | ||
pcpu.h | ||
pmap.h | ||
proc.h | ||
profile.h | ||
ptrace.h | ||
reg.h | ||
reloc.h | ||
resource.h | ||
setjmp.h | ||
sigframe.h | ||
signal.h | ||
smp.h | ||
stdarg.h | ||
sysarch.h | ||
types.h | ||
ucontext.h | ||
varargs.h | ||
vmparam.h |