over someone else's fixes; this is at least offensive. If you
have problems doing a proper merge, we are here, your fellow
committers. :-(
Reapply markup fixes from revision 1.2 and fix some more. Also
fix the $OpenBSD$ tag.
installed ones under /boot (which we may not even have in the
case of a cross build).
This introduced chicken and egg problem - we need boot images
early in the "depend" stage but they have not yet been built.
Work around this by excluding the generated makeboot.c source
from the "depend" list; it's okay because we hardcode all its
dependencies explicitly. We actually lose the dependency bit
on <sys/types.h> but it's probably okay too as the only thing
we use is the u_char datatype and this is unlikely to change.
After all, it's normal for sloppy cleaning to cause problems.
beast.FreeBSD.org running 5.0-CURRENT alpha has been able to
cross build i386 world with this patch.
Prodded by: gallatin
kern/kern_descrip.c:
Aquire Giant in fdrop_locked when file refcount hits zero, this removes
the requirement for the caller to own Giant for the most part.
kern/kern_ktrace.c:
Aquire Giant in ktrgenio, simplifies locking in upper read/write syscalls.
kern/vfs_bio.c:
Aquire Giant in bwillwrite if needed.
kern/sys_generic.c
Giant pushdown, remove Giant for:
read, pread, write and pwrite.
readv and writev aren't done yet because of the possible malloc calls
for iov to uio processing.
kern/sys_socket.c
Grab giant in the socket fo_read/write functions.
kern/vfs_vnops.c
Grab giant in the vnode fo_read/write functions.
Rev 1.2 changed the default emulation from ``elf64_sparc'' to ``elf32_sparc''
and I never noticed it after my review of rev 1.1. Backing the change of
the default emulation out, and Wa-la!, I can now build a native [and usable]
binutils. WTF, the "-m elf64_sparc" parameter handed to `ld' by `gcc'
wasn't DTRT is beyond me.
Missed a place where the pipe sleep lock was needed in order to safely grab
Giant, fix it and add an assertion to make sure this doesn't happen again.
Fix typos in the PIPE_GET_GIANT/PIPE_DROP_GIANT that could cause the
wrong mutex to get passed to PIPE_LOCK/PIPE_UNLOCK.
Fix a location where the wrong pipe was being passed to
PIPE_GET_GIANT/PIPE_DROP_GIANT.