Commit Graph

40355 Commits

Author SHA1 Message Date
Peter Wemm
c35518b4ed Make this more compatable with libc_r. Make the internal types for storing
registers an array of longs rather than int.
2003-06-02 21:49:35 +00:00
Poul-Henning Kamp
0f557e0ac0 Further devilification of CCD:
Change the list interface to simplify things.
Remove old list ioctls which bogusly exported the softc to userland.
Move the softc and associated structures from the public header to
the source file.
2003-06-02 21:29:04 +00:00
Poul-Henning Kamp
189337d81f Begin deevilification of CCD:
Make CCD a GEOM class.

For now only use this for implementing a OAM config method which
can return a list of configured CCD devices in the format which
"ccdconfig -g[v]" would normally output.
2003-06-02 20:50:03 +00:00
Tor Egge
c7251aede7 Initialize td->td_pcb->pcb_ext in cpu_thread_setup() since a garbage
value (e.g. 0xd0d0d0d0) can cause a kernel panic.
2003-06-02 20:43:28 +00:00
Poul-Henning Kamp
786a6905ec Return an indicative error message. 2003-06-02 20:35:37 +00:00
Robert Watson
985a0d9735 Also implement mpo_copy_mbuf_label() for mac_lomac, or labels may
not be properly propagated across some mbuf copy operations.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-02 18:49:11 +00:00
David E. O'Brien
c1050bf144 Document new (starting with 5.x) __FreeBSD_version scheme. 2003-06-02 18:03:20 +00:00
Scott Long
9f0f54ad83 Oops, __FreeBSD_version should be 501100, not 510100. The former implies
that we are at FreeBSD 5.10

Reminded by:	everybody
Guaranteed not to break world by:	imp
2003-06-02 17:53:08 +00:00
Jens Schweikhardt
7b594d2a81 s/u_short/unsigned short/ to make this compile if _POSIX_C_SOURCE=200112
Fix a few but probably not all style bugs.

Suggested by:	bde
MFC after:	2 weeks
2003-06-02 17:23:37 +00:00
Robert Watson
f32bb0529b Use mac_biba_label_copy() and mac_mls_label_copy() to implement the
mpo_copy_mbuf_label() entry point for Biba and MLS, respectively.
Otherwise, labels in m_tags may not be properly propagated across
some classes of mbuf operations.  This problem caused these policies
to fail-stop the system with a panic.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-02 17:21:38 +00:00
David E. O'Brien
71c5a90130 Use __FBSDID(). 2003-06-02 17:01:49 +00:00
David E. O'Brien
27e0099c4a Use __FBSDID(). 2003-06-02 16:56:40 +00:00
David E. O'Brien
006124d811 Use __FBSDID(). 2003-06-02 16:32:55 +00:00
Tor Egge
ad05d58087 Add tracking of process leaders sharing a file descriptor table and
allow a file descriptor table to be shared between multiple process
leaders.

PR:		50923
2003-06-02 16:05:32 +00:00
Hartmut Brandt
d68d53d4d6 Fix a typo in an ATM media name. As this name was not use yet, no problems
should occur.
2003-06-02 09:13:08 +00:00
Maxim Konovalov
b0af6a7be5 Remove unused #ifdef BRIDGE.
Reviewed by:	nyan
2003-06-02 08:36:18 +00:00
David E. O'Brien
db31907c73 Use __FBSDID(). 2003-06-02 06:48:51 +00:00
David E. O'Brien
9676a785e7 Use __FBSDID(). 2003-06-02 06:43:15 +00:00
David E. O'Brien
cef2a2e364 Use __FBSDID(). 2003-06-02 06:16:45 +00:00
David E. O'Brien
0f0f21c394 Use __FBSDID(). 2003-06-02 06:02:49 +00:00
Peter Wemm
193b147c05 MFi386: i386/include/asm.h rev 1.11: Do not abuse ##. 2003-06-02 05:59:35 +00:00
Mike Silbersack
1104779b70 Replace if_fxp's handrolled defrag function with m_defrag.
No actual bug with the existing code, just tidying things up.

Submitted by:	hmp
2003-06-02 05:16:42 +00:00
Scott Long
46ea475783 Bump __FreeBSD_version to 510100 for 5.1-CURRENT 2003-06-02 05:05:27 +00:00
Scott Long
5f23c2b5c4 We are at 5.1-CURRENT now 2003-06-02 04:58:43 +00:00
David E. O'Brien
dfb835396a Fix a style nit.
Submitted by:	ru
2003-06-02 03:26:03 +00:00
David E. O'Brien
8d19a0584b 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 "##".
2003-06-02 02:41:38 +00:00
David E. O'Brien
9f2636a8cf Don't use a C compiler to assemble a pure asm file. 2003-06-02 02:37:27 +00:00
Matt Jacob
e404e36b27 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.
2003-06-02 00:37:42 +00:00
David E. O'Brien
69bb404192 Use C99 compatable asm statements. 2003-06-02 00:29:35 +00:00
Alan Cox
cccf11b865 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.
2003-06-01 23:59:48 +00:00
Marcel Moolenaar
0fa2b83829 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.
2003-06-01 23:22:56 +00:00
Marcel Moolenaar
86f4f6f7b8 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.
2003-06-01 23:19:21 +00:00
Ruslan Ermilov
234dfc904a A new API function PacketAliasRedirectDynamic() can be used
to mark a fully specified static link as dynamic; i.e. make
it a one-time link.
2003-06-01 23:15:00 +00:00
Ruslan Ermilov
f1a529f3da 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.
2003-06-01 22:49:59 +00:00
Maxime Henrion
1edc4c46b8 Change a :
bzero(ptr, sizeof(DC_RXLEN * 5));
which should obviously be:
	bzero(ptr, DC_RXLEN * 5);

Looks like this bug may have reduced the effectiveness of the
workaround for the hardware bug in the PNIC chips.

MFC after:	1 week
2003-06-01 22:09:12 +00:00
David E. O'Brien
5345d76f4a Be sloppier about the miidevs.h dependency. This reduces the maintenance
effort at the expense of making miidevs.h a dependency for very .o.

Requested by:	imp
2003-06-01 20:47:46 +00:00
David E. O'Brien
3c5dad6ef0 Accpet '1'..'5' in place of F1..F5 for serial console users.
Reviewed by:	Bruce M Simpson <bms@spc.org>
2003-06-01 20:41:04 +00:00
David E. O'Brien
4b620ec03d Shorten long comment. 2003-06-01 20:28:20 +00:00
David E. O'Brien
713c939103 Sync with i386/GENERIC ordering. 2003-06-01 20:26:38 +00:00
Maxime Henrion
0934f18afb - 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
2003-06-01 19:26:34 +00:00
Matt Jacob
d8f9e010d2 Restore parentheses removed inappropriately in last commit. 2003-06-01 19:01:01 +00:00
Poul-Henning Kamp
83d771de78 Simplify the GEOM OAM api: Drop the request type, and let everything
hinge on the "verb" parameter which the class gets to interpret as
it sees fit.

Move the entire request into the kernel and move changed parameters
back when done.
2003-06-01 13:47:51 +00:00
Poul-Henning Kamp
a6c58fec6c constify g_sanity() 2003-06-01 13:30:39 +00:00
Dag-Erling Smørgrav
f834a1168c Add (but do not connect) a half-finished driver for Aureal Vortex cards.
The mixer works, pcm support is half done.
2003-06-01 11:58:46 +00:00
Poul-Henning Kamp
b3c481ae1a Remove break after return.
Add XXX comment where intent is unclear.

Found by:	FlexeLint
2003-06-01 09:27:33 +00:00
Poul-Henning Kamp
961de0b761 Remove #include <sys/disklabel.h> 2003-06-01 09:25:17 +00:00
Poul-Henning Kamp
b44f808797 Don't leak "barlist" allocation on failure.
Found by:	FlexeLint
2003-06-01 09:24:17 +00:00
Poul-Henning Kamp
4df05d61bd Remove unused variables.
Found by:       FlexeLint
2003-06-01 09:20:38 +00:00
Poul-Henning Kamp
58223589d5 Use bcmp() to compare hash strings. 2003-06-01 09:18:49 +00:00
Don Lewis
64820e19bc Don't unlock the parent directory vnode twice if the ISDOTDOT flag
is set.
2003-06-01 09:16:26 +00:00
Poul-Henning Kamp
878d4f3dda 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
Poul-Henning Kamp
04361c8c3a Make "where" an alias for "trace" 2003-06-01 09:06:23 +00:00
Poul-Henning Kamp
058675037b Add /* FALLTHROUGH */
Found by:	FlexeLint
2003-06-01 09:01:02 +00:00
Marcel Moolenaar
798c9e50b0 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
Don Lewis
3a140162b4 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
Marcel Moolenaar
bf822712f7 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
Yoshihiro Takahashi
079a4307f0 MFi386: revision 1.199 2003-06-01 04:51:07 +00:00
Yoshihiro Takahashi
de31756031 Merged from sys/isa/ppc.c revision 1.40. 2003-06-01 04:48:34 +00:00
Yoshihiro Takahashi
adeebc533e Merged from sys/isa/fd.c revision 1.250. 2003-06-01 04:46:30 +00:00
Yoshihiro Takahashi
b19a8c613b Merged from sys/dev/sio/sio.c revision 1.399. 2003-06-01 04:44:43 +00:00
Juli Mallett
b0327095f6 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
Robert Watson
e1249def7d 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
Robert Watson
ef2e1ca561 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
Robert Watson
a0ccd3f6ad 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 Wemm
395aac85f8 MFi386: rev 1.56: remove break after return 2003-05-31 22:02:11 +00:00
Peter Wemm
0c5b3efcb0 MFi386: rev 1.23: use gdb_strlen()/gdb_strcpy() directly. 2003-05-31 22:00:57 +00:00
Peter Wemm
fbbfc4c335 MFi386: rev 1.50: remove unused variable 2003-05-31 21:58:55 +00:00
Marcel Moolenaar
5e7019bf32 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
Poul-Henning Kamp
89e50d0e9a 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
Marcel Moolenaar
480a728dee 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
Poul-Henning Kamp
a3e7d3f16f wrap macro in do {...} while(0) 2003-05-31 21:11:51 +00:00
Poul-Henning Kamp
b82af320cf Add "" around mutex name to make message less confusing. 2003-05-31 21:11:01 +00:00
Poul-Henning Kamp
21e1378b62 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 Moolenaar
c01da18e22 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
Marcel Moolenaar
8ef6f226da 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 Moolenaar
3893a77138 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
Poul-Henning Kamp
07c6eac9d7 Add /* FALLTHROUGH */
Move /* FALLTHROUGH */ to correct location.
Remove unused variable(s).

Found by:       FlexeLint
2003-05-31 20:46:21 +00:00
Poul-Henning Kamp
82dcf708f8 Add /* FALLTHROUGH */
Remove unused variable(s).
Order switch in canonical order.

Found by:       FlexeLint
2003-05-31 20:44:32 +00:00
Poul-Henning Kamp
bd961794c3 Add /* FALLTHROUGH */
Found by:       FlexeLint
2003-05-31 20:43:47 +00:00
Poul-Henning Kamp
35e1694a4d Remove unused variable(s).
Add XXX comment where intent is unclear.

Found by:       FlexeLint
2003-05-31 20:43:17 +00:00
Marcel Moolenaar
62931aa266 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
Poul-Henning Kamp
bb0b8a23c0 Remove unused variable(s).
Found by:       FlexeLint
2003-05-31 20:42:24 +00:00
Poul-Henning Kamp
00999c80d8 Eliminate mostly unused local variable.
Found by:       FlexeLint
2003-05-31 20:41:52 +00:00
Poul-Henning Kamp
d2f30d92a7 Add /* FALLTHROUGH */
Remove break after return

Found by:       FlexeLint
2003-05-31 20:41:08 +00:00
Poul-Henning Kamp
25371920a0 Fix indentation
Found by:       FlexeLint
2003-05-31 20:40:12 +00:00
Poul-Henning Kamp
6f75979695 Remove unused variable(s).
Add /* FALLTHROUGH */

Found by:       FlexeLint
2003-05-31 20:39:28 +00:00
Poul-Henning Kamp
4738f8c1a8 Remove return after goto.
Remove break after return;

Found by:       FlexeLint
2003-05-31 20:35:32 +00:00
Poul-Henning Kamp
60db3b9e60 Remove unused variable(s).
Remove break after return;

Found by:       FlexeLint
2003-05-31 20:34:36 +00:00
Poul-Henning Kamp
66f7a83274 Put definition of struct svr4_sockcache_entry in a .h file rather than
having two independent definitions in two .c files.
Fiddle surrounding details to match.

Found by:       FlexeLint
2003-05-31 20:33:18 +00:00
Poul-Henning Kamp
670966596b Remove unused variable(s).
Found by:       FlexeLint
2003-05-31 20:29:34 +00:00
Poul-Henning Kamp
d1043f6d6a Remove break after return
Found by:       FlexeLint
2003-05-31 20:28:21 +00:00
Poul-Henning Kamp
85dc30cf82 Remove unused variable(s).
Put XXX comment where intent is unclear.

Found by:       FlexeLint
2003-05-31 20:27:42 +00:00
Poul-Henning Kamp
618b80ddcf Avoid unbalancing the { } count in the source file with #ifdef by
putting the opening { after the #ifdef ... #endif sequence.

Found by:       FlexeLint
2003-05-31 20:25:53 +00:00
Poul-Henning Kamp
7d4220518e Remove break after return;
Found by:       FlexeLint
2003-05-31 20:24:30 +00:00
Poul-Henning Kamp
9a3454805e Don't rely on boolean expression evaluating to 1 or 0 by default.
Found by:       FlexeLint
2003-05-31 20:23:46 +00:00
Poul-Henning Kamp
30f5ad0faf Remove unused variable(s).
Mark a non-critical memoryleak with XXX comment

Found by:       FlexeLint
2003-05-31 20:21:53 +00:00
Poul-Henning Kamp
1e18ce425e emove unused variable(s).
Found by:       FlexeLint
2003-05-31 20:19:13 +00:00
Poul-Henning Kamp
1e93e04fa9 Remove return after panic.
Found by:       FlexeLint
2003-05-31 20:18:23 +00:00
Poul-Henning Kamp
90471005e1 Remove needless return
Found by:       FlexeLint
2003-05-31 20:16:44 +00:00
Poul-Henning Kamp
4fe77d64a0 Add a couple of XXX comments where the intent is not clear.
Found by:       FlexeLint
2003-05-31 20:13:58 +00:00
Poul-Henning Kamp
74f1af0191 Remove unused variable(s).
Remove break after goto

Found by:       FlexeLint
2003-05-31 20:11:33 +00:00
Poul-Henning Kamp
b1921a6f33 Remove return after panic.
Found by:       FlexeLint
2003-05-31 20:09:42 +00:00
Poul-Henning Kamp
a62f80f8e0 Remove unused variable and now unbalanced call to splbio();
Found by:       FlexeLint
2003-05-31 20:09:01 +00:00
Poul-Henning Kamp
21b16e9715 Wrap macro in do {...} while(0);
Found by:       FlexeLint
2003-05-31 20:07:16 +00:00
Poul-Henning Kamp
048069758e Remove break after return.
Found by:       FlexeLint
2003-05-31 20:06:27 +00:00
Poul-Henning Kamp
bf975fe45b Remove unsed variables.
Add explicit breaks to switch

Found by:       FlexeLint
2003-05-31 20:05:25 +00:00
Poul-Henning Kamp
8eab8cefd8 Remove unused variable.
Found by:       FlexeLint
2003-05-31 20:04:19 +00:00
Poul-Henning Kamp
50cc8392cc Remove unused variables.
Remove now unused pointer to ether header.
Remove break after return

Found by:       FlexeLint
2003-05-31 20:02:43 +00:00
Poul-Henning Kamp
674ebf0f6b Remove break after return;
Found by:       FlexeLint
2003-05-31 20:01:14 +00:00
Poul-Henning Kamp
f22cfda31c Remove break after return
Found by:       FlexeLint
2003-05-31 19:59:29 +00:00
Poul-Henning Kamp
9c96882e80 Remove unused variables.
Found by:       FlexeLint
2003-05-31 19:58:45 +00:00
Poul-Henning Kamp
1000b87f2a Remove now unused pointer to etherheader.
Found by:       FlexeLint
2003-05-31 19:56:35 +00:00
Poul-Henning Kamp
61301f74d0 Remove unused variable.
Found by:       FlexeLint
2003-05-31 19:56:09 +00:00
Poul-Henning Kamp
29382d1af7 Remove double return()
Found by:       FlexeLint
2003-05-31 19:55:32 +00:00
Marcel Moolenaar
a063facbf6 Fix ia32 compat on ia64. Recent ia64 MD changes caused the garbage on
the stack to be changed in a way incompatible with elf32_map_insert()
where we used data_buf without initializing it for when the partial
mapping resulting in a misaligned image (typical when the page size
implied by the image is not the same as the page size in use by the
kernel). Since data_buf is passed by reference to vm_map_find(), the
compiler cannot warn about it.

While here, move all local variables to the top of the function.
2003-05-31 19:55:05 +00:00
Poul-Henning Kamp
c5d771b807 Prepend _ to internal union members to avoid ambiguity.
Found by:       FlexeLint
2003-05-31 19:52:15 +00:00
Poul-Henning Kamp
0b074f6c93 Remove unused variables
Found by:       FlexeLint
2003-05-31 19:51:05 +00:00
Poul-Henning Kamp
a0fb4cf18d Remove unused variables
Add /* FALLTHROUGH */

Found by:       FlexeLint
2003-05-31 19:49:49 +00:00
Poul-Henning Kamp
19ca58475e Remove unnecessary breaks.
Remove unused variables.
Add XXX comment where a break may be missing. [lxtphy.c]

Found by:       FlexeLint
2003-05-31 19:48:33 +00:00
Poul-Henning Kamp
5a87a6f702 Move some FALLTHROUGH comments so they work.
Fix indentation error.
Make boardid string long enough.
Remove unused variable.

Found by:       FlexeLint
2003-05-31 19:46:58 +00:00
Poul-Henning Kamp
b77052e617 Remove unused variable.
Remove unneeded return;

Found by:       FlexeLint
2003-05-31 19:41:33 +00:00
Alan Cox
34567de7fc Add vm object locking to vm_object_madvise(). 2003-05-31 19:40:57 +00:00
Poul-Henning Kamp
3bae8877f4 Remove unused variables.
Found by:       FlexeLint
2003-05-31 19:40:43 +00:00
Poul-Henning Kamp
16cef37ea3 Don't define memcpy() to bcopy() and in particular not memset() to
bzero() when we have them all already.

Found by:       FlexeLint
2003-05-31 19:38:43 +00:00
Poul-Henning Kamp
b2bf0c7f48 Fix indentation.
Found by:       FlexeLint
2003-05-31 19:38:00 +00:00
Poul-Henning Kamp
7fd69a8064 Remove unused variables.
Rename struct h0h0 to g_hh01 in order to make it unique over files.

Found by:       FlexeLint
2003-05-31 19:37:21 +00:00
Poul-Henning Kamp
2f613363c7 Remove unused variable.
Found by:       FlexeLint
2003-05-31 19:34:52 +00:00
Poul-Henning Kamp
5578b9263b Do not define memset() to bzero(). We have a memset().
Found by:       FlexeLint
2003-05-31 19:31:46 +00:00
Poul-Henning Kamp
c543626797 Remove unused variables.
Remove #ifdef notyet which will never become.

Found by:       FlexeLint
2003-05-31 19:30:52 +00:00
Poul-Henning Kamp
23bfa598a8 Remove unused variable.
Remove unneeded return.

Found by:       FlexeLint
2003-05-31 19:29:38 +00:00
Poul-Henning Kamp
68283a9b5a Remove unused variable.
Found by:       FlexeLint
2003-05-31 19:28:53 +00:00
Poul-Henning Kamp
ce67c955ca Add a destroy_geom method to the slice "library".
If a slice class has no destroy_geom method, use this one.

This should allow all slicers to kldload.
2003-05-31 19:25:05 +00:00
Poul-Henning Kamp
fc29c9de5c Don't use & in front of arrays.
Found by:       FlexeLint
2003-05-31 19:23:11 +00:00
Poul-Henning Kamp
a980e07369 Remove unused variable.
Found by:       FlexeLint
2003-05-31 19:08:23 +00:00
Poul-Henning Kamp
e4d2978dd8 Add /* FALLTHROUGH */
Found by:       FlexeLint
2003-05-31 19:07:22 +00:00
Poul-Henning Kamp
8aa2b5ce7e We cannot use the normal strlen() and strcpy, but don't #define strlen and
strcpy to get private versions, use private versions directly.

Found by:       FlexeLint
2003-05-31 19:06:38 +00:00
Poul-Henning Kamp
76e4a2dc72 Add missing break;
Found by:       FlexeLint
2003-05-31 19:04:37 +00:00
Poul-Henning Kamp
c9e61fbb81 Protect macro with do { ... } while (0)
Found by:       FlexeLint
2003-05-31 19:04:07 +00:00
Poul-Henning Kamp
80fcafb161 Remove unused variable.
Found by:       FlexeLint
2003-05-31 19:03:20 +00:00
Poul-Henning Kamp
78b52202d0 Fix indentation.
Found by:       FlexeLint
2003-05-31 19:02:20 +00:00
Robert Watson
05e830f1e7 Rewrite Biba and MLS label externalization code to use sbufs instead
of C strings internally; C strings require a lot of return value
checking that (a) takes a lot of space, and (b) is difficult to get
right.  Prior to the advent of compartment support, modeling APIs
for helper functions on snprintf worked fine; with the additional
complexity, the sbuf_printf() API makes a lot more sense.

While doing this, break out the printing of sequential compartment
lists into a helper function, mac_{biba,mls}_compartment_to_string().
This permits the main body of mac_{biba,mls}_element_to_string()
to be concerned only with identifying sequential ranges rather
than rendering.

At a less disruptive moment, we'll push the move from snprintf()-like
interface to sbuf()-like interface up into the MAC Framework layer.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-05-31 19:01:44 +00:00
Poul-Henning Kamp
01bfa91fa2 Fix off-by-one error in range check of VC index.
Found by:       FlexeLint
2003-05-31 19:01:08 +00:00
Poul-Henning Kamp
9a4b535c7a Add /* FALLTHROUGH */
Found by:       FlexeLint
2003-05-31 19:00:02 +00:00
Poul-Henning Kamp
89e3693051 Remove extra ';'
Found by:       FlexeLint
2003-05-31 18:57:41 +00:00
Poul-Henning Kamp
e64f402ff1 Hang softc from dev_t 2003-05-31 18:56:58 +00:00
Poul-Henning Kamp
d6b602d4b2 Remove unused variable.
Found by:       FlexeLint
2003-05-31 18:55:18 +00:00
Poul-Henning Kamp
04d0f26703 Fix off-by-one errors in range checks of state machine states & events.
Found by:       FlexeLint
2003-05-31 18:54:02 +00:00
Poul-Henning Kamp
5eed219cef Remove extra ';'
Found by:       FlexeLint
2003-05-31 18:52:38 +00:00
Poul-Henning Kamp
ff81e317d4 Use temporary variable to avoid double expansion of macro with side effects.
Found by:       FlexeLint
2003-05-31 18:46:45 +00:00
Poul-Henning Kamp
c7b24d7dcd Remove unused variable.
Found by:       FlexeLint
2003-05-31 18:45:32 +00:00
Poul-Henning Kamp
777d1b3990 Fix off-by-one error in drive number check.
Don't return(foo(...)) in function returning void.

Found by:       FlexeLint
2003-05-31 18:41:09 +00:00
Poul-Henning Kamp
0623afde6f Remove extra unused variable.
Found by:       FlexeLint
2003-05-31 18:39:29 +00:00
Poul-Henning Kamp
9d4b1fa40e Remove extra ';'
Found by:       FlexeLint
2003-05-31 18:37:30 +00:00
Poul-Henning Kamp
5d9bef6473 Add GEOM module compilation shims. 2003-05-31 18:36:41 +00:00
Poul-Henning Kamp
da507a2181 Fix \ alignment in macro.
Remove breaks after return.
Remove unused variable.

Found by:       FlexeLint
2003-05-31 18:21:40 +00:00
Poul-Henning Kamp
7379c88f4f Add /* FALLTHROUGH */
Found by:       FlexeLint
2003-05-31 18:20:26 +00:00
Poul-Henning Kamp
6280ed26af Remove unused local variables.
Found by:       FlexeLint
2003-05-31 18:17:32 +00:00
Poul-Henning Kamp
6c87f8d5ea Introduce a init and fini member functions on a class.
Use ->init() and ->fini() to handle the mutex in geom_disk.c

Remove the g_add_class() function and replace it with a standardized
g_modevent() function.

This adds the basic infrastructure for loading/unloading GEOM classes
2003-05-31 18:13:07 +00:00
Garrett Wollman
6e49b1fe55 Don't generate an ip_id for packets with the DF bit set; ip_id is
only meaningful for fragments.  Also don't bother to byte-swap the
ip_id when we do generate it; it is only used at the receiver as a
nonce.  I tried several different permutations of this code with no
measurable difference to each other or to the unmodified version, so
I've settled on the one for which gcc seems to generate the best code.
(If anyone cares to microoptimize this differently for an architecture
where it actually matters, feel free.)

Suggested by:	Steve Bellovin's paper in IMW'02
2003-05-31 17:55:21 +00:00
Poul-Henning Kamp
03841f4eec Eliminate potential overflows by allocating softc dynamically,
removing at the same time the need for this to be a "count" config
option.

Found by:       FlexeLint
2003-05-31 17:06:20 +00:00
Poul-Henning Kamp
f075585f67 Remove the G_CLASS_INITIALIZER, we do not need it anymore. 2003-05-31 16:59:27 +00:00
Poul-Henning Kamp
8e5d2c7eca Fix systematic off-by-one errors in unit number range checks.
Found by:       FlexeLint
2003-05-31 16:57:01 +00:00
Poul-Henning Kamp
56824e138d Use symbolic constants instead of "4".
Use arrays instead of relying on struct packing.

Identical md5(scsi_ch.o).
2003-05-31 16:54:37 +00:00
Poul-Henning Kamp
850cb24ef8 "break" rather than fall through to a break in the default clause.
Found by:       FlexeLint
2003-05-31 16:53:16 +00:00
Poul-Henning Kamp
26028fee6f Don't use return(foo(...)); in function returning void.
Found by:       FlexeLint
2003-05-31 16:51:41 +00:00
Poul-Henning Kamp
7e28a78f0e Use le_uuid_dec() since GPT UUID's are always in LE format.
Tested by:      Marcel
2003-05-31 16:48:43 +00:00
Poul-Henning Kamp
8313328657 Introduce {be,le}_uuid_{enc,dec}() functions for explicitly encoding
and decoding UUID's in big endian and little endian binary format.
2003-05-31 16:47:07 +00:00
Poul-Henning Kamp
17a1391990 The IO_NOWDRAIN and B_NOWDRAIN hacks are no longer needed to prevent
deadlocks with vnode backed md(4) devices because md now uses a
kthread to run the bio requests instead of doing it directly from
the bio down path.
2003-05-31 16:42:45 +00:00
Poul-Henning Kamp
7021f3f539 Don't use return(foo(...)); in a function returning void.
Found by:       FlexeLint
2003-05-31 16:36:42 +00:00
Scott Long
0480feef80 Man, I'm not on the ball. 4th does not need to escape '\' chars. This
should make our beloved friend look less like he has a massive head wound.
2003-05-31 16:07:00 +00:00
Scott Long
d9d27cecf8 Flag when ACPI has been disabled by the user so that sysinstall can do
something with it.
2003-05-31 11:19:11 +00:00
Peter Wemm
4af5a3de60 Add acpi to the build. Remove the hack from machdep.c that lies to the
loader to shut it up.
2003-05-31 07:00:08 +00:00
Peter Wemm
b043c80645 Have hammer_time() return the proc0 stack location, and have locore
switch to it before calling mi_startup().  The bootstack is WAY too small
for running acpica during probe/attach.  While here, pass modulep/physfree
to the startup routine, rather than writing to the global variables in
locore.S.

Approved by:  re (amd64/*)
2003-05-31 06:54:29 +00:00
Peter Wemm
5681a6f60d Regenerate. 2003-05-31 06:51:04 +00:00
Peter Wemm
1f5b79bc16 Make this compile with WITNESS enabled. It wants the syscall names. 2003-05-31 06:49:53 +00:00
Peter Wemm
ff7bf2f72e Port acpica to amd64.
Approved by:  re (amd64/* blanket)
2003-05-31 06:47:05 +00:00
Peter Wemm
151cd71608 Add the MD ifdefs for amd64 to point to the IO space bustag/handle.
Approved by:  re ("safe" amd64 support)
2003-05-31 06:45:28 +00:00
Peter Wemm
cc71eb5e10 With the help of jhb, fix the ACPI_ACQUIRE_GLOBAL_LOCK() macros and
port to amd64 after repocopy.

Approved by: re (amd64/*)
2003-05-31 06:43:55 +00:00
Peter Wemm
d5167abf3c Add __amd64__ to the ifdefs that introduce the "pcicfg" spinlock to
witness.

Approved by:  re (safe amd64 support)
2003-05-31 06:42:37 +00:00
Scott Long
832bb1e2d0 Enable the new bootloader for i386 only. The new loader.rc is will only
be installed if an old one does not exist, i.e. only during install, not
during upgrades.

Approved by:	re
2003-05-31 05:25:18 +00:00
Thomas Moestl
c944338750 Fix interrupt assignment for non-builtin PCI devices on e450s.
This machine uses a non-standard scheme to specify the interrupts to
be assigned for devices in PCI slots; instead of giving the INO
or full interrupt number (which is done for the other devices in this
box), the firmware interrupt properties contain intpin numbers, which
have to be swizzled as usual on PCI-PCI bridges; however, the PCI host
bridge nodes have no interrupt map, so we need to guess the
correct INO by slot number of the device or the closest PCI-PCI
bridge leading to it, and the intpin.

To do this, this fix makes the following changes:
- Add a newbus method for sparc64 PCI host bridges to guess
  the INO, and glue code in ofw_pci_orb_callback() to invoke it based
  on a new quirk entry. The guessing is only done for interrupt numbers
  too low to contain any IGN found on e450s.
- Create another new quirk entry was created to prevent mapping of EBus
  interrupts  at PCI level; the e450 has full INOs in the interrupt
  properties of EBus devices, so trying to remap them could cause
  problems.
- Set both quirk entries for e450s; remove the no-swizzle entry.
- Determine the psycho half (bus A or B) a driver instance manages
  in psycho_attach()
- Implement the new guessing method for psycho, using the slot number,
  psycho half and property value (intpin).

Thanks go to the testers, especially Brian Denehy, who tested many kernels
for me until I had found the right workaround.

Tested by:	Brian Denehy <B.Denehy@90east.com>, jake, fenner,
		Marius Strobl <marius@alchemy.franken.de>,
		Marian Dobre <mari@onix.ro>
Approved by:	re (scottl)
2003-05-30 20:48:05 +00:00
Hiten Pandya
b77c32a07e Rename BUS_DMAMEM_NOSYNC to BUS_DMA_COHERENT.
The current name is confusing, because it indicates to
the client that a bus_dmamap_sync() operation is not
necessary when the flag is specified, which is wrong.

The main purpose of this flag is to hint the underlying
architecture that DMA memory should be mapped in a coherent
way, but the architecture can ignore it.  But if the
architecture does supports coherent mapping of memory, then
it makes bus_dmamap_sync() calls cheap.

This flag is the same as the one in NetBSD's Bus DMA.

Reviewed by: gibbs, scottl, des (implicitly)
Approved by: re@ (jhb)
2003-05-30 20:40:33 +00:00
Robert Watson
6d7f268ad1 rpc.lockd stability workaround: remove PCATCH from the tsleep() in
nfs_lock.c.  Right now, if we permit a signal to interrupt the sleep,
we will slip the lock and no process on that client, the server, or
any other client will be able to acquire the lock.  This can happen,
for example, if a user hits Ctrl-C or Ctrl-T while a process is
waiting for the lock.  By removing PCATCH, we prevent that from
happening, at the cost of not permitting a user-requested lock abort:
also nasty.  However, a user interface bug might be preferable to a
serious semantic bug, so we go with that for now.

We need to teach the rpc.lockd/kernel protocol how to abort lock
requests, and rpc.lockd how to handle aborted lock requests; patches
for the kernel bit are floating around, but no rpc.lockd bit yet.

Approved by:	re (scottl)
2003-05-30 17:15:56 +00:00
Robert Watson
c2ea1fec5b Make sure all character pointers are properly initialized; this was
mismerged from the MAC tree, and didn't get picked up because warnings
are not normally fatal in per-module builds, only when they are linked
into a kernel (such as LINT).

Reported by:	des and the technicolor tinderbox
Approved by:	re (scottl)
2003-05-30 17:02:36 +00:00
Scott Long
dfc36ded78 Add a new bootloader menu. Pull in screen.4th and frames.4th from the
examples directory to support it.  This is installed only on i386 for
now.  It will be enabled in a later commit.

Approved by:	re
2003-05-30 09:29:24 +00:00
Scott Long
9d5be300d3 Add support for the upcoming 2410SA card.
Approved by:	re (telecon)
2003-05-30 09:22:19 +00:00
Scott Long
95c9929a3b aic79xx.c:
Use the special LUNLEN_SINGLE_LEVEL constant for
	post Rev A4 hardware for single byte luns.  Without
	this change, Rev B hardware would place the single
	byte of lun data in byte 0 of the lun structure when
	it should be in byte 1.  Since there are few if any
	devices on the market that support multiple luns in
	target mode, the corrupted lun field (which was only
	corrupted for non-zero luns) wasn't hurting us.

Approved by: re	(rwatson)
2003-05-30 02:15:15 +00:00
Scott Long
6ee007e145 Fix a reported case of severe data corruption:
aic79xx.h:
aic79xx.reg:
	Return the SCB_TAG field to 16byte alignment.
	It seems that on some PCI systems, SCBs are not
	transferred correctly to the controller with
	the previous placement of the SCB_TAG field.

Approved by:	re (rwatson)
2003-05-30 02:14:22 +00:00
Peter Wemm
edd1f930aa Update the kernel compile flags inside the .if ${MACHINE_ARCH} == "amd64"
section to stop gcc generating the dwarf2 .eh_frame unwind tables.  It
is dead weight for the time being.  Maybe it can be used to perform
stack traces and/or get the location of function arguments in ddb, but
that requires a dwarf2 runtime interpreter, which we do not have.

Approved by:	re (amd64 "safe" bits)
2003-05-30 01:06:58 +00:00
Peter Wemm
ec2343a8e1 Add ddb machdep bits.
Approved by:	re (amd64 bits)
2003-05-30 01:03:43 +00:00
Peter Wemm
5c980babcd Nasty 'make it compile' port to amd64. Note that it needs some other
wire protocol for the extra registers.  I should probably just remove it
from here for now since its quite useless.

Approved by:	re (amd64/* blanket)
2003-05-30 01:02:52 +00:00
Peter Wemm
5feb2148ba Initial port to amd64 after repocopy from i386. Note that the
disassembler has not been updated yet, and will do some very strange
things.  It does tracebacks (without function arguments due to regparm
calling conventions) if -fno-omit-frame-pointer is used (to come later).
This achieves basic functionality.

Approved by:	re (amd64/* blanket)
2003-05-30 01:01:07 +00:00
Peter Wemm
0afbc83dfd Add setjmp/longjmp for ddb 2003-05-30 00:58:48 +00:00
Bernd Walter
6445c6bdf1 Correct the fix in rev 1.70
Some lines were misslocated

Submitted by:	Jay Cornwall <jay@evilrealms.net>
Approved by:	re (rwatson)
2003-05-29 23:47:12 +00:00
Robert Watson
7792fe5719 Use strsep() in preference to manual string parsing for Biba and MLS
label internalization.  Use sensible variable names.  Include comments.
Doesn't fix any known bugs, but may fix unknown ones.

Approved by:	re (scottl)
2003-05-29 22:51:52 +00:00
Maxime Henrion
193f2edbf9 When loading a module that contains a sysctl which is already compiled
in the kernel, the sysctl_register() call would fail, as expected.
However, when unloading this module again, the kernel would then panic
in sysctl_unregister().  Print a message error instead.

Submitted by:	Nicolai Petri <nicolai@catpipe.net>
Reviewed by:	imp
Approved by:	re@ (jhb)
2003-05-29 21:19:18 +00:00
David Malone
0f7e5f778a Add an INVARIENTS only check to make sure Giant is held if mbuf
allocation is attempted with M_TRYWAIT.

Reviewed by:	bmilekic
Approved by:	re (scottl)
2003-05-29 18:38:24 +00:00
David Malone
de1cab2b60 Grab giant in sendit rather than kern_sendit because sockargs may
allocate mbufs with M_TRYWAIT, which may require Giant.

Reviewed by:	bmilekic
Approved by:	re (scottl)
2003-05-29 18:36:26 +00:00
Thomas Moestl
9078f61c55 Completely disable interrupts (not just raise %pil) when calculating the
value to be written into tick_compare in tick_hardclock(). While
we were taking care that the value to be written was at least TICK_GRACE
ticks in the future, a vector interrupt could happen between calculating
the value and writing it. If it took longer than TICK_GRACE to complete
(which is doubtful for a single device-triggered vector interrupt, but
quite likely for some IPIs), the value written would be in the past
and tick interrupts (which drive hardclock and statclock) would stop
until %tick wraps around, which takes a long time.
Also, increase TICK_GRACE from 1000 to 10000 for good measure.

Reported by:	kris
Reviewed by:	jake
Approved by:	re (scottl)
2003-05-29 17:49:21 +00:00
Marcel Moolenaar
3a8c4f9f9c Move the sysctls of the misalignment handler to where they belong
and use OID_AUTO instead of fixed IDs.

Approved by: re@ (blanket)
2003-05-29 06:30:36 +00:00