]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
22 years agoRe-insert TUNABLE() export of MAC Biba and MAC MLS module 'enabled'
Robert Watson [Thu, 5 Sep 2002 18:52:52 +0000 (18:52 +0000)]
Re-insert TUNABLE() export of MAC Biba and MAC MLS module 'enabled'
sysctls.  Apparently lost during some or another merge.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories

22 years agoMake the printf messages when routing interrupts more consistent in the
John Baldwin [Thu, 5 Sep 2002 17:08:35 +0000 (17:08 +0000)]
Make the printf messages when routing interrupts more consistent in the
various PCI bridge drivers.

22 years agoTest PCIbios.ventry against 0 to see if we found a PCIbios entry point,
John Baldwin [Thu, 5 Sep 2002 17:07:07 +0000 (17:07 +0000)]
Test PCIbios.ventry against 0 to see if we found a PCIbios entry point,
not the 'entry' member.  The entry point is formed from both a base and
a relative entry point.  'entry' is that relative offset.  It is perfectly
valid to have an entry point with a relative offset of 0.  PCIbios.ventry
is the virtual address of the entry point that takes both 'base' and
'entry' into account, thus it is the proper variable to test to see if we
have an entry point or not.

22 years agoWarns cleanups for netstat:
David Malone [Thu, 5 Sep 2002 17:06:51 +0000 (17:06 +0000)]
Warns cleanups for netstat:
1) Include arpa/inet.h for ntohs.
2) Constness fixes.
3) Fix shadowing except for "sin" which shouldn't be in scope.
4) Remove register keyword.
5) Add missing initialsers to user defined structs.
5) Make prototype of netname6 globally visable.
6) Use right macros for printing syncache stats (even though entrie isn't
   a word).

22 years agoMove some variables to the BSS instead of explicitly zero'ing them. This
John Baldwin [Thu, 5 Sep 2002 17:05:15 +0000 (17:05 +0000)]
Move some variables to the BSS instead of explicitly zero'ing them.  This
also makes all of the PCIbios variable be zero'd, not just the entry field.

22 years agoStatically compile pcn(4) into the install kernel vs. using as module.
David E. O'Brien [Thu, 5 Sep 2002 15:45:01 +0000 (15:45 +0000)]
Statically compile pcn(4) into the install kernel vs. using as module.
lnc(4) will attach to AMD PCnet/FAST NICs if pcn(4) does not attach.
I.e. pcn(4) gets first chance.  There is a problem however in that pcn(4)
was moved out of the install kernel so that the module would be used.
This however causes bad installs if one has an AMD PCnet/FAST NIC.

22 years agoAdd the PCN module.
David E. O'Brien [Thu, 5 Sep 2002 15:41:09 +0000 (15:41 +0000)]
Add the PCN module.

22 years agoMake recursion prevention variable per-instance and remove XXX comment
Maxim Sobolev [Thu, 5 Sep 2002 15:35:38 +0000 (15:35 +0000)]
Make recursion prevention variable per-instance and remove XXX comment
about thread-unsafety.

MFC after: 2 weeks

22 years agoInclude <sys/mutex.h> and its prerequisite <sys/lock.h> instead of depending
Bruce Evans [Thu, 5 Sep 2002 15:33:30 +0000 (15:33 +0000)]
Include <sys/mutex.h> and its prerequisite <sys/lock.h> instead of depending
on namespace pollution 4 layers deep in <netinet/in_pcb.h>.

Removed unused includes.  Sorted includes.

22 years agoUse `struct uma_zone *' instead of uma_zone_t, so that <sys/uma.h> isn't
Bruce Evans [Thu, 5 Sep 2002 14:04:34 +0000 (14:04 +0000)]
Use `struct uma_zone *' instead of uma_zone_t, so that <sys/uma.h> isn't
a prerequisite.

22 years agoInclude <sys/systm.h> for the definition of offsetof() instead of depending
Bruce Evans [Thu, 5 Sep 2002 13:08:22 +0000 (13:08 +0000)]
Include <sys/systm.h> for the definition of offsetof() instead of depending
on the definition being misplaced in <sys/types.h>.  The definition probably
belongs in <sys/stddef.h>.

22 years agoInclude <sys/systm.h> for the definition of offsetof() instead of depending
Bruce Evans [Thu, 5 Sep 2002 12:58:57 +0000 (12:58 +0000)]
Include <sys/systm.h> for the definition of offsetof() instead of depending
on the definition being misplaced in <sys/types.h>.  The definition probably
belongs in <sys/stddef.h>.

22 years agoDo not cast from a pointer to an integer of a possibly different size.
Bruce Evans [Thu, 5 Sep 2002 12:30:54 +0000 (12:30 +0000)]
Do not cast from a pointer to an integer of a possibly different size.
This fixes a warning on i386's with 64-bit longs.

