Commit Graph

45338 Commits

Author SHA1 Message Date
Hartmut Brandt
8f52a59171 Don't remove the first mbuf in the chain if it got empty.
This removes the packet header in certain cases which later on
will give panic. Clarify what the atm_intr expects in the comment
and de-obscurify the code a little bit by replacing the portability
macros with the BSD names. The code isn't maintained externally anymore
so there's no point in keeping the extra level of obscurity.
2004-02-21 12:55:07 +00:00
Yaroslav Tykhiy
efb4018be7 Improve the SIOCSIFCAP handler a bit:
- allow for ifp->if_ioctl being NULL, as the rest of ifioctl() does;
- give the interface driver a chance to report a error to the caller;
- don't forget to update ifp->if_lastchange upon successful modification
  of interface operation parameters.
2004-02-21 12:48:25 +00:00
Scott Long
41a1325df9 Fix a major brain-o. If the command needs to be put on the deferred queue,
take it off of the busy queue first.  This should fix the 'command is on
another queue' panic that showed up recently.
2004-02-21 05:32:40 +00:00
Olivier Houchard
fdf2a3468a Do not test if pDCB is not NULL, we dereference it before anyway, and it
should not happen. Add a KASSERT instead.

Reported by:	Ted Unangst <tedu@coverity.com>
Spotted out by:	cperciva
2004-02-20 20:36:55 +00:00
Jim Rees
695a135c63 whitespace changes only (prepare for merge from citi tree) 2004-02-20 16:57:36 +00:00
Pawel Jakub Dawidek
3c976c3f95 Backout previous change, it breaks build and it is not needed
layering violation. As pointed out, there is much better way to do this.
Sorry guys, I need to find a better way to force reviews.

Requested by:	harti, julian, scottl (mentor)
Pointy hat to:	pjd
2004-02-20 08:26:27 +00:00
Brian Feldman
fe5f3a72ac Make sure to wake up any select waiters when closing a kqueue (also, not
crash).  I am fairly sure that only people with SMP and multi-threaded
apps using kqueue will be affected by this, so I have a stress-testing
program on my web site:
<URL:http://green.homeunix.org/~green/getaddrinfo-pthreads-stresstest.c>
2004-02-20 04:00:48 +00:00
Mathew Kanner
0a2a8111d2 Fix a glitch in my last commit and revert to using selwakeuppri
Noticed by:	tanimura
Noticed by:	truckman
2004-02-20 01:24:57 +00:00
Wilko Bulte
91bdd189c6 Make uscanner recognise EPSON Perfection 3200. Tested with xsane.
PR: kern/63041
MFC after: 3 days
2004-02-19 22:05:10 +00:00
John Baldwin
712f57d8ab Tidy up the thread taskqueue implementation and close a lost wakeup race.
Instead of creating a mutex that we msleep on but don't actually lock when
doing the corresponding wakeup(), in the kthread, lock the mutex associated
with our taskqueue and msleep while the queue is empty.  Assert that the
queue is locked when the callback function is called to wake the kthread.
2004-02-19 22:03:52 +00:00
Wilko Bulte
c09eddb36d Add EPSON Perfection 3200 scanner. 2004-02-19 22:01:28 +00:00
Wilko Bulte
1e96c62e79 Add EPSON Perfection 3200 scanner 2004-02-19 21:58:23 +00:00
Jacques Vidrine
57f22bd4af Rework jail_attach(2) so that an already jailed process cannot hop
to another jail.

Submitted by:	rwatson
2004-02-19 21:03:20 +00:00
Poul-Henning Kamp
bc55355956 Report the correct length for symlink entries. 2004-02-19 19:09:52 +00:00
John Baldwin
ccab16610b Add back an include to fix the build for the CPU_ELAN case. 2004-02-19 18:34:26 +00:00
Nate Lawson
abcbc5bc60 Use ACPI_NEXT_RESOURCE instead of defining our own copy. The one provided
with ACPI-CA is identical now.
2004-02-19 18:20:03 +00:00
Nate Lawson
bb949efb95 Do not remove the fixed handlers. Several systems (e.g., ASUS) only
return events on the fixed handler even after defining a duplicate in the
AML.  While this violates the spec, hopefully we can get by with leaving
both installed.
2004-02-19 18:16:34 +00:00
Pawel Jakub Dawidek
51e9da0539 Add new failure detection algorithm.
It works as follows:
In every 'interval' seconds defined links are checked.
If they are non-active they will not be used by to data transfer.

No response from:	julian, archie
Silent on:		net@
Approved by:		scottl (mentor)
2004-02-19 17:04:23 +00:00
Pawel Jakub Dawidek
d592e95ba7 Export private structure owned by ng_ether(4) module outside.
It'll is required by new failure detection algorithm for ng_one2many(4).

No response from:	julian, archie
Silent on:		net@
Approved by:		scottl (mentor)
2004-02-19 16:58:01 +00:00
Pawel Jakub Dawidek
e1ae50791e Makefile needed for building geom_concat module.
Approved by:	scottl (mentor)
2004-02-19 15:43:58 +00:00
Pawel Jakub Dawidek
19d16e2fee Introduce CONCAT GEOM class for disk concatenation.
It allows manual and automatic (based on on-disk metadata) concatenation.

Reviewed by:	phk, scottl
Approved by:	scottl (mentor)
2004-02-19 15:19:49 +00:00
Hajimu UMEMOTO
931282ced7 - call ip6_output() instead of nd6_output() when ipsec tunnel
mode is applied, since tunneled packets are considered to be
  generated packets from a tunnel encapsulating node.
- tunnel mode may not be applied if SA mode is ANY and policy
  does not say "tunnel it".  check if we have extra IPv6 header
  on the packet after ipsec6_output_tunnel() and call ip6_output()
  only if additional IPv6 header is added.
- free the copyed packet before returning.

Obtained from:	KAME
2004-02-19 14:57:22 +00:00
Pawel Jakub Dawidek
461167c289 Added sysctl security.jail.jailed.
It returns 1 is process is inside of jail and 0 if it is not.
Information if we are in jail or not is not a secret, there is plenty of
ways to discover it. Many people are using own hack to check this and
this will be a legal way from now on.

It will be great if our starting scripts will take advantage of this sysctl
to allow clean "boot" inside jail.

Approved by:	rwatson, scottl (mentor)
2004-02-19 14:29:14 +00:00
Pawel Jakub Dawidek
f6739b1ddc Simplify check. We are only able to check exclusive lock and if
2nd condition is true, first one is true for sure.

Approved by:	jhb, scottl (mentor)
2004-02-19 14:19:31 +00:00
Pawel Jakub Dawidek
41fe0c8ad5 Fixed ucred structure leak.
Approved by:	scottl (mentor)
PR:		54163
MFC after:	3 days
2004-02-19 14:13:21 +00:00
Yoshihiro Takahashi
f4c2aae420 MFi386: revision 1.466 2004-02-19 13:10:39 +00:00
Bruce M Simpson
a1166f2439 Add BSD compatibility tty ioctls LINUX_TIOCSBRK and LINUX_TIOCCBRK. This
addition appears to allow VMware 3 Workstation to operate with nmdm(4)
as a virtual COM device.

Tested by:	Guido van Rooij
2004-02-19 12:38:12 +00:00
Don Lewis
cf93aa166c When reparenting a process in the PT_DETACH code, only set p_sigparent
to SIGCHLD if the new parent process is initproc.

MFC after:	2 weeks
2004-02-19 10:39:42 +00:00
Tim J. Robbins
bddcdc5193 Use size_t or ssize_t wherever appropriate instead of casting from int *
to size_t *, which is incorrect because they may have different widths.
This caused some subtle forms of corruption, the mostly frequently
reported one being that the last character of a filename was sometimes
duplicated on amd64.
2004-02-19 09:56:58 +00:00
Tim J. Robbins
3722550aa6 Enforce the file size limit in VOP_WRITE() as well as VOP_TRUNCATE();
pointed out by bde.
2004-02-19 09:06:06 +00:00
Alan Cox
0f75a97722 - Correct a long-standing race condition in vm_page_try_to_free() that
could result in a dirty page being unintentionally freed.
 - Simplify the dirty page check in vm_page_dontneed().

Reviewed by:	tegge
MFC after:	7 days
2004-02-19 07:43:55 +00:00
Don Lewis
6567eef757 A Linux thread created using clone() should not send SIGCHLD to its
parent if no signal is specified in the clone() flags argument.

PR:		42457
MFC after:	2 weeks
2004-02-19 06:43:48 +00:00
Nate Lawson
968c0e1bf4 Fix problem caused by previous commit where some users' buttons
stopped returning events.  Don't disable the event when removing
the handler because it still needs to be enabled for the other
handler.  Also, remove duplicate AcpiEnableEvent calls since the
install function now does this for us.
2004-02-19 05:35:20 +00:00
Nate Lawson
32869e71fb Add support for 'h' and 'hh' modifiers for printf(9).
Submitted by:	Bruno Ducrot <ducrot AT poupinou.org>
Reviewed by:	bde
2004-02-19 05:29:39 +00:00
David E. O'Brien
32a31d0d6f Checkpoint the NOTES I was working on. 2004-02-19 04:39:14 +00:00
Mathew Kanner
e0b6c8a1da Fix a long-standing bug where select on vchans doesn't work
(never wake up) by iterating over them when they exist.

Approved by:	tanimura (mentor)
2004-02-19 01:07:15 +00:00
John Baldwin
77fa00fa7c Switch to using the new $PIR interrupt routing code and remove the old
code.  The pci_cfgreg.c file now just controls reading/writing PCI config
registers.
2004-02-18 22:41:53 +00:00
John Baldwin
2e41ba54d6 Rework the $PIR (aka PCIBIOS) PCI interrupt routing code and split it off
into its own file:
- All of the $PIR interrupt routing is now done in a link-centric fashion.
  When a host-PCI bridge that uses the $PIR attaches, it calls pir_parse()
  to parse the table.  This scans for link devices and merges all the masks
  for each link device from the table entries.  It then looks at the intline
  register of PCI devices connected to a link to figure out if the BIOS has
  routed this link and if so to which IRQ.
- The IRQ for any given link can be overridden via a hint like so:
  'hw.pci.link.0x62.irq=10'  Any IRQ set in this matter is treated as if it
  were set that way by the BIOS.
- We only call the BIOS to route each link device once.
- When a PCI device wants to route an interrupt, we look it up in the $PIR
  to find the associated link.  If the link is routed, we simply return the
  IRQ it is using.  If it is not routed, we have to pick one.  This uses a
  different algorithm from the old code.  First off, when we try to pick
  an interrupt from a mask of possible interrupts, we try to pick the one
  that is least loaded as far as PCI devices.  We maintain this weight based
  on the number of devices attached to each link device.  When choosing an
  IRQ, we first attempt to route using any PCI only interrupts (the old
  code did this as well).  If that doesn't work, we try to use the list of
  IRQs that the BIOS has used.  This is a new step that the new code didn't
  do and avoids using IRQ 3 or 4 for every virgin interrupt routing.  If
  none of the IRQs that the BIOS used worked, then we fall back to trying
  anything.
- The fallback mask for !PC98 was fixed to include IRQ 3 and not allow IRQ
  2.
- We don't use the $PIR to route interrupts on a PCI-PCI bridge unless it
  has already been used to route on at least one Host-PCI bridge.  This
  helps to avoid mixing and matching x86 firmware PCI interrupt routing
  methods (which is a Bad Thing(tm)).

Silence on:	current@
2004-02-18 22:40:23 +00:00
Poul-Henning Kamp
0b7ed341e1 Change the disk(9) API in order to make device removal more robust.
Previously the "struct disk" were owned by the device driver and this
gave us problems when the device disappared and the users of that device
were not immediately disappearing.

Now the struct disk is allocate with a new call, disk_alloc() and owned
by geom_disk and just abandonned by the device driver when disk_create()
is called.

Unfortunately, this results in a ton of "s/\./->/" changes to device
drivers.

Since I'm doing the sweep anyway, a couple of other API improvements
have been carried out at the same time:

The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to
DISKFLAG_NEEDSGIANT

A version number have been added to disk_create() so that we can detect,
report and ignore binary drivers with old ABI in the future.

Manual page update to follow shortly.
2004-02-18 21:36:53 +00:00
Tim J. Robbins
ba122e68e0 Add partial support for large (>4GB) files on ext2 filesystems. This
support is partial in that it will refuse to create large files on
filesystems that haven't been upgraded to EXT2_DYN_REV or that don't
have the EXT2_FEATURE_RO_COMPAT_LARGE_FILE flag set in the superblock.

MFC after:	2 weeks
2004-02-18 14:08:25 +00:00
Colin Percival
3a1bdbf8d1 Don't ignore errors from vfs_allocate_syncvnode.
PR:		kern/18503
Submitted by:	Anatoly Vorobey <mellon@pobox.com>
Approved by:	rwatson (mentor)
2004-02-18 05:20:54 +00:00
Bruce Evans
ef4ddd38bf Fixed some style bugs (spaces instead of tabs in macro definitions ...). 2004-02-18 02:56:14 +00:00
Peter Wemm
df7c361e64 Checkpoint a hack to enable running i386 libc_r binaries on a 64 bit
kernel.  I'm not happy with it yet - refinements are to come.
This hack allows the kern.ps_strings and kern.usrstack sysctls to respond
to a 32 bit request, such as those coming from emulated i386 binaries.
2004-02-18 00:54:17 +00:00
Max Laier
36e8826ffb Backout MT_TAG removal (i.e. bring back MT_TAGs) for now, as dummynet is
not working properly with the patch in place.

Approved by: bms(mentor)
2004-02-18 00:04:52 +00:00
Bill Paul
18b59e2d02 Add vector for memmove() (currently aliased to memcpy()) a implement
ExInterlockedAddLargeStatistic().
2004-02-17 21:50:39 +00:00
Søren Schmidt
3b270fcfe8 Dont use the bio_taskqueue if we are in timeout.
Use taskqueue_thread rather than taskqueue_swi (maybe we should have
a taskqueue_ata).
2004-02-17 19:24:11 +00:00
Tom Rhodes
01ba334c9a Do not place dirmask in unnamed padding. Move it to the bottom of this
list where it should have been added originally.

Prodded by:	bde
2004-02-17 16:53:41 +00:00
Hajimu UMEMOTO
da0f40995d IPSEC and FAST_IPSEC have the same internal API now;
so merge these (IPSEC has an extra ipsecstat)

Submitted by:	"Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net>
2004-02-17 14:02:37 +00:00
David Malone
a1cc6206fb Correct a comment.
Reviewed by:	alfred, tanimura
2004-02-17 12:30:32 +00:00
Bruce Evans
82b976c5c3 Backed out previous commit since it just causes panics unless a special
value for MSGBUF_SIZE is configured.  MSGBUF_SIZE =
(32768 * bootverbose ? 2 : 1) is always 1 or 2, so there is not enough space
in the buffer for metadata, and blindly using the nonexistent space tends
to cause fatal pagefaults.  I think
MSGBUF_SIZE = (32768 * (bootverbose ? 2 : 1)) would be always 32768 since
bootverbose is only statically initialized to 0 early when MSGBUF_SIZE is
used.  MSGBUF_SIZE = (32768 * ((boothowto & RB_VERBOSE) ? 2 : 1)) should
work, but this belongs in <sys/msgbuf.h> even less than previous versions.
MSGBUF_SIZE shouldn't be a macro.
2004-02-17 11:11:10 +00:00
Dag-Erling Smørgrav
963385cf22 Mechanical whistespace cleanup. 2004-02-17 10:21:03 +00:00
Tim J. Robbins
8bb386f217 If the "next free cluster" field of the FSInfo block is 0xFFFFFFFF,
it means that the correct value is unknown. Since this value is just
a hint to improve performance, initially assume that the first non-reserved
cluster is free, then correct this assumption if necessary before writing
the FSInfo block back to disk.

PR:		62826
MFC after:	2 weeks
2004-02-17 08:51:49 +00:00
Ruslan Ermilov
9aa2bd22cd Re-add sio.S, and properly deal with assembler files.
Repocopied by:	joe
2004-02-17 07:13:04 +00:00
David E. O'Brien
c3e6ec868f Fix the AMD64 build: this file shouldn't exist. 2004-02-16 23:47:02 +00:00
Lukas Ertl
ce7565b430 Remove some more 'makedev' related macros.
Approved by:     grog (mentor)
2004-02-16 23:14:13 +00:00
Bruce M Simpson
88f6b0435e Shorten the name of the socket option used to enable TCP-MD5 packet
treatment.

Submitted by:	Vincent Jardin
2004-02-16 22:21:16 +00:00
Dag-Erling Smørgrav
497ddd5807 Back out previous commit due to objections. 2004-02-16 21:36:59 +00:00
Dag-Erling Smørgrav
3e704d0bb7 Back out previous commit; it doesn't seem to do what I thought it does. 2004-02-16 21:31:14 +00:00
David E. O'Brien
143a25c2a8 Increase the size of MSGBUF_SIZE if booted with -v. 2004-02-16 20:42:11 +00:00
Dag-Erling Smørgrav
cbea5fb98f Don't panic if we fail to satisfy an M_WAITOK request; return 0 instead.
The calling code will either handle that gracefully or cause a page fault.
2004-02-16 18:41:58 +00:00
Dag-Erling Smørgrav
44f4b94b38 Don't bother storing a result when all you need are the side effects. 2004-02-16 18:38:46 +00:00
Dag-Erling Smørgrav
b14160b848 Avoid code duplication on platforms where int and long are the same size. 2004-02-16 18:37:00 +00:00
Dag-Erling Smørgrav
9e6108885c Random style fixes and a comment update. No functional changes. 2004-02-16 18:19:15 +00:00
Hajimu UMEMOTO
ce9f8a4f5a correct function name in comment.
Submitted by:	"Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net>
2004-02-16 18:07:53 +00:00
Matt Jacob
9b81514d7d We aren't D_TAPE. We aren't anything. The reasons why this was ever set
at all is lost in the mists of time.
2004-02-16 17:43:57 +00:00
Guido van Rooij
517dbe6673 Fix type in a sysctl. It used to be: net.key.prefered_oldsa
and is corrected to net.key.preferred_oldsa
This makes it consistent with the KAME IPsec implementation.

Approved by:	sam
2004-02-16 17:09:53 +00:00
Hajimu UMEMOTO
70dbc6cbfc don't update outgoing ifp, if ipsec tunnel mode encapsulation
was not made.

Obtained from:	KAME
2004-02-16 17:05:06 +00:00
Hajimu UMEMOTO
06a72d12d1 nuke unused functions.
Submitted by:	"Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net>
2004-02-16 17:02:44 +00:00
Hajimu UMEMOTO
c589019989 we don't need to include ipsec.h.
Submitted by:	"Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net>
2004-02-16 16:58:48 +00:00
Bruce M Simpson
91179f796d Spell types consistently throughout this file. Do not use the __packed attribute, as we are often #include'd from userland without <sys/cdefs.h> in front of us, and it is not strictly necessary.
Noticed by:	Sascha Blank
2004-02-16 14:40:56 +00:00
Hidetoshi Shimokawa
19b3bba3e5 - Clean up global data.
- Force dcons to be the high-level console after dcons_crom
	has been attached.
- Add a tunable to be the high-level console.
2004-02-16 07:25:46 +00:00
Alan Cox
5850fa3e42 Correct a long-standing race condition in vm_contig_launder() that could
result in a panic "vm_page_cache: caching a dirty page, ...": Access to the
page must be restricted or removed before calling vm_page_cache().  This
race condition is identical in nature to that which was addressed by
vm_pageout.c's revision 1.251 and vm_page.c's revision 1.275.

MFC after:	7 days
2004-02-16 03:43:57 +00:00
Bill Paul
eaecffb942 More cleanups/fixes for the AMD Am1771 driver:
- When adding new waiting threads to the waitlist for an object,
  use INSERT_LIST_TAIL() instead of INSERT_LIST_HEAD() so that new
  waiters go at the end of the list instead of the beginning. When we
  wake up a synchronization object, only the first waiter is awakened,
  and this needs to be the first thread that actually waited on the object.

- Correct missing semicolon in INSERT_LIST_TAIL() macro.

- Implement lookaside lists correctly. Note that the Am1771 driver
  uses lookaside lists to manage shared memory (i.e. DMAable) buffers
  by specifying its own alloc and free routines. The Microsoft documentation
  says you should avoid doing this, but apparently this did not deter
  the developers at AMD from doing it anyway.

With these changes (which are the result of two straight days of almost
non-stop debugging), I think I finally have the object/thread handling
semantics implemented correctly. The Am1771 driver no longer crashes
unexpectedly during association or bringing the interface up.
2004-02-16 02:50:03 +00:00
Poul-Henning Kamp
f82dfde7e5 White-space align a struct definition.
Move a SYSINIT to the file where it belongs.
2004-02-15 21:43:08 +00:00
David Malone
346180de08 Abstract dirhash's locking using macros. This should make it easier to
use the same dirhash code on different branches/platforms.

Reviewed by:	Ted Unangst <tedu@zeitbombe.org>
Reviewed by:	iedowse
MFC after:	3 weeks
2004-02-15 21:39:35 +00:00
David Malone
e790940191 Return EACCES rather than ENOBUFS if ipfw blocks a packet on the
way out at layer 2.

PR:		62385
Submitted by:	Oleg Bulyzhin <oleg@rinet.ru>
Approved by:	luigi
MFC after:	1 week
2004-02-15 21:27:27 +00:00
David Malone
a82294d01c In fdcheckstd the descriptor table should never be shared, so just
KASSERT this rather than trying to deal with what happens when file
descriptors change out from under us.
2004-02-15 21:14:48 +00:00
Nate Lawson
64746d0689 Workaround some ACPI BIOSen which break the IO port into multiple
resources.  (Note that the correct range is 0x3f7,0x3f0-0x3f5.)  Such
devices will be detected as follows:

  fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> port
  0x3f7,0x3f4-0x3f5,0x3f2-0x3f3,0x3f0-0x3f1 irq 6 drq 2 on acpi0

To do this, we find the minimum and maximum start addresses for the
resources and use them as the base for the IO and control ports.

Help from:	jhb
2004-02-15 20:30:22 +00:00
Bruce Evans
72632ef235 Fixed style bugs near previous commit (mainly formatting errors and
missing parentheses).  Use default handling (trap to debugger) for
udev2dev(x, 1) since it is an error and doesn't happen anywhere in
the sys tree except in bogusly commented out code in coda.
2004-02-15 20:14:47 +00:00
Colin Percival
a20e9655b9 Remove opv_desc_vector from vfs_add_vnodeops, since it is defined
and given a value, but never used.  This has no effect on the
resulting binaries, since gcc optimizes the variable away anyway.

PR:		kern/62684
Approved by:	rwatson (mentor)
2004-02-15 17:27:33 +00:00
Poul-Henning Kamp
2a3faf2fbd Split the initialization of the cdevsw into a separate function. 2004-02-15 10:35:33 +00:00
Poul-Henning Kamp
96cf36028e This is not a D_TTY driver. 2004-02-15 10:08:09 +00:00
Bruce Evans
053791db10 Fixed misspellings of "ext2_*" as "ufs_*" and " "ext2fs_*", and of
"independent" as "dependent" Fixed some other relatively minor wording
and formatting errors.
2004-02-15 08:19:42 +00:00
Bruce Evans
175aef1cdb Removed support for the unsupported option READONLY. It just forced
dishonoring of requests for read-write mounts.
2004-02-15 07:15:58 +00:00
Robert Watson
402d7aa884 Remove excess brackets. 2004-02-15 00:43:22 +00:00
Alan Cox
c6d9ef2e1f Correct a long-standing race condition in vm_fault() that could result in a
panic "vm_page_cache: caching a dirty page, ...": Access to the page must
be restricted or removed before calling vm_page_cache().  This race
condition is identical in nature to that which was addressed by
vm_pageout.c's revision 1.251 and vm_page.c's revision 1.275.

Reviewed by:	tegge
MFC after:	7 days
2004-02-15 00:42:26 +00:00
Simon L. B. Nielsen
862bba7a70 mdoc(7) janitor:
- Fix hard sentence breaks.
- Quote argument to the Nd macro.
- Use Pa for filenames.
2004-02-15 00:42:08 +00:00
Scott Long
444dbd3802 Remove the static major assignment for iir(4).
Submitted by:	phk (partially)
2004-02-14 23:18:58 +00:00
Scott Long
a7c4d6e18c Remove the static major assignment for ips(4).
Submitted by:	phk, inspired by others.
2004-02-14 23:11:03 +00:00
Scott Long
a90d2f4c6f Remove the reservation for the I2O device. The code never materialized, and
if it does in the future, it won't need a static major.
2004-02-14 23:07:24 +00:00
Bruce M Simpson
32ff046639 Final brucification pass. Spell types consistently (u_int). Remove bogus
casts. Remove unnecessary parenthesis.

Submitted by:	bde
2004-02-14 21:49:48 +00:00
Roman Kurakin
126a20d4c2 Adding missing cx (cronyx/Sigma) entry.
Approved by:	imp (mentor)
2004-02-14 21:14:38 +00:00
Roman Kurakin
de80a5d9d6 Fixing copyright and adding vendor cvs id.
Approved by:	imp (mentor)
2004-02-14 21:08:11 +00:00
Bill Paul
134164f8d3 Fix a problem with the way we schedule work on the NDIS worker threads.
The Am1771 driver will sometimes do the following:

- Some thread-> NdisScheduleWorkItem(some work)
- Worker thread -> do some work, KeWaitForSingleObject(some event)
- Some other thread -> NdisScheduleWorkItem(some other work)

When the second call to NdisScheduleWorkItem() occurs, the NDIS worker
thread (in our case ndis taskqueue) is suspended in KeWaitForSingleObject()
and waiting for an event to be signaled. This is different from when
the worker thread is idle and waiting on NdisScheduleWorkItem() to
send it more jobs. However, the ndis_sched() function in kern_ndis.c
always calls kthread_resume() when queueing a new job. Normally this
would be ok, but here this causes KeWaitForSingleObject() to return
prematurely, which is not what we want.

To fix this, the NDIS threads created by kern_ndis.c maintain a state
variable to indicate whether they are running (scanning the job list
and executing jobs) or sleeping (blocked on kthread_suspend() in
ndis_runq()), and ndis_sched() will only call kthread_resume() if
the thread is in the sleeping state.

Note that we can't just check to see if the thread is on the run queue:
in both cases, the thread is sleeping, but it's sleeping for different
reasons.

This stops the Am1771 driver from emitting various "NDIS ERROR" messages
and fixes some cases where it crashes.
2004-02-14 20:57:32 +00:00
Roman Kurakin
07c6a85154 Fixing memory deallocation 2004-02-14 20:56:09 +00:00
Poul-Henning Kamp
8bd95dd3be Use consistent style for cdevsw initialization 2004-02-14 20:04:25 +00:00
Poul-Henning Kamp
d60d18d491 Use standard style for cdevsw initialization. 2004-02-14 20:03:36 +00:00
Poul-Henning Kamp
e618d9ea2d Use standard style for cdevsw initializtion 2004-02-14 20:01:24 +00:00
Poul-Henning Kamp
f8f3930958 Use same style for cdevsw as the rest of our drivers. 2004-02-14 19:58:05 +00:00
Poul-Henning Kamp
d1dc3136b2 This is not a D_TTY driver. 2004-02-14 19:56:35 +00:00
Robert Watson
679a106075 By default, don't allow processes in a jail to list the set of
jails in the system.  Previous behavior (allowed) may be restored
by setting security.jail.list_allowed=1.
2004-02-14 19:19:47 +00:00
Robert Watson
7e440242e5 Fix mismerge in last commit: check that cred->cr_prison is NULL
before dereferencing the prison pointer.
2004-02-14 18:52:43 +00:00
Robert Watson
f08df373a3 By default, when a process in jail calls getfsstat(), only return the
data for the file system on which the jail's root vnode is located.
Previous behavior (show data for all mountpoints) can be restored
by setting security.jail.getfsstatroot_only to 0.  Note: this also
has the effect of hiding other mounts inside a jail, such as /dev,
/tmp, and /proc, but errs on the side of leaking less information.
2004-02-14 18:31:11 +00:00
Poul-Henning Kamp
281591449a Do not check error code from closing ->access() calls, we know they succeed. 2004-02-14 17:59:44 +00:00
Poul-Henning Kamp
bfc37a5112 Add a KASSERT which checks that a class never fails a closing ->access()
call.
2004-02-14 17:58:57 +00:00
Poul-Henning Kamp
f457ed1403 Try again to get rid of makedev(). 2004-02-14 17:56:59 +00:00
Poul-Henning Kamp
d08c5d0b9b Remove the check which used to protect us against make_dev() being
called until DEVFS had a chance to initialize.  Since DEVFS is mandatory
and things over in that department coincidentally works from without
any initialization now, this is safe.
2004-02-14 17:19:43 +00:00
Alan Cox
84d98bf699 - Correct a long-standing race condition in vm_page_try_to_cache() that
could result in a panic "vm_page_cache: caching a dirty page, ...":
   Access to the page must be restricted or removed before calling
   vm_page_cache().  This race condition is identical in nature to that
   which was addressed by vm_pageout.c's revision 1.251.
 - Simplify the code surrounding the fix to this same race condition
   in vm_pageout.c's revision 1.251.  There should be no behavioral
   change.  Reviewed by: tegge

MFC after:	7 days
2004-02-14 08:54:37 +00:00
Marcel Moolenaar
b662bdc270 Test the return value of UART_PARAM(). Invalid line parameters did not
result in an error before.

PR: kern/60284
Submitted by: Thomas Sandford <freebsduser@paradisegreen.co.uk>
2004-02-14 05:54:39 +00:00
Bruce Evans
e9827c6d93 Fixed some style bugs:
- don't unlock the vnode after vinvalbuf() only to have to relock it
  almost immediately.
- don't refer to devices classified by vn_isdisk() as block devices.
2004-02-14 04:41:13 +00:00
Nate Lawson
d3e1c2411e Fix hw.acpi.os_name by renaming it to hw.acpi.osname. The "_name" suffix
is reserved by the loader, and thus any tunable name with that suffix will
be silently discarded.

Document this in the header and man page so that other developers do not
develop so many bumps on the head after banging it against the wall.

Detective work by:	Mark Santcroos, grehan
2004-02-14 03:17:30 +00:00
Brian Feldman
a0ed09c0af T -CURRENT DO NOT CRASH UPON ^T K PLZ THX.
Also, use sched_pctcpu() instead of assuming td->td_kse is non-NULL.
2004-02-14 01:30:06 +00:00
Max Laier
97075d0c0a Do not expose ip_dn_find_rule inline function to userland and unbreak world.
----------------------------------------------------------------------
2004-02-13 22:26:36 +00:00
Bruce Evans
2211aa126a MFffs (ffs_vfsops.c 1.76 (part of the big soft updates commit): lock
the vnode around calls to vinvalbuf()).  Apparently no one has tested
ext2fs with DEBUG_VOP_LOCKS.  Vnode locking for vinvalbuf() might not
be required in non-soft-updates cases, but it is now asserted.

MFffs (uncommitted related and nearby cleanups: don't unlock the vnode
after vinvalbuf() only to have to relock it almost immediately; don't
refer to devices classified by vn_isdisk() as block devices).
2004-02-13 20:23:16 +00:00
Max Laier
189a0ba4e7 Do not check receive interface when pfil(9) hook changed address.
Approved by: bms(mentor)
2004-02-13 19:20:43 +00:00
Max Laier
1094bdca51 This set of changes eliminates the use of MT_TAG "pseudo mbufs", replacing
them mostly with packet tags (one case is handled by using an mbuf flag
since the linkage between "caller" and "callee" is direct and there's no
need to incur the overhead of a packet tag).

This is (mostly) work from: sam

Silence from: -arch
Approved by: bms(mentor), sam, rwatson
2004-02-13 19:14:16 +00:00
Bruce M Simpson
265ed01285 Brucification.
Submitted by:	bde
2004-02-13 18:21:45 +00:00
Bruce Evans
1203f5be25 Fixed a misplaced ifdef that prevented npx.c building without "device isa"
ISA.  npx has few isa dependencies, but it does unconditional outb()'s to
the isa bus in the !SMP case, and it attaches to isa if "device isa" is
configured in order to support PNP-ISA.  The ifdef for the latter was
misplaced.

PR:		62595
2004-02-13 18:04:51 +00:00
Bruce Evans
e7a4845084 Fixed longstanding brokenness of inode updates. The waitfor flag was
dishonored in rev.1.1 by commenting out the code that honored it.  This
gave the worst disadvantages of async mounts in an uncontrollable way.

Honoring the flag costs about 50% in real time in worst cases on a new
but not very fast ATA drive with write caching (probably more on drives
without write caching).  The old misbehavior can be recovered using
async mounts after implementing them in mount_ext2fs(8) (just put the
MNT_ASYNC flag in mount_ext2fs's table of supported options like it
is in mount's table).
2004-02-13 17:49:03 +00:00
Yoshihiro Takahashi
1a413640ac MFi386: Get rid of unnecessary use of m4(1) by using cpp(1) instead.
Repocopied by:	joe
2004-02-13 15:39:59 +00:00
Yoshihiro Takahashi
32efe8e4b4 MFi386: revisions 1.74 and 1.75.
- kzip(8) is long dead.
  - Clean CLEANFILES.
2004-02-13 15:26:22 +00:00
Yoshihiro Takahashi
4dcf467f93 MFi386: revision 1.20 (don't strip kgzldr.o) 2004-02-13 15:24:25 +00:00
Hajimu UMEMOTO
c46e7f1d52 - wrap mappedaddr block by #ifdef INET for IPv6-only kernel in future.
- rejects IPv6 packet toward IPv4-mapped address if its source address
  is not an IPv4-mapped IPv6 address, since the converted IPv4 packets
  would have an unexpected IPv4 source address.
- when V6ONLY socket option is set, discard packets destined to a
  v4/ipv4 mapped ipv6 address.
- have PULLDOWN_TEST codepath.
- get rid of in6_mcmatch().

Obtained from:	KAME
2004-02-13 15:11:47 +00:00
Hajimu UMEMOTO
efddf5c64d supported IPV6_RECVPATHMTU socket option.
Obtained from:	KAME
2004-02-13 14:50:01 +00:00
Ruslan Ermilov
41460aa51a Merged from kmod.mk,v 1.152: strip debugging symbols even when not
configured for debugging.  This saves some bytes, and produces the
same "kernel" object as if it was configured for debugging.
2004-02-13 13:21:41 +00:00
Ruslan Ermilov
1a17c23db2 Don't override the standard SYSTEM_LD setting from kern.pre.mk.
Instead, use the linker script to record the correct entry point.
2004-02-13 12:28:53 +00:00
Poul-Henning Kamp
18e47b55a9 Back out my last commit to syscons, things seem to be far more evil
than suspected.

and obviously nobody runs the patches I post to -current :-(

Poul-Henning
2004-02-13 12:04:15 +00:00
Ruslan Ermilov
817b59bff6 Reduce the number of knobs controlling the build of debug modules
to one, DEBUG_FLAGS, which is also compatible with <bsd.prog.mk>.
Previously one had to set both DEBUG and DEBUG_FLAGS to build the
.ko.debug with debugging symbols which was boring when doing this
manually.
2004-02-13 10:40:54 +00:00
Ruslan Ermilov
9673a2c2d0 Removed -g from CFLAGS. There is a better way to build debugging
versions of the modules, and unconditionally putting -g in CFLAGS
has negative impact on the size of the resulting .ko object, even
now that debugging symbols are always stripped.
2004-02-13 10:11:01 +00:00
Ruslan Ermilov
4c293d355f We didn't strip debugging symbols from .ko if DEBUG was undefined. 2004-02-13 09:39:45 +00:00
Marcel Moolenaar
317872f26c Don't create a mapfile during link. It's not needed for the build. 2004-02-13 04:45:41 +00:00
Marcel Moolenaar
a02efe9a7c o Don't build with -fpic. It's not needed and inconsistent with how
other constributions are compiled.
o  Remove powerpc specific additions to CFLAGS.
2004-02-13 04:43:41 +00:00
Bruce Evans
0efb13948d MFextfs: backed out secondary changes in rev.1.40 that had become just
style bugs (a variable that is used only once, and misformattings).
2004-02-13 03:05:12 +00:00
Jun Kuriyama
df1941fb59 Fix style bugs in previous commit.
Submitted by:	bde
2004-02-13 02:02:06 +00:00
Poul-Henning Kamp
d2bae332d6 Remove the absolute count g_access_abs() function since experience has
shown that it is not useful.

Rename the relative count g_access_rel() function to g_access(), only
the name has changed.

Change all g_access_rel() calls in our CVS tree to call g_access() instead.

Add an #ifndef BURN_BRIDGES #define of g_access_rel() for source
code compatibility.
2004-02-12 22:42:11 +00:00
Ruslan Ermilov
63dfee8866 Fixed the fatal bug introduced in previous commit: don't strip
kgzldr.o -- kgzipping with such a loader produces bad images.
2004-02-12 22:06:33 +00:00
Ruslan Ermilov
c6cad6c575 Clean CLEANFILES. 2004-02-12 21:43:50 +00:00
Poul-Henning Kamp
f484fc6593 Don't use makedev() to hack up dev_t's early in boot, do it right
with make_dev() (and avoid doing it again later).
2004-02-12 21:32:59 +00:00
Alan Cox
40448065e8 Further reduce the use of Giant in vm_map_delete(): Perform pmap_remove()
on system maps, besides the kmem_map, without Giant.

In collaboration with:	tegge
2004-02-12 20:56:06 +00:00
John Baldwin
3094dfd106 Use the PCIR_BAR() macro rather than a magic number to specify the BAR
for controller memory.
2004-02-12 20:47:03 +00:00
Poul-Henning Kamp
74cf585544 Correct the cleanup of the alias dev_t for /dev/urandom: being an
alias it depends on the aliased dev_t and disappears automatically
when that is removed.

Submitted by:	"Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net>
2004-02-12 20:46:49 +00:00
John Baldwin
e4a87c455e Fix a whitespace nit. 2004-02-12 20:45:01 +00:00
Poul-Henning Kamp
f865123ec4 Give both consumers and providers a {void *private, u_int index} which
the implementing class can use to hang internal info from.
2004-02-12 20:32:11 +00:00
Bruce M Simpson
b30190b542 Update the prototype for tcpsignature_apply() to reflect the spelling of
the types used by m_apply()'s callback function, f, as documented in mbuf(9).

Noticed by:	njl
2004-02-12 20:16:09 +00:00
Bruce M Simpson
bca0e5bfc3 style(9) pass; whitespace and comments.
Submitted by:	njl
2004-02-12 20:12:48 +00:00
Bruce M Simpson
a0194ef1ea Remove an unnecessary initialization that crept in from the code which
verifies TCP-MD5 digests.

Noticed by:	njl
2004-02-12 20:08:28 +00:00
Bruce Evans
67406320ff MFffs (ffs_vfsops.c 1.227: clean up open mode bandaid). This reduces
gratuitous differences with ffs a little.
2004-02-12 17:54:58 +00:00
Bruce Evans
8adff5fc12 Fixed some minor style bugs (English usage and formatting of binary
operators) in and near revs.1.169-1.170 (open mode bandaid).  This
(or better a proper fix) should have been done before cloning the
bandaid to many other file systems.
2004-02-12 16:52:24 +00:00
Peter Grehan
321fd46031 Work-in-progress for the 'Kauai' ATA device in Mac notebooks. The
device seems to be the macio ATA cell with a PCI front-end, and
has no relation to PIIX-style ATA/PCI devices.
2004-02-12 09:17:16 +00:00
Peter Grehan
a3063d483e Add sys file required for IEEE fp functions.
Submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
2004-02-12 09:12:11 +00:00
Jun Kuriyama
5580f04ab0 Reverse lock order by using local variable. This will shut up "acquiring
duplicate lock of same type" message.

Reviewed by:	mckusick
2004-02-12 08:52:08 +00:00
Ruslan Ermilov
5c8f32a869 Tidy up makefiles.
Tested by:	marcel
2004-02-12 08:10:34 +00:00
Peter Grehan
9a580b5e18 Remove register keyword and constify tmp values. This fixes
PPC compile warning - PPC is the only consumer of this code
path.
2004-02-12 03:23:13 +00:00
Brian Feldman
f662a93197 Always socantsendmore() before deallocating a socket. This, in turn,
calls selwakeup() if necessary (which it is, if you don't want freed
memory hanging around on your td->td_selq).

Props to:	alfred
2004-02-12 01:48:40 +00:00
Bill Paul
c7a61a03e8 Correct instance of *timeout that should have been timeout.
Noticed by: mlaier
2004-02-11 23:11:12 +00:00
Ruslan Ermilov
ea81a634b5 kzip(8) is long dead. 2004-02-11 22:25:25 +00:00
Don Lewis
55b5f2a202 When reparenting a process to init, make sure that p_sigparent is
set to SIGCHLD.  This avoids the creation of orphaned Linux-threaded
zombies that init is unable to reap.  This can occur when the parent
process sets its SIGCHLD to SIG_IGN.  Fix a similar situation in the
PT_DETACH code.

Tested by:	"Steven Hartland" <killing AT multiplay.co.uk>
2004-02-11 22:06:02 +00:00
Ruslan Ermilov
40d387429f Overhaul makefiles. 2004-02-11 22:01:17 +00:00
Bill Paul
31d5c7fd4d Add yet more bulletproofing. This is to guard against the case that
ndis_init_nic() works one during attach, but fails later. Many things
will blow up if ndis_init_nic() fails and we aren't careful.
2004-02-11 21:53:40 +00:00
Ruslan Ermilov
23350aaf89 _start.S -> _start.s as the latter is pure asm file.
Repocopied by:	joe
2004-02-11 21:17:04 +00:00
Pawel Jakub Dawidek
72e330954e Added g_print_bio() function to print informations about given bio.
Approved by:	phk, scottl (mentor)
2004-02-11 18:21:32 +00:00
John Baldwin
e7a44cace2 Argh! Fix a bogon. lim_cur() was returning the hard (max) limit rather
than the soft (cur) limit.

Submitted by:	bde
2004-02-11 18:04:13 +00:00
Bruce Evans
1723bc36ef Removed more vestiges of vfs_ioopt:
- rev.1.42 of ffs_readwrite.c added a special case in ffs_read() for reads
  that are initially at EOF, and rev.1.62 of ufs_readwrite.c fixed
  timestamp bugs in it.  Removal of most of vfs_ioopt made it just and
  optimization, and removal of the vm object reference calls made it less
  than an optimization.  It was cloned in rev.1.94 of ufs_readwrite.c as
  part of cloning ffs_extwrite() although it was always less than an
  optimization in ffs_extwrite().
- some comments, compound statements and vertical whitespace were vestiges
  of dead code.
2004-02-11 15:27:26 +00:00
Tim J. Robbins
3a7f5cac4a Use automatic major number allocation for the nfs4 device instead of
stealing #29, which is already reserved for mcd.
2004-02-11 13:31:30 +00:00
Peter Grehan
49f397d0c3 Interrupt statistics, vmstat -i now works.
Submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
Slightly modified by: grehan
Derived from:  i386
2004-02-11 13:18:31 +00:00
Tim J. Robbins
28c013fd72 Un-reserve major 144 (nsmb) now that we are using automatic allocation. 2004-02-11 12:58:06 +00:00
Tim J. Robbins
fd13f79252 Use automatic major number allocation for nsmb devices. 2004-02-11 12:49:49 +00:00
Peter Grehan
9c24bed2d9 Clean up header files, which fixes compile warning. 2004-02-11 10:49:30 +00:00
Peter Grehan
69a9f22118 - constify devinfo strings to eliminate compile warning
- remove trailing whitespace
2004-02-11 10:15:15 +00:00
Thomas Quinot
a0e1020523 (atapi_cb): Reenable automatic retrieve of sense data on error, making
it asynchronous to avoid incorrect use of ata_atapicmd within an
 ATAPI callback.

Tested by:	harti
2004-02-11 10:14:08 +00:00
Bruce M Simpson
45d370ee8b Fix a typo; left out preprocessor conditional for sigoff variable, which
is only used by TCP_SIGNATURE code.

Noticed by:	Roop Nanuwa
2004-02-11 09:46:54 +00:00
Ruslan Ermilov
846a4356ea Get rid of unnecessary use of m4(1) by using cpp(1) instead.
(John tells me there were problems when trying this before,
but it appears to be safe these day.)

OK'ed by:	jhb
Repocopied by:	joe
2004-02-11 08:42:38 +00:00
Peter Grehan
3102ccf30c - fix compile warnings
- removed obsolete NetBSD-derived ADB conditionals
2004-02-11 08:07:19 +00:00
Peter Grehan
1820f9fe29 - fixed trailing whitespace and indentation
- removed unused variable to fix compile warning
2004-02-11 07:58:43 +00:00
Peter Grehan
735e89e8a5 Fix compile warning 2004-02-11 07:48:19 +00:00
Peter Grehan
475a183dd1 - remove trailing whitespace
- fix compile warnings. badaddr() will go to a header file soon.
2004-02-11 07:44:56 +00:00
Peter Grehan
7c2779715c Cleaned up param.h:
- culled long-dead #define's
 - segment register defs moved to sr.h
 - NPMAPS moved to pmap.h
 - KERNBASE moved to vmparam.h
 - removed include of <machine/cpu.h> and fixed src files that
   relied on this.

Modifying segment register code no longer causes gcc rebuilds :-)
2004-02-11 07:27:34 +00:00
Peter Grehan
d1850887de Invalide pcb's fpu cpu # by setting it to INT_MAX, not NULL. 2004-02-11 07:19:15 +00:00
Peter Grehan
7d23b5b7db Add sysctl hw.uma_mdpages to track how many pages have been allocated
by UMA_MD_SMALL_ALLOC
2004-02-11 04:42:48 +00:00
Bruce M Simpson
1cfd4b5326 Initial import of RFC 2385 (TCP-MD5) digest support.
This is the first of two commits; bringing in the kernel support first.
This can be enabled by compiling a kernel with options TCP_SIGNATURE
and FAST_IPSEC.

For the uninitiated, this is a TCP option which provides for a means of
authenticating TCP sessions which came into being before IPSEC. It is
still relevant today, however, as it is used by many commercial router
vendors, particularly with BGP, and as such has become a requirement for
interconnect at many major Internet points of presence.

Several parts of the TCP and IP headers, including the segment payload,
are digested with MD5, including a shared secret. The PF_KEY interface
is used to manage the secrets using security associations in the SADB.

There is a limitation here in that as there is no way to map a TCP flow
per-port back to an SPI without polluting tcpcb or using the SPD; the
code to do the latter is unstable at this time. Therefore this code only
supports per-host keying granularity.

Whilst FAST_IPSEC is mutually exclusive with KAME IPSEC (and thus IPv6),
TCP_SIGNATURE applies only to IPv4. For the vast majority of prospective
users of this feature, this will not pose any problem.

This implementation is output-only; that is, the option is honoured when
responding to a host initiating a TCP session, but no effort is made
[yet] to authenticate inbound traffic. This is, however, sufficient to
interwork with Cisco equipment.

Tested with a Cisco 2501 running IOS 12.0(27), and Quagga 0.96.4 with
local patches. Patches for tcpdump to validate TCP-MD5 sessions are also
available from me upon request.

Sponsored by:	sentex.net
2004-02-11 04:26:04 +00:00
Nate Lawson
33febf93d6 Prefer buttons defined in the AML over the ones in the FADT. Some
systems define power/sleep buttons in both places but only deliver
notifies to the ones defined in the AML.

Also, reduce length of various function handler names.

PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:
2004-02-11 02:57:33 +00:00
Peter Grehan
439696f355 Correctly create interrupt key for PCI, which is the OpenFirmware
pci-hi/med/lo + node 'interrupts' property. This worked by
accident until recent notebooks required correct operation.

Tested by:  Suleiman Souhlal <refugee@segfaulted.com>
2004-02-10 23:57:35 +00:00
Bill Paul
eae7237c29 Add some bulletproofing: don't allow the ndis_get_info() or ndis_set_info()
routines to do anything except return error if the miniport adapter context
is not set (meaning we either having init'ed the driver yet, or the
initialization failed).

Also, be sure to NULL out the adapter context along with the
miniport characteristics pointers if calling the MiniportInitialize()
method fails.
2004-02-10 23:01:53 +00:00
Ruslan Ermilov
f61e198401 Since loader(8) on SPARC64 is a pure ELF executable (as opposed
to other architectures), there is no reason not to strip(1) it.

Tested by:	kensmith
2004-02-10 22:11:36 +00:00
Prafulla Deuskar
b81490427d Only reset the phy when it is absolutely required.
This should fix the issues with long *init* times when
you do ifconfig em0 alias.

MFC after:	3 days
2004-02-10 21:31:09 +00:00
Jacques Vidrine
a9c2bfa8e9 Fix a panic in pseudofs(9) that could occur when doing an I/O
operation with a large request or large offset.

Reported by:	Joel Ray Holveck <joelh@piquan.org>
Submitted by:	des
2004-02-10 21:06:47 +00:00
Alan Cox
a3dfacb51c Correct a long-standing race condition in the inactive queue scan. (See
the added comment for low-level details.)  The effect of this race
condition is a panic "vm_page_cache: caching a dirty page, ..."

Reviewed by:	tegge
MFC after:	7 days
2004-02-10 18:34:27 +00:00
Pawel Jakub Dawidek
18e88d825c Now we have g_topology_assert_not(), so use it to detect deadlocks.
Approved by:	phk, scottl (mentor)
2004-02-10 15:55:17 +00:00
Pawel Jakub Dawidek
692498b0cd Added macro which will be used to assert, that the topology lock is not held.
Approved by:	phk, scottl (mentor)
2004-02-10 15:53:28 +00:00
Poul-Henning Kamp
e9338d5991 Change the kernels definition of NODEV from ((dev_t)-1) to NULL. 2004-02-10 15:23:47 +00:00
Poul-Henning Kamp
99cf2f941c don't call sbuf_clear() right after sbuf_new(), it is not necessary. 2004-02-10 10:54:19 +00:00
Tim J. Robbins
b4484bf031 Fixes problems that occurred when a file was removed and a directory
created with the same name, and vice versa:
- Immediately recycle vnodes of files & directories that have been deleted
or renamed.
- When looking an entry in the VFS name cache or smbfs's private
cache, make sure the vnode type is consistent with the type of file
the server thinks it is, and re-create the vnode if it isn't.

The alternative to this is to recycle vnodes unconditionally when their
use count drops to 0, but this would make all the caching we do
mostly useless.

PR:		62342
MFC after:	2 weeks
2004-02-10 05:53:02 +00:00
Peter Grehan
716563e20c Loader makefile cleanup.
Submitted by:  ru
2004-02-09 21:54:54 +00:00
Dag-Erling Smørgrav
38efe50cbd Remove VFS_STATFS() call which violated the lock order and wasn't
really required anyway.

PR:		kern/61994
Submitted by:	Bjoern Groenvall <bg@sics.se>
2004-02-09 20:33:42 +00:00
Bill Paul
59137ea864 Add stub implementations of KfLowerIrql() and KfRaiseIrql() (both of
which are _fastcall).
2004-02-09 19:13:58 +00:00
Hajimu UMEMOTO
0f36f0e84a fix build with FAST_IPSEC.
Reported by:	cjc
2004-02-09 16:02:16 +00:00
Yoshihiro Takahashi
5e0eb6243d MFi386: Factor out -nostdlib and use PROG. 2004-02-09 16:01:45 +00:00
Ruslan Ermilov
78d6d797e9 MFi386.
- Factor out common settings and put them in an upper level Makefile.inc.
- Properly use PROG for real programs, not their products.
- Further reduce diffs to i386 versions.

Tested on:	sparc64 (panther)
2004-02-09 14:17:02 +00:00
Ruslan Ermilov
bcd106e18b - Factor out -nostdlib to an upper level Makefile.inc.
- Now that bsd.prog.mk deals with programs linked with -nostdlib
  better, and has a notion of an "internal" program, use PROG
  where possible.  This has a good impact on the contents of
  .depend files and causes programs to be linked with cc(1).

XXX: boot2 couldn't be converted as it's actually two programs.

Tested on:	i386, amd64
2004-02-09 14:11:58 +00:00
Peter Grehan
a4d2c25de5 Disable branch-target instruction cache on MPC7457 as outlined
in Motorola processor errata.

Submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
2004-02-09 07:04:01 +00:00
Scott Long
f893fdd54e Fall back to INTR_MPSAFE if INTR_FAST registration fails.
PR:	kern/62276
2004-02-09 05:29:05 +00:00
Peter Grehan
ef7efb4ab0 Recognize MPC7547 (aka G4+) 2004-02-09 02:25:24 +00:00
Peter Grehan
e6d3e1c2c6 Definitions for MPC7457 CPU type and HID0 bits 2004-02-09 00:12:50 +00:00
Bill Paul
ff853f37b7 Make NdisMMapIoSpace() guard against NULL/uninitialized resource pointers too. 2004-02-08 20:39:35 +00:00
Bill Paul
4dfa77161a Make NdisMMapIoSpace() handle the case where a device has both mem
and altmem ranges mapped.
2004-02-08 20:32:41 +00:00
Matt Jacob
67ff51f150 Remove condition variables and status associated with target mode
enabling. Instead, go to an interrupt/polled model.

Fix get_lun_statep so we don't panic if there are no wildcard luns enabled.

MFC after:	6 days
2004-02-08 19:17:56 +00:00
Matt Jacob
c98d7aa472 Remove condition variables and status associated with target mode
enabling. Instead, go to an interrupt/polled model.

MFC after:	6 days
2004-02-08 19:16:01 +00:00
Hajimu UMEMOTO
8b00e59d89 - obey ip6po_minmtu.
- notify a proper path MTU to applications.

Obtained from:	KAME
2004-02-08 18:22:27 +00:00
Scott Long
777a986004 Allow amr(4) to get a dynamic major number instead of a static one.
Submitted by:	Andre Guibert de Bruet
2004-02-08 16:07:22 +00:00
Lukas Ertl
60b42b1c00 Don't free ressources that haven't been allocated. This should fix
the "disappearing subdisks" problem when new subdisks can't be created
due to some errors.

This is in fact an ugly hack, but a more elegant solution would probably
require a redesign of vinum in several places.

Approved by: joerg (mentor)
2004-02-08 15:27:58 +00:00
Poul-Henning Kamp
df3df337b8 Polish the work/state engine in preparation for HW-crypto support. 2004-02-08 10:19:18 +00:00
Poul-Henning Kamp
d091e630f1 Add a missing error case return.
Problem reported by:	Flemming Jacobsen <fj@batmule.dk>
2004-02-08 09:39:02 +00:00
Mike Silbersack
b49d824e8b Add the SF_NODISKIO flag to sendfile. This flag causes sendfile to be
mindful of blocking on disk I/O and instead return EBUSY when such
blocking would occur.

Results from the DeBox project indicate that blocking on disk I/O
can slow the performance of a kqueue/poll based webserver.  Using
a flag such as SF_NODISKIO and throwing connections that would block
to helper processes/threads helped increase performance.

Currently, only the Flash webserver uses this flag, although it could
probably be applied to thttpd with relative ease.

Idea by:	Yaoping Ruan & Vivek Pai
2004-02-08 07:35:48 +00:00
Mike Silbersack
08fc808d7f Move m_uiotombuf from uio.h to mbuf.h, where I should have put it in
the first place.

Suggested by:	bde
2004-02-08 03:19:08 +00:00
Peter Wemm
ca88a766c2 I forgot to add the NO_MODULES override for NOTES 2004-02-08 00:39:38 +00:00
Bill Paul
9d6c81e670 Don't hold NDIS_LOCK() around call to ndis_getstate_80211() since it
may block on ndis_get_info().
2004-02-07 23:52:58 +00:00
Bill Paul
e21ffdf2ef Argh. kthread_suspend() when in P_KTHREAD context, tsleep() when not,
not the other way around.
2004-02-07 23:47:10 +00:00
Ruslan Ermilov
8e310f4646 Argh, unbreak "make depend" for AMD64.
Reported by:	kris
2004-02-07 23:30:45 +00:00
Poul-Henning Kamp
3aa5a3ad90 We don't need to hold Giant to create the worker kthread. 2004-02-07 23:01:17 +00:00
Bill Paul
5a57707840 Correct an intance of mtx_pool_lock() that should have been mtx_pool_unlock(). 2004-02-07 22:19:20 +00:00
Scott Long
8b60cc16ab Remove the use of AACQ_COMPLETE here since there is no longer a completion
queue.
2004-02-07 20:54:29 +00:00
Poul-Henning Kamp
36095f4a2b I guess nobody has needed to use the SVR4olator to create device
nodes, or if they did, they're now locked away on the Kurt Gdel
memorial home for the numerically confused:

Don't cast a kernel pointer (from makedev(9)) to an integer (maj+minor combo).
2004-02-07 18:54:34 +00:00
Scott Long
ecd1c51f92 Do some small cleanups to comments and remove AACQ_COMPLETE definitions since
the completion queue is long-gone.
2004-02-07 17:40:38 +00:00
Ruslan Ermilov
6ed6b4ab71 MFi386: Removed -elf and duplicate -ffreestanding. 2004-02-07 14:35:33 +00:00
Ruslan Ermilov
e215fffac2 - Removed -elf which is not a valid gcc(1) option anymore.
- Removed -ffreestanding; it's enforced by ../Makefile.inc.
2004-02-07 14:32:06 +00:00
Ruslan Ermilov
600f8a8d39 Generate .depend file. 2004-02-07 13:38:47 +00:00
Yoshihiro Takahashi
cc78dccee9 MFi386: Cleanups to sys/boot makefiles. 2004-02-07 12:19:44 +00:00
Ruslan Ermilov
079cbb98ac Style: use the defined() expression explicitly. 2004-02-07 11:05:10 +00:00
Scott Long
d85f27ce7f Remove the hack of lowering AAC_MAX_FIB now that the root cause of the
problem was found.
2004-02-07 10:30:59 +00:00
Scott Long
4102d44b77 If a command has to be deferred because there are no more resources for it
on the card, unmap it first.  This allows it to be picked up properly when
the queue gets kicked again.  This was the root problem for the lost command
(i.e. stuck in getblk/vinvalb) problem.  While here, panic if commands don't
map correctly instead of just silently ignoring the problem and dropping
command.  Also slow down the dynamic allocation of new commands.

It should be safe to go back into the aac waters.  Thanks to everyone who
suffered through this and provided good feedback.
2004-02-07 10:30:22 +00:00
Alan Cox
c5aebf380c swp_pager_async_iodone() no longer requires Giant. Modify bufdone()
and swapgeom_done() to perform swp_pager_async_iodone() without Giant.

Reviewed by:	tegge
2004-02-07 08:54:50 +00:00
Ruslan Ermilov
7e39a38ec9 Untangle building of AMD64 boot code.
Tested on:	amd64 (sledge)
2004-02-07 08:10:07 +00:00
Bill Paul
9ec5585585 Add a whole bunch of new stuff to make the driver for the AMD Am1771/Am1772
802.11b chipset work. This chip is present on the SMC2602W version 3
NIC, which is what was used for testing. This driver creates kernel
threads (12 of them!) for various purposes, and required the following
routines:

PsCreateSystemThread()
PsTerminateSystemThread()
KeInitializeEvent()
KeSetEvent()
KeResetEvent()
KeInitializeMutex()
KeReleaseMutex()
KeWaitForSingleObject()
KeWaitForMultipleObjects()
IoGetDeviceProperty()

and several more. Also, this driver abuses the fact that NDIS events
and timers are actually Windows events and timers, and uses NDIS events
with KeWaitForSingleObject(). The NDIS event routines have been rewritten
to interface with the ntoskrnl module. Many routines with incorrect
prototypes have been cleaned up.

Also, this driver puts jobs on the NDIS taskqueue (via NdisScheduleWorkItem())
which block on events, and this interferes with the operation of
NdisMAllocateSharedMemoryAsync(), which was also being put on the
NDIS taskqueue. To avoid the deadlock, NdisMAllocateSharedMemoryAsync()
is now performed in the NDIS SWI thread instead.

There's still room for some cleanups here, and I really should implement
KeInitializeTimer() and friends.
2004-02-07 06:44:13 +00:00
Matt Jacob
746e9c8540 Checkpoint of work in progress in cleaning up target mode. It actually
seems to work well in RELENG_4. However, 5.X locking foo means that I'll
have to do some quick redesign.

Add ioctl handlers for ISP_GETROLE and ISP_SETROLE ioctls.
2004-02-07 03:47:33 +00:00
Matt Jacob
2cd44270e5 add a count for inotifies as well as atios.
MFC after:	1 week
2004-02-07 03:44:43 +00:00
Matt Jacob
4e8a2b48a7 Reverse role defines for initiator and target mode to better match the
class 3 service parameters we'd get.

Steal 8 bits out of the portid u_int32_t for role information (port ids
are 24 bits anyway).

MFC after:	1 week
2004-02-07 03:43:27 +00:00
Matt Jacob
cc330eadff Add case to handle ISPCTL_GET_PDB.
MFC after:	1 week
2004-02-07 03:42:17 +00:00
Matt Jacob
87ab7d39a4 If we're defined to have a default role for target mode, make it
just ISP_ROLE_TARGET- not both.

MFC after:	1 week
2004-02-07 03:39:42 +00:00
Matt Jacob
e0d3cfb7be Change role defines so that they better match class 3 service parameters.
Add ISPCTL_GET_PDB isp_control operation.

MFC after:	1 week
2004-02-07 03:38:39 +00:00
Scott Long
8f6a5435e7 Reduce AAC_MAX_FIBS to work around some yet-unidentified bugs in the
handling of resources shortages.  The driver is now so fast that it can
completely fill all 512 slots on the card, but for some reason only 511
slots are being allocated.  Anything that tries to go into the 512th
slot gets silently lost.   Both bugs need to be fixed at a later date,
but this should fix the reports of hangs in getblk and vinvalb.
2004-02-07 03:30:32 +00:00
Scott Long
a32a982d4a - Broaden the scope of locking in aac_command_thread() again to catch some
edge cases in the loop.

- Try to grab a command before dequeueing the bio from the bioq.  The old
  behaviour of requeuing deferred bios to the end of the bioq is arguably
  wrong.  This should be fixed in the future to check the bioq head without
  automatically dequeueing the bio.
2004-02-07 03:26:38 +00:00
Scott Long
9768efef88 Add an #ifdef _KERNEL so that this file can be used from userland. 2004-02-07 03:20:07 +00:00
Pawel Jakub Dawidek
12047230cd Allow decreasing access count even if there is no disk anymore.
This will allow closing disks that were removed while opened.

Approved by:	phk, scottl (mentor)
2004-02-06 23:10:49 +00:00
Lukas Ertl
5b2f81ec4b Fix memory leak.
PR:            kern/58634
Submitted by:  le
Approved by:   phk
2004-02-06 22:51:04 +00:00
Ruslan Ermilov
a4a62f5d1f First round of cleanups to sys/boot/ makefiles:
- do not use PROG for what's not a real C program,
- use sys.mk transformation rules where possible,
- only create the "machine" symlink on AMD64,
- removed MAINTAINER lines in individual makefiles,
- added the LIBSTAND defitinion to <bsd.libnames.mk>,
- somewhat better contents in .depend files.

Tested on:	i386, amd64
Prodded by:	bde
2004-02-06 21:58:32 +00:00
Peter Wemm
4e37bb8f5d Reduce the inline limit from 20000 to 8000 after the previous changes
to simplify the curthread expansion some months ago.
2004-02-06 20:40:04 +00:00
Peter Wemm
5162123068 Remove the badsw* INVARIANTS checks. The events that this attempts
to catch are already nicely caught by trapping the null pointer derefs.
Remove no-longer-used noswitch/nothrow strings.  They were referenced
by the stub cpu_switch() etc functions before they were implemented.
Try something a little different for the lock prefixes.

Prompted by:  bde (the first two items anyway)
2004-02-06 20:38:39 +00:00
John Baldwin
28596eb0ea Regen. 2004-02-06 20:21:18 +00:00
John Baldwin
44c99fac14 Sync up MP safe flags with global syscalls.master. This includes write(),
close(), getpid(), ibcs2_setuid(), getuid(), ptrace(), ibcs2_pause(),
ibcs2_nice(), ibcs2_kill(), ibcs2_pgrpsys(), dup(), pipe(), ibcs2_setgid(),
getgid(), umask(), and sigreturn().
2004-02-06 20:20:07 +00:00
John Baldwin
23816cc365 Sync up MP safe flags with global syscalls.master. This includes read(),
write(), close(), getpid(), setuid(), getuid(), svr4_sys_pause(),
svr4_sys_nice(), svr4_sys_kill(), svr4_sys_pgrpsys(), dup(), pipe(),
setgid(), getgid(), svr4_sys_signal(), umask(), getgroups(), setgroups(),
svr4_sys_sigprocmask(), svr4_sys_sigsuspend(), svr4_sys_sigaltstack(),
svr4_sys_sigaction(), svr4_sys_sigpending(), mprotect(), munmap(),
setegid(), seteuid(), setreuid(), setregid().
2004-02-06 20:07:33 +00:00