Commit Graph

32515 Commits

Author SHA1 Message Date
Alfred Perlstein
ef1047305e cleanup:
fix line wraps, add some comments, fix macro definitions, fix for(;;) loops.
2002-05-01 08:08:24 +00:00
Peter Wemm
5a70dcbcc8 Connect up kern_envp *before* we use it for getenv() and console probing.
It is a bit late after that when we have no consoles. :-]

Also, fix a comment nit and print a warning about missing metadata.
2002-05-01 06:52:08 +00:00
Peter Wemm
49d8998589 Add "CFLAGS+= -I${MAKESRCPATH}" when running under the kernel build,
otherwise #include "aicasm.h" etc do not work with gcc-3 and later.
2002-05-01 06:50:59 +00:00
Crist J. Clark
0f56b10c4b Enlighten those who read the FINE POINTS of the documentation a bit
more on how ipfw(8) deals with tiny fragments. While we're at it, add
a quick log message to even let people know we dropped a packet. (Note
that the second FINE POINT is somewhat redundant given the first, but
since the code is there, leave the docs for it.)

MFC after:	1 day
2002-05-01 06:29:16 +00:00
Peter Wemm
33438f3bac Remove two unused headers (<machine/frame.h> and <machine/psl.h>).
psl.h is 100% bogus to be referenced here, especially from alpha MD code.
2002-05-01 06:24:51 +00:00
David E. O'Brien
addbf23d05 "pointers are not permitted as case values", so force the macros to ints. 2002-05-01 04:18:36 +00:00
David E. O'Brien
90a78bd0ba makeobjops.awk is stricter on syntax than the perl version. 2002-05-01 03:52:40 +00:00
David E. O'Brien
9fa411ae4a Use makeobjops.awk rather than makeobjops.pl.
(with big thanks to Oliver Fromme <olli@fromme.com>)
2002-05-01 03:28:14 +00:00
David E. O'Brien
dfbf15ee80 Awk version of makeobjops.PL.
Note the invocation ordering is slightly different:
	awk -f makeobjops.awk foo.m -ch

Submitted by:	Oliver Fromme <olli@fromme.com>
2002-05-01 03:19:19 +00:00
David E. O'Brien
82303b6b14 Remove the trailing ^M's. makeobjops.awk does not like them. 2002-05-01 03:07:40 +00:00
Peter Wemm
6692ac6644 Cosmetic tweaks. Try and keep the style more consistent, catch some stray
whitespace and update a comment.
2002-05-01 02:51:50 +00:00
Peter Wemm
4924b9dd80 Zap some stale unused headers, including one machine/psl.h (which is
a stub on alpha).  Compile tested on alpha and x86.
2002-05-01 02:17:33 +00:00
Peter Wemm
701964e4a2 Zap KMODDEPS entries so that people do not wonder why it isn't working on
-current.

Apolgies to: anhold
2002-05-01 01:34:48 +00:00
Peter Wemm
06639be707 Catch any stray KMODDEPS entries to make sure they do not keep turning up. 2002-05-01 01:32:28 +00:00
Peter Wemm
aed0556447 kern_tc.c doesn't use <machine/psl.h>, and having this #include breaks
other platforms.
2002-05-01 01:31:26 +00:00
David E. O'Brien
2244cf6bba Remove this Perl script. There have been zero bug reports against
vnode_if.awk.
2002-05-01 00:40:44 +00:00
Matthew N. Dodd
47bbd753d9 Document the location (in the source tree) of the "Porter's Handbook". 2002-04-30 23:55:16 +00:00
Matthew N. Dodd
a8f6daaeca Bump __FreeBSD_version for mtx_init() change.
Document same.

Forgotten by:	 jhb
2002-04-30 23:54:03 +00:00
Scott Long
1089f082aa Fix a bug where the aacp device would only talk to bus 0 on the
controller.
2002-04-30 22:50:26 +00:00
Scott Long
44b00b1df3 Note that the aacp device requires CAM 2002-04-30 22:47:26 +00:00
Jeff Roberson
289f207c81 Convert longs to u_longs in stats. This will hold off wrap arounds for a
while longer.
2002-04-30 22:39:32 +00:00
Alan Cox
ea0f50bcf0 o Convert the vm_page buckets mutex to a spin lock. (This resolves
an issue on the Alpha platform found by jeff@.)
 o Simplify vm_page_lookup().

Reviewed by:	jhb
2002-04-30 21:24:47 +00:00
Poul-Henning Kamp
39acc78a1e Brucifixion ? Yes, out that door, row on the left, one patch each.
Many thanks to:	bde
2002-04-30 20:42:06 +00:00
Poul-Henning Kamp
9c30ce571e Brucifixion ? Yes, out that door, row on the left, one patch each. 2002-04-30 19:48:45 +00:00
Poul-Henning Kamp
2266fe776e Don't export timecounter structures under debug. with sysctl, they
contain no truly interesting data anymore.
2002-04-30 19:34:31 +00:00
Matthew Dillon
e6728403d4 These are Alexander Kabaev's VFSops fixes (see the thread 'Found: module
loading breakage').  The patch fixes serious issues with the VFS
operations vector array which results in a crash when a filesystem module
adding a new VOP is loaded into the kernel.  Basically what was happening
before was that the old operations vector was being freed and a new one
allocated.  The original MALLOC code tended to reuse the same address
for the case and so the bug did not rear its ugly head until the new memory
subsystem was emplaced.

This patch replaces the temporary workaround Dave O'Brien comitted in 1.58.

The patch is clean enough that I intend to MFC it to stable at some point.

Submitted by:	Alexander Kabaev <ak03@gte.com>
MFC after:	1 week
2002-04-30 18:44:32 +00:00
Julian Elischer
d4f567ee57 Need more includes. 2002-04-30 16:43:51 +00:00
Julian Elischer
9a27ef0da4 Add the myson controllers to LINT
MFC after:	2 weeks
2002-04-30 16:08:16 +00:00
Julian Elischer
f269532cd0 Add the extra argument to mtx_init() 2002-04-30 15:50:09 +00:00
Benno Rice
b23e18d688 Add sigcode.S 2002-04-30 11:13:16 +00:00
Jeff Roberson
8efc4eff00 Add a new UMA debugging facility. This will overwrite freed memory with
0xdeadc0de and then check for it just before memory is handed off as part
of a new request.  This will catch any post free/pre alloc modification of
memory, as well as introduce errors for anything that tries to dereference
it as a pointer.

This code takes the form of special init, fini, ctor and dtor routines that
are specificly used by malloc.  It is in a seperate file because additional
debugging aids will want to live here as well.
2002-04-30 07:54:25 +00:00
Andrew R. Reiter
cecd70a0a2 - Take advantage of the M_ZERO flag that can now be passed to uma_zalloc.
- Remove atm_uma_ctor() as the M_ZERO will zero out the memory for us.
2002-04-30 07:41:59 +00:00
Marcel Moolenaar
1f0fa5e154 Add ar.lc and ar.ec to the trapframe. These are not saved for syscalls,
only for exceptions.

While adding this to exception_save and exception_restore, it was hard
to find a good place to put the instructions. The code sequence was
sufficiently arbitrarily ordered that the density was low (roughly 67%).
No explicit bundling was used.
Thus, I rewrote the functions to optimize for density (close to 80% now),
and added explicit bundles and nop instructions. The immediate operand
on the nop instruction has been incremented with each instance, to make
debugging a bit easier when looking at recurring patterns. Redundant
stops have been removed as much as possible. Future optimizations can
focus more on performance. A well-placed lfetch can make all the
difference here!

Also, the FRAME_Fxx defines in frame.h were mostly bogus. FRAME_F10 to
FRAME_F15 were copied from FRAME_F9 and still had the same index. We
don't use them yet, so nothing was broken.
2002-04-30 06:37:25 +00:00
Scott Long
d1def83b54 Fix udf_read(). Honor the uio_resid when determining the size of
the block to read and copy out.  This removes the hack in
udf_readatoffset() for only reading one block at a time.  WooHoo!
Remove a redundant test for fragmented fids in both udf_readdir()
and udf_lookup().  Add comment to both as to why the test is
written the way it is.  Add a few more safety checks for brelse().

Thanks to Timothy Shimmin <tes@boing.melbourne.sgi.com> for pointing
out these problems.
2002-04-30 05:05:05 +00:00
Jeff Roberson
2cc35ff9c6 Move the implementation of M_ZERO into UMA so that it can be passed to
uma_zalloc and friends.  Remove this functionality from the malloc wrapper.

Document this change in uma.h and adjust variable names in uma_core.
2002-04-30 04:26:34 +00:00
Warner Losh
883ee9463e skibo tells me that that I didn't apply all of his last patch, and
sent me a replacement patch that fixes the problem.  The challenge
buffer was not large enough by a factor of 4 (due to my changing the
size from 128 to 32, but not u_int8_t to u_int32_t).

MFC after: 1 day
Submitted by: skibo@pacbell.net
2002-04-30 03:46:27 +00:00
Alan Cox
7788e21963 o Revert vm_fault1() to its original name vm_fault(), eliminating the wrapper
that took its place for the purposes of acquiring and releasing Giant.
2002-04-30 03:44:34 +00:00
Marcel Moolenaar
d146070aa2 Make this work for ski again. Don't call ia64_mca_init() when we're
in the simulator.
2002-04-30 02:29:00 +00:00
Marcel Moolenaar
54ab759998 Include md_var.h. It has the prototype of ia64_running_in_simulator(). 2002-04-30 02:26:32 +00:00
Marcel Moolenaar
3b7c887b17 Remove KTR_EXTEND. 2002-04-30 02:14:24 +00:00
Seigo Tanimura
960ed29c4b Revert the change of #includes in sys/filedesc.h and sys/socketvar.h.
Requested by:	bde

Since locking sigio_lock is usually followed by calling pgsigio(),
move the declaration of sigio_lock and the definitions of SIGIO_*() to
sys/signalvar.h.

While I am here, sort include files alphabetically, where possible.
2002-04-30 01:54:54 +00:00
Jeff Roberson
28bc44195c Add a new zone flag UMA_ZONE_MTXCLASS. This puts the zone in it's own
mutex class.  Currently this is only used for kmapentzone because kmapents
are are potentially allocated when freeing memory.  This is not dangerous
though because no other allocations will be done while holding the
kmapentzone lock.
2002-04-29 23:45:41 +00:00
Paul Saab
d4aa427fd1 - Set the maximum number of device transactions to what the driver
is limiting it to, not what the device says it can handle.
- cl_status is an integer. cl_lstatus is a pointer.
- Add some debugging code to dump some things the driver knows about
  the adapter.
- Tell CAM that the adapter can handle more commands when a command
  completes.  This fixes the problem were the SIM would freeze once
  the driver hit the maximum number of transactions for the device.
- Change the vendor string to COMPAQ.
- Turn of Synchronize Cache for now.  It locks the controller up.

Approved by:	msmith
Obtained from:	Yahoo!
2002-04-29 21:46:09 +00:00
Warner Losh
0f98688eb0 We don't need the card_if.h here. It breaks the building of kernels
with wi but without pccard.  Also remove an RCS id that I don't think
we need.
2002-04-29 21:11:02 +00:00
Robert Watson
84f9ed84d7 Since devfs now uses vnode locks, add devfs back to IS_LOCKING_VFS. 2002-04-29 20:29:08 +00:00
Robert Watson
a12cfddc0f Use vnode locking with devfs; permit VFS locking assertions to make
sense for devfs vnodes, and reduce/remove potential races in the devfs
code.

Submitted by:	iadowse
Approved by:	phk
2002-04-29 20:00:39 +00:00
Warner Losh
1456297748 splsoftnet is spelled splimp in FreeBSD rather than splnet. splimp is
used to protect the rest of the driver.  This is a no-op commit to current,
but is needed for the MFC.

MFC after: 1 day
2002-04-29 19:04:29 +00:00
Eric Anholt
b1ade6ab46 More diff reduction: Shuffle around some header code as was done in
drmcommand-0-0-1-branch of DRI CVS, more return code cleanup, and remove some
gratuitous ifdefs.

Approved by:	des
2002-04-29 18:18:42 +00:00
Jake Burkholder
e289cb8fe7 Add support for an alternate signal trampoline; add a sysarch call to register
an alternate trampoling with the kernel.
2002-04-29 18:08:26 +00:00
Robert Watson
43a7c4e919 Re-add the 16384 bucket also.
Submitted by:	green
2002-04-29 17:53:23 +00:00
Robert Watson
bd796eb25f Revert a portion of kern_malloc.c:1.99, which (in addition to adding
malloc profiling) also modified the set of pre-defined buckets for the
memory allocator.  For reasons unknown to me, this resulted in extensive
memory corruption in the kernel, in particular on SMP boxes, so I'm
committing this work-around until Jeff gets a chance to debug it
properly.  David Wolfskill pointed me at this commit as the one that
might be a problem; I've been running this code on two dual-processor
burn-in boxes for about 12 hours now, and the rate of panics due to
memory corruption has dropped to zero (from one every five minutes).

Hopefully not treading on the toes of:	jeff
2002-04-29 17:12:02 +00:00
Mike Barcroft
d75cd4deb9 Make this header self-reliant with regard to the types it uses. 2002-04-29 16:58:54 +00:00
Josef Karthauser
8a7a68b108 Some non-functional changes to make the differences between NetBSD's
and our version clear to see.
2002-04-29 16:23:14 +00:00
Maxim Sobolev
f4b27e80b3 Regen after rev.1.89 of usbdevs. 2002-04-29 15:02:30 +00:00
Maxim Sobolev
daa77b45ce Change Device ID string for DaisyTech devices to be more sensible.
PR:		37197
Submitted by:	Olexander Kunytsa <kunia@istc.kiev.ua>
2002-04-29 15:01:35 +00:00
Poul-Henning Kamp
875525d517 Introduce NetBSD's mii_phy_match() API and use it in the nsgphy to
get a description printed.
2002-04-29 14:09:10 +00:00
Poul-Henning Kamp
e5fbad8bca Convert exphy and ukphy over to the new code.
exphy is done flying blind, ukphy is tested on one card.
2002-04-29 13:35:31 +00:00
Poul-Henning Kamp
279fe8d156 Make one generic mii_phy_detach() to replace 19 slightly different ones.
Rename mii_phy_auto_stop() mii_phy_down().

Introduce mii_down(), use it from nge.  Do not indirect it to 19 identical
case's in 19 switchstatements like NetBSD did.
2002-04-29 13:07:38 +00:00
Benno Rice
b57e802a85 Commit of stuff that's been sitting in my tree for a while.
Highlights include:
- New low-level trap code from NetBSD.  The high level code still needs a lot
  of work.
- Fixes for some pmap handling in thread switching.
- The kernel will now get to attempting to jump into init in user mode.  There
  are some pmap/trap issues which prevent it from actually getting there though.

Obtained from:	NetBSD (parts)
2002-04-29 12:14:31 +00:00
Poul-Henning Kamp
78c8c3db4b Move a lot closer to NetBSDs MII support for GigE.
Move fxp and nge drivers over to use the new stuff.
2002-04-29 11:57:30 +00:00
Benno Rice
d809b79220 - Add back calls to setfault that were removed when these functions were moved. 2002-04-29 09:28:56 +00:00
David Malone
dbe620d321 Add a sysctl which disables the logging of console output.
Approved by:	phk
MFC after:	2 weeks
2002-04-29 09:15:38 +00:00
Jeroen Ruigrok van der Werven
1cf1a725ff Fix indention which I did wrong in a previous commit.
Submitted by:	bde
2002-04-29 08:18:06 +00:00
Peter Wemm
db17c6fc07 Tidy up some loose ends.
i386/ia64/alpha - catch up to sparc64/ppc:
- replace pmap_kernel() with refs to kernel_pmap
- change kernel_pmap pointer to (&kernel_pmap_store)
  (this is a speedup since ld can set these at compile/link time)
all platforms (as suggested by jake):
- gc unused pmap_reference
- gc unused pmap_destroy
- gc unused struct pmap.pm_count
(we never used pm_count - we track address space sharing at the vmspace)
2002-04-29 07:43:16 +00:00
Warner Losh
d76b2f9d54 Spell hw.cbb.start_memory the same in the HINT as well as the sysctl.
Noted by: bde
2002-04-29 07:41:58 +00:00
Warner Losh
9ce2d50cf2 Make sysctl RW 2002-04-29 07:37:09 +00:00
Poul-Henning Kamp
b7dee1db97 Moving closer to being able to use NetBSD's generic mii_set_media()
function.
2002-04-29 07:18:26 +00:00
Warner Losh
8ad896e0ad Untimeout before calling timeout. I think that I have caught all the cases
where we were scheduling a timeout multiple times, but am not positive.
2002-04-29 06:55:46 +00:00
Poul-Henning Kamp
a295ccc9f0 Edging ever closer to NetBSD... 2002-04-29 06:48:20 +00:00
David E. O'Brien
f3320cac13 Barrow something from the `nmap' port to help the ENOCLUE people upgrading
from releng4 and are not able to properly read make(1) output.
2002-04-29 06:35:25 +00:00
Poul-Henning Kamp
45521525a7 Move us yet closer to IFM_* definitions in NetBSD. 2002-04-29 05:32:44 +00:00
Alan Cox
532eadef77 Document three synchronization issues in vm_fault(). 2002-04-29 05:23:01 +00:00
Eric Anholt
c9d942be3a Diff reduction to my experimental code: clean up return code handling.
Approved by:	des
2002-04-29 00:25:10 +00:00
Alan Cox
780b1c0997 Pass the caller's file name and line number to the vm_map locking functions. 2002-04-28 23:12:52 +00:00
Cameron Grant
21ed9908a2 add a missing \n to an unregister failure message 2002-04-28 22:59:45 +00:00
Cameron Grant
9dbee70d4a recognise ct5880-e
Submitted by:	SONODA Yoshihide <yshd@na.rim.or.jp>
2002-04-28 22:38:23 +00:00
Poul-Henning Kamp
b418ad5c2e Follow NetBSD and s/IFM_1000_TX/IFM_1000_T/ 2002-04-28 20:34:20 +00:00
Poul-Henning Kamp
07dd938303 Don't pass three args when one will do just fine, and even prevent
mistakes like the one brgphy.c (now corrected).
2002-04-28 19:25:07 +00:00
Dag-Erling Smørgrav
afe18bfe77 Move drm to the i386-only section. 2002-04-28 19:21:48 +00:00
Poul-Henning Kamp
83549c664b Improve an API by about 4 lines per driver. 2002-04-28 19:01:32 +00:00
Poul-Henning Kamp
3aae18bde8 Use generic MII #defines instead of private ones when the registers
are IEEE defined.

Object file comes out the same.
2002-04-28 18:47:29 +00:00
Poul-Henning Kamp
1aad4b2a52 Merge in rev 1.9 from NetBSD. 2002-04-28 18:43:30 +00:00
Poul-Henning Kamp
2f35ea476d We don't need the arp kludge any more. 2002-04-28 18:29:44 +00:00
Poul-Henning Kamp
6b00cf46ec Stylistic sweep through the timecounter code.
Renovate comments.
2002-04-28 18:24:21 +00:00
Poul-Henning Kamp
d25917e856 Don't screw up our uptime with historical dates. 2002-04-28 16:51:36 +00:00
Gary Jennejohn
3573a23fa1 Change instances of avma1pp2- to ifpi2- in printf's since the name
of the driver should be emitted.

This was already changed in the code committed to RELENG_4.
2002-04-28 11:47:10 +00:00
Bruce Evans
4cfce7a7a6 Removed unused forward struct declaration. 2002-04-28 09:51:45 +00:00
Marcel Moolenaar
4ee5409b54 Add mca.c. 2002-04-28 08:43:47 +00:00
Scott Long
b22841b0ff Nuke -g 2002-04-28 06:38:38 +00:00
Alan Cox
d974f03c69 o Introduce and use vm_map_trylock() to replace several direct uses
of lockmgr().
 o Add missing synchronization to vmspace_swap_count(): Obtain a read lock
   on the vm_map before traversing it.
2002-04-28 06:07:54 +00:00
Eric Anholt
67a2a28fe4 Hook the DRM up to the build and add it to NOTES.
Approved by:	des
2002-04-28 04:58:40 +00:00
Warner Losh
9218b6a376 Alphabetize descriptions and remove the "PCI" from the desciptions.
Suggested by: brooks
2002-04-28 02:04:28 +00:00
Peter Wemm
44e74ba6c3 We do not necessarily need to map/unmap pages to zero parts of them.
On systems where physical memory is also direct mapped (alpha, sparc,
ia64 etc) this is slightly harmful.
2002-04-28 00:15:48 +00:00
Ian Dowse
ba1551ca81 Avoid the user-visible effect of setting SA_NOCLDWAIT when the
SIGCHLD handler is SIG_IGN. This is a reimplementation of the
problematic revision 1.131 of kern_exit.c. To avoid accessing process
UPAGES, we set a new procsig flag when the SIGCHLD handler is SIG_IGN
and use that instead.
2002-04-27 22:41:41 +00:00
Peter Wemm
4f033348f4 Finish fixing hints. Remember the use_kenv state for the next run.
Otherwise we fall back to using the static hints the next time around.
We still have the leftover fallback code there which meant that we skipped
the use_hints checking on the second and subsequent calls.  Also, be a bit
more careful about walking off the end of the envp array.

I've extracted this from a larger diff.  I hope I didn't miss anything...
2002-04-27 22:32:57 +00:00
Peter Wemm
fc1218bb71 Partial fix for hints
Obtained from:  mux
2002-04-27 22:25:13 +00:00
Ian Dowse
3eee035c5b Remove a stale comment saying that the vnode lock must be the first
element in the structure pointed to by vp->v_data; the vnode lock
is now within the vnode structure itself.
2002-04-27 22:20:33 +00:00
Ian Dowse
10632e44cc Remove the nfs_{lock,unlock,islocked} functions and the associated
definitions; they have been unused and #if 0'd out since the Lite/2
merge and we are unlikely to want them in the future.
2002-04-27 22:10:16 +00:00
Alan Cox
089b073345 o Begin documenting the (existing) locking protocol on the vm_map
in the same style as sys/proc.h.
 o Undo the de-inlining of several trivial, MPSAFE methods on the vm_map.
   (Contrary to the commit message for vm_map.h revision 1.66 and vm_map.c
   revision 1.206, de-inlining these methods increased the kernel's size.)
2002-04-27 22:01:37 +00:00
Eric Anholt
24d44c5d51 Add makefiles for DRM modules
Approved by:	des
2002-04-27 20:55:03 +00:00
Eric Anholt
4fc9623548 Add the code for the DRM, based on the code from the drm-kmod port.
This is not hooked up yet, that will come later.

Approved by:	des
2002-04-27 20:47:57 +00:00
Alan Cox
c01945726b For what it's worth, fix the compilation of an I386_CPU-only kernel
now that certain warnings are fatal.
2002-04-27 18:13:35 +00:00
Alan Cox
ce6612b6b6 Don't call vm_map_growstack() from trapwrite() as vm_fault() now performs
this automatically.
2002-04-27 17:07:15 +00:00
Alan Cox
72ba293d78 MFi386 1.222: Remove vm_map_growstack() and acquisition and release of Giant
around vm_fault() in trap_pfault().
2002-04-27 17:00:28 +00:00
Darren Reed
7df187a3ad Merge updates from 3.4.26 - 3.4.27. 2002-04-27 16:56:25 +00:00
Warner Losh
cd5a4c63c7 This patch fixes my breakage of ssid matching. I introduced the
breakage when I tried to merge OpenBSD wi_hostap changes into the
tree.  Skibo found the problem and submitted these patches.  Thanks!

Submitted by: skibo@pacbell.net
2002-04-27 16:03:25 +00:00
Warner Losh
0853849336 Better names for the PCI cards. The biggest change is that we now
identify the Intersil Prism 2.5 PCI native card as that, rather than
Linksys, the first folks to get it to market.
2002-04-27 16:01:26 +00:00
Alan Cox
644d87b30a MFi386 1.222: Remove vm_map_growstack() and acquisition and release of Giant
around vm_fault().
2002-04-27 09:34:15 +00:00
Seigo Tanimura
acbbcc5f1d Fix the code fragment clobbered in my last commit. 2002-04-27 09:33:49 +00:00
Seigo Tanimura
d48d4b2501 Add a global sx sigio_lock to protect the pointer to the sigio object
of a socket.  This avoids lock order reversal caused by locking a
process in pgsigio().

sowakeup() and the callers of it (sowwakeup, soisconnected, etc.) now
require sigio_lock to be locked.  Provide sowwakeup_locked(),
soisconnected_locked(), and so on in case where we have to modify a
socket and wake up a process atomically.
2002-04-27 08:24:29 +00:00
Poul-Henning Kamp
f5d157fb51 Explain magic number.
Add magic date no explanation.

Add a delta which was lost in transit yesterday which prevented
other timecounters from actually being used.
2002-04-27 07:28:54 +00:00
Poul-Henning Kamp
50d866ce0f Fix a {} bug which doesn't have any effect yet.
Spotted by:	jake
2002-04-27 07:07:37 +00:00
Poul-Henning Kamp
f175569ac2 Make the dummy timecounter actually tick or we will never get anyhere. 2002-04-27 07:06:52 +00:00
John Baldwin
e64b74e35b Whitespace bogon. 2002-04-27 04:48:36 +00:00
Marcel Moolenaar
9ae9d0ff86 Insert a semi-colon between label 'skip:' and the closing brace
of the FOREACH loop to silence GCC 3.
2002-04-27 02:58:18 +00:00
Scott Long
fe3cb0e1ec Add a CAM interface to the aac driver. This is useful in case you should
ever connect a SCSI Cdrom/Tape/Jukebox/Scanner/Printer/kitty-litter-scooper
to your high-end RAID controller.  The interface to the arrays is still
via the block interface; this merely provides a way to circumvent the
RAID functionality and access the SCSI buses directly.  Note that for
somewhat obvious reasons, hard drives are not exposed to the da driver
through this interface, though you can still talk to them via the pass
driver.  Be the first on your block to low-level format unsuspecting
drives that are part of an array!

To enable this, add the 'aacp' device to your kernel config.

MFC after:	3 days
2002-04-27 01:31:17 +00:00
Warner Losh
3465a702f3 Make this driver compile for -stable also to prep for MFC 2002-04-26 23:11:23 +00:00
Mike Barcroft
a30d4b3270 Move the new byte order function prototypes from <sys/param.h> to
<sys/endian.h>.  This puts us in line with NetBSD and OpenBSD.
2002-04-26 22:48:23 +00:00
Alan Cox
cbd53e95fe o Control access to the vm_page_buckets with a mutex.
o Fix some style(9) bugs.
2002-04-26 22:44:15 +00:00
Wes Peters
8373917257 Rename the file used to specify the nextboot to make it clear that this
is a loader configuration file and can be used for more than just a
kernel name.

Submitted by:	Gordon Tetlow <gordont@gnf.org>
2002-04-26 22:32:15 +00:00
Poul-Henning Kamp
62efba6a0c Now that the private parts of timecounters are no longer being fingered
by other bits of code, split struct timecounter into two.

struct timecounter contains just the bits which pertains to the hardware
counter and the reading of it.

struct timehands (as in "the hands on a clock") contains all the ugly bit
fidling stuff.  Statically compile ten timehands.

This commit is the functional part.  A later cosmetic patch will rename
various variables and fieldnames.
2002-04-26 21:51:08 +00:00
Poul-Henning Kamp
b4a1d0deb1 Hide the private parts of timecounter from a couple of places that don't
really need to know the gory details.
2002-04-26 21:31:44 +00:00
Poul-Henning Kamp
14021ab570 Redo the pps bit to avoid digging into the private bits of the timecounter. 2002-04-26 21:22:02 +00:00
Daniel C. Sobral
1a923a14f4 A long, long time ago, msmith introduced vfs.root.mountfrom
loader variable, which let users specify the root mount point
the exact way one does after booting the kernel.

Let's take this opportunity to document it...
2002-04-26 20:52:59 +00:00
Poul-Henning Kamp
7bf758bff0 Simplify the RFC2783 and PPS_SYNC timestamp collection API. 2002-04-26 20:24:28 +00:00
Marcel Moolenaar
9bedf13fee Initialize MCA in cpu_startup() so that it's ready before we wake-up
the application processors. This allows us to collect unconsumed AP
specific error records as part of the wake-up.
2002-04-26 19:36:25 +00:00
Marcel Moolenaar
6e0be618ed MCA specific code has been moved to a seperate file. It is expected
to grow enough to be in the way here.
2002-04-26 19:33:20 +00:00
Marcel Moolenaar
e477773f01 Machine Check Architecture (MCA) support code. Error records are
collected at boot and made available through sysctl(8). At the
moment, the following MIB names are created:

	hw.mca.count	- The number of error records collected.
	hw.mca.first	- The lowest sequence number present.
	hw.mca.last	- The highest sequence number present.
	hw.mca.<X>	- The error record with sequence number <X>.

Using sysctl(8) allows us to easily detect and analyze the records,
which is very helpful during development of MCA but can also be used
in production as a way to collect machine health statistics.
2002-04-26 19:30:11 +00:00
Marcel Moolenaar
53f1567fc3 Machine Check Architecture (MCA) structures and constants. 2002-04-26 19:16:59 +00:00
Ruslan Ermilov
6bde859f40 Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.

Eliminate the need in the second installworld.  For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.

Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1.  Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).

Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).

In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.

Moved the creation of the "crypto" dist from release.5 to
release.2.

In release.3 and doMFSKERN, build kernels in the "world"
environment.  KERNELS now means "additional" kernels, GENERIC is
always built.

Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.

Inline createBOOTMFS target.

Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules.  GC doMODULES as such.

Assorted fixes:

Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".

Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.

gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.

release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists.  Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories.  This will be fixed
soon.

Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage.  Most of the userland makefiles did not test it for "YES"
anyway.

XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists?  (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)

Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.

Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
Orion Hodson
c6d4b83ad1 Add ac97_reset function that polls ready bits in power register. One
component in tweaks required for the ICH3 controller in the thinkpad
x22 reported by Colin Perkins on -multimedia.
2002-04-26 15:27:56 +00:00
Poul-Henning Kamp
9e1b5510c3 Move the winding of timecounters out of hardclock and into a normal
timeout loop.

Limit the rate at which we wind the timecounters to approx 1000 Hz.

This limits the precision of the get{bin,nano,micro}[up]time(9)
functions to roughly a millisecond.
2002-04-26 12:37:36 +00:00
Poul-Henning Kamp
056abcabb7 Various cleanup and sorting of clock reading functions. Add the two
functions missing in the complete 12 function complement.
2002-04-26 10:19:29 +00:00
Poul-Henning Kamp
656d3e04d1 Rename tco_setscales() and tco_delta() to use the same tc_ prefix as
the rest of this file.
2002-04-26 10:11:02 +00:00
Poul-Henning Kamp
7e2d76ff05 Remove the tc_update() function. Any frequency change to the
timecounter will be used starting at the next second, which is
good enough for sysctl purposes.  If better adjustment is needed
the NTP PLL should be used.
2002-04-26 10:06:26 +00:00
Brian Somers
b94c4e9a93 Test if rootvnode is NULL rather than if rootdev is NODEV when determining
if there's a filesystem present.

rootdev can be NODEV in the NFS-mounted root scenario.

Discussed with: Harti Brandt <brandt@fokus.gmd.de>, iedowse
2002-04-26 09:52:54 +00:00
Wes Peters
1de372dcd4 Add a -k option to reboot to specify the kernel to boot next time
around.  If the kernel boots successfully, the record of this kernel
is erased, it is intended to be a one-shot option for testing
kernels.

This could be improved by having the loader remove the record of
the next kernel to boot, it is currently removed in /etc/rc immediately
after disks are mounted r/w.

I'd like to MFC this before the 4.6 freeze unless there is violent
objection.

Reviewed by:	Several on IRC
MFC after:	4 days
2002-04-26 07:31:04 +00:00
Greg Lehey
a182065f27 vinum_open: recognize twed device.
Submitted by:	Holger Kipp <holger.kipp@alogis.com>
PR:		37458
MFC after: 	5 days
		(to get 4.6 code freeze)
2002-04-26 04:23:19 +00:00
Robert Watson
ae6b9ab00b Add UDF to the list of filesystems where locking assertions should be
evaluated.

Approved by:	scottl
2002-04-26 04:06:08 +00:00
Boris Popov
b88157559d UIO_NOCOPY is not supported for now, so refuse read opeartion if this flag
is set. The full emulation of bio are on its way...
2002-04-26 03:49:02 +00:00
Robert Watson
dbb17987fc 1.43 (dfr 04-Apr-97): /*
1.43         (dfr      04-Apr-97):  * [dfr] Kludge until I get around to fixing all the vfs locking.
1.43         (dfr      04-Apr-97):  */

	The new devfs doesn't support VFS locking.  So don't do locking
	assertions for devfs vnodes.

	With this change, a kernel with options DEBUG_VFS_LOCKS actually
	gets to single-user mode.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-04-26 03:39:04 +00:00
Mike Silbersack
e1f1827f98 Make sure that sockets undergoing accept filtering are aborted in a
LRU fashion when the listen queue fills up.  Previously, there was
no mechanism to kick out old sockets, leading to an easy DoS of
daemons using accept filtering.

Reviewed by:	alfred
MFC after:	3 days
2002-04-26 02:07:46 +00:00
Dag-Erling Smørgrav
521eb014c8 Add the mutex profiling lock to the witness list. This hopefully unbreaks
the MUTEX_PROFILING + WITNESS + !WITNESS_SKIPSPIN case.

Submitted by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-04-25 22:48:40 +00:00
Bruce Evans
2c900f6451 Fixed some longstanding bugs in _getenv_static():
- malformed environment strings (ones without an '=') were not rejected.
  There shouldn't be any of these, but when the static environment is
  empty it always begins with one of these; this one should be considered
  as the terminator after the end of the environment, but it isn't.
- the comparison of the name being looked up with the name in the
  environment was fuzzy -- only the characters up to the length of the
  latter were compared, so _getenv_static("foobar") matched "foo=..."
  in the environment and everything matched "" in the empty environment.

MFC after:	3 days
2002-04-25 20:25:15 +00:00
Semen Ustimenko
37f044d650 Implement true multicast filtering.
Inspired by:	dc(4)

MFC after:	1 week
2002-04-25 18:16:15 +00:00
Marcel Moolenaar
780a1fb3ca The official name for McKinley is: Itanium 2 2002-04-25 17:51:43 +00:00
Yoshihiro Takahashi
0b9a090051 MFi386: revision 1.339. 2002-04-25 13:32:56 +00:00
Yoshihiro Takahashi
27ecba3177 MFi386: revision 1.56 2002-04-25 13:31:27 +00:00
Yoshihiro Takahashi
f9ef610bd0 MFi386: revision 1.8 2002-04-25 13:28:10 +00:00
Yoshihiro Takahashi
5497ee0acf Merged from sys/dev/syscons/syscons.c revision 1.383 2002-04-25 13:25:36 +00:00
Bruce Evans
ff557fa1a9 Break the following implementation of panic(3):
#!bin/sh

	# Original version of this by Michael Reifenberger
	# <root@nihil.plaut.de>.

	mdconfig -d -u 11 >/dev/null 2>&1
	dd if=/dev/zero of=zz bs=1m count=1

	while :
	do
		mdconfig -a -t vnode -f zz -u 11
		fdisk -f - -iv /dev/md11 <<EOF1
		g c1 h64 s32
		p 1 165 0 2048
		a 1
	EOF1
		mdconfig -d -u 11
	done

Garbage pointers in __si_u were not cleared by destroy_dev().  Not
clearing si_disk made the above fatal because the disk layer uses
si_disk as a flag to indicate that the dev_t has been completely
initialized.  disk_destroy() clears si_disk for the parent dev_t
but doesn't get called for children.

Not fixed:
- setting the undocumented sysctl debug.free_devt should cause more
  complete destruction of the dev_t including clearing of __si_u, but
  actually causes the above to panic a little earlier.
- the loop leaks 10 memory allocations per iteration (4 DEVFS, 2 devbuf
  and 4 dev_t).

Reviewed by:	timeout by MAINTAINER after 3 months
2002-04-25 13:17:33 +00:00
Josef Karthauser
c628479a57 Add a power exceeded debug message.
Update the $NetBSD$ ident to match reality.
2002-04-25 12:58:30 +00:00
Josef Karthauser
8e0c4b3892 MFNetBSD:
revision 1.96
    date: 2001/11/22 21:59:33;  author: augustss;  state: Exp;  lines: +3 -3
    Correct a comment.
2002-04-25 12:51:08 +00:00
Josef Karthauser
9206cd4c25 MFNetBSD:
revision 1.95
    date: 2001/11/20 16:09:01;  author: augustss;  state: Exp;  lines: +39 -6
    Sanity check max packet lengths.
2002-04-25 12:49:38 +00:00
Josef Karthauser
cafee33353 MFNetBSD:
revision 1.94
    date: 2001/11/20 13:50:07;  author: augustss;  state: Exp;  lines: +16 -9
    Update for new speed handling.
2002-04-25 12:37:55 +00:00
Andrew R. Reiter
d4d6aee5a0 - Fix a round down bogon in uma_zone_set_max().
Submitted by: jeff@
2002-04-25 06:24:40 +00:00
Darren Reed
37d55dca34 bring in changes from 3.4.26. 2002-04-25 03:31:39 +00:00
Darren Reed
39252e7612 This commit was generated by cvs2svn to compensate for changes in r95415,
which included commits to RCS files with non-trunk default branches.
2002-04-25 03:23:53 +00:00
Darren Reed
43ba65e60d Import IPFilter 3.4.26 kernel sources, including H.323 proxy.
Include the licence file for both IPFilter and the H.323 proxy (from QNX),
for convienence.
2002-04-25 03:23:53 +00:00
Darren Reed
13114a18ac Import IPFilter 3.4.26 kernel sources, including H.323 proxy.
Include the licence file for both IPFilter and the H.323 proxy (from QNX),
for convienence.
2002-04-25 03:23:52 +00:00
Marcel Moolenaar
d297ad160e Don't use the symbol name to lookup the symbol value when we can use
the symbol index defined by the relocation. The elf_lookup() support
function is to be used by elf_reloc() when symbol lookups need to be
done. The elf_lookup() function operates on the symbol index and
will do a symbol name based lookup when such is required, otherwise
it uses the symbol index directly. This solves the problem seen on
ia64 where the symbol hash table does not contain local symbols and
a symbol name based lookup would fail for those symbols.

Don't pass the symbol name to elf_reloc(), as it isn't used any more.
2002-04-25 01:22:16 +00:00
Andrew R. Reiter
04a3d10ee5 - Tweak wording of panic message to make more sense. 2002-04-24 22:32:48 +00:00
Poul-Henning Kamp
f6424ee53f Improve the cross-references in the XML output.
Explained by:	des
Sponsored by:	DARPA & NAI Labs.
2002-04-24 21:02:28 +00:00
Andrew R. Reiter
d98861bb51 - Turn the atm_stackq_pool into a uma_zone (and change it's name to
atm_stackq_zone).
- Change the related atm_allocate() and atm_free() calls into uma_zalloc()
  and uma_zfree() calls.
2002-04-24 20:56:23 +00:00
Hajimu UMEMOTO
83649f07c7 Correct timer management (deprecated) in nd6_timer.
Obtained from:	KAME
MFC after:	3 days
2002-04-24 19:09:48 +00:00
John Hay
de0d2cad31 Add another chip id for the new LAVA 4-port serial card.
PR:		37333
Submitted by:	Ari Suutari <ari.suutari@syncrontech.com>
MFC after:	4 days
2002-04-24 18:55:50 +00:00
John Hay
aaeedfc626 Ignore the multifunction bit in the PCIR_HEADERTYPE.
PR:		37333
Submitted by:	Ari Suutari <ari.suutari@syncrontech.com>
MFC after:	4 days
2002-04-24 18:53:43 +00:00
Andrew R. Reiter
1bbd50f9c8 - Remove atm_attributes_pool and the relating atm_allocate() and atm_free()
calls associated with the pool and the objects allocated out from the
  pool.
- Insert atm_attributes_zone which is a uma_zone that is used just as the
  atm_attributes_pool was (including the max objects value).  Also, used
  the appropriate zalloc and zfree's where necesary.
2002-04-24 18:06:18 +00:00
Maxime Henrion
78689b156f Don't call freeenv() on a modified pointer.
Submitted by:	Alexander Kabaev <ak03@gte.com>
Reviewed by:	phk
Pointy hat to:	mux
2002-04-24 17:49:21 +00:00
Justin T. Gibbs
e905720a60 aic7xxx_freebsd.c -> aic7xxx_osm.c 2002-04-24 16:59:47 +00:00
Justin T. Gibbs
8f214efc9a Major update to the aic7xxx driver:
ahc_eisa.c:
ahc_pci.c:
	Conform to new aic7xxx IRQ API.

	Adapt to aic7xxx_freebsd -> aic7xxx_osm changes.

aic7770.c:
	Disable card generated interrupt early in our probe for
	"extra safety"

	Commonize some seeprom code with the PCI side of the driver.

aic7xxx.c:
	Correctly initialize a few scratch ram locations during
	a sequencer restart.  This avoids spurious sequencer ram
	parity errors in some configurations.

	Include the softc in ahc_update_residual calls.  We need it
	for some diagnostics in this code path.

	Flag a data overrun on an auto-request sense failure as a
	CAM_AUTOSENSE_FAIL rather than a CAM_DATA_RUN_ERR.

	Force a renegotiation after noticing a parity error.  This
	covers targets that lose our negotiation settings but don't
	bother to give us a unit attention condition.  This can happen
	if a target fails during a reselection of us during a cable
	pull.

	Convert some code to using constants.

	Fix some typos.

	Correct target mode message loop handling.  ahc_clear_msg_state
	was not clearing the "need to go to message out phase" bit once
	our loop was over.

	Simplify some abort handling code.

	Include tag information in target mode immediate notify events.

	When shutting down EISA controllers, don't EISA BIOS settings in
	the high portions of scratch ram.  This fixes warm boot issues on
	some systems.

	Save a bit of space by only allocating the SCBs that we can use.

	Avoid some code paths in ahc_abort_scbs() if we are currently
	acting as a target.

	Correctly cleanup stranded SCBs in the card's SCB array.  These
	are SCBs who's mapping has already been torn down by code that
	aborted the SCB by seeing it in another list first.

	Add a comment about some potential bus reset issues for target
	mode on Twin (EISA only) controllers.

aic7xxx.h:
	Cleanup the hardware scb definitions a bit.

	Allocate a ful 256 byte scb mapping index.  This simplifies
	the lookup code since the table covers all possible (and potentially
	bogus) values.

	Make AHC_DEBUG work again.

aic7xxx.reg:
	Updates to hardware SCB definition.

	New definitions for target mode fixes.

aic7xxx.seq:
	In target mode, initialize SAVED_LUN just after we receive
	the identify message.  It may be required in the error recovery
	path when a normal cdb packet (includes lun) is not sent up to
	the host for processing.

	Respond to irregular messages during a selection in target mode.

	Defer looking for space for a cdb packet until we are about to
	enter command phase.  We want to be able to handle irregular messages
	even if we would otherwise return QUEUE_FULL or BUSY.

	Add support for sending Ignore Wide Residue messages as a target.

	In the disable disconnect case in target mode, set our transfer
	rate correctly once data are availble.

aic7xxx_93cx6.c:
aic7xxx_93cx6.h:
	Add the ability to write and erase the seeprom.

aic7xxx_inline.h:
	Correct Big Endian handling of large cdb sizes (> 12 bytes).

	Adaptec to changes in the calc_residual API.

	Correct a target mode bug where we always attempted to service
	the input queue even if no progress could be made due to lack
	of ATIOs.

aic7xxx_osm.c:
	Adaptec to new IRQ mapping API.  The new API allows the core
	to only enable our IRQ mapping once it is safe (sufficient
	initialization) to do so.

	Slap bootverbose protection around some diagnostics.

	Only attempt DT phases if we are wide.

aic7xxx_osm.h:
	Enable big endian support.

	Adjust for IRQ API change.

aic7xxx_pci.c:
	Be more careful about relying on subvendor 9005 information.
	We now only trust it for HBAs.  This should allow the driver
	to attach to some MBs where the subvendor/device information
	does not follow the Adaptec spec.

	Only enable interrupts on the card once we are fully setup.

	Disable external SCB ram usage on the aic7895.  I have not
	been able to make it 100% reliable.

	Adjust to seeprom routines being properly prefixed with "ahc".

	Fix a few bugs in the external SCB ram probing routine.  We
	need to clear any parity errors we've triggered during the
	probe to avoid future, fatal, interrupts.

	If we detect an invalid cable combination, pretent there are
	no cable at all.  This will enable all of the terminators
	which is probably the safest configuration we can "guess".

MFC after: 4 days
2002-04-24 16:58:51 +00:00
Justin T. Gibbs
7ce72dbaec Add macro functionality.
Staticize and allow unique naming of data structures so that more
than on sequencer program can be statically compiled into the kernel
at a time.
2002-04-24 16:24:43 +00:00
Warner Losh
d5ccecfad7 o Work around bugs in the powerof2 macro: It thinks that 0 is a power of
2, but that's not the case.  This fixes the case where there were slots
  in the PIR table that had no bits set, but we assumed they did and used
  strange results as a result.
o Map invalid INTLINE registers to 255 in pci_cfgreg.c.  This should allow
  us to remove the bogus checks in MI code for non-255 values.

I put these changes out for review a while ago, but no one responded
to them, so into current they go.

This should help us work better on machines that don't route
interrupts in the traditional way.

MFC After: 4286 millifortnights
2002-04-24 15:30:11 +00:00
Warner Losh
e5d7e9c76c Fix a PNPID in a comment
Submitted by: David Xu
2002-04-24 15:22:53 +00:00
Poul-Henning Kamp
078c6f01f9 Make specific provisions for the kernel simulator used in the regression
tests, other userland programs may need to include <geom/geom.h>.

Sponsored by:	DARPA & NAI Labs.
2002-04-24 12:53:12 +00:00
Ruslan Ermilov
2cbc81ffe4 The install.debug and reinstall.debug targets are needed solely
to build kernel and kernel modules so stop supporting them in
bsd.subdir.mk and reimplement them in kern.post.mk and kmod.mk
as special versions of the install and reinstall targets, and
only define them if DEBUG is also defined (when debug versions
are really built).

Prompted by:	bde
2002-04-24 11:26:19 +00:00
Seigo Tanimura
ce00aebe22 Free(9) should be Giant-free.
Suggested by:	jhb
2002-04-24 09:59:18 +00:00
Jake Burkholder
127e8646b8 Split file system setup code out into a function called mount.
Implement vsnprintf.  Implement panic in terms of it.
2002-04-24 05:54:10 +00:00
Scott Long
cbfd045b10 Prepare for a major update to the aac driver:
Update the aac driver with the new crashdump api.
	Protect sync fibs with a mutex.
	Align all DMA buffers on a PAGE_SIZE boundary.

MFC after:	3 days
2002-04-24 05:12:50 +00:00
Jake Burkholder
0d0c927680 Add support for loading files other than /boot/loader. Useful if you're
loader is screwed and you want loader.old.
Rewrite the scaled down printf so it actually works right, and add support
for more formats.
2002-04-24 04:27:49 +00:00
Mike Silbersack
c473d3e406 Remove sodropablereq - this function hasn't been used since the
syncache went in.

MFC after:	3 days
2002-04-24 04:11:08 +00:00
Jake Burkholder
3ff6556567 Add an exit function. 2002-04-24 02:50:59 +00:00
Jake Burkholder
083d8c5bab Add -Wno-unused. 2002-04-24 02:50:36 +00:00
Jake Burkholder
8c2f8986a6 memcpy, memset -> bcopy, bzero. 2002-04-24 02:24:32 +00:00
Jake Burkholder
4b487ad2ec Clean up elf loading to not make assumptions about the ordering of sections.
Don't load the symbol table; this is only needed for loading kernels and we
load the loader.
2002-04-24 02:10:35 +00:00
Jake Burkholder
e2b255fdea Remove xfsread. Just call fsread directly. 2002-04-24 01:47:05 +00:00
Jake Burkholder
912ceb7f18 Remove a bunch of unused variables, functions and macros. Allocate storage
statically instead of using a faked up malloc.
2002-04-24 01:40:54 +00:00
Mike Barcroft
58631bbe0e Rearrange <netinet/in.h> so that it is easier to conditionalize
sections for various standards.  Conditionalize sections for various
standards.  Use standards conforming spelling for types in the
sockaddr_in structure.
2002-04-24 01:26:11 +00:00
Matt Jacob
c7948a94c5 Make Veritas Storage Appliance a HILUNS device.
MFC after:	1 day
2002-04-24 00:00:55 +00:00
Poul-Henning Kamp
53705e35ae Implement the GEOMGETCONF ioctl which returns vital stats for the
current device in XML in an sbuf.

Sponsored by:	DARPA & NAI Labs
2002-04-23 19:54:02 +00:00
Jeffrey Hsu
4bc37205bc The cold and panicstr variables do not need to be protected by sched_lock.
Submitted by:	Jennifer Yang (yangjihui@yahoo.com)
Reviewed by:	jake & jhb in principle
2002-04-23 19:50:22 +00:00
Poul-Henning Kamp
2285b09474 All in a days work: make a function static. 2002-04-23 19:03:03 +00:00
Poul-Henning Kamp
3c9f58204e Don't free(9) a pointer which has been modified.
Chapeau de pointe:	mux
2002-04-23 18:52:39 +00:00
Poul-Henning Kamp
708da94ef2 Add a basic sanity check on pointers passed to free(9).
Should be improved by:	jeff
2002-04-23 18:50:25 +00:00
Poul-Henning Kamp
00d70dec4e Don't call malloc(9) to allocate zero bytes softc data for devices. 2002-04-23 15:48:23 +00:00
Boris Popov
959b83b921 Track nfs's getpages() changes:
Properly count v_vnodepgsin.
    Do not reread page if is already valid.
    Properly handle partially filled pages.
2002-04-23 14:30:43 +00:00
Boris Popov
3f36e6f21a Get rid from extra #ifdefs. 2002-04-23 13:55:14 +00:00
Boris Popov
30fc2d74fa Initialize thread select queue in the same way as rev 1.93 of sys_generic.c
does.

Missed and found by:	alfred
2002-04-23 13:29:23 +00:00
Poul-Henning Kamp
7d590cc46f Introduce some serious paranoia to try to catch a memory overwrite problem
as early as possible.

Sponsored by:	DARPA & NAI Labs
2002-04-23 11:48:45 +00:00
Gary Jennejohn
bb83e7583e On slow machines interrupts could be lost, so check for pending
interrupts in a loop.

Tested by: Andrew Gordon <arg-bsd@arg1.demon.co.uk>
2002-04-23 10:25:35 +00:00
Ruslan Ermilov
b25a566d47 Merge bsd.obj.mk's version of the _SUBDIR target with bsd.subdir.mk.
Ensure all standard targets honor SUBDIR.  Now `make obj' descends into
SUBDIRs even if NOOBJ is set (some descendants may still need an object
directory, but we do not have such precedents).  Now `make install' in
non-bsd.subdir.mk makefiles runs `afterinstall' target _after_ `install'
in SUBDIRs, like we do in bsd.subdir.mk.  Nothing depended on the wrong
order anyway.

Fixed `distribute' targets (except for the bsd.subdir.mk version) so that
they do not depend on _SUBDIR; `distribute' calls `install' which already
depends on _SUBDIR.

De-standardize `maninstall', otherwise manpages would be installed twice.
(To be revised later.)
2002-04-23 09:03:56 +00:00
Marcel Moolenaar
ef845b75e7 Remove unused static variable quantum. 2002-04-23 06:14:10 +00:00
Robert Watson
7a0776e477 Slightly restructure extattr_get_vp() so that there's only one entry point
to VOP_GETEXTATTR().  This simplifies code flow when inserting MAC hooks.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-04-23 01:27:38 +00:00
Alfred Perlstein
ea5b39d029 Don't FILEDESC_LOCK around calls to falloc(). 2002-04-22 20:09:11 +00:00
Poul-Henning Kamp
efb9df5cef Protect against multitple #includes of this file. 2002-04-22 19:54:17 +00:00
Andrew R. Reiter
e2a8a1af0e - Revert previous change of atm storage pools -> uma_zones until a solution
to atm_free() is written.
2002-04-22 18:26:05 +00:00
John Polstra
1c33cc4bc5 Add missing splx calls in bge_tick. These don't make any functional
difference in -current, but they are important for -stable where
they are missing too.

MFC after:	1 day
2002-04-22 16:15:16 +00:00
Ruslan Ermilov
05276e5f8c Back out remnants of revision 1.97: we don't need TARGET_ARCH here. 2002-04-22 15:53:04 +00:00
Ruslan Ermilov
0ac2fc87d2 Use standard bsd.init.mk prologue. 2002-04-22 15:47:11 +00:00
Dag-Erling Smørgrav
d397408818 Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
Warner Losh
632754e510 Implement shared secret mode for hostap mode.
Submitted by: Thomas Skibo <skibo@pacbell.net>
2002-04-22 07:09:13 +00:00
Poul-Henning Kamp
29f88f470e Comment out Kirks io-request priority hack until we can do this in a
civilized way which doesn't cause grief.

The problem is that it is not generally safe to cast a "struct bio
*" to a "struct buf *".  Things like ccd, vinum, ata-raid and GEOM
constructs bio's which are not entrails of a struct buf.

Also, curthread may or may not have anything to do with the I/O request
at hand.

The correct solution can either be to tag struct bio's with a
priority derived from the requesting threads nice and have disksort
act on this field, this wouldn't address the "silly-seek syndrome"
where two equal processes bang the diskheads from one edge to the
other of the disk repeatedly.

Alternatively, and probably better: a sleep should be introduced
either at the time the I/O is requested or at the time it is completed
where we can be sure to sleep in the right thread.

The sleep also needs to be in constant timeunits, 1/hz can be practicaly
any sub-second size, at high HZ the current code practically doesn't
do anything.
2002-04-22 06:53:20 +00:00
Marcel Moolenaar
d435ac4e91 Add ia64_sal_init_state(). This function will initialize the machine
check handling. In its current form, it only determines the largest
amount of state information it can get from SAL and allocates a region
7 memory block for it.

The next steps involve:
o  get and log any unconsumed (NVM stored) error records across
   reboots,
o  register an OS_MCA handler and enable machine checks.
2002-04-22 06:43:31 +00:00
Marcel Moolenaar
1dc66a63cd Add state information types. 2002-04-22 06:35:40 +00:00
Andrew R. Reiter
27e69e45bb - Change the atm_attributes_pool and atm_stackq_pool to be uma_zone's
(with the appropriate set_max) rather than using the HARP storage pool
  code.
2002-04-22 05:11:44 +00:00
Jake Burkholder
11dcdc976b Avoid using pmap_kenter "early", since it may need to dink with vm_page
structures, which may not be setup yet.  Minor cleanups.
2002-04-21 22:57:42 +00:00
Marcel Moolenaar
7ac993bf17 Fix WAW dependency violation on r17 (line 198) that only exists for
the SMP case. While on the subject, remove unnecessary stops. I don't
know if this resolves the memory corruption I'm seeing, but it does
have the potential. We'll see...
2002-04-21 22:43:50 +00:00
Marcel Moolenaar
0f9d8c9b27 Implement elf_reloc(). The RT specification says that we can expect
both Elf_Rel and Elf_Rela types of relocation, so handle them both
even though we only have Rel_Rela ATM. We don't handle 32-bit and
big-endian variants yet. Support for that is not trivial enough to
implement it without any evidence that we ever need it in the near
future.

For the FPTR relocations, we currently use the fptr_storage used by
_reloc() is locore.s. This is in no way a real solution, but for now
provides the service we need to get the basics going.

A static recursive function lookup_fdesc() is used to find the address
of a function in a way that keeps track of the load module so that
we can get the correct GP value if we need to construct an OPD (ie
there's no OPD yet for the function.

For simplicity, we create an OPD for the IPLT relocations as well and
simply fill the user provided function descriptor from the OPD. Since
the the official descriptors are unique, this has no bad side effects.
Note that we ignore the addend for FPTR relocations, but use the
addend for IPLT relocations as an offset to the function address.

This commit allows us to load and relocate modules and modules appear
to work correctly, although we probably need to make sure that we set
GP correctly in all cases when we have inter-module calls. This
especially applies to assembly coded functions that have cross module
calls.
2002-04-21 21:27:57 +00:00
Marcel Moolenaar
8420105927 Add function link_elf_get_gp(), specific to ia64 for now, to get
the DT_PLTGOT value. On ia64 this is the value of GP. We need this
to construct function descriptors, but the elf file structure is
not exported to MD code.

Note that the name of the function is based on the meaning that
DT_PLTGOT has on ia64. This may differ on other architectures. As
such, link_elf_get_gp() has a high level of MD to it. Renaming the
function to describe what DT_* value is returned makes it generic,
but also makes the MD code less clear and if we only need this on
ia64, then a general name for a specific function doesn't help.

In short: I don't know what is "right" at this time, so I'll go
with what I have.
2002-04-21 21:08:30 +00:00
Ian Dowse
3aed248695 Limit to the maximum allowed reply size the amount of data that
nfsrv_readdir and nfsrv_readdirplus can return. A client request
containing an over-large `count' field could trigger the "Bad nfs
svc reply" panic in nfs_syscalls.c.

Spotted while trying to reproduce kern/37304, which turned out to
be fixed in FreeBSD a long time ago.

MFC after:	1 week
2002-04-21 16:14:54 +00:00
Bruce Evans
4cc6241557 Don't attempt to decvlare M_DEVFS whern MALLOC_DECLARE is not defined.
This fixes warnings that should be errors in fstat.

Reminded by:	alpha tinderbox

Fixed some style bugs (ones near BOF and EOF; there are many more).
2002-04-21 15:47:03 +00:00
Bruce Evans
54a4c5bf21 Include <sys/systm.h> for (at least) the definition of atomic functions
which are sometimes used by the macros in <sys/mutex.h>; don't depend
on not-quite-necessary namespace pollution in <sys/mutex.h>.
2002-04-21 15:35:54 +00:00
Doug Rabson
fb767b2d4e Setup the child's return values correctly when forking an IA-32 process. 2002-04-21 12:34:58 +00:00
Mark Murray
bd41864183 Use protected names (_foo) to cutdown on boatloads of lint warnings. 2002-04-21 11:16:10 +00:00
Mark Murray
20f99c2b81 Wrap GCC-specific stuff and provide alternative for lint. 2002-04-21 11:11:02 +00:00
Mark Murray
b935044a8a Parenthesise macro arguments to reduce lint warnings. 2002-04-21 11:08:52 +00:00
Mark Murray
815eb79cb8 Fix really dumb braino of mine; cast a sizeof() to an int, which it is
being compared to, not size_t, which it already is.
2002-04-21 11:02:36 +00:00
Mark Murray
28e7ba4d11 Used protected names (_foo) for parameter names. This helps clean up
a boatload of lint warnings.
2002-04-21 10:57:43 +00:00
Mark Murray
db8f2e326c Stylify (mainly line up macro EOL-continuation \'s), and add a dummy
alternative for lint.
2002-04-21 10:49:00 +00:00
Mark Murray
1a924d7213 Parenthesise macro arguments to reduce lint warnings. 2002-04-21 10:43:24 +00:00
Mark Murray
d8c1bdfeb2 Stylify, fix tabs.
Liked by:	bde (a couple of months back)
2002-04-21 10:38:35 +00:00
Mark Murray
83238851f8 Remove macros that are defined elsewhere. 2002-04-21 10:32:48 +00:00
Marcel Moolenaar
76a9e6c9f5 Improve self-relocation and fix ABI misinterpretation. The changes
here mostly mirror the changes made in
	boot/efi/libefi/arch/ia64/start.S rev 1.5

Significant difference: We don't handle the IPLT relocation here.
For barebones KLD support, we make the fptr_storage global.
2002-04-21 08:56:17 +00:00
Marcel Moolenaar
77de753f65 Improve self-relocation:
o  We don't expect the PLT relocations to follow the .rela section
   anymore. We still assume that PLT relocations are long formed,
o  Document register usage,
o  Improve ILP,
o  Fix the FPTR relocation by creating unique OPDs per function.
   Comparing functions is valid now,
o  The IPLT relocation naturally handles the addend. Deal with it.
   We ignore the addend for FPTR relocations for now. It's not at
   all clear what it means anyway.

Fix ABI misinterpretation:
o  For Elf_Rela relocations, the addend is explicit and should not
   be loaded from the memory address we're relocating. Only do that
   for Elf_Rel relocations (ie the short form).
o  DIR64LSB is not the same as REL64LSB. DIR64LSB applies to a
   symbol (S+A), whereas REL64LSB applies to the base address (BD+A),
2002-04-21 08:49:47 +00:00
David E. O'Brien
34ef85ee3d o Use our own elf2aout now.
o Generalize a little.
2002-04-21 02:37:55 +00:00
Andrew R. Reiter
64151e7a8a - Nuke some more not needed #ifdef cruft. 2002-04-21 01:41:05 +00:00
Marcel Moolenaar
9daa5b147a GCC 3.x WARNS: Add a break to the default case. 2002-04-20 21:56:42 +00:00
Mike Barcroft
04961ff8be Reenable the newly unbroken hfa device. 2002-04-20 19:44:38 +00:00
Mike Barcroft
72cd6fa0c0 Change two KM_COPY()s to bcopy(). This should have been done when the
KM_* macros were removed.
2002-04-20 19:27:34 +00:00
Jake Burkholder
9ba847abf3 MFi386 1.222. Remove vm_map_growstack and acquisition and release of Giant
from trap_pfault.
2002-04-20 17:28:08 +00:00
Jake Burkholder
d1fef1792c Check the alignment of the stack pointer before copying in windows from the
user stack in response to a failed window fill, allowing the process to be
killed if its wrong.  This caused user programs which misalign their stack
pointer to get stuck in an infinite loop at the kernel-userland boundary,
which is mostly harmless.

The same thing causes a fatal RED state exception on OpenBSD and probably
NetBSD.

Inspired by:	art@openbsd.org
2002-04-20 16:23:52 +00:00
Jake Burkholder
bb52b4f3fc Fix off by one errors in cache flush calls (mostly harmless). 2002-04-20 15:58:40 +00:00
Jake Burkholder
26956cba94 Add needed include of tick.h. 2002-04-20 15:52:53 +00:00
Robert Watson
b099af16dd Add an XXX: linux_uselib() should be using vn_open() rather than invoking
VOP_OPEN() and doing lots of manual checking.  This would further
centralize use of the name functions, and once the MAC code is integrated,
meaning few extraneous MAC checks scattered all over the place.  I don't
have time to fix this now, but want to make sure it doesn't get
forgotten.  Anyone interested in fixing this should feel free.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-04-20 14:43:34 +00:00
Semen Ustimenko
da1b4964c9 Update the email appearing in copyright string.
MFC after:	1 day
2002-04-20 12:39:41 +00:00
Semen Ustimenko
d09fa37dd9 Merge ``&& must be ||'' bug noticed and fixed in OpenBSD. The only ill effect
was if_baudrate being always 10Mbit.

Obtained from:	OpenBSD
MFC after:	1 day
2002-04-20 12:35:38 +00:00
Seigo Tanimura
1c2451c24d Push down Giant for setpgid(), setsid() and aio_daemon(). Giant protects only
malloc(9) and free(9).
2002-04-20 12:02:52 +00:00
Benno Rice
f6310641b9 Replace inline asm with it's inline function wrapper. 2002-04-20 10:06:22 +00:00
Andrew R. Reiter
e062d89cdc - Create a ``zero fill'' constructor for uma_zcreate's ctor argument.
Inspired by: jake@
2002-04-20 09:04:58 +00:00
Alan Cox
a569838764 Reintroduce locking on accesses to vm_object_list. 2002-04-20 07:23:22 +00:00
Boris Popov
5f3d1ad8c9 Add character translation table between Unix and NetWare according
to Sweden standards.

Submitted by:	Roger Olofsson <roger.olofsson@kommun.engelholm.se>
MFC after:	1 week
2002-04-20 05:35:02 +00:00
Mike Barcroft
c636dc4381 Add typedef of sa_family_t to <sys/un.h>, per POSIX and X/Open. Hide
portions of <sys/un.h> when a standard has been requested.
2002-04-20 02:26:43 +00:00
Mike Barcroft
c6e43821cd Add sa_family_t type to <sys/_types.h> and typedefs to <netinet/in.h>
and <sys/socket.h>.  Previously, sa_family_t was only typedef'd in
<sys/socket.h>.
2002-04-20 02:24:35 +00:00
Marcel Moolenaar
5ce9299f05 Don't put a line break in string literals. GCC 3.1 complains and GCC
3.2 drops the ball.
2002-04-20 01:42:56 +00:00
Robert Watson
0510317039 Improve style consistency of vfs_syscalls.c by converting the style used
in various extattr_*() calls to match the rest of the file.  Originally,
these bits at the end looked more like style(9).  This patch was submitted
by green by way of the TrustedBSD MAC tree, and I fixed a few problems
with it on the way through.  Someone with more time on their hands should
convert the entire file to style(9); this commit is for diff reduction
purposes.

Submitted by:	green
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-04-20 01:37:08 +00:00
Marcel Moolenaar
f1db38534e Don't put a line break in string literals. GCC 3.1 complains and GCC
3.2 drops the ball.
2002-04-20 01:35:45 +00:00
Robert Watson
d51ed1a04a Spelling fix for comment. 2002-04-20 01:14:25 +00:00
Mike Barcroft
b4ff0fb0f7 Comment out and mark broken the hea and hfa devices until someone has
time to fix them.
2002-04-20 00:51:30 +00:00
Andrew R. Reiter
cb809c2827 - Nuke small sgi ifdef bits. 2002-04-20 00:39:32 +00:00
Mike Barcroft
94aae28200 Fix compiling of acpica when debugging is enabled. In the previous
revision, two getenv()s were accidentally changed to use testenv().

Pointy hat to:	mux
2002-04-19 23:36:38 +00:00
Alfred Perlstein
74d618ca43 Clean up:
Comment run_filter() to explain what it does.

Remove chatty comments.

void busdma_swi() { }  -> void busdma_swi(void) { }
2002-04-19 22:58:09 +00:00
Semen Ustimenko
9cd64fb3dd Move tx(4) driver to sys/dev/tx. BTW split hardware structures and constants
into if_txreg.h.

MFC after:	1 week
2002-04-19 22:43:57 +00:00
Warner Losh
6d3ffec0e5 Make this build on 4.x machines again (building a -current kernel on a
-stable machine via the old-school methods):

Use __FreeBSD_version in preference to __FreeBSD__ >= N where possible.
Define a single variable mythread which is set to curproc or curthread
depending on the OS version (with a comment saying it is a white lie on
4.x since it really is a proc).

NB: __FreeBSD__ is the OS level of the host machine, not the target,
and should never be used, if possible, as __FreeBSD__ >= N.
2002-04-19 22:28:09 +00:00
Andrew R. Reiter
4fba67caca - Nuke some more #ifdef sun related sections. 2002-04-19 21:38:43 +00:00
Andrew R. Reiter
c330efb1ed - Nuke some #ifdef sun4m code; it hasn't been updated in 4 years and is not
being used.
2002-04-19 20:02:03 +00:00
Andrew R. Reiter
2575dfa6d9 - Change KM_ macro calls to the appropriate function call.
- Nuke KM_ macros from port.h

  This is a leadin step towards cleaning up this code as I wait for some
  ATM cards and a ATM switch to arrive.
2002-04-19 17:45:22 +00:00
Andrew R. Reiter
cfaf7ad37a - Remove KM_ macro calls and replace with the real function we're calling.
As a note, this driver needs the same updating as the hfa driver was
  just given; removing these macros since I will be nuking them from
  netatm.
2002-04-19 17:43:11 +00:00
Robert Watson
89e9e6e7c5 In sendfile(), use the vn_rdwr() helper function, rather than manually
constructing a struct aio and invoking VOP_READ() directly.  This cleans
up the code a little, but also has the advantage of making sure almost
all vnode read/write access in the kernel goes through the helper
function, meaning that instrumentation of that helper function can impact
almost all relevant read/write operations.  In this case, it permits us
to put MAC hooks into vn_rdwr() and not modify uipc_syscalls.c (yet).

In general, if helper vn_*() functions exist, they should be used in
preference to direct VOP's in system call service code.

Submitted by:	green
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-04-19 13:46:24 +00:00
Robert Watson
5a06cb0ca6 Divorce proc0 and proc1 credentials earlier; while this isn't technically
needed in the current code, in the MAC tree, create_init() relies on the
ability to modify the credentials present for initproc, and should not
perform that modification on a shared credential.  Pro-active diff
reduction against MAC changes that are in the queue; also facilitates
other work, including the capabilities implementation.

Submitted by:	green
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-04-19 13:35:53 +00:00
Marcel Moolenaar
3adcb4ce38 Build modules on ia64:
o  Make the cam, cd9660 lomac and sound modules i386 and alpha
   specific due to link problems (@gprel relocation when @ltoff
   is required).  Once resolved, these can be moved back to the
   generic list.
o  Build linprocfs only on those architectures that have the
   linux module.
o  Make the sppp module i386 and alpha specific due to compile
   problems (pointers as switch cases). Once resolved, this can
   be moved back to the generic list.
o  Build all i386 specific modules, with the exception of those
   mentioned above as being moved from the generic list to the
   i386 list and those with dependencies on the linux module (aac)
   or i386 dependent (ar, apm, atspeaker, fpu, gnufpu, ibcs2,
   linux, ncv, nsp, netgraph, oltr, pecoff, s3, sbni, stg and
   vesa).
o  Don't build acpi as a module yet. It most be ported first.
   Once ported, it can be added to the ia64 list.
o  Don't build ipfilter yet due to compile errors (osreldate.h
   not found).
2002-04-19 09:44:50 +00:00
Poul-Henning Kamp
95c24b31df Make kernel dumps work with GEOM.
Notice that if the device on which the dump is set is destroyed for
any reason, the dump setting is lost.  This in particular will
happen in the case of spoilage.  For instance if you set dump on
ad0s1b and open ad0 for writing, ad0s* will be spoilt and the dump
setting lost.  See geom(4) for more about spoiling.

Sponsored by: DARPA & NAI Labs.
2002-04-19 09:24:12 +00:00
Poul-Henning Kamp
50cbb62eab Make life easier for reference-vector generatorts in tools/regression/geom
by including a FreeBSD friendly CVS identifier in the XML output.

Sponsored by: DARPA & NAI Labs.
2002-04-19 09:21:27 +00:00
Poul-Henning Kamp
3bdd2d061a suser is Giant safe, so optimize a pointless case. 2002-04-19 09:20:13 +00:00
Poul-Henning Kamp
3c8451c966 Add a SI_DUMPDEV flag for devices.
Sponsored by: DARPA & NAI Labs.
2002-04-19 09:19:37 +00:00
Marcel Moolenaar
81b22b1dfd Respect setting of NM to allow cross-building. 2002-04-19 09:04:53 +00:00
Atsushi Onoe
60f514a9a7 Some fixes for Symbol card.
- The version string doesn't need to start with 'V'.
- Symbol firmware doesn't support ROAMING_MODE nor MICROWAVE_OPEN.
Obtained from: NetBSD
2002-04-19 08:16:59 +00:00
Marcel Moolenaar
b226acefc2 Allocate sufficient pages to hold the bootinfo block and stop
hardwiring the location.
2002-04-19 06:43:09 +00:00
Marcel Moolenaar
81764c987b Remove the bootinfo kludge. We get the address of the bootinfo
block from the loader.
2002-04-19 06:35:55 +00:00
SUZUKI Shinsuke
88ff5695c1 just merged cosmetic changes from KAME to ease sync between KAME and FreeBSD.
(based on freebsd4-snap-20020128)

Reviewed by:	ume
MFC after:	1 week
2002-04-19 04:46:24 +00:00
Alan Cox
92de35b0ce o Move the acquisition of Giant from vm_fault() to the point
after initialization in vm_fault1().
 o Fix some style problems in vm_fault1().
2002-04-19 04:20:31 +00:00
Alan Cox
3c3f826d7e o Remove vm_map_growstack() from ia64's trap_pfault().
o Remove the acquisition and release of Giant from ia64's trap_pfault().
   (vm_fault() still acquires it.)
2002-04-19 02:08:33 +00:00
Jacques Vidrine
e983a3762b When exec'ing a set[ug]id program, make sure that the stdio file descriptors
(0, 1, 2) are allocated by opening /dev/null for any which are not already
open.

Reviewed by:	alfred, phk
MFC after:	2 days
2002-04-19 00:45:29 +00:00
Søren Schmidt
091a610ac9 Fix the breakage of tagged queueing that the busdma integration
introduced. Since its now only possible to have one DMA control
block at a time, we move the setup to dmastart instead.
2002-04-18 19:11:45 +00:00
Scott Long
ce2d4dd7f1 Add the PCI ID for an upcoming variant of a soon-to-be released series of
cards.
2002-04-18 15:47:31 +00:00
Alfred Perlstein
198d002e7b Cleanup comments.
Remove all current poll(2) extensions except POLLINIGNEOF as they are now
unused.

Submitted by: bde
2002-04-18 14:54:26 +00:00
Alfred Perlstein
5a6ce14c42 Remove support for using soon to be retired "special" poll(2) ops.
Replace with kevent(2) ops.

This is untested, but the code would rot even further if this wasn't
applied.  I've chosen to apply this to prompt some cleanup.

Submitted by: bde
2002-04-18 14:52:28 +00:00
Alfred Perlstein
7858dcd629 Cleanup of logic, flow and comments.
Submitted by: bde
2002-04-18 14:47:34 +00:00
Stephen McKay
e3c5a44915 Work around an Intel 21143 chip bug.
Rev 1.56 of if_dc.c removed calls to mii_pollstat() from the dc_tick()
routine.  dc_tick() is called regularly to detect link up and link down
status, especially when autonegotiating.

The expectation was that mii_tick() (which is still called from dc_tick())
would update status information automatically in all cases where it would
be sensible to do so.

Unfortunately, with authentic 21143 chips this is not the case, and
the driver never successfully autonegotiates.  This is because (despite
what it says in the 21143 manual) the chip always claims that link is not
present while the autonegotiation enable bit is set.  Autonegotation takes
place and succeeds, but the driver tests the link bits before it switches
off the autonegotiation enable bit, and success is not recognised.

The simplest solution is to call dcphy_status() more often for MII_TICK
calls by dropping out of the switch statement instead of exiting when
we are autonegotiating and link appears to not be present.  When
autonegotiation succeeds, dcphy_status() will note the speed and fdx/hdx
state and turn off the autonegotiation enable bit.  The next call to
dcphy_status() will notice that link is present, and the dc driver code
will be notified.

Macronix chips also use this code, but implement link detection as
described in the manual, and hence don't need this patch.  However, tests
on a Macronix 98715AEC-C show that it does not adversely affect them.

This could be done better but is the minimal effective change, and most
closely mimics what was happening prior to rev 1.56 of if_dc.c.  (Actually
I also deleted a small amount of unnecessary code while I was in the area.)

Reviewed by:	wpaul
2002-04-18 14:40:20 +00:00
Alan Cox
ff8f4ebe22 Add a comment documenting a race condition in vm_fault(): Specifically, a
modification is made to the vm_map while only a read lock is held.
2002-04-18 03:55:50 +00:00
Robert Watson
91e007dc70 Since WITNESS doesn't just do mutexes, remove "mutex" from the WITNESS
comment in GENERIC config files of appropriate platforms.  For whatever
reason, powerpc didn't use WITNESS in GENERIC.
2002-04-18 03:44:44 +00:00
Robert Watson
aa4019efa1 Witness doesn't just track mutexes, so don't say mutexes specifically. It
also tracks sxlocks, etc.
2002-04-18 03:41:49 +00:00
Alan Cox
6139043b1f o Call vm_map_growstack() from vm_fault() if vm_map_lookup() has failed
due to conditions that suggest the possible need for stack growth.
   This has two beneficial effects: (1) we can
   now remove calls to vm_map_growstack() from the MD trap handlers and (2)
   simple page faults are faster because we no longer unnecessarily perform
   vm_map_growstack() on every page fault.
 o Remove vm_map_growstack() from the i386's trap_pfault().
 o Remove the acquisition and release of Giant from i386's trap_pfault().
   (vm_fault() still acquires it.)
2002-04-18 03:28:27 +00:00
Tor Egge
de8218bb7b Fix typo in adjusted panic message.
Submitted by:	cokane
2002-04-17 22:41:58 +00:00
Tor Egge
50c15af4da Update io_apic_ints array properly when revoking an irq mapping.
Adjust panic message.

Submitted by:	David Xu <bsddiy@yahoo.com>
2002-04-17 18:27:10 +00:00
Alfred Perlstein
62563373ff De-K&R dkcksum() to fix some issues with c++.
Submitted by: Miguel Mendez <flynn@energyhq.homeip.net>
2002-04-17 18:09:27 +00:00
Maxime Henrion
b48a4280fc Avoid calling malloc() or free() while holding the
kenv lock.

Reviewed by:	jake
2002-04-17 17:51:10 +00:00
Ruslan Ermilov
2ecf206550 Install files via FILES, there's no reason to compare them before installing. 2002-04-17 16:56:36 +00:00
Matthew N. Dodd
41fd17a668 Fix missing commas. 2002-04-17 16:12:24 +00:00
Ruslan Ermilov
092179f985 Really unbreak it this time (clean and install were still broken). 2002-04-17 15:33:40 +00:00
Bernd Walter
b5b4067771 Fix a compiler warning I missed in the last commit.
Reviewed by:	gallatin
Approved by:	gallatin
2002-04-17 15:32:11 +00:00
Brian Somers
c357e4dfc8 Make delay iteration counts a function of hz as the delay period in each
loop is inversly proportional to hz.

This makes things more sane for configurations with hz != 100.

Cosmetic: Make the loops look similar to the loops in digi.c
2002-04-17 15:28:41 +00:00
Brian Somers
b2d8576794 Make delay iteration counts a function of hz as the delay period in each
loop is inversly proportional to hz.

This makes things more sane for configurations with hz > 100.

Submitted by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
2002-04-17 15:13:52 +00:00
Bernd Walter
27c5b6c8f1 Revive dec_axppci_33_intr_route for LCA.
We now get valid interrupt lines for devices on secondary pci busses.

Reviewed by:	gallatin
Approved by:	gallatin
2002-04-17 14:08:22 +00:00
Thomas Moestl
70abba50b6 Parenthesize some macro arguments.
PR:		20024
Submitted by:	Tony Finch <dot@dotat.at>
2002-04-17 14:00:37 +00:00
Bernd Walter
dd516e0773 Clear the error flags in the LCA_IOC_STAT0 register after
machine_checks.
This fixes pci config reads for non existing devices on secondary
pci busses.

Thanks to Andrew Gallatin for pointing me to the register

Reviewed by:	gallatin
Approved by:	gallatin
2002-04-17 13:57:50 +00:00
Thomas Moestl
421a9d041e Add macros for concatenating tailqs and stailqs.
PR:		20024
Submitted by:	Tony Finch <dot@dotat.at> (TAILQ_CONCAT)
2002-04-17 13:43:31 +00:00
Maxime Henrion
d786139c76 Rework the kernel environment subsystem. We now convert the static
environment needed at boot time to a dynamic subsystem when VM is
up.  The dynamic kernel environment is protected by an sx lock.

This adds some new functions to manipulate the kernel environment :
freeenv(), setenv(), unsetenv() and testenv().  freeenv() has to be
called after every getenv() when you have finished using the string.
testenv() only tests if an environment variable is present, and
doesn't require a freeenv() call. setenv() and unsetenv() are self
explanatory.

The kenv(2) syscall exports these new functionalities to userland,
mainly for kenv(1).

Reviewed by:	peter
2002-04-17 13:06:36 +00:00
Maxime Henrion
fd448168b7 Add an entry for the kenv(2) syscall (code to follow).
Reviewed by: peter
2002-04-17 13:05:13 +00:00
Josef Karthauser
865fe6dbe4 Revert part of revision 1.49 which was supposed to be white space
only.  In the device probe we don't want to match unless there is
an iface structure already set up.
2002-04-17 12:03:20 +00:00
Matthew N. Dodd
f5d1240c12 Remove a stray comment terminator that was hiding beyond 80 columns. 2002-04-17 07:04:58 +00:00
Matthew N. Dodd
1462e313d4 - Add defines for ABR and UBR traffic types.
- Add IDT bits to vendor/vendorapi/device enums.
- Add EISA to atm_bus enum.
2002-04-17 07:00:56 +00:00
Peter Wemm
334f706177 Do not free the vmspace until p->p_vmspace is set to null. Otherwise
statclock can access it in the tail end of statclock_process() at an
unfortunate time.  This bit me several times on an SMP alpha (UP2000)
and the problem went away with this change.  I'm not sure why it doesn't
break x86 as well.  Maybe it's because the clocks are much faster
on alpha (HZ=1024 by default).
2002-04-17 05:26:42 +00:00
David E. O'Brien
200e654a4a I am not sure why ## was used in this macro, as w/o the string concatenation
the tokens are legal ANSI-C.  Maybe to enable 'op' to be a macro itself?
Anyway, with the ## concatenation Gcc 3.1's integrated `cpp' treats "=op("
as a single token vs. the three tokens it is.
2002-04-17 04:31:43 +00:00
Boris Popov
af9b5e8fe5 Recongnize more error codes returned by W2K servers.
MFC after:	4 days
2002-04-17 03:14:28 +00:00
Boris Popov
0904a0d3fe Add more NetBIOS name types.
MFC after:	4 days
2002-04-17 03:12:24 +00:00
Alan Cox
b208d0633f Remove an unused option, VM_FAULT_HOLD, to vm_fault(). 2002-04-17 02:23:57 +00:00
Julian Elischer
440ed3238b diff reduction 2002-04-17 01:50:03 +00:00
Julian Elischer
2cc8ce3cbf Slight diff-reduction to -stable. 2002-04-17 01:25:46 +00:00
Ian Dowse
df99ca52f1 The recent NFS forced unmount improvements introduced a side-effect
where some client operations might be unexpectedly cancelled during
an unsuccessful non-forced unmount attempt. This causes problems
for amd(8), because it periodically attempts a non-forced unmount
to check if the filesystem is still in use.

Fix this by adding a new mountpoint flag MNTK_UNMOUNTF that is set
only during the operation of a forced unmount. Use this instead of
MNTK_UNMOUNT to trigger the cancellation of hung NFS operations.

Also correct a problem where dounmount() might inadvertently clear
the MNTK_UNMOUNT flag.

Reported by:	simokawa
MFC after:	1 week
2002-04-17 01:07:29 +00:00
Matthew N. Dodd
10e38949b4 Add MODULE_VERSION. 2002-04-17 00:31:32 +00:00
Matthew N. Dodd
073bba0262 Wrap function in #ifdef DIAGNOSTIC to compile with -Werror. 2002-04-17 00:30:38 +00:00
Matthew N. Dodd
5aaf51e01d Add ESA200 to enum atm_device. 2002-04-17 00:30:06 +00:00
Matthew N. Dodd
906cf7526c - Convert the 'hfa' ATM interface driver to newbus.
- Add stubs for EISA and SBUS cards.
  (VME, FutureBUS, and TurboChannel stubs not provided.)
- Add infrastructure to build driver and bus front-end modules.
2002-04-17 00:26:09 +00:00
Luigi Rizzo
7632341a30 Add DEVICE_POLLING support to the "rl" driver.
The diffs are very similar to the ones for the "sis" driver.

MFC After: 5 days
2002-04-16 22:03:14 +00:00
Julian Elischer
de963643e5 This time get it right 2002-04-16 20:40:06 +00:00
Julian Elischer
265faa845f Makefile for the myson driver. 2002-04-16 20:34:14 +00:00
Julian Elischer
440d3f4df5 Add entry for the myson ethernet driver
Submitted by:	Myson , Taiwan
2002-04-16 20:23:58 +00:00
Matt Jacob
4a999c65de Scale back # of luns supported for SCC to 16384- oops- top 3 bits are a
lun address modifier of sorts. Only an HP XP-512 seems to have cared.

Fix a few misplaced pointers for the new fabric goop, which has been
demonstrated to work on newer Brocades and McData switches now.
Put in commented out code which would run GFF_ID if the QLogic f/w
allowed it.

Don't whine about not being able to find a handle for a command if it
was a command aborted (by us).
2002-04-16 19:55:35 +00:00
Julian Elischer
0cde2d130e Diff reduction to 4.x version. 2002-04-16 19:31:55 +00:00
John Baldwin
ba626c1db2 Lock proctree_lock instead of pgrpsess_lock. 2002-04-16 17:11:34 +00:00
John Baldwin
596325f154 - Lock proctree_lock instead of pgrpsess_lock.
- Use temporary variables to hold a pointer to a pgrp while we dink with it
  while not holding either the associated proc lock or proctree_lock.  It
  is in theory possible that p->p_pgrp could change out from under us.
2002-04-16 17:09:22 +00:00
John Baldwin
c8b1829d8e - Lock proctree_lock instead of pgrpsess_lock.
- Simplify return logic of setsid() and setpgid().
2002-04-16 17:06:11 +00:00
John Baldwin
ea97757a54 - Lock proctree_lock instead of pgrpsess_lock.
- Exclusively lock proctree_lock while calling leavepgrp().
2002-04-16 17:04:21 +00:00
John Baldwin
f089b57070 - Merge the pgrpsess_lock and proctree_lock sx locks into one proctree_lock
sx lock.  Trying to get the lock order between these locks was getting
  too complicated as the locking in wait1() was being fixed.
- leavepgrp() now requires an exclusive lock of proctree_lock to be held
  when it is called.
- fixjobc() no longer gets a shared lock of proctree_lock now that it
  requires an xlock be held by the caller.
- Locking notes in sys/proc.h are adjusted to note that everything that
  used to be protected by the pgrpsess_lock is now protected by the
  proctree_lock.
2002-04-16 17:03:05 +00:00
Benno Rice
864bc5205b Correct a comment. 2002-04-16 12:15:17 +00:00
Benno Rice
e79f59e84c Implement the following functions:
- pmap_kextract
	- pmap_object_init_pt
	- pmap_protect
	- pmap_remove_pages

I'm pretty sure pmap_remove_pages is at least somewhat bogus.
2002-04-16 12:13:10 +00:00
Benno Rice
27dbf9d5e8 Remove some dead code. 2002-04-16 12:10:04 +00:00
Benno Rice
d080d5fd7c Use mtsrin() instead of inline asm. 2002-04-16 12:07:41 +00:00
Benno Rice
a8aaf02c3c Change the value of PMAP_BOOTSTRAP so we don't stomp on the PTE index value. 2002-04-16 12:00:43 +00:00
Benno Rice
b2df36e7d2 Add inlines for mtsrin and mfsrin. 2002-04-16 11:45:09 +00:00
Søren Schmidt
4ec627a3eb Add support for the nVIDIA nForce ATA controller.
Collapse the VIA/AMD/nVIDIA support code into one, they are
created more or less equal anyway..
2002-04-16 08:30:51 +00:00
Warner Losh
93ca0d0cfb Merge from OpenBSD's fixes:
o move timeout from wihap_info to wihap_sta_info
o sprinkle spls into the code (need to use proper -current locking)
o better use of le16toh and htole16
o fix a few leaks m_freem(m)
o minor knf
o minor de-knf to match OpenBSD
o de__P
2002-04-16 07:45:30 +00:00
Warner Losh
c8e6c42caa Minor format nit 2002-04-16 07:39:25 +00:00
Alan Cox
edbecb0cf5 Remove code that updates vm->vm_ssize. This duplicates work already
performed by vm_map_growstack().
2002-04-16 05:56:01 +00:00
Alan Cox
87906298f1 Remove code that updates vm->vm_ssize. This duplicates work already performed
by vm_map_growstack().
2002-04-16 05:38:13 +00:00
John Baldwin
0654f06291 Cast another bus_addr_t to long long for a printf to quiet a warning on
alpha.
2002-04-16 01:58:13 +00:00
Andrew R. Reiter
99b8d33f34 - Nuke fore_pci_device.
- Add a device_method_t array, fore_methods.
- Add a fore_ident_table that contains the various FORE Systems PCA-200
  series devices.
- Rewrite of the fore_probe routine (formerly known as fore_pci_probe).
- Minor changes... mostly WIP stuff to get this updated... still much to
  be done.
2002-04-16 01:38:31 +00:00
Andrew R. Reiter
1df8b447a2 - Remove PCA-200E definition -- this will be re-added in the commit to
fore_load.c that will add ``fore_ident_table'' which holds various
  types of FORE Systems PCA-200 series devices.
2002-04-16 01:34:00 +00:00
David E. O'Brien
89de0c9cbf pal.s is no longer needed for the kernel to build with Gcc. We now use
in-line macros.  pal.s remains however for use by Compaq 'ccc' some day.
2002-04-15 23:28:10 +00:00
David E. O'Brien
3f52464b1c Remove the .stab directives. I do not understand what is different about
Gcc 3.1's 'cpp' vs. 2.95.3's.  Maybe it is due to other code movement and
it just shows up weirdly in handling the .stab's.  Anyway, w/o this change
building a kernel gives:

    alpha/alpha/pal.s:75: relocation truncated to fit: REFLONG .text
    alpha/alpha/prom_disp.s:67: relocation truncated to fit: REFLONG .text
2002-04-15 21:44:19 +00:00
Poul-Henning Kamp
fe4dc7a6ee Remove two debug printfs which should never have been committed. 2002-04-15 21:08:51 +00:00
John Baldwin
38e0823392 You have to cast int64_t's to long long if you printf them with %lld.
This now compiles on alpha without a warning.

Pointy-hat to:	phk
2002-04-15 21:04:32 +00:00
John Baldwin
77b6db948d Recognize the AC97 interface to the onboard sound controller on the Nvidia
nForce chipset.  Playback at least seems to work fine with the ich driver
out of the box.

Sponsored by:	The Weather Channel
Help from:	cg
2002-04-15 20:42:40 +00:00
Jeroen Ruigrok van der Werven
c2d6947d14 Sync with UDF p4 tree: Use POSIX integer types instead of BSD types. 2002-04-15 19:49:15 +00:00
Dag-Erling Smørgrav
4db0d7f16f Document WITNESS_PROFILING.
Submitted by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-04-15 19:42:15 +00:00
John Baldwin
e789153cfc Use bus_addr_t instead of u_int for local variables that are derived from
the per-channel bus_addr_t offset.  Also, cast the offset to (long long)
and use %#llx instead of %#x to fix printf warnings on architectures where
sizeof(bus_addr_t) != sizeof(int).
2002-04-15 19:16:37 +00:00
Coleman Kane
9264fbc80a Fix some nits in AMD AGP driver. Remove excess malloc and move a bzero
out of the way, so it won't cause trouble.

Submitted by:	Frank Mayher <frank@exit.com>
MFC after: 1 week
2002-04-15 18:57:26 +00:00
Peter Wemm
c58d96bb2f Fix an "oops!" that turned out to be mostly harmless (but gave a warning).
I did this right on the sparc64.  Store the direct mapped addresses in
the correct variables.

Submitted by:	jake
2002-04-15 16:07:52 +00:00
Peter Wemm
1a87a0da66 Pass vm_page_t instead of physical addresses to pmap_zero_page[_area]()
and pmap_copy_page().  This gets rid of a couple more physical addresses
in upper layers, with the eventual aim of supporting PAE and dealing with
the physical addressing mostly within pmap.  (We will need either 64 bit
physical addresses or page indexes, possibly both depending on the
circumstances.  Leaving this to pmap itself gives more flexibilitly.)

Reviewed by:	jake
Tested on:	i386, ia64 and (I believe) sparc64. (my alpha was hosed)
2002-04-15 16:00:03 +00:00
Ollivier Robert
a8851d32b1 Remove a spurious warning as x is always initialised before use.
es137x.c: In function `es1371_rdcd':
es137x.c:598: warning: `x' might be used uninitialized in this function

PR:		kern/35408
Submitted by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
2002-04-15 14:43:23 +00:00
Yoshihiro Takahashi
0f8af5c368 MFi386: revision 1.7. 2002-04-15 13:44:00 +00:00
Benno Rice
2819d0ade2 Add ofwd to the GENERIC config for powerpc. 2002-04-15 12:30:18 +00:00
Benno Rice
3e0ec88767 Add a nexus device.
Copied from:	sparc64
2002-04-15 12:29:18 +00:00
Poul-Henning Kamp
e1d970f181 Improve the implementation of adjtime(2).
Apply the change as a continuous slew rather than as a series of
discrete steps and make it possible to adjust arbitraryly huge
amounts of time in either direction.

In practice this is done by hooking into the same once-per-second
loop as the NTP PLL and setting a suitable frequency offset deducting
the amount slewed from the remainder.  If the remaining delta is
larger than 1 second we slew at 5000PPM (5msec/sec), for a delta
less than a second we slew at 500PPM (500usec/sec) and for the last
one second period we will slew at whatever rate (less than 500PPM)
it takes to eliminate the delta entirely.

The old implementation stepped the clock a number of microseconds
every HZ to acheive the same effect, using the same rates of change.

Eliminate the global variables tickadj, tickdelta and timedelta and
their various use and initializations.

This removes the most significant obstacle to running timecounter and
NTP housekeeping from a timeout rather than hardclock.
2002-04-15 12:23:11 +00:00
Benno Rice
52a3cde55d Turn some CTR's into CTR0's. 2002-04-15 12:11:18 +00:00
Poul-Henning Kamp
b35c8f287d Take the "tickadj" element out of struct clockinfo. Our adjtime(2)
implementation is being changed and the very concept of tickadj will
no longer be meaningful.
2002-04-15 12:11:06 +00:00
Benno Rice
da57e52add GC an extraneous prototype of delay(). 2002-04-15 12:02:43 +00:00
Benno Rice
d96118005f Basic OpenFirmware disk driver. It will attach to anything in OpenFirmware
that declares itself to be a disk, which may be the wrong thing to do in
the long term but it works well enough to attach to emulated disks in the
PowerPC simulator in gdb now that they have the proper device_type
property.
2002-04-15 10:54:22 +00:00
Benno Rice
f8f889484a Grab a major number for OpenFirmware disk devices. 2002-04-15 10:41:47 +00:00
David E. O'Brien
9b019189c4 option<space><tab> 2002-04-15 09:21:51 +00:00
Poul-Henning Kamp
b9c6e8bdbd In the ntp_adjtime(2) syscall, return our actual estimate of unapplied
offset correction instead of the most recent offset applied.
2002-04-15 08:58:24 +00:00
Jeff Roberson
5e914b96b9 Finish adding support code for sysctl kern.mprof. This dumps some malloc
information related to bucket size effeciency.  Three things are printed on
each row:

Size is the size the user actually asked for rounded to 16 bytes.
Requests is the number of times this size was asked for.
Real Size is the size we actually handed out.

At the end the total memory used and total waste is displayed.  Currently my
system displays about 33% wasted memory.

The intent of this code is to gather statistics for tuning the malloc bucket
sizes.  It is not intended to be run with INVARIANTS and it is not entirely
mp safe.  It can be enabled via 'options MALLOC_PROFILE' which was commited
earlier.
2002-04-15 05:24:01 +00:00
Jeff Roberson
6f2671750e Remove malloc_type's ks_limit.
Updated the kmemzones logic such that the ks_size bitmap can be used as an
index into it to report the size of the zone used.

Create the kern.malloc sysctl which replaces the kvm mechanism to report
similar data.  This will provide an easy place for statistics aggregation if
malloc_type statistics become per cpu data.

Add some code ifdef'd under MALLOC_PROFILING to facilitate a tool for sizing
the malloc buckets.
2002-04-15 04:05:53 +00:00
Jeff Roberson
5dacf95488 Don't peak into the malloc_type structure for limits. The desired vnodes
check should be sufficient.  This is required for the pending removal of
malloc_type limits.
2002-04-15 03:35:35 +00:00
Brooks Davis
39606b2e27 Fix tx-rate setting for Lucent cards.
Submitted by:	Eugene Perevyazko <john@pcs.dp.ua>
2002-04-14 23:18:40 +00:00
Brooks Davis
42d7dbe6bf Support the Siemens SpeedStream PCI card.
PR:		kern/35988
Submitted by:	Stephen Gunn <csg@waterspout.com>
2002-04-14 22:08:58 +00:00
David Malone
b0f4bb511e Make the MTRR code a bit more defensive - this should help people
trying to run X on some Athlon systems where the BIOS does odd things
(mines an ASUS A7A266, but it seems to also help on other systems).

Here's a description of the problem and my fix:

        The problem with the old MTRR code is that it only expects
        to find documented values in the bytes of MTRR registers.
        To convert the MTRR byte into a FreeBSD "Memory Range Type"
        (mrt) it uses the byte value and looks it up in an array.
        If the value is not in range then the mrt value ends up
        containing random junk.

        This isn't an immediate problem. The mrt value is only used
        later when rewriting the MTRR registers. When we finally
        go to write a value back again, the function i686_mtrrtype()
        searches for the junk value and returns -1 when it fails
        to find it. This is converted to a byte (0xff) and written
        back to the register, causing a GPF as 0xff is an illegal
        value for a MTRR byte.

	To work around this problem I've added a new mrt flag
	MDF_UNKNOWN.  We set this when we read a MTRR byte which
	we do not understand.  If we try to convert a MDF_UNKNOWN
	back into a MTRR value, then the new function, i686_mrt2mtrr,
	just returns the old value of the MTRR byte. This leaves
	the memory range type unchanged.

I have seen one side effect of the fix, which is that ACPI calls
after X has been run seem to hang my machine. As running X would
previously panic the machine, this is still an improvement ;-)

I'd like to MFC this before the 4.6 code freeze - please let me
know if it causes any problems.

PR:		28418, 25958
Tested by:	jkh, Christopher Masto <chris@netmonger.net>
MFC after:	2 weeks
2002-04-14 20:19:13 +00:00
David Malone
7376ec0dd7 Make the MTRR code a bit more defensive - this should help people
trying to run X on some Athlon systems where the BIOS does odd things
(mines an ASUS A7A266, but it seems to also help on other systems).

Here's a description of the problem and my fix:

	The problem with the old MTRR code is that it only expects
	to find documented values in the bytes of MTRR registers.
	To convert the MTRR byte into a FreeBSD "Memory Range Type"
	(mrt) it uses the byte value and looks it up in an array.
	If the value is not in range then the mrt value ends up
	containing random junk.

	This isn't an immediate problem. The mrt value is only used
	later when rewriting the MTRR registers. When we finally
	go to write a value back again, the function i686_mtrrtype()
	searches for the junk value and returns -1 when it fails
	to find it. This is converted to a byte (0xff) and written
	back to the register, causing a GPF as 0xff is an illegal
	value for a MTRR byte.

	To work around this problem I've added a new mrt flag
	MDF_UNKNOWN.  We set this when we read a MTRR byte which
	we do not understand.  If we try to convert a MDF_UNKNOWN
	back into a MTRR value, then the new function, i686_mrt2mtrr,
	just returns the old value of the MTRR byte. This leaves
	the memory range type unchanged.

I'd like to merge this before the 4.6 code freeze, so if people
can test this with XFree 4 that would be very useful.

PR:		28418, 25958
Tested by:	jkh, Christopher Masto <chris@netmonger.net>
MFC after:	2 weeks
2002-04-14 20:13:08 +00:00
Archie Cobbs
4a48abb26a Use 'struct callout' instead of 'struct callout_handle' to avoid
exhausting the kernel timeout table. Perform the usual gymnastics to
avoid race conditions between node shutdown and timeouts occurring.

Also fix a bug in handling ack delays < PPTP_MIN_ACK_DELAY. Before,
we were ack'ing immediately. Instead, just impose a minimum ack delay
time, like the name of the macro implies.

MFC after:	1 week
2002-04-14 17:37:35 +00:00
Alfred Perlstein
46e12b42fe Don't allow one to trace an ancestor when already traced.
PR: kern/29741
Submitted by: Dave Zarzycki <zarzycki@FreeBSD.org>
Fix from: Tim J. Robbins <tim@robbins.dropbear.id.au>
MFC After: 2 weeks
2002-04-14 17:12:55 +00:00
Scott Long
51a7b740a1 Actually add the UDF files! 2002-04-14 16:52:14 +00:00
Max Khon
b3827c8bd6 Cosmetical change: remove empty line to reduce diffs to RELENG_4 2002-04-14 16:40:11 +00:00
Scott Long
df263cbd02 Add a filesystem driver for the Universal Disk Format. For more info,
see http://people.freebsd.org/~scottl/udf

 MFC after:	when asmodai gets the backport done
 Prodded by:	phk asmodai des
2002-04-14 16:36:49 +00:00
Jeff Roberson
5300d9dda2 Fix a witness warning when expanding a hash table. We were allocating the new
hash while holding the lock on a zone.  Fix this by doing the allocation
seperately from the actual hash expansion.

The lock is dropped before the allocation and reacquired before the expansion.
The expansion code checks to see if we lost the race and frees the new hash
if we do.  We really never will lose this race because the hash expansion is
single threaded via the timeout mechanism.
2002-04-14 13:47:10 +00:00
Jeff Roberson
0da47b2fc6 Protect the initial list traversal in sysctl_vm_zone() with the uma_mtx. 2002-04-14 12:39:38 +00:00
John Hay
fcd478479d Fix the play / record rate setting so that it actually works.
The extra microphone channel capability is part of the "normal" ac97
capabilities and not an extended ac97 capability. Now recording on
codecs without a seperate mic channel works.

MFC after:	1 week
2002-04-14 10:39:59 +00:00
Jeff Roberson
79a3e97054 Use VOP_GETVOBJECT instead of accessing the member directly. This fixed
an issue with nullfs and NAMEI shared.

Submitted by:	Alexander Kabaev
2002-04-14 10:18:48 +00:00
David E. O'Brien
76dcc6cba9 Modernize SCM ID. 2002-04-14 07:07:09 +00:00
Marcel Moolenaar
7c9824f7a1 Dotting the i-s:
o  Use chunk instead of region when we talk about a memory range.
   Region can be confused with region register and we already
   call it chunk in machdep.c
o  Update the twiddle every 16MB
2002-04-14 05:37:18 +00:00
Alan Cox
24ab015f79 Regen 2002-04-14 05:33:58 +00:00
Alan Cox
b0d97980f6 Remove the requirement that Giant be held around sigreturn(). 2002-04-14 05:31:47 +00:00
Peter Wemm
421f855923 Allow a kernel to be compiled with both SKI and acpica and still
work on real hardware.  (SKI used to break the sapic probes)
2002-04-14 04:33:41 +00:00
John Baldwin
87484be35f Remove stale XXX comment. 2002-04-14 04:12:44 +00:00
Alan Cox
00e731601d o Use aiocblist::fd_file in the AIO threads rather than recomputing
the file * from the calling process's descriptor table.
 o Eliminate sharing of the calling process's descriptor table
   with the AIO threads.
2002-04-14 03:04:19 +00:00
Jeff Roberson
af7f9b97b6 Fix the calculation that determines uz_maxpages. It was off for large zones.
Fortunately we have no large zones with maximums specified yet, so it wasn't
breaking anything.

Implement blocking when a zone exceeds the maximum and M_WAITOK is specified.
Previously this just failed like the old zone allocator did.  The old zone
allocator didn't support WAITOK/NOWAIT though so we should do what we
advertise.

While I was in there I cleaned up some more zalloc logic to further simplify
that code path and reduce redundant code.  This was needed to make the blocking
work properly anyway.
2002-04-14 01:56:25 +00:00
Alan Cox
b7c8cbabf9 Add comment that sigreturn() is MPSAFE. 2002-04-13 23:37:10 +00:00
John Baldwin
9c1ab3e04a - Change killpg1()'s first argument to be a thread instead of a process so
we can use td_ucred.
- In killpg1(), the proc lock is sufficient to check if p_stat is SZOMB
  or not.  We don't need sched_lock.
- Close some races in psignal().  In psignal() there is a big switch
  statement based on p_stat.  All the different cases are assuming that
  the process (or thread) isn't going to change state out from under it.
  To ensure this is true, just lock sched_lock for the entire switch.  We
  practically held it the entire time already anyways.  This also
  simplifies the locking somewhat and actually results in fewer lock
  operations.
- Allow signotify() to be called with the sched_lock held since psignal()
  now does that.
- Use td_ucred in a couple of places.
2002-04-13 23:33:36 +00:00
John Baldwin
bad56603ba - Change donice() to take a thread as the first argument instead of a
process so it can use td_ucred.
- Require the target process of donice() to be locked when donice() is
  called.
- Use td_ucred.
- Lock the target process of p_cansee() and while reading the credentials
  of a process.
- Change the logic of rtprio() slightly so it does it's copyin() if needed
  prior to locking the target process.
- rtprio() no longer needs Giant.  In theory with full KSE it would still
  need Giant to protect p_ucred of curproc for the p_canfoo() functions
  but p_canfoo() will be changing to using td_ucred of curthread before
  full KSE hits the tree.
2002-04-13 23:28:23 +00:00
John Baldwin
a92e7c792a - Change procfs_control()'s first argument to be a thread pointer instead
of a process pointer.
- Move the p_candebug() at the start of procfs_control() a bit to make
  locking feasible.  We still perform the access check before doing
  anything, we just now perform it after acquiring locks.
- Don't lock the sched_lock for TRACE_WAIT_P() and when checking to see if
  p_stat is SSTOP.  We lock the process while setting p_stat to SSTOP
  so locking the process is sufficient to do a read to see if p_stat is
  SSTOP or not.
2002-04-13 23:19:13 +00:00
John Baldwin
ce5aaf4554 Lock the target process for p_candebug(). 2002-04-13 23:15:28 +00:00
John Baldwin
ff7299d998 Lock the target process in procfs_doproc*regs() for p_candebug and while
reading/writing the registers.
2002-04-13 23:14:08 +00:00
John Baldwin
094a945562 Rework logic of syscalls that modify process credentials as described in
rev 1.152 of sys/kern/kern_prot.c.
2002-04-13 23:11:23 +00:00
John Baldwin
590ae816c2 - p_cansee() needs the target process locked.
- We need the proc lock held for more of procfs_doprocstatus().
2002-04-13 23:09:41 +00:00
John Baldwin
07f3485d5e - Change the algorithms of the syscalls to modify process credentials to
allocate a blank cred first, lock the process, perform checks on the
  old process credential, copy the old process credential into the new
  blank credential, modify the new credential, update the process
  credential pointer, unlock the process, and cleanup rather than trying
  to allocate a new credential after performing the checks on the old
  credential.
- Cleanup _setugid() a little bit.
- setlogin() doesn't need Giant thanks to pgrp/session locking and
  td_ucred.
2002-04-13 23:07:05 +00:00
John Baldwin
a7ff744350 - Change the first argument of ktrcanset(), ktrsetchildren(), and ktrops()
to a thread pointer so that ktrcanset() can use td_ucred.
- Add some proc locking to partially protect p_tracep and p_traceflag.
2002-04-13 22:54:18 +00:00
David E. O'Brien
0301e9c83b Turn on TGA support.
Submitted by:	Andrew M. Miklic <AndrwMklc@cs.com>
2002-04-13 22:34:16 +00:00
David E. O'Brien
a68bbb481b Quiet GCC 3.1 warning. 2002-04-13 22:21:28 +00:00
Poul-Henning Kamp
ff7ed9f76b If the receiver runs out of space for an received frame in the internal
FIFO or the in-RAM descriptors it will switch to RX_IDLE from where it
is not restarted.

We used to deal with RX_IDLE by doing a total reinit but this lost
our link and caused a potential 30sec autonegotiation against
switches.  This was changed to a less heavyhanded approach, but this
failed to restart the receiver it it were in the RX_IDLE state.

This change adds the RX_IDLE and the RX_FIFO_OFLOW conditions as
triggers for interrupts and receive side processing, and restarts
the receiver when it is RX_IDLE.

Remove the #ifdef notyet'ed nge_rxeoc() function.

Sponsored by:	Cybercity Internet, Denmark.
MFC after:	7 days
2002-04-13 21:33:33 +00:00
Thomas Moestl
8db523989f Use pmap_extract() instead of pmap_kextract() to retrieve the physical
address associated with a user virtual address in
pipe_build_write_buffer().

Reviewed by:	alc
2002-04-13 20:09:06 +00:00
Alan Cox
80eef17ba9 o Remove vm_map_growstack() and useracc() from sendsig(). Copyout() and
suword() will automatically grow the stack if needed.
 o Add a comment that osigreturn() and sigreturn() are MPSAFE.
2002-04-13 19:17:49 +00:00
Boris Popov
6e8681aa50 Check write permissions before creating anything.
PR:		kern/27883
MFC after:	1 week
2002-04-13 15:33:26 +00:00
Jeroen Ruigrok van der Werven
bcbf4411d6 Use the correct macros for F_SETFD/F_GETFD instead of magic numbers.
Reflect that fact in the manual page.

PR:		12723
Submitted by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
Approved by:	bde
MFC after:	2 weeks
2002-04-13 10:16:53 +00:00
Warner Losh
8961964d97 Fix an edge case wrt membase, but more changes needed 2002-04-13 05:52:35 +00:00
Warner Losh
387a5bacc2 Restore NetBSD copyrights that shouldn't have been removed in the first place. 2002-04-13 04:07:07 +00:00
Thomas Moestl
de67a4bd91 Back out the last revision - it does not work correctly when one of
the pages in question is not in the top-level vm object, but in
one of the shadow ones.

Pointed out by: alc
Pointy hat to:	tmm
2002-04-13 00:03:07 +00:00
John Baldwin
6871a6c89e Rework ptrace(2) to be more locking friendly. We do any needed copyin()'s
and acquire the proctree_lock if needed first.  Then we lock the process
if necessary and fiddle with it as appropriate.  Finally we drop locks and
do any needed copyout's.  This greatly simplifies the locking.
2002-04-12 21:17:37 +00:00
Thomas Moestl
60f2606a7d Do not use pmap_kextract() to find out the physical address of a user
belong to a user virtual address; while this happens to work on some
architectures, it can't on sparc64, since user and kernel virtual
address spaces overlap there (the distinction between them is done via
separate address space identifiers).

Instead, look up the page in the vm_map of the process in question.

Reviewed by:	jake
2002-04-12 19:38:41 +00:00
Mike Barcroft
795aff0ed9 Include <sys/cdefs.h> for definition of __BSD_VISIBLE.
Pointy hat to:	mike
2002-04-12 15:56:45 +00:00
Ruslan Ermilov
2f42caa5de Unbreak this as well.
At the extra bonus of fixing the contents of the .depend file.

Not really my day.
2002-04-12 15:49:30 +00:00
Søren Schmidt
6ed14aa161 Add a couble more Promise chip ID's. 2002-04-12 14:10:19 +00:00
Doug Rabson
722ff934ee Initialise ar.cflg, which contains the IA-32 registers cr0 and cr4. Since
all IA-32 processes use the same values for cr0 and cr4, we initialise
them at system startup.
2002-04-12 07:43:35 +00:00
Doug Rabson
c85c7b5ff6 Print extra information in printtrap() if the interrupted state was for
an IA-32 process. Don't sign extend arguments in ia32_syscall - its not
normally going to be useful (e.g. pointers need to be zero extended).
2002-04-12 07:41:16 +00:00
Marcel Moolenaar
9ca98629d7 Fix definition of va_start: We don't need to take the address of
va_list. It's a builtin type. gcc 3.1 doesn't care either way,
but gcc 3.2 is more picky and doesn't like the former.
2002-04-12 06:50:51 +00:00
Warner Losh
41544fe68c Forgot to commit this when I committed the rest of the hostap stuff. 2002-04-12 06:19:18 +00:00
Warner Losh
fafbd94d8d After committing the forgotten IFM_IEEE80211_HOSTAP stuff to if_media.h,
no need for the ifdefs here anymore.
2002-04-12 06:12:21 +00:00
Warner Losh
73ce5fac0e Add hostap 802.11 media type.
From wi_hostap stuff by Thomas Skibo
2002-04-12 06:10:37 +00:00
Warner Losh
64fa2b20c6 -DWI_HOSTAP no longer needed 2002-04-12 06:01:49 +00:00
Warner Losh
b0152b2e40 unifdef -DWI_HOSTAP, like OpenBSD does 2002-04-12 06:01:28 +00:00
Alfred Perlstein
7344c0a194 ifdef WI_HOSTAP some stuff that seems like it needs to be ifdef'd. 2002-04-12 05:46:36 +00:00
Peter Wemm
a8f559e910 Really fix uniprocessor on IA64. Note to self: do not use variables before
they are initialized.   I had correctly figured out that the UP problem was
the pcpu current_pmap thing, but didn't fix it right last time.
2002-04-12 05:17:15 +00:00
Warner Losh
e122b676e6 Replace the original host WEP implementation with the one in OpenBSD
(apparently by markus@, at least committed by him).  This has the
advantage of not using the bad IV's from Fluhrer/Mantin/Shamir as well
as bringing the drivers a little closer together.

Also use a few constants in place of magic numbers in one place.

Obtained from: OpenBSD 1.25, 1.28, 1.36, 1.38, 1.42
2002-04-12 03:42:37 +00:00
Jeffrey Hsu
4037698769 Fix corner case where m_len was not being initialized.
Submitted by:	Maksim Yevmenkin <myevmenk@digisle.net>
MFC after:	1 week
2002-04-12 00:01:50 +00:00
Warner Losh
f90d35eca1 Add ActionTec HWC01170 and Linksys IWN2
Obtained from: OpenBSD
2002-04-11 21:21:14 +00:00
Warner Losh
0d2a385fa9 Catchup to 1.32 2002-04-11 21:19:04 +00:00
Warner Losh
7afbcf5ed0 Add ACTIONTEC HWC01170 from OpenBSD 2002-04-11 21:18:17 +00:00
John Baldwin
59cfd37dd4 Use the proc lock to protect p_ucred while we read a few items from it. 2002-04-11 21:17:45 +00:00
John Baldwin
3aa68913bc Make this compile again when UMASS_DEBUG isn't defined. 2002-04-11 21:09:41 +00:00
John Baldwin
b106d2f56a - Set the base priority of an ithread that has no handlers when we set its
normal priority.
- Lock sched_lock while we dink with the priorities.
- Remove a few extra blank lines.
2002-04-11 21:03:35 +00:00
John Baldwin
5a882ddd66 Commented out locking that would be used in the ps command if locks were
used in ddb.
2002-04-11 21:01:34 +00:00
John Baldwin
8e4357a4cb Use proc lock to protect p_ucred pointer while we deference it to read a
few values.
2002-04-11 21:00:38 +00:00
John Baldwin
0af24d5151 Use td_ucred in a few spots. 2002-04-11 21:00:05 +00:00
Alan Cox
ab9ab5702e Regen 2002-04-11 17:35:53 +00:00
Alan Cox
a0805f6f7a Remove the requirement that Giant be held around osigreturn(). All platform-
specific implementations are MPSAFE.
2002-04-11 17:34:38 +00:00
Alan Cox
0d36f49e63 Add a comment that osigreturn() is MPSAFE. 2002-04-11 17:13:08 +00:00
John Baldwin
2c823989e1 Fix a warning due to the code assuming sizeof(int) == sizeof(void *) which
is not true on the alpha.  I think that other parts of this code also make
this implicit assumption as well.
2002-04-11 15:31:01 +00:00
Bernd Walter
0dc76ffdd4 LCA based systems can't handle more than 16 devices on pci bus 0.
Reviewed by:	gallatin
Approved by:	gallatin
2002-04-11 13:24:20 +00:00
Søren Schmidt
5b93eb04a9 Add yet another chip ID for a Promise TX2 chip. 2002-04-11 11:04:23 +00:00
Nick Hibma
b2f485ca0d Delay umass_cam_rescan by 200 ms to make sure attach is finished by the
time we tell CAM to rescan the bus. Together with the previous patch
this should avoid the problem where the devices would wedge because they
got spoken to over two different pipes.

Tested by:	Tomas Pluskal <plusik@pohoda.cz>
2002-04-11 10:34:15 +00:00
Peter Wemm
31c41f1b1e Bandaid for a buffer overrun in the module searching code. When breaking
up the module_path string, we would walk one past the end of the buffer.
This hurting ia64 originally, but it was probably also happening on i386
occasionally as well.  The effects were usually harmless, it would add
bogus "binary" search directories to the places it actually looked for
files.
2002-04-11 10:00:44 +00:00
Peter Wemm
2ab188f529 Finally fix loader completely for IA64. efifs_stat() wasn't setting
the S_IFREG bit for regular files.  This caused the path search code to
skip it when it finally did find the kernel (after the common/module.c
buffer overrun bug was fixed)
2002-04-11 09:50:11 +00:00