obrien [Mon, 2 Jun 2003 02:41:38 +0000 (02:41 +0000)]
Don't use ## to concatinate to two things that don't together make a C token.
Two tokens that don't together form a vaid preprocssor token cannot be
pasted together using ANSI-C token concatinatation. GCC 3.2's cpp, at least,
produces the desired result w/o using "##".
obrien [Mon, 2 Jun 2003 01:01:42 +0000 (01:01 +0000)]
To quote Tony Maher <tonymaher@optushome.com.au>, "maybe 3rd time lucky ;-)"
*sigh* Just can't get a brake when trying to react too quickly and fix the build.
mjacob [Mon, 2 Jun 2003 00:37:42 +0000 (00:37 +0000)]
Check in some months long pending minor debug output changes.
Clarify that the implicit fallthrough was *not* intentional (thanks, Poul!)
and reorganize the code so a correct fallthrough (with /* FALLTHROUGH */)
occurs.
marcel [Mon, 2 Jun 2003 00:16:39 +0000 (00:16 +0000)]
o Fix a cut-n-paste bug. We were clobbering rp with gp...
o Make sure the arguments to ctx_wrapper() are loaded from the
backing store by forcing an underflow. Do this by making all
registers in the register frame local.
alc [Sun, 1 Jun 2003 23:59:48 +0000 (23:59 +0000)]
Change kernel_object and kmem_object to (&kernel_object_store) and
(&kmem_object_store), respectively. This allows the address of these
objects to be resolved at link-time rather than run-time.
marcel [Sun, 1 Jun 2003 23:22:56 +0000 (23:22 +0000)]
Improve set_mcontext:
o Don't copy psr verbatim from the user supplied context. Only allow
userland to change the processor settings that are part of the user
mask.
marcel [Sun, 1 Jun 2003 23:19:21 +0000 (23:19 +0000)]
Improve on cpu_set_upcall:
o Use pcb and tf for the new pcb and the new trapframe and use pcb0
for the old (current) pcb. The mix of pcb, pcb2 and tf was slightly
confusing.
o Don't define td->td_frame here. It has already been set previously
by cpu_thread_setup. Add a KASSERT to make sure pcb and tf are both
non-NULL.
o Make sure the number of dirty registers is 0 for the new thread.
There are no user registers on the backing store because we heven't
enter userland yet.
Make the PacketAliasSetAddress() function call optional. If it
is not called, and no static rules match an outgoing packet, the
latter retains its source IP address. This is in support of the
"static NAT only" mode.
tjr [Sun, 1 Jun 2003 22:37:38 +0000 (22:37 +0000)]
Give the -o option before any filename operands when invoking the sort
utility. 1003.1-2001 does not allow sort to accept the -o option after
the operands (Base Definitions, 12.2 Utility Syntax Guidelines,
Guideline 9).
mux [Sun, 1 Jun 2003 19:26:34 +0000 (19:26 +0000)]
- Style(9) fixes, most notably :
o Remove register keyword
o ANSIfy prototypes
o Remove "return;" at the end of void functions
o Remove trailing spaces
o Don't align local variables with tabs and reorder them
o Don't use /* FOO */ at the end of a #ifdef FOO block if
it's a small block
- Other non-functional changes :
o 6 -> ETHER_ADDR_LEN
o Don't initialize if_output; ether_ifattach() does it for us
marcel [Sun, 1 Jun 2003 08:29:43 +0000 (08:29 +0000)]
Implement cpu_thread_setup(). This is mostly the same as on i386,
except for the fact that trapframes have a size recorded in it
that we set here too. We need this for proper thread setup.
truckman [Sun, 1 Jun 2003 06:24:32 +0000 (06:24 +0000)]
Fix up locking problems in fifo_open() and fifo_close():
Sleep on the vnode interlock while waiting for another
caller to increment fi_readers or fi_writers. Hold the
vnode interlock while incrementing fi_readers or fi_writers
to prevent a wakeup from being missed.
Only access fi_readers and fi_writers while holding the vnode
lock. Previously fifo_close() decremented their values without
holding a lock.
Move resource deallocation from fifo_close() to fifo_inactive(),
which allows the VOP_CLOSE() call in the error return path in
fifo_open() to be removed. Fifo_open() was calling VOP_CLOSE()
with the vnode lock held, in violation the current vnode locking
API. Also the way fifo_close() used vrefcnt() to decide whether
to deallocate resources was bogus according to comments in the
vrefcnt() implementation.
marcel [Sun, 1 Jun 2003 05:57:58 +0000 (05:57 +0000)]
Remove the ia64 hackery in threadinit() that was needed to work around
the lameness of the kstack code. The EPC overhaul de-lame-ified the
kstack code by removing the need for contigmalloc(). We can now
allocate stacks using malloc(). We probably want to make the stacks
swappable as well so that we can make it MI. But that's another story.
jmallett [Sun, 1 Jun 2003 04:42:14 +0000 (04:42 +0000)]
Use SC_NO_CUTPASTE to protect cutpaste variables correctly, fixing the
-Werror build with such option, but not other combinations. LINT
misses this because syscons knobs in LINT turn off a lot of code.
rwatson [Sun, 1 Jun 2003 02:42:18 +0000 (02:42 +0000)]
Return EOPNOTSUPP for attempted EA operations on VCHR vnodes in UFS2;
if we permit them to occur, the kernel panics due to our performing
EA operations using VOP_STRATEGY on the vnode. This went unnoticed
previously because there are very for users of device nodes on UFS2
due to the introduction of devfs. However, this can come up with
the Linux compat directories and its hard-coded dev nodes (which will
need to go away as we move away from hard-coded device numbers).
This can come up if you use EA-intensive features such as ACLs and
MAC.
The proper fix is pretty complicated, but this band-aid would be
an excellent MFC candidate for the release.
gordon [Sun, 1 Jun 2003 01:43:37 +0000 (01:43 +0000)]
Move networkfs_types from mountcritlocal into defaults/rc.conf as netfs_types.
Also add logic into mountcritremote to add extra_netfs_types to the list.
This unbreaks putting smbfs, portalfs and now nwfs in fstab.
rwatson [Sat, 31 May 2003 23:31:51 +0000 (23:31 +0000)]
Attempt to further comment and clarify System V IPC logic: document
why certain exceptions are made, note an inconsistency between
FreeBSD and some other implementations regarding IPC_M, and let
suser() generate our EPERM rather than forcing it ourselves.
Remove a carriage return that crept in in the last commit.
marcel [Sat, 31 May 2003 21:21:35 +0000 (21:21 +0000)]
Now that we have the signal trampolines in the gateway page and the
gateway page is considered kernel space, we can panic when we should
only SIGSEGV. Hence, add the additional constraint that for page
faults we also require running with kernel privileges. The gateway
page is the only kernel code running with user privileges, iso this
is a correct way to exclude the gateway page from kernel land.
We do not currently exclude the gateway page for other faults as it
is not always the right way to do it. Further tuning will happen on
a case by case bases.
phk [Sat, 31 May 2003 21:16:12 +0000 (21:16 +0000)]
If DESTDIR was specified as a makeoption in the kernelconfig file
we want to pass it on to the modules build so we don't install
the kernel under DESTDIR and the modules in /boot.
marcel [Sat, 31 May 2003 21:14:25 +0000 (21:14 +0000)]
Implement cpu_set_upcall(). Required by libthr and used by
thr_create(2). This implementation is so far only compile tested.
But since this is also the last of the functions required to
support libthr, we're now functionally complete (for some weird
definition of functionally; and complete). Runtime testing can
commence.
marcel [Sat, 31 May 2003 21:07:08 +0000 (21:07 +0000)]
Implement set_mcontext() and get_mcontext(). Just as for sendsig() and
sigreturn(), we cheat and assume the preserved registers are still
on-chip and unmodified. This is actually the case, but more by accident
than by design. We need to use unwinding eventually or explicitly
compile the kernel in a way that the compiler steers clear from using
the preserved registers completely.