22 years agoAdd debug.rman_debug sysctl MIB and loader tunable instead of broken
Mitsuru IWASAKI [Thu, 5 Sep 2002 11:45:02 +0000 (11:45 +0000)]
Add debug.rman_debug sysctl MIB and loader tunable instead of broken
RMAN_DEBUG option.
This would be useful for debugging resource manager code.

22 years agoFix a format buglet.
Poul-Henning Kamp [Thu, 5 Sep 2002 11:42:03 +0000 (11:42 +0000)]
Fix a format buglet.

Spotted by: iedowse

22 years agoParse hint.acpi.0.disabled correctly.
Mitsuru IWASAKI [Thu, 5 Sep 2002 11:16:23 +0000 (11:16 +0000)]
Parse hint.acpi.0.disabled correctly.
Now that hint.acpi.0.disabled="0" won't disable acpi as expected.

Pointed-out by: bde

22 years agoInclude <sys/malloc.h> instead of depending on namespace pollution 2
Bruce Evans [Thu, 5 Sep 2002 09:43:24 +0000 (09:43 +0000)]
Include <sys/malloc.h> instead of depending on namespace pollution 2
layers deep in <sys/proc.h> or <sys/vnode.h>.

Include <sys/vmmeter.h> instead of depending on namespace pollution in
<sys/pcpu.h>.

Sorted includes as much as possible.

22 years agoForward declare struct uio so that <sys/uio.h> isn't a prerequisite.
Bruce Evans [Thu, 5 Sep 2002 09:31:14 +0000 (09:31 +0000)]
Forward declare struct uio so that <sys/uio.h> isn't a prerequisite.

Removed bogus forward declarations of structs.

22 years agoThe changes mentioned below were accidently committed as part of
David Malone [Thu, 5 Sep 2002 09:11:20 +0000 (09:11 +0000)]
The changes mentioned below were accidently committed as part of
my previous commit, so the commit message is incorrect for them.
The actual changes were:

elfcore.c 1.11:
Use a uintmax_t 'cos we con't know if php->p_filesz will be a
Elf32_Size or an Elf64_Size and we don't know how these relate to
size_t. Change some ints to size_t and ssize_ts.

gcore.c 1.28:
Include <arpa/inet.h> for ntohl, which is used in N_BADMAG.
Use a uid_t for a uid.

md-nop.c 1.6:
Mark some parameters as unused.

22 years agoInclude <sys/malloc.h> instead of depending on namespace pollution 2
Bruce Evans [Thu, 5 Sep 2002 08:13:20 +0000 (08:13 +0000)]
Include <sys/malloc.h> instead of depending on namespace pollution 2
layers deep in <sys/proc.h> or <sys/vnode.h>.

Removed unused includes.  Sorted includes.

22 years agoPad after "char *n_name;" in the !_AOUT_INCLUDE_ case so that struct nlist
Bruce Evans [Thu, 5 Sep 2002 08:03:02 +0000 (08:03 +0000)]
Pad after "char *n_name;" in the !_AOUT_INCLUDE_ case so that struct nlist
has some chance of having the same layout in all cases on machines with
sizeof(char *) != sizeof(long).

22 years agoForward declare struct vnode so that <sys/vnode.h> or some other header
Bruce Evans [Thu, 5 Sep 2002 07:54:03 +0000 (07:54 +0000)]
Forward declare struct vnode so that <sys/vnode.h> or some other header
that happens to forward declare struct vnode isn't a prerequisite (most
places get it from <sys/imgact.h>).

22 years agoInclude stdint.h to make this compile.
Ian Dowse [Thu, 5 Sep 2002 07:43:34 +0000 (07:43 +0000)]
Include stdint.h to make this compile.

Submitted by: Garance A Drosihn <drosih@rpi.edu>

22 years agos/SGNL/SIG/
David Xu [Thu, 5 Sep 2002 07:30:18 +0000 (07:30 +0000)]
s/SGNL/SIG/
s/SNGL/SINGLE/
s/SNGLE/SINGLE/

Fix abbreviation for P_STOPPED_* etc flags, in original code they were
inconsistent and difficult to distinguish between them.

Approved by: julian (mentor)

22 years agoInclude <sys/malloc.h> instead of depending on namespace pollution 2
Bruce Evans [Thu, 5 Sep 2002 07:02:43 +0000 (07:02 +0000)]
Include <sys/malloc.h> instead of depending on namespace pollution 2
layers deep in <sys/proc.h> or <sys/vnode.h>.

Removed unused includes.

Fixed some printf format errors (1 fatal on i386's; 1 fatal on alphas;
1 not fatal on any supported machine).

22 years agoUncommented MAC options so that they get linted. This exposes brokenness
Bruce Evans [Thu, 5 Sep 2002 06:46:11 +0000 (06:46 +0000)]
Uncommented MAC options so that they get linted.  This exposes brokenness
in kern_mac.c.

22 years agoImplement LINUX_TIOCSCTTY.
Marcel Moolenaar [Thu, 5 Sep 2002 02:51:25 +0000 (02:51 +0000)]
Implement LINUX_TIOCSCTTY.

PR: kern/42404

22 years agoSplit up ptrace() into a wrapper that does the copying to and from
Ian Dowse [Thu, 5 Sep 2002 01:02:50 +0000 (01:02 +0000)]
Split up ptrace() into a wrapper that does the copying to and from
user space and a kern_ptrace() implementation. Use the kern_*()
version in the Linux emulation code to remove more stack gap uses.

Approved by: des

22 years agoremove #pragma ident
Alfred Perlstein [Wed, 4 Sep 2002 23:58:23 +0000 (23:58 +0000)]
remove #pragma ident

22 years agoANSIify function definitions.
David Malone [Wed, 4 Sep 2002 23:29:10 +0000 (23:29 +0000)]
ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by: md5

22 years agoAdd a tip about using sed(1)'s FreeBSD-specific -i option.
Juli Mallett [Wed, 4 Sep 2002 23:28:35 +0000 (23:28 +0000)]
Add a tip about using sed(1)'s FreeBSD-specific -i option.

MFC after: 42 days

22 years agoAvoid a signedness warning by casting chain_index to a size_t.
David Malone [Wed, 4 Sep 2002 21:22:49 +0000 (21:22 +0000)]
Avoid a signedness warning by casting chain_index to a size_t.
(Should be OK as chain_index is supposed to be positive).

22 years agoNo need to declare optind as an external int.
David Malone [Wed, 4 Sep 2002 21:16:51 +0000 (21:16 +0000)]
No need to declare optind as an external int.

22 years agoMake syslogd -u treat "*" as all levels by explictly setting pri_cmp
David Malone [Wed, 4 Sep 2002 21:11:25 +0000 (21:11 +0000)]
Make syslogd -u treat "*" as all levels by explictly setting pri_cmp
for it.

While I'm here, add a the ability to say "!level" in a way which
should be compatible with Linux's syslogd.

PR: 28935
No objections: audit
MFC after: 2 weeks

22 years agoWhen printing the wait status, break it down into a signal and a exit status.
David Malone [Wed, 4 Sep 2002 21:00:45 +0000 (21:00 +0000)]
When printing the wait status, break it down into a signal and a exit status.

PR: 41912
Submitted by: Aaron Smith <aaron@mutex.org>
MFC after: 2 weeks

22 years agoSwap sense of no_v[46]bind variables and rename as v[46]bind_ok -
David Malone [Wed, 4 Sep 2002 20:31:53 +0000 (20:31 +0000)]
Swap sense of no_v[46]bind variables and rename as v[46]bind_ok -
this avoids some double negatives which are a bit difficult to
parse.

Always tread v[46]bind{,_ok} as booleans.

22 years agoFix parsing of unix domain entries after addition of IPv6 RPC support.
David Malone [Wed, 4 Sep 2002 20:15:20 +0000 (20:15 +0000)]
Fix parsing of unix domain entries after addition of IPv6 RPC support.

PR: 40771
Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr>

22 years agoUnder DIAGNOSTIC, complain if a timeout(9) routine took more than 1msec.
Poul-Henning Kamp [Wed, 4 Sep 2002 20:05:00 +0000 (20:05 +0000)]
Under DIAGNOSTIC, complain if a timeout(9) routine took more than 1msec.

22 years agoOn the ElanSC520 CPU use general purpose timer#2 as timecounter.
Poul-Henning Kamp [Wed, 4 Sep 2002 19:52:17 +0000 (19:52 +0000)]
On the ElanSC520 CPU use general purpose timer#2 as timecounter.

This is a vast improvement over the i8254, since it is a simple
memory load rather than a comples sequence of interrupt blocking,
multiple input/output instructions, and wrap-around detection.

I have not bothered to time the fundamental timecounter get routine,
but gettimeofday(2) is 10% faster with the ELAN timecounte.

The downside is that HZ=100 is not enough, 150 or more recommended,
I use 250 myself.

22 years agoChange the support for AMDs ElanSC520 CPU from being a device driver to
Poul-Henning Kamp [Wed, 4 Sep 2002 19:43:22 +0000 (19:43 +0000)]
Change the support for AMDs ElanSC520 CPU from being a device driver to
be
options CPU_ELAN
(NB: Soekris.com users!)

It is cleaner this way.  We still recognize the cpu on the host-pci bridge.

22 years agoDo not employ timecounter hardware if our hz does not support their
Poul-Henning Kamp [Wed, 4 Sep 2002 19:32:18 +0000 (19:32 +0000)]
Do not employ timecounter hardware if our hz does not support their
correct rewinding.

22 years agoFunction prototypes don't need 'extern'.
John Baldwin [Wed, 4 Sep 2002 19:31:09 +0000 (19:31 +0000)]
Function prototypes don't need 'extern'.

22 years agoDon't let children attach fast interrupts if the parent interrupt is normal.
Poul-Henning Kamp [Wed, 4 Sep 2002 18:50:40 +0000 (18:50 +0000)]
Don't let children attach fast interrupts if the parent interrupt is normal.

Submitted by: bde

22 years agoMake consistent; turn spaces into tabs where there is a mixture.
Mark Murray [Wed, 4 Sep 2002 18:14:17 +0000 (18:14 +0000)]
Make consistent; turn spaces into tabs where there is a mixture.

22 years agoBring back the PUC_FASTINTR option, and implement it correctly so that
Poul-Henning Kamp [Wed, 4 Sep 2002 15:29:04 +0000 (15:29 +0000)]
Bring back the PUC_FASTINTR option, and implement it correctly so that
child devices also know if they are fast or normal.

Requested by: bde

22 years agoGive up on calling tc_ticktock() from a timeout, we have timeout
Poul-Henning Kamp [Wed, 4 Sep 2002 10:15:19 +0000 (10:15 +0000)]
Give up on calling tc_ticktock() from a timeout, we have timeout
functions which run for several milliseconds at a time and getting
in queue behind one or more of those makes us miss our rewind.

Instead call it from hardclock() like we used to do, but retain the
prescaler so we still cope with high HZ values.

22 years agoAdd in_hosteq() and in_nullhost() macros to make life of developers
Maxim Sobolev [Wed, 4 Sep 2002 09:55:50 +0000 (09:55 +0000)]
Add in_hosteq() and in_nullhost() macros to make life of developers
porting NetBSD code a little bit easier.

Obtained from: NetBSD

22 years agoSigh. The fix to the suspend code wasn't complete, since the resume
Scott Long [Wed, 4 Sep 2002 08:13:36 +0000 (08:13 +0000)]
Sigh.  The fix to the suspend code wasn't complete, since the resume
code was broken in the same way.

Submitted by: co9@xs4all.nl
MFC after: 3 days

22 years agoMore in the continuing saga of phk vs his strange serial card.
Warner Losh [Wed, 4 Sep 2002 06:53:37 +0000 (06:53 +0000)]
More in the continuing saga of phk vs his strange serial card.

In this installment, we learn that it is bad to access registers that
are only defined for mfc cards in the interrupt handler when we do not
in fact have a mfc card.  For MFC cards, we'll only call the ISR if
the this card interrupted bit is set.  For non mfc cards (which are
basically 90% of pccards in use), we always call the ISR and avoid
touching the suspect registers.  We always pacify the bit in the MFC
case on the off chance that will help in the itnerrupt handler not
being registed.

22 years agoAlright, fix the problems with the elf loader for the Alpha. It turns
Matthew Dillon [Wed, 4 Sep 2002 04:42:12 +0000 (04:42 +0000)]
Alright, fix the problems with the elf loader for the Alpha.  It turns
out that there is no easy way to discern the difference between a text
segment and a data segment through the read-only OR execute attribute
in the elf segment header, so revert the algorithm to what it was before.

Neither can we account for multiple data load segments in the vmspace
structure (at least not without more work), due to assumptions obreak()
makes in regards to the data start and data size fields.

Retain RLIMIT_VMEM checking by using a local variable to track the
total bytes of data being loaded.

Reviewed by: peter
X-MFC after: ASAP

22 years agoFix up a comment.
John Baldwin [Wed, 4 Sep 2002 03:53:21 +0000 (03:53 +0000)]
Fix up a comment.

22 years agoUse resource_list_print_type() instead of duplicating the code in
John Baldwin [Wed, 4 Sep 2002 03:19:33 +0000 (03:19 +0000)]
Use resource_list_print_type() instead of duplicating the code in
nexus_print_resources().

22 years ago- Make pci_load_vendor_data() static and do it during MOD_LOAD instead of
John Baldwin [Wed, 4 Sep 2002 03:13:16 +0000 (03:13 +0000)]
- Make pci_load_vendor_data() static and do it during MOD_LOAD instead of
  when the first PCI bus attaches.
- Create /dev/pci during MOD_LOAD as well.
- Destroy /dev/pci during MOD_UNLOAD (not that you can kldunload pci, but
  might as well get the code right)

22 years agoUse resource_list_print_types() instead of duplicating the code.
John Baldwin [Wed, 4 Sep 2002 03:11:20 +0000 (03:11 +0000)]
Use resource_list_print_types() instead of duplicating the code.

22 years agoDie on -D=foo, when parsing options - we can't let someone define (nil).
Juli Mallett [Wed, 4 Sep 2002 01:12:39 +0000 (01:12 +0000)]
Die on -D=foo, when parsing options - we can't let someone define (nil).

MFC after: 3 days

22 years agoDeprecate the use of sendmail_enable="NONE" as it adversely affects the
Gregory Neil Shapiro [Tue, 3 Sep 2002 22:15:57 +0000 (22:15 +0000)]
Deprecate the use of sendmail_enable="NONE" as it adversely affects the
new rcNG effort.

Submitted by: Mike Makonnen <makonnen@pacbell.net>

22 years agoMake the text segment locating heuristics from rev 1.121 more reliable
Peter Wemm [Tue, 3 Sep 2002 21:18:17 +0000 (21:18 +0000)]
Make the text segment locating heuristics from rev 1.121 more reliable
so that it works on the Alpha.  This defines the segment that the entry
point exists in as 'text' and any others (usually one) as data.

Submitted by: tmm
Tested on: i386, alpha

22 years ago- Change falloc() to acquire an fd from the process table last so that
John Baldwin [Tue, 3 Sep 2002 20:16:31 +0000 (20:16 +0000)]
- Change falloc() to acquire an fd from the process table last so that
  it can do it w/o needing to hold the filelist_lock sx lock.
- fdalloc() doesn't need Giant to call free() anymore.  It also doesn't
  need to drop and reacquire the filedesc lock around free() now as a
  result.
- Try to make the code that copies fd tables when extending the fd table in
  fdalloc() a bit more readable by performing assignments in separate
  statements.  This is still a bit ugly though.
- Use max() instead of an if statement so to figure out the starting point
  in the search-for-a-free-fd loop in fdalloc() so it reads better next to
  the min() in the previous line.
- Don't grow nfiles in steps up to the size needed if we dup2() to some
  really large number.  Go ahead and double 'nfiles' in a loop prior
  to doing the malloc().
- malloc() doesn't need Giant now.
- Use malloc() and free() instead of MALLOC() and FREE() in fdalloc().
- Check to see if the size we are going to grow to is too big, not if the
  current size of the fd table is too big in the loop in fdalloc().  This
  means if we are out of space or if dup2() requests too high of a fd,
  then we will return an error before we go off and try to allocate some
  huge table and copy the existing table into it.
- Move all of the logic for dup'ing a file descriptor into do_dup() instead
  of putting some of it in do_dup() and duplicating other parts in four
  different places.  This makes dup(), dup2(), and fcntl(F_DUPFD) basically
  wrappers of do_dup now.  fcntl() still has an extra check since it uses
  a different error return value in one case then the other functions.
- Add a KASSERT() for an assertion that may not always be true where the
  fdcheckstd() function assumes that falloc() returns the fd requested and
  not some other fd.  I think that the assertion is always true because we
  are always single-threaded when we get to this point, but if one was
  using rfork() and another process sharing the fd table were playing with
  the fd table, there might could be a problem.
- To handle the problem of a file descriptor we are dup()'ing being closed
  out from under us in dup() in general, do_dup() now obtains a reference
  on the file in question before calling fdalloc().  If after the call to
  fdalloc() the file for the fd we are dup'ing is a different file, then
  we drop our reference on the original file and return EBADF.  This
  race was only handled in the dup2() case before and would just retry
  the operation.  The error return allows the user to know they are being
  stupid since they have a locking bug in their app instead of dup'ing
  some other descriptor and returning it to them.

Tested on: i386, alpha, sparc64

22 years agoDon't try (and fail) to fchmod /dev/stdout. Revert the manual page
Tony Finch [Tue, 3 Sep 2002 19:37:23 +0000 (19:37 +0000)]
Don't try (and fail) to fchmod /dev/stdout. Revert the manual page
to suggest the portable alternative to -p.

PR: 42356
Submitted by: Kimura Fuyuki <fuyuki@hadaly.org>
MFC after: 1 week

22 years ago- Move $FreeBSD$ to the top of the file.
John Baldwin [Tue, 3 Sep 2002 19:21:39 +0000 (19:21 +0000)]
- Move $FreeBSD$ to the top of the file.
- Fix a few grammar bogons.
- Add a small style guide.

Reviewed by: bde (a while ago)

22 years agoAdd some KASSERT()'s to ensure that we don't perform spin mutex ops on
John Baldwin [Tue, 3 Sep 2002 18:25:16 +0000 (18:25 +0000)]
Add some KASSERT()'s to ensure that we don't perform spin mutex ops on
sleep mutexes and vice versa.  WITNESS normally should catch this but
not everyone uses WITNESS so this is a fallback to catch nasty but easy
to do bugs.

22 years agoAdhere to guidelines when testing for null strings.
Eric Melville [Tue, 3 Sep 2002 17:39:26 +0000 (17:39 +0000)]
Adhere to guidelines when testing for null strings.

Submitted by: rwatson

22 years agoRemove aic7xxx from the module build framework until all bootstrapping
Justin T. Gibbs [Tue, 3 Sep 2002 16:54:48 +0000 (16:54 +0000)]
Remove aic7xxx from the module build framework until all bootstrapping
issues are resolved.

22 years agonfsd doesn't die on SIGTERM but on SIGUSR1, correct script to kill nfsd with
Gordon Tetlow [Tue, 3 Sep 2002 16:02:57 +0000 (16:02 +0000)]
nfsd doesn't die on SIGTERM but on SIGUSR1, correct script to kill nfsd with
the right signal.

22 years agoDon't need to install the signal trampoline here anymore.
Jake Burkholder [Tue, 3 Sep 2002 14:59:41 +0000 (14:59 +0000)]
Don't need to install the signal trampoline here anymore.

22 years agoInstall the userland signal trampoline when sigaction is first called,
Jake Burkholder [Tue, 3 Sep 2002 14:55:29 +0000 (14:55 +0000)]
Install the userland signal trampoline when sigaction is first called,
instead of on startup.  This fixes binary compatibility of dynamically
linked binaries from before the signal code move.

Suggested by: wollman (a long time ago)

22 years agoIn the kernel code, we have the tsleep() call with the PCATCH argument.
David Xu [Tue, 3 Sep 2002 12:56:01 +0000 (12:56 +0000)]
In the kernel code, we have the tsleep() call with the PCATCH argument.
PCATCH means 'if we get a signal, interrupt me!" and tsleep returns
either EINTR or ERESTART depending on the circumstances.  ERESTART is
"special" because it causes the system call to fail, but right as it
returns back to userland it tells the trap handler to move %eip back a
bit so that userland will immediately re-run the syscall.
This is a syscall restart. It only works for things like read() etc where
nothing has changed yet. Note that *userland* is tricked into restarting
the syscall by the kernel. The kernel doesn't actually do the restart. It
is deadly for things like select, poll, nanosleep etc where it might cause
the elapsed time to be reset and start again from scratch.  So those
syscalls do this to prevent userland rerunning the syscall:
  if (error == ERESTART) error = EINTR;

Fake "signals" like SIGTSTP from ^Z etc do not normally invoke userland
signal handlers. But, in -current, the PCATCH *is* being triggered and
tsleep is returning ERESTART, and the syscall is aborted even though no
userland signal handler was run.
That is the fault here.  We're triggering the PCATCH in cases that we
shouldn't.  ie: it is being triggered on *any* signal processing, rather
than the case where the signal is posted to userland.
--- Peter

The work of psignal() is a patchwork of special case required by the process
debugging and job-control facilities...
--- Kirk McKusick
"The design and impelementation of the 4.4BSD Operating system"
Page 105

in STABLE source, when psignal is posting a STOP signal to sleeping
process and the signal action of the process is SIG_DFL, system will
directly change the process state from SSLEEP to SSTOP, and when
SIGCONT is posted to the stopped process, if it finds that the process
is still on sleep queue, the process state will be restored to SSLEEP,
and won't wakeup the process.

this commit mimics the behaviour in STABLE source tree.

Reviewed by: Jon Mini, Tim Robbins, Peter Wemm
Approved by: julian@freebsd.org (mentor)

22 years agoRemove a debug printf.
Poul-Henning Kamp [Tue, 3 Sep 2002 11:31:34 +0000 (11:31 +0000)]
Remove a debug printf.

Correctly identify the ARGOSY SP320 dual port serial PCMCIA card.

22 years agoDrop another cookie to wet Warners appetite:
Poul-Henning Kamp [Tue, 3 Sep 2002 11:24:25 +0000 (11:24 +0000)]
Drop another cookie to wet Warners appetite:

We need to call the drivers interrupt function even though the card is not
multifunction.

22 years agoFix interrupt registration:
Poul-Henning Kamp [Tue, 3 Sep 2002 11:22:13 +0000 (11:22 +0000)]
Fix interrupt registration:

PUC devices live on pccard or pci so INTR_FAST is never really an option.
Don't try to register the interrupt as fast and don't allow the children
to do so either.

22 years agoStyle: fix a function whitespace stuff-up. Remove a debugging printf.
Poul-Henning Kamp [Tue, 3 Sep 2002 11:19:44 +0000 (11:19 +0000)]
Style: fix a function whitespace stuff-up.  Remove a debugging printf.

22 years agoStyle: move a global variable up to the top of the file.
Poul-Henning Kamp [Tue, 3 Sep 2002 11:18:35 +0000 (11:18 +0000)]
Style: move a global variable up to the top of the file.

22 years agoDon't probe the interrupt on puc(4) attached devices.
Poul-Henning Kamp [Tue, 3 Sep 2002 11:17:38 +0000 (11:17 +0000)]
Don't probe the interrupt on puc(4) attached devices.

22 years agoSuggest -p instead of -o /dev/stdout.
Tony Finch [Tue, 3 Sep 2002 10:18:56 +0000 (10:18 +0000)]
Suggest -p instead of -o /dev/stdout.

PR: 42356

22 years agoRemove spurious whitespace
Tony Finch [Tue, 3 Sep 2002 09:58:11 +0000 (09:58 +0000)]
Remove spurious whitespace

22 years ago- Improve AC97 presence check and move it from fm801_attach() to fm801_probe();
Maxim Sobolev [Tue, 3 Sep 2002 08:58:15 +0000 (08:58 +0000)]
- Improve AC97 presence check and move it from fm801_attach() to fm801_probe();
- add bus capabilities into the driver, so that it is possible for a radio
  driver to attach to it to use shared resources of fm801 chip. The radio
  driver itself will be committed later.

MFC after: 1 week

22 years agoWhen installing package from a local file assume that all subsequent
Maxim Sobolev [Tue, 3 Sep 2002 06:59:33 +0000 (06:59 +0000)]
When installing package from a local file assume that all subsequent
autoinstalled dependencies will have the same extension, not just
".tbz".

Pointy hat to: obrien
X-MFC after: -1 day

22 years agogcc 3.2
Warner Losh [Tue, 3 Sep 2002 06:13:43 +0000 (06:13 +0000)]
gcc 3.2
rm -rf /usr/include/g++ needed to upgrade from 4.6

22 years agoPrevent ps(1) from doing idiotic munging of things in a -ofmt= string.
Juli Mallett [Tue, 3 Sep 2002 05:44:00 +0000 (05:44 +0000)]
Prevent ps(1) from doing idiotic munging of things in a -ofmt= string.

God I hate the backwards compatability crap here.

22 years agoFix a nasty bug exposed by mktime() when time_t is significantly bigger
Peter Wemm [Tue, 3 Sep 2002 04:34:10 +0000 (04:34 +0000)]
Fix a nasty bug exposed by mktime() when time_t is significantly bigger
than 32 bits.  It was trying to figure out things like the day of week
of when time_t is roughly 2^62 etc.  Make a better guess for the starting
point for the binary search that works on both 32 and 64 bit types.  I have
been using this for a while now.

22 years agoTurn off usage of SMP style locking until we sort out CAM.
Matt Jacob [Tue, 3 Sep 2002 04:31:55 +0000 (04:31 +0000)]
Turn off usage of SMP style locking until we sort out CAM.

22 years agoMake this compile
Peter Wemm [Tue, 3 Sep 2002 04:30:00 +0000 (04:30 +0000)]
Make this compile

22 years agoDon't do transition locking (i.e., CAM->MPT->CAM)- Peter claimed that ia64
Matt Jacob [Tue, 3 Sep 2002 02:18:21 +0000 (02:18 +0000)]
Don't do transition locking (i.e., CAM->MPT->CAM)- Peter claimed that ia64
chokes the chicken with this.

Submitted by: wemm@freebsd.org

22 years agoSet errno to EILSEQ when invalid multibyte sequences are detected
Tim J. Robbins [Tue, 3 Sep 2002 01:09:47 +0000 (01:09 +0000)]
Set errno to EILSEQ when invalid multibyte sequences are detected
(XSI extension to 1003.1-2001).

22 years agoModified release notes: Remote note about enabling rnNG (it's now on
Bruce A. Mah [Tue, 3 Sep 2002 01:07:32 +0000 (01:07 +0000)]
Modified release notes:  Remote note about enabling rnNG (it's now on
by default), cvs 1.11.2.

MFCs noted:  Binutils 2.12.1 20020622 snapshot.

22 years agoNew release notes: ng_l2tp(4) (+MFC), ifconfig(8) promisc (+MFC),
Bruce A. Mah [Tue, 3 Sep 2002 00:26:24 +0000 (00:26 +0000)]
New release notes:  ng_l2tp(4) (+MFC), ifconfig(8) promisc (+MFC),
inetd(8) service limitations (+MFC).

MFCs noted:  uaudio, daemon(8), tcpd(8).

22 years agoNow that _BSD_CLK_TCK_ and _BSD_CLOCKS_PER_SEC_ are the same on all
Mike Barcroft [Tue, 3 Sep 2002 00:06:58 +0000 (00:06 +0000)]
Now that _BSD_CLK_TCK_ and _BSD_CLOCKS_PER_SEC_ are the same on all
architectures, move the definition directly into <time.h> and finish
the removal of <machine/ansi.h>.

22 years agoRemove an unneeded PROC_LOCK, which caused lock recursion panics.
Jake Burkholder [Mon, 2 Sep 2002 23:46:13 +0000 (23:46 +0000)]
Remove an unneeded PROC_LOCK, which caused lock recursion panics.
Print a warning about old applications with no signal trampoline.

Reported by: marius@alchemy.franken.de

22 years agoUse the new kern_*() functions to avoid using the stack gap in
Ian Dowse [Mon, 2 Sep 2002 22:46:05 +0000 (22:46 +0000)]
Use the new kern_*() functions to avoid using the stack gap in
linux_fcntl*() and linux_getcwd().

22 years agoAlign _BSD_CLK_TCK_ and _BSD_CLOCKS_PER_SEC_ with most other
Mike Barcroft [Mon, 2 Sep 2002 22:40:56 +0000 (22:40 +0000)]
Align _BSD_CLK_TCK_ and _BSD_CLOCKS_PER_SEC_ with most other
platforms.  This introduces some binary incompatibilities for
dynamically linked programs which make use of clock(3) and times(3).

Approved by: jake

22 years agoSplit up __getcwd so that kernel callers of the internal version
Ian Dowse [Mon, 2 Sep 2002 22:40:30 +0000 (22:40 +0000)]
Split up __getcwd so that kernel callers of the internal version
can specify whether the buffer is in user or system space.

22 years agoAlign _BSD_CLK_TCK_ and _BSD_CLOCKS_PER_SEC_ with most other
Mike Barcroft [Mon, 2 Sep 2002 22:40:12 +0000 (22:40 +0000)]
Align _BSD_CLK_TCK_ and _BSD_CLOCKS_PER_SEC_ with most other
platforms.  This introduces some binary incompatibilities for
dynamically linked programs which make use of clock(3) and times(3).

22 years agoSplit fcntl() into a wrapper and a kernel-callable kern_fcntl()
Ian Dowse [Mon, 2 Sep 2002 22:24:14 +0000 (22:24 +0000)]
Split fcntl() into a wrapper and a kernel-callable kern_fcntl()
implementation. The wrapper is responsible for copying additional
structure arguments (struct flock) to and from userland.

22 years agoWe don't use single_mountd_enable anymore. It's just mountd_enable. I must
Gordon Tetlow [Mon, 2 Sep 2002 21:20:58 +0000 (21:20 +0000)]
We don't use single_mountd_enable anymore. It's just mountd_enable. I must
have missed this in my earlier sweep.

22 years agoOnly install the scripts that actually used on FreeBSD.
Gordon Tetlow [Mon, 2 Sep 2002 20:49:26 +0000 (20:49 +0000)]
Only install the scripts that actually used on FreeBSD.

22 years agoCommit a revised sendmail script that works the same way as rc.sendmail.
Gordon Tetlow [Mon, 2 Sep 2002 20:37:03 +0000 (20:37 +0000)]
Commit a revised sendmail script that works the same way as rc.sendmail.
This should also quell warnings when sendmail_enable="NONE"

22 years agoHook up libkern/strlcpy.c and libkern/strlcat.c after repocopy.
Brooks Davis [Mon, 2 Sep 2002 20:16:22 +0000 (20:16 +0000)]
Hook up libkern/strlcpy.c and libkern/strlcat.c after repocopy.

Obtained from: OpenBSD
Discussed on: -arch

22 years agoMake SCSI_DELAY setable at boot time and runtime via the
Brooks Davis [Mon, 2 Sep 2002 20:10:19 +0000 (20:10 +0000)]
Make SCSI_DELAY setable at boot time and runtime via the
kern.cam.scsi_delay tunable/sysctl.

Reviewed by: mdodd, njl

22 years agoDon't initialise policy, v4bind and v6bind where the variables are
David Malone [Mon, 2 Sep 2002 20:07:14 +0000 (20:07 +0000)]
Don't initialise policy, v4bind and v6bind where the variables are
declared - it was bad style and caused a bug. v[46]bind need to be
reset whenever we go to the "more:" label.

Jean-Luc and I came up with this patch independently, so it had
better be right!

PR: 40771
Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr>

22 years agotpc -> tcp in an error message.
David Malone [Mon, 2 Sep 2002 20:00:46 +0000 (20:00 +0000)]
tpc -> tcp in an error message.

PR: 40771
Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr>