Commit Graph

87982 Commits

Author SHA1 Message Date
Max Khon
be6a158e0f - MAXPATHLEN -> PATH_MAX (pass correct buffer size to readlink as well)
Requested by:		bde
2003-03-28 12:05:45 +00:00
Maxim Sobolev
5edf954aad Add pc-card from ARCHOS CD-224E cdrom.
MFC after:	1 week
2003-03-28 11:12:52 +00:00
Max Khon
01114bfc94 bump __FreeBSD_version for thread-safe realpath(3) 2003-03-28 09:50:26 +00:00
Poul-Henning Kamp
10c665ef8f Fix an XXX: and implement LINUX_BLKGETSIZE correctly. 2003-03-28 08:58:11 +00:00
Warner Losh
d1636fcf4e Expound a little bit about the softc, where its size is found and a
caution against emulating legacy softc methods used in the tree.
2003-03-28 07:28:31 +00:00
Warner Losh
78515472cb Remove bogus card.4, and replace it with a link to oldcard.4. ru
pointed this out a while ago, and I'm just now getting back to it.  It
obsoletes one of ru's changes, but since oldcard.4 is so much better,
that doesn't matter.

Submitted by: ru
2003-03-28 07:14:12 +00:00
Warner Losh
9b89e63ce7 Create a man page for bus_child_present(9), a function to see if a
given device is considered accessible by its parent device bus driver
(or its parent, etc).
2003-03-28 07:09:17 +00:00
Warner Losh
129edde443 pccarddevs_data.h no longer generated 2003-03-28 06:44:57 +00:00
Warner Losh
2983138955 MFp4:
Don't generate the data file.
Use 0xffffffff rather than -1 for sign safety as these fields are uint32_t.
2003-03-28 06:43:50 +00:00
Matthew N. Dodd
0e91b7d532 - Clean up function calling conventions.
- Be consistent about what we call our softc.
- Minor formatting.
- Add some register definitions gleaned from NetBSD/Linux.
2003-03-28 06:27:08 +00:00
Mike Silbersack
df8c7fc96e Allow m_dup_pkthdr to accept mbufs with attached clusters as
targets.

Submitted by:	bmilekic
2003-03-28 05:57:48 +00:00
Ian Dowse
6205bf3107 Add a checksum to the kernel message buffer, and update it every
time a character is written. Use this at boot time to reject the
existing buffer contents if they are corrupt. This fixes a problem
seen on some hardware (especially laptops) where the message buffer
gets partially corrupted during a short power cycle or reset, but
the msgbuf structure is left intact so it gets reused, resulting
in random junk and control characters appearing in dmesg and
/var/log/messages.

PR:		kern/28497
2003-03-28 02:50:10 +00:00
Matthew N. Dodd
c591e5ebee Multicast support, gleaned from NetBSD's if_iy driver.
Submitted by:	 Craig Boston <craig@xfoil.gank.org>
2003-03-28 02:15:01 +00:00
Juli Mallett
7a51271b68 Close the disk file descriptor that is RO before trying to open the
new one, and do not fall back to the RO fd.  There was a bug here
in that the RO fd was never closed, if the RDRW open succeeded, but
this code is bogus anyway, and it breaks newfs of floppies, at least
for me, due to "Device busy."  Anything that wants to fall back is
doing something significantly odd that it should have some more complex
code on its end.
2003-03-28 01:50:11 +00:00
Matthew N. Dodd
c67c1ce843 Default data length should be 56, not 64. 2003-03-28 00:31:51 +00:00
Max Khon
226a0f0f8b Make realpath() thread-safe. New implementation does not use chdir(2) at all.
Submitted by:	Constantin S. Svintsoff <kostik (at) iclub.nsu.ru>
2003-03-27 20:48:53 +00:00
Tor Egge
5e2e6a67c4 Check return value from vmapbuf instead of the function address. 2003-03-27 20:48:34 +00:00
Robert Watson
8cd5699048 Don't pass NULL in as a flags argument to libfetch's fetchGetURL()
as this can result in a NULL pointer deference when parsing the
flags later.  This change fixes "pkg_add -r" on 5.0-CURRENT for
me; not quite clear how the problem was introduced.
2003-03-27 20:44:09 +00:00
David Schultz
8ee63f6eae Correct LDBL_* constants based on values from i386. 2003-03-27 20:38:22 +00:00
Matthew N. Dodd
aa5d693129 - Rely on ether_ifattach() to initialize part of our struct ifnet
rather than doing it ourself.
- Set ifq_maxlen.
- Include the size of the ethernet header when we allocate
  our mbuf chain in ieget().
2003-03-27 20:38:00 +00:00
Takeshi Shibagaki
a94c7d66aa Add an information and fix typo. 2003-03-27 19:33:22 +00:00
Tor Egge
10dccf8ff2 Eliminate a buffer sleep/wakeup race. 2003-03-27 19:28:11 +00:00
Robert Watson
78183ac2d2 Trim "trustedbsd_" from the front of the policy module "short names";
the vendor is only included in the long name currently, reducing
verbosity when modules are registered and unregistered.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-27 19:26:39 +00:00
John Baldwin
0f9d6538bb Add missing includes from previous commit.
Reported by:	des
2003-03-27 18:18:35 +00:00
Maxim Konovalov
7778283b40 Fix indentation. 2003-03-27 15:00:10 +00:00
Maxim Konovalov
be1e4c5162 o Protect set_fs_param() by splimp(9).
Quote from kern/37573:

	There is an obvious race in netinet/ip_dummynet.c:config_pipe().
	Interrupts are not blocked when changing the params of an
	existing pipe.  The specific crash observed:

	... -> config_pipe -> set_fs_parms -> config_red

	malloc a new w_q_lookup table but take an interrupt before
	intializing it, interrupt handler does:

	... -> dummynet_io -> red_drops

	red_drops dereferences the uninitialized (zeroed) w_q_lookup
	table.

o Flush accumulated credits for idle pipes.
o Flush accumulated credits when change pipe characteristics.
o Change dn_flow_queue.numbytes type to unsigned long.

	Overlapping dn_flow_queue->numbytes in ready_event() leads to
	numbytes becomes negative and SET_TICKS() macro returns a very
	big value.  heap_insert() overlaps dn_key again and inserts a
	queue to a ready heap with a sched_time points to the past.
	That leads to an "infinity" loop.

PR:		kern/33234, kern/37573, misc/42459, kern/43133,
		kern/44045, kern/48099
Submitted by:	Mike Hibler <mike@cs.utah.edu> (kern/37573)
MFC after:	6 weeks
2003-03-27 14:56:36 +00:00
Poul-Henning Kamp
63728c47e8 Run a revision on the OAM api.
Use prefix gctl_ systematically.
Add flag with access perms for each argument.
Add ro/rw versions of argument building functions.
General cleanup.
2003-03-27 14:35:00 +00:00
Poul-Henning Kamp
5e52756d9d Check return value of g_call_me() 2003-03-27 14:32:52 +00:00
Maxim Konovalov
7102717ac1 o netisr_queue() returns 1 on success and 0 on failure,
fix a typo (?) in rev. 1.90.

PR:		kern/50163
2003-03-27 12:52:57 +00:00
Tim J. Robbins
cd6d3a03c8 Deregister the dev_clone event handler we registered - don't touch the
handlers installed by other devices.
2003-03-27 12:47:53 +00:00
Maxim Konovalov
d6131f4b8e o Add -u <username> flag to jail(8): set user context before exec.
PR:		bin/44320
Submitted by:	Mike Matsnev <mike@po.cs.msu.su>
Reviewed by:	-current
MFC after:	6 weeks
2003-03-27 12:16:58 +00:00
Maxim Konovalov
089f4427b4 o Fix a comment.
o GC an unused macro.

PR:		kern/49083
Submitted by:	Bjoern A. Zeeb <bzeeb+freebsd@zabbadoz.net>
Not objected by: rwatson
2003-03-27 11:35:45 +00:00
Søren Schmidt
c7f547fde8 Biofinish the request if we cannot malloc in ad_start. 2003-03-27 10:48:21 +00:00
Poul-Henning Kamp
83e13864c3 Allocate the toplevel indir with M_WAITOK to avoid complicating things
needlessly.

Detected by:	rwatsons EvilMalloc(9)
2003-03-27 10:14:36 +00:00
Eivind Eklund
b11003f306 Change DEFMX to 0. This removes the size limit for print jobs by default.
Discussed with: gad (now), arch (a year ago)
2003-03-27 08:33:01 +00:00
Matthew N. Dodd
618095ccef Catch up with recent events. 2003-03-27 07:37:02 +00:00
Matthew N. Dodd
7736233b36 Add missing COMPAT_ISA_DRIVER().
Oops.
2003-03-27 05:40:40 +00:00
David Schultz
0c66f5adc3 Write negative zero as '-0.0'. Otherwise, it is parsed as an integer
before being cast to a floating point type, and the sign is lost.
2003-03-27 05:32:28 +00:00
Jake Burkholder
0f0dfee4d5 Handle the fictitious pages created by the device pager. For fictitious
pages which represent actual physical memory we must strip off the fake
page in order to allow illegal aliases to be detected.  Otherwise we map
uncacheable in the virtual and physical caches and set the side effect bit,
as is required for mapping device memory.

This fixes gstat on sparc64, which wants to mmap kernel memory through a
character device.
2003-03-27 02:16:31 +00:00
Jake Burkholder
868aaa93bc Set the cache line size for subordinate pci bridges as well as for their
child devices.  This fixes dma timeouts for devices behind the bridge.

Reported by:	simokawa
Tested by:	simokawa
2003-03-27 02:01:59 +00:00
David Xu
a75fd4bf6e Put child process in a different process group, ensure that the broadcast
signal never affects su directly, some shells changes its pgrp at running
or suspended time, so a broadcast SIGTSTP from child will mess up su's job
control.

Discussed with: bde
2003-03-27 01:32:51 +00:00
Tor Egge
5bbb806004 Add support for reading directly from file to userland buffer when the
O_DIRECT descriptor status flag is set and both offset and length is a
multiple of the physical media sector size.
2003-03-26 23:40:42 +00:00
Tor Egge
6b08046175 Adjust the number of vnodes scanned by vlrureclaim() according to the
size of the vnode list.
2003-03-26 22:15:58 +00:00
Robert Watson
f2538508f6 Permit debug.malloc.failure_rate to be specified using a tunable so
that the feature can be enabled during the boot process.  Note the
continued limitation that FreeBSD fails so rapidly with this setting
enabled that it's hard to narrow down particular failures for
correction; we really need per-malloc type failure rates.
2003-03-26 20:44:29 +00:00
Robert Watson
c26adbe322 Add MBTOM(), a macro that converts from an mbuf blocking disposition
flag (M_DONTWAIT / M_TRYWAIT) to a malloc(9) blocking disposition flag
(M_NOWAIT, M_WAITOK).  The semantic match isn't perfect, but for
scenarios where malloc data is used in the network stack, such as for
MAC labeling or for m_tags, we sometimes need to map from one to the
other to get the right blocking behavior.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-26 20:29:15 +00:00
Chris Costello
03b920e1a8 Add a sample specfile listing to FILES.
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-26 20:25:13 +00:00
Robert Watson
eae870cdb4 Add a new kernel option, MALLOC_MAKE_FAILURES, which compiles
in a debugging feature causing M_NOWAIT allocations to fail at
a specified rate.  This can be useful for detecting poor
handling of M_NOWAIT: the most frequent problems I've bumped
into are unconditional deference of the pointer even though
it's NULL, and hangs as a result of a lost event where memory
for the event couldn't be allocated.  Two sysctls are added:

debug.malloc.failure_rate

  How often to generate a failure: if set to 0 (default), this
  feature is disabled.  Otherwise, the frequency of failures --
  I've been using 10 (one in ten mallocs fails), but other
  popular settings might be much lower or much higher.

debug.malloc.failure_count

  Number of times a coerced malloc failure has occurred as a
  result of this feature.  Useful for tracking what might have
  happened and whether failures are being generated.

Useful possible additions: tying failure rate to malloc type,
printfs indicating the thread that experienced the coerced
failure.

Reviewed by:	jeffr, jhb
2003-03-26 20:18:40 +00:00
Paul Saab
90836fcf7d Nuke HTT from here too.
Spotted by:	jhb
2003-03-26 19:55:03 +00:00
Paul Saab
87437b0b89 Nuke options HTT infavor of machdep.hlt_logical_cpus tunable/sysctl.
This keeps the logical cpu's halted in the idle loop.  By default
the logical cpu's are halted at startup.  It is also possible to
halt any cpu in the idle loop now using machdep.hlt_cpus.

Examples of how to use this:
machdep.hlt_cpus=1	halt cpu0
machdep.hlt_cpus=2	halt cpu1
machdep.hlt_cpus=4	halt cpu2
machdep.hlt_cpus=3	halt cpu0,cpu1

Reviewed by:	jhb, peter
2003-03-26 19:49:34 +00:00
Peter Wemm
bb9cca1c2f Halt the cpus in the idle loop for SMP as well for several reasons:
1) Its critical for HTT.  There's less foot-shooting opportunity.
2) I've seen significant improvements in interactive response to commands
over ssh sessions.  I assume this is less lock contention.
3) As incentive to finish the idle cpu IPI wakeup stuff.
4) The machine on my desk was blowing hot air in my general direction
because somebody forgot to turn the hlt on, and it saves 50 watts per
cpu..

The machdep.cpu_idle_hlt sysctl is still available, but now the default
is the same as on UP kernels.
2003-03-26 19:40:29 +00:00