Commit Graph

32515 Commits

Author SHA1 Message Date
Alan Cox
c0b6bbb80b o Condition the compilation and use of vm_freeze_copyopts()
on ENABLE_VFS_IOOPT.
2002-05-06 05:45:57 +00:00
Jeff Roberson
6953f5da1a Hold the currently selected vnode's lock across the call to VOP_GETVOBJECT.
Don't try to create a vm object before the file system has a chance to finish
initializing it.  This is incorrect for a number of reasons.  Firstly, that
VOP requires a lock which the file system may not have initialized yet. Also,
open and others will create a vm object if it is necessary later.
2002-05-06 04:47:43 +00:00
Alan Cox
dcc5840ed5 o Some improvements to the page coloring of vm objects, particularly,
for shadow objects.

Submitted by:	bde
2002-05-06 03:34:17 +00:00
Bruce Evans
607aa34e88 Include <sys/queue.h> so that this file provides its own namespace
pollution which is required for its includes of <sys/_lock.h> and
<sys/_mutex.h> to work.
2002-05-06 03:13:08 +00:00
Chris D. Faulhaber
eab0c369f1 s/sysctl -w/sysctl/ 2002-05-06 00:45:27 +00:00
Alan Cox
e86256c1f4 o Move vm_freeze_copyopts() from vm_map.{c.h} to vm_object.{c,h}. It's plainly
an operation on a vm_object and belongs in the latter place.
2002-05-06 00:12:47 +00:00
Bruce Evans
5eb6f4bc21 Restored db_elf.c from the Attic. This will be used for a quick fix for
the longstanding brokenness of symbols in ddb at boot time.  It doesn't
compile and is not attached to the build yet.
2002-05-06 00:05:44 +00:00
Maxime Henrion
9d997d8be8 Add the lchflags(2) syscall.
Reviewed by:	rwatson
2002-05-05 23:47:41 +00:00
Maxime Henrion
8d9b781fb5 Add an entry for the lchflags(2) syscall. It's useful to prevent
a symlink deletion.

Reviewed by:	rwatson
2002-05-05 23:37:44 +00:00
Jeff Roberson
576365ba36 Move a KASSERT() in open() prior to unlocking the vnode. It's not safe to
call VOP_GETVOBJECT without a lock.
2002-05-05 23:17:13 +00:00
Alan Cox
c50fe92b8d o Condition the compilation of uiomoveco() and vm_uiomove()
on ENABLE_VFS_IOOPT.
 o Add a comment to the effect that this code is experimental
   support for zero-copy I/O.
2002-05-05 22:42:40 +00:00
Luigi Rizzo
43d11e8453 Indentation and comments cleanup, no functional change.
MFC after: 3 days
2002-05-05 21:27:47 +00:00
Poul-Henning Kamp
81e017430a Expand the one-line function pbreassignbuf() the only place it is or could
be used.
2002-05-05 20:37:08 +00:00
Poul-Henning Kamp
d08961bec3 Move some UFS related stuff home where it belongs. 2002-05-05 20:04:33 +00:00
Orion Hodson
7dace039d8 No longer attempt to power off the ACLINK during suspend - luigi
reports this causes his ich machine to hang.
2002-05-05 15:37:09 +00:00
Maxime Henrion
4e039937d9 Add a KERNELDUMPMAGIC_CLEARED macro to unbreak savecore. Since
it is a "magic" value, what it expands to is not really important.
I set it to "Cleared Kernel Dump", but that can be changed later
if someone thinks it's not good enough.

Pointy hat to:	fenner
2002-05-05 13:47:21 +00:00
Marcel Moolenaar
e80835fe0e o Add struct mca_guid
o  Add currently known GUIDs
o  Slight restyling
2002-05-05 08:26:25 +00:00
Marcel Moolenaar
33264d92ba o Include md_var.h
o  Remove definition of struct ia64_fdesc
o  Remove prototype of os_boot_rendez
o  Use the FDESC_FUNC and FDESC_GP abstractions
2002-05-05 08:18:42 +00:00
Marcel Moolenaar
fd4a02c900 Remove definition of struct ia64_fdesc. It's been moved to md_var.h 2002-05-05 08:16:10 +00:00
Marcel Moolenaar
8cc99b71a9 o Move definition of struct ia64_fdesc here to remove duplication.
o  Add prototype of os_boot_rendez.
2002-05-05 08:14:32 +00:00
Alan Cox
15fdd586e3 o Remove GIANT_REQUIRED from vm_map_lookup() and vm_map_lookup_done().
o Acquire and release Giant around vm_map_lookup()'s call
   to vm_object_shadow().
2002-05-05 05:36:28 +00:00
Bruce Evans
f5216b9a19 Return the correct error code (ENOSYS, not EINVAL) from nosys(). Getting
killed by SIGSYS for unimlemented syscalls is bad enough.

Obtained from:	Lite2 branch

The Lite2 branch has some other interesting unmerged (?) bits in this
file.  They are well hidden among cosmetic regressions.
2002-05-05 04:50:47 +00:00
Bruce Evans
a9a0f15a69 Fixed breakage of binary compatibility of the kern.clockrate sysctl in
sys/time.h rev.1.53, etc.  Zero out the entire struct clkinfo and not
just the new spare part of it so that there is no possibility of leaking
kernel stack context to userland.
2002-05-05 04:33:09 +00:00
Bruce Evans
f318190a01 Fixed checking for VM86 mode in doreti which I broke in rev.1.30. Only
the case of VM86 calls from the kernel was broken, so this bug was not
a security hole.

PR:		36710
Submitted by:	David Xu <davidx@viasoft.com.cn> (version for RELENG_4)
MFC after:	3 days
2002-05-05 03:19:48 +00:00
Jeff Roberson
c7173f58fa Use pages instead of uz_maxpages, which has not been initialized yet, when
creating the vm_object.  This was broken after the code was rearranged to
grab giant itself.

Spotted by:     alc
2002-05-04 21:49:29 +00:00
Alan Cox
79660d837c o Make _vm_object_allocate() and vm_object_allocate() callable
without holding Giant.
 o Begin documenting the trivial cases of the locking protocol
   on vm_object.
2002-05-04 20:23:48 +00:00
David E. O'Brien
856f29cf94 Use -ffreestanding for kernel bits unconditionally. 2002-05-04 20:07:33 +00:00
Maxime Henrion
afd458b0fa Fix a typo.
Submitted by:	dwmalone
2002-05-04 19:50:09 +00:00
Poul-Henning Kamp
60a084052b Shake unused stuff out of the flags in struct buf->b_flags. 2002-05-04 19:40:34 +00:00
Poul-Henning Kamp
e31c615c60 Remove a six year old undocumented #ifdef : NO_B_MALLOC. 2002-05-04 19:24:55 +00:00
Poul-Henning Kamp
2a5bcfdef6 The struct buf->b_act was not used anywere. 2002-05-04 19:06:32 +00:00
Bill Fenner
7bf744074d Restore the ability interrupt dumps on i386, based on
the old kern_shutdown.c .  Other archs might be able to
use similar code but I don't have anything to test on.
2002-05-04 17:45:48 +00:00
Matthew Dillon
9f9435545b Remove obsolete code (that was already #if 0'd out).
Requested by: Hiten Pandya <hitmaster2k@yahoo.com>
2002-05-04 17:10:15 +00:00
Maxime Henrion
614be65181 When a program launched on the local console exits, the shell will
call read() to get the next command, and scread() disables the
screensaver.  We don't want this behaviour in the sc_saver_keybonly
case.

Submitted by:	Olivier Houchard <doginou@ci0.org>
2002-05-04 15:42:38 +00:00
Doug Rabson
9e861cfaa4 Use region 7 addresses for the slabs in the PV and PT zones so that we
don't confuse the zone allocater by translating region 5 addresses to
region 7 addresses (which is unavoidable for PTEs).
2002-05-04 12:21:32 +00:00
Poul-Henning Kamp
d9fc2b816e Do not call nge_tick() if we get an PHY interrupt, nge_tick() calls
mii_tick() which should only be called once per second.

Our current MII/PHY state-engine is not able to deal with PHY
interrupts as far as I can tell, and most net drivers don't seem
to use the link/status change call-back mechanism.  It seems that
MII/PHY was orphaned before it grew up.
2002-05-04 11:15:33 +00:00
Poul-Henning Kamp
37c0fba7c4 Increase gigE negotiation timeout to 17 seconds.
10 seconds is not enough to negotiate a gigE link with a cisco switch which
holds carrier off for several seconds between tries.
2002-05-04 11:08:49 +00:00
Poul-Henning Kamp
fd94424c78 Clean up mii/phy drivers: Remove the MIIF_DOINGAUTO which doesn't really
do anything at the end of the day except bloat the drivers which has
copy&pasted it.
2002-05-04 11:00:30 +00:00
Marcel Moolenaar
9a1bf46934 Make sure we don't index the pm_rid array out of bounds in
pmap_ensure_rid(). This can happen because the function is
called for both user and kernel addresses, while the rid array
only has room for user addresses. This bug got exposed by rev
1.58 of ia64/ia64/pmap.c and rev 1.8 of ia64/include/pmap.h.
2002-05-04 08:04:28 +00:00
Alfred Perlstein
698f85d3e3 style(9): 'if' and 'while' need a space after them. 2002-05-04 07:40:49 +00:00
Jeff Roberson
5df148630f Include systm.h so panic(9) is defined when doing DEBUG_ALL_VFS_LOCKS. 2002-05-04 02:40:37 +00:00
Jeff Roberson
441271159e Include systm.h for panic(9) so that DEBUG_ALL_VFS_LOCKS compiles. 2002-05-04 02:37:00 +00:00
Jeff Roberson
ef317162da include systm.h in vnode_if.c so that panic is defined when we're doing
DEBUG_ALL_VFS_LOCKS.
2002-05-04 02:35:13 +00:00
Alan Cox
8c5c5d049f o Remove GIANT_REQUIRED from vm_map_lookup_entry() and
vm_map_check_protection().
 o Call vm_map_check_protection() without Giant held in munmap().
2002-05-04 02:07:36 +00:00
Poul-Henning Kamp
1ed91802ee HPFS picks up the vop_stdgetpages and vop_stdputpages member functions
via the default entry and the default vop vector.
2002-05-03 18:23:29 +00:00
Juli Mallett
ea0b7a7699 Typo fix: detects -> detect.
Reviewed by:	phk
2002-05-03 17:59:25 +00:00
Poul-Henning Kamp
9589c2561c Fix a memory-leak when configuring a vnode backed md(4) device fails.
Submitted by:	Martin Faxér <gmh003532@brfmasthugget.se>
MFC after:	4 weeks
2002-05-03 17:55:10 +00:00
Dag-Erling Smørgrav
d95ec55335 s/pfs_badop/vop_eopnotsupp/
Submitted by:	phk
2002-05-03 14:58:25 +00:00
Poul-Henning Kamp
48e5da550a Initialize time_second to 1 instead of zero to pacify slightly bogus arp code.
Various minor style fixes from BDE.
2002-05-03 08:46:03 +00:00
Poul-Henning Kamp
9ebe64ca1b Don't grab the lock until somewhat later in attach to avoid a lock
reversal.
2002-05-03 08:44:53 +00:00
Poul-Henning Kamp
afe564a200 Name ufs_vop_[gs]etextattr() consistently with the rest of our VOPs and
put then in the ufs_vnops where they belong, rather than in the ffs_vnops.

Ok'ed by:	rwatson
Sponsored by:	DARPA & NAI Labs.
2002-05-03 08:40:33 +00:00
Seigo Tanimura
6041fa0a60 As malloc(9) and free(9) are now Giant-free, remove the Giant lock
across malloc(9) and free(9) of a pgrp or a session.
2002-05-03 07:46:59 +00:00
Seigo Tanimura
5cbc7077cb The first argument of pgsigio() is now struct sigio **. 2002-05-03 07:45:26 +00:00
Seigo Tanimura
c8d8a686e4 Fix the lock order reversal between the sigio lock and a process/pgrp lock in
funsetownlst() by locking the sigio lock across funsetownlst().
2002-05-03 05:32:25 +00:00
Marcel Moolenaar
cb5e1f4f73 Adjust KINFO_PROC_SIZE due to segsz_t being changed from a 32-bit to
a 64-bit integral.
2002-05-03 01:41:37 +00:00
Scott Long
39ee03c316 bzero out the sync command buffer when sending commands. This was causing
problems when enumerating multiple arrays.

This is an MFC candidate.
2002-05-03 00:07:50 +00:00
Josef Karthauser
38c162edb3 MFNetBSD:
revision 1.94
    date: 2001/12/30 20:26:59;  author: augustss;  state: Exp;  lines: +5 -2
    Make sure we don't have any pending softintrs when entering polling mode.
    Thanks to Darrin for finding and fixing this problem when using USB
    keyboards in DDB.
2002-05-02 22:47:37 +00:00
Peter Wemm
85f79d52e9 Retire makeobjops.pl - replaced by ../tools/makeobjops.awk. 2002-05-02 22:21:59 +00:00
Prafulla Deuskar
29c4c8ed2b Make em driver compilable on IA64/alpha.
Submitted by:	peter
MFC after:	3 days
2002-05-02 22:21:01 +00:00
Peter Wemm
7bdbf808c3 Retire makeLINT.pl 2002-05-02 22:20:40 +00:00
Peter Wemm
59d72e9d82 Makefile uses genwakecode.sh now. 2002-05-02 22:17:35 +00:00
Alfred Perlstein
90535973d5 Cleanup, quote:
This leaves some vestiges of the old locking, including style
  bugs in it.  I've only noticed anachronisms in socketvar.h so far
  (I've merged net* but not kern or all of sys).  The patch also
  has old fixes for style bugs in accf stuff and namespace pollution
  in uma...  The largest style bugs are line continued backslashes
  in column 80 and (these are fixed), and starting the do-while
  code for the new macros in column 40, which is quite unlike the
  usual indentation (see sys/queue.h) and not even like the indentation
  for the old macros (column 32) (this is not fixed).

Submitted by: bde
2002-05-02 22:03:19 +00:00
Poul-Henning Kamp
0b5d880d39 As promised make the hack for sizeof(struct disklabel) on alpha annoying.
Run make world (or recompile whatever program whines) to get rid of warning.

Compat bits will be removed entirely in about two weeks.
2002-05-02 21:53:39 +00:00
Maxime Henrion
6dbde1fe23 Convert devfs to nmount.
Reviewed by:	phk
2002-05-02 20:27:42 +00:00
Maxime Henrion
8392a47923 Convert the pseudofs framework to nmount (thus procfs and linprocfs).
Reviewed by:	des (some time ago), phk
2002-05-02 20:25:55 +00:00
Maxime Henrion
4d8b916946 Convert fdescfs to nmount.
Reviewed by:	phk
2002-05-02 20:24:50 +00:00
Scott Long
1347b4e84f Don't reference vop_std* since they are already implicitly
referenced through the VOP_DEFAULT vector

Submitted by:	phk
2002-05-02 20:23:47 +00:00
David E. O'Brien
1de6d67791 Revert rev 1.1018. rp(4) and dgb(4) are deemed MI, while the rest of the
drivers for simular hardware are i386-specific.  That is why I did not
find the information here.
2002-05-02 19:42:38 +00:00
Poul-Henning Kamp
d65b3c73d7 Use vop_panic() instead of our home-rolled version. 2002-05-02 19:15:52 +00:00
Poul-Henning Kamp
ef41ad17bd Use vop_panic() instead of rolling our own. 2002-05-02 19:13:44 +00:00
Alan Cox
bc91c5107a o Change the implementation of vm_map locking to use exclusive locks
exclusively.  The interface still, however, distinguishes
   between a shared lock and an exclusive lock.
2002-05-02 17:32:27 +00:00
Dag-Erling Smørgrav
cff135d87c Join the pissing contest: generate LINT with a single sed(1) command.
Smaller script, smaller (though equivalent) output.
2002-05-02 16:34:47 +00:00
Julian Elischer
8ac00c2767 Add missing UNLOCKs
Submitted by: dirkx@covalent.net
2002-05-02 15:58:04 +00:00
John Baldwin
3fc755c118 - Protect randompid and nprocs with the allproc_lock.
- Reorder fork1() to do malloc() and other blocking operations prior to
  acquiring the needed process locks.
- The new process inherit's the credentials of curthread, not the
  credentials of the old process.
- Document a really weird race that will come up with KSE allows multiple
  kernel threads per process.
2002-05-02 15:13:45 +00:00
John Baldwin
d7aadbf9ce - Reorder a few things so that when we lock the process at the end of
exit1() we don't have to release it until we acquire schd_lock to
  call cpu_throw().
- Since we can switch at any time due to preemption or a lock release
  prior to acquiring sched_lock, don't update switchtime and switchticks
  until the very end of exit1() after we have acquired sched_lock.
- Interlock the proctree_lock and proc lock in wait1() and exit1() to
  avoid lost wakeups when a parent blocks waiting for a child to exit at
  the bottom of wait1().  In exit1() the proc lock interlocked with
  proctree_lock (and released after acquiring sched_lock) is that of
  the parent process.
- In wait1() use an exclusive lock of proctree lock while we are
  looking for a process to harvest.  This allows us to completely
  remove all references to the process once we've found one (i.e.,
  disconnect it from pgrp's, session's, zombproc list, and it's parent's
  children list) "atomically" without needing to worry about a lock
  upgrade.
- We don't need sched_lock to test if p_stat is SZOMB or SSTOP when holding
  the proc lock since the proc lock is always held with p_stat is set to
  SZOMB or SSTOP.
- Protect nprocs with an xlock of the allproc_lock.
2002-05-02 15:09:58 +00:00
John Baldwin
9b3b1c5fdf - Reorder execve() so that it performs blocking operations before it
locks the process.
- Defer other blocking operations such as vrele()'s until after we
  release locks.
- execsigs() now requires the proc lock to be held when it is called
  rather than locking the process internally.
2002-05-02 15:00:14 +00:00
Jeff Roberson
8f70816cf2 Hide a pointer to the malloc_type bucket at the end of the freed memory. If
this memory is modified after it has been freed we can now report it's
previous owner.
2002-05-02 09:07:04 +00:00
Jeff Roberson
b9ba893179 Move around the dbg code a bit so it's always under a lock. This stops a
weird potential race if we were preempted right as we were doing the dbg
checks.
2002-05-02 09:05:36 +00:00
Doug Rabson
1cae166218 The width of segsz_t should be 64, not 32 on ia64. 2002-05-02 09:04:29 +00:00
Andrew R. Reiter
c3bdc05fb9 - Changed the size element of uma_zctor_args to be size_t instead of int.
- Changed uma_zcreate to accept the size argument as a size_t intead of
  int.

Approved by:	jeff
2002-05-02 07:36:30 +00:00
Andrew R. Reiter
2647924585 - Replaced the Atm_connection storage pool with an uma_zone of
Atm_connection items.
- Replaced the Atm_connvc storage pool with an uma_zone of Atm_connvc
  items.
- Created void atm_cm_init(void *) and added it to the netatm init code.
  I'm thinking that there will definetly be more ``subsystem'' init
  functions to be added so I'll probably change these calls to be a for
  loop through init routines (or something).
2002-05-02 07:27:29 +00:00
Jeff Roberson
5a34a9f089 malloc/free(9) no longer require Giant. Use the malloc_mtx to protect the
mallochash.  Mallochash is going to go away as soon as I introduce the
kfree/kmalloc api and partially overhaul the malloc wrapper.  This can't happen
until all users of the malloc api that expect memory to be aligned on the size
of the allocation are fixed.
2002-05-02 07:22:19 +00:00
Jun Kuriyama
23dc40e1dd Use shell script version (using awk and sed) of makeLINT.pl. 2002-05-02 06:10:09 +00:00
Marcel Moolenaar
2a688cec16 In pmap_pinit0, remove duplicate initialization. 2002-05-02 05:35:02 +00:00
Marcel Moolenaar
b905ae4ef9 PCPU(current_pmap) is initialized in pmap_bootstrap. No need to
do it again.
2002-05-02 05:30:42 +00:00
Scott Long
cd1b1a1d35 In udf_bmap(), return the physical block number, not the logical
block number.  This fixes things like cp (ouch!) which use mmap.
2002-05-02 05:01:14 +00:00
Alan Cox
569687d02f o Remove dead and lockmgr()-specific debugging code. 2002-05-02 02:32:09 +00:00
Jeff Roberson
639c9550fb Remove the temporary alignment check in free().
Implement the following checks on freed memory in the bucket path:
	- Slab membership
	- Alignment
	- Duplicate free

This previously was only done if we skipped the buckets.  This code will slow
down INVARIANTS a bit, but it is smp safe.  The checks were moved out of the
normal path and into hooks supplied in uma_dbg.
2002-05-02 02:08:48 +00:00
David E. O'Brien
b20b5a8b09 Add some NOTES on the Comtrol Rocketport and the Digiboard drivers. 2002-05-01 23:03:31 +00:00
Marcel Moolenaar
b9492ca0a4 Save the MCA info specific to the AP as part of the AP launch. 2002-05-01 22:19:03 +00:00
Marcel Moolenaar
0e09ff93a3 Make ia64_mca_save_state MP safe. Protect access to the info block,
updating the sysctl tree and clearing the SAL state by a spin lock.
2002-05-01 22:10:03 +00:00
Matt Jacob
f77e6d9569 If we get a DATA UNDERRUN error from QLogic FC cards, but the RQCS_RU bit
is not set in the scsi completion status, or if the residual is clearly
nonsense, then this was a command that suffered the loss of one or more
FC frames in the middle of the exchange.

Set HBA_BOTCH and hope it will get retried. It's the only thing we can do.

MFC after:	1 day
2002-05-01 21:58:36 +00:00
Peter Wemm
47a45d1b17 Try using genwakecode.sh instead of the perl version. 2002-05-01 21:54:07 +00:00
Peter Wemm
9b4e33b6ba Add a shell script to do what genwakecode.pl does.
Obtained from:	ade
2002-05-01 21:52:34 +00:00
Alfred Perlstein
f132072368 Redo the sigio locking.
Turn the sigio sx into a mutex.

Sigio lock is really only needed to protect interrupts from dereferencing
the sigio pointer in an object when the sigio itself is being destroyed.

In order to do this in the most unintrusive manner change pgsigio's
sigio * argument into a **, that way we can lock internally to the
function.
2002-05-01 20:44:46 +00:00
Warner Losh
3498b5ed09 We don't need no stinkin' echos here.
Instead, don't run kldxref if you don't have one on your system.
2002-05-01 19:24:26 +00:00
Semen Ustimenko
08279b9cfe Add an epic_stats_update() function (called once per second). Even though
we don't collect any stats in it, we mii_tick() in it! This fix the bug
when autonegotiating fullduplex modes.

Also, pause activity before setting TXCON in epic_miibus_statchg(). Though
i've never seen problmes from not doing that, the documentation says we
need to do it.

MFC after:	1 week
2002-05-01 19:23:04 +00:00
Semen Ustimenko
4592db4635 MII_TICK handlers need not restart aneg on these PHYs, they behave pretty
well as is, so - just fetch current status upon MII_TICK.

Also do IFM_INST verification at the top of *_service() then doing it
separately for every case in switch.

acphy: do not read MII_ACPHY_DIAG twice, there is nothing latching.
qsphy: always fetch actual link status from MII_QSPHY_PCTL.

MFC after:	1 week
2002-05-01 19:15:54 +00:00
John Baldwin
6af7484d0f Axe unused SESS_UNLOCK_NOSWITCH() and PGRP_UNLOCK_NOSWITCH() macros. The
MTX_NOSWITCH flag was deprecated a while ago.
2002-05-01 18:11:16 +00:00
Alfred Perlstein
59017610b2 Fix some edge cases where bad string handling could occur.
Submitted by: ps
2002-05-01 08:29:41 +00:00
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