Commit Graph

90478 Commits

Author SHA1 Message Date
phk
305dd90d00 Use bcmp() to compare hash strings. 2003-06-01 09:18:49 +00:00
phk
3f94d08046 Clarify the code a bit.
Submitted by:	Nadav Eiron <nadav@TheEirons.org>
2003-06-01 09:16:50 +00:00
truckman
c2bcb3a19e Don't unlock the parent directory vnode twice if the ISDOTDOT flag
is set.
2003-06-01 09:16:26 +00:00
phk
c12a93745f Remove unused variables.
Remove break after return.
Add XXX comment where intent is unclear.

Found by:       FlexeLint
2003-06-01 09:12:24 +00:00
phk
bfaecf4a47 Make "where" an alias for "trace" 2003-06-01 09:06:23 +00:00
phk
51281e3429 Add /* FALLTHROUGH */
Found by:	FlexeLint
2003-06-01 09:01:02 +00:00
marcel
10b3bd530b 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.

Pointed out by: mtm
2003-06-01 08:29:43 +00:00
jmallett
94463ac57a Make prototype match code with regard to constness of args to the
function pointer passed in.
2003-06-01 06:43:39 +00:00
tjr
dfd248ebc6 Split the env(1) manpage off from printenv(1); there is not much point
in keeping them together. Mention that printenv is obsolescent.
2003-06-01 06:29:47 +00:00
truckman
0c845cdfd3 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.

Reviewed by:	bde
2003-06-01 06:24:32 +00:00
tjr
564a07d9be Close files after opening them to avoiding leaking descriptors and memory. 2003-06-01 06:15:30 +00:00
marcel
2d3c5aba3d 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.
2003-06-01 05:57:58 +00:00
nyan
606016928a MFi386: revision 1.199 2003-06-01 04:51:07 +00:00
nyan
6a8f274032 Merged from sys/isa/ppc.c revision 1.40. 2003-06-01 04:48:34 +00:00
nyan
85061b76b7 Merged from sys/isa/fd.c revision 1.250. 2003-06-01 04:46:30 +00:00
nyan
d773af8769 Merged from sys/dev/sio/sio.c revision 1.399. 2003-06-01 04:44:43 +00:00
jmallett
dbdf5fd320 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.

Reviewed by:	marcel (some time ago)
2003-06-01 04:42:14 +00:00
rwatson
1963dd0ba4 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.
2003-06-01 02:42:18 +00:00
gordon
9e4887bad8 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.
2003-06-01 01:43:37 +00:00
des
fb023b686e Try to describe the control flags a little better. 2003-06-01 00:34:38 +00:00
marcel
ca00882d6c Build libthr by default on ia64. 2003-06-01 00:32:21 +00:00
gordon
a37c13def2 nwfs is network filesystem. Treat it as such when mounting filesystems. 2003-06-01 00:32:03 +00:00
des
71e070589a Don't build pam_std_option(). 2003-05-31 23:38:16 +00:00
rwatson
3a7cb1d1fd 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.

Reviewed by:	gordon
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-05-31 23:31:51 +00:00
rwatson
55281b2df1 Attempt to marginally de-obfuscate sections of the System V IPC access
control logic.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-05-31 23:17:30 +00:00
peter
acd4004bf3 MFi386: rev 1.56: remove break after return 2003-05-31 22:02:11 +00:00
peter
1b3d5aa600 MFi386: rev 1.23: use gdb_strlen()/gdb_strcpy() directly. 2003-05-31 22:00:57 +00:00
peter
73a59225a5 MFi386: rev 1.50: remove unused variable 2003-05-31 21:58:55 +00:00
obrien
2c128d0844 Wrap gperf & groff wth NO_CXX. 2003-05-31 21:29:38 +00:00
marcel
536604960e 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.
2003-05-31 21:21:35 +00:00
phk
3d538bff10 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.
2003-05-31 21:16:12 +00:00
schweikh
6856bac682 Fix grammar bogons.
MFC after:	3 days
2003-05-31 21:14:41 +00:00
marcel
2fe9074be4 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.
2003-05-31 21:14:25 +00:00
phk
ad5820a3d9 wrap macro in do {...} while(0) 2003-05-31 21:11:51 +00:00
phk
11a69d36a0 Add "" around mutex name to make message less confusing. 2003-05-31 21:11:01 +00:00
phk
c414ef8915 Add an XXX comment with a TODO item for next time we run a revision
on this API.
2003-05-31 21:10:01 +00:00
marcel
bf7c437f68 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.
2003-05-31 21:07:08 +00:00
schweikh
b8e383ac78 Rewrite this csh program as a /bin/sh program. This appears to be
the last csh script needed for a buildworld. You should now be able
to buildworld on a system that was compiled with NO_TCSH=true.
Verified to produce the same result for the one file being generated
during buildworld, share/doc/papers/kernmalloc/appendix.ms.

Reviewed by:	hackers@
MFC after:	2 weeks
2003-05-31 21:02:50 +00:00
marcel
dc5393a5ef Make the regset pointers const pointers for the context restore functions.
This works better with set_mcontext() and is more precise in general.
2003-05-31 21:02:18 +00:00
marcel
e4d5efee39 Some ia32 related finetuning for the EPC syscall path:
o  The SDM states that flushing the RSE in the cycle prior to the
   call to ia32 code yields the best performance. We don't really
   care to much about performance here, but we do the same anyway.
   I'm being paranoia and conservative here.
o  Only initialize the ia32 state registers, not the registers used
   as scratch by the ia32 engine. This saves a couple of loads from
   the trapframe, but also helps debugging: we don't clobber useful
   debugging data (engineering hints :-)
o  Make sure all general registers constituting ia32 state have been
   initialized. If there's no useful to be loaded from the trapframe,
   clear the register. This avoids accidentally leaking NaT bits.
o  Make sure we set ar.k6 prior to clobbering ar.bspstore and also
   set ar.k7 prior to setting sp. This fixes a race seen for ia64
   native code as well (and previously fixed too).
2003-05-31 20:57:26 +00:00
phk
d2dc9cb8f4 Add /* FALLTHROUGH */
Move /* FALLTHROUGH */ to correct location.
Remove unused variable(s).

Found by:       FlexeLint
2003-05-31 20:46:21 +00:00
phk
81cb8df2a1 Add /* FALLTHROUGH */
Remove unused variable(s).
Order switch in canonical order.

Found by:       FlexeLint
2003-05-31 20:44:32 +00:00
phk
cfd44d0633 Add /* FALLTHROUGH */
Found by:       FlexeLint
2003-05-31 20:43:47 +00:00
phk
da5ab211ef Remove unused variable(s).
Add XXX comment where intent is unclear.

Found by:       FlexeLint
2003-05-31 20:43:17 +00:00
marcel
bf9a37ed83 Make sure we have all the dirty registers in user frames on the
backing store before we discard them. It is possible that we
enter the kernel (due to an execve in this case) with a lot of
dirty user registers and that the RSE has only partially spilled
them (to make room for new frames). We cannot move the backing
store pointer down (to discard user registers) when not all of
the user registers are on the backing store.
So, we flush the register stack IFF this happens. Unconditionally
doing the flush is too costly, because the condition in which we
need to flush is very rare.

This change appears to fix the SIGSEGV that sometimes happen for
newly executed processes and so far also appears to fix the last
of the corruption. It is possible, although not likely, that this
change prevents some other bug from happening, even though it is
itself not a fix. Hence the uncertainty. We'll know in a couple
of months I guess :-)
2003-05-31 20:42:35 +00:00
phk
e4952b702f Remove unused variable(s).
Found by:       FlexeLint
2003-05-31 20:42:24 +00:00
phk
ab4f448244 Eliminate mostly unused local variable.
Found by:       FlexeLint
2003-05-31 20:41:52 +00:00
phk
0be28e9b95 Add /* FALLTHROUGH */
Remove break after return

Found by:       FlexeLint
2003-05-31 20:41:08 +00:00
phk
f438d88dd1 Fix indentation
Found by:       FlexeLint
2003-05-31 20:40:12 +00:00
phk
568e2f76aa Remove unused variable(s).
Add /* FALLTHROUGH */

Found by:       FlexeLint
2003-05-31 20:39:28 +00:00