]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
21 years agoAdd a new bootloader menu. Pull in screen.4th and frames.4th from the
Scott Long [Fri, 30 May 2003 09:29:24 +0000 (09:29 +0000)]
Add a new bootloader menu.  Pull in screen.4th and frames.4th from the
examples directory to support it.  This is installed only on i386 for
now.  It will be enabled in a later commit.

Approved by: re

21 years agoAdd support for the upcoming 2410SA card.
Scott Long [Fri, 30 May 2003 09:22:19 +0000 (09:22 +0000)]
Add support for the upcoming 2410SA card.

Approved by: re (telecon)

21 years agoaic79xx.c:
Scott Long [Fri, 30 May 2003 02:15:15 +0000 (02:15 +0000)]
aic79xx.c:
Use the special LUNLEN_SINGLE_LEVEL constant for
post Rev A4 hardware for single byte luns.  Without
this change, Rev B hardware would place the single
byte of lun data in byte 0 of the lun structure when
it should be in byte 1.  Since there are few if any
devices on the market that support multiple luns in
target mode, the corrupted lun field (which was only
corrupted for non-zero luns) wasn't hurting us.

Approved by: re (rwatson)

21 years agoFix a reported case of severe data corruption:
Scott Long [Fri, 30 May 2003 02:14:22 +0000 (02:14 +0000)]
Fix a reported case of severe data corruption:

aic79xx.h:
aic79xx.reg:
Return the SCB_TAG field to 16byte alignment.
It seems that on some PCI systems, SCBs are not
transferred correctly to the controller with
the previous placement of the SCB_TAG field.

Approved by: re (rwatson)

21 years agoUpdate the kernel compile flags inside the .if ${MACHINE_ARCH} == "amd64"
Peter Wemm [Fri, 30 May 2003 01:06:58 +0000 (01:06 +0000)]
Update the kernel compile flags inside the .if ${MACHINE_ARCH} == "amd64"
section to stop gcc generating the dwarf2 .eh_frame unwind tables.  It
is dead weight for the time being.  Maybe it can be used to perform
stack traces and/or get the location of function arguments in ddb, but
that requires a dwarf2 runtime interpreter, which we do not have.

Approved by: re (amd64 "safe" bits)

21 years agoAdd ddb machdep bits.
Peter Wemm [Fri, 30 May 2003 01:03:43 +0000 (01:03 +0000)]
Add ddb machdep bits.

Approved by: re (amd64 bits)

21 years agoNasty 'make it compile' port to amd64. Note that it needs some other
Peter Wemm [Fri, 30 May 2003 01:02:52 +0000 (01:02 +0000)]
Nasty 'make it compile' port to amd64.  Note that it needs some other
wire protocol for the extra registers.  I should probably just remove it
from here for now since its quite useless.

Approved by: re (amd64/* blanket)

21 years agoInitial port to amd64 after repocopy from i386. Note that the
Peter Wemm [Fri, 30 May 2003 01:01:07 +0000 (01:01 +0000)]
Initial port to amd64 after repocopy from i386.  Note that the
disassembler has not been updated yet, and will do some very strange
things.  It does tracebacks (without function arguments due to regparm
calling conventions) if -fno-omit-frame-pointer is used (to come later).
This achieves basic functionality.

Approved by: re (amd64/* blanket)

21 years agoAdd setjmp/longjmp for ddb
Peter Wemm [Fri, 30 May 2003 00:58:48 +0000 (00:58 +0000)]
Add setjmp/longjmp for ddb

21 years agoAdd an stub for _rtld_thread_init. This is a part I missed in
Alexander Kabaev [Fri, 30 May 2003 00:58:37 +0000 (00:58 +0000)]
Add an stub for _rtld_thread_init. This is a part I missed in
my last commit.

Approved by: re (scottl)

21 years agoDon't post-increment pointers inside a loop conditional.
Matthew N. Dodd [Fri, 30 May 2003 00:49:16 +0000 (00:49 +0000)]
Don't post-increment pointers inside a loop conditional.

While I'm here:
- Let lm_add() call strdup() on its own behalf.
- Use a temporary pointer when parsing constraints; only set the
  constraint pointer on a totally successful match.

PR:  bin/52783
Submitted by:  David P. Reese Jr. <daver@gomerbud.com>
Approved by:  re (rwatson)

21 years agoAttempt to eliminate PLT relocations from rwlock aquire/release
Alexander Kabaev [Fri, 30 May 2003 00:21:52 +0000 (00:21 +0000)]
Attempt to eliminate PLT relocations from rwlock aquire/release
path, making them suitable for direct use by the dynamic loader.

Register libpthread-specific locking API with rtld on startup.

This still has some rough edges with signals which should be
addresses later.

Approved by: re (scottl)

21 years agoCall the __sys_sigprocmask(the system call) when sigprocmask()
Daniel Eischen [Fri, 30 May 2003 00:09:22 +0000 (00:09 +0000)]
Call the __sys_sigprocmask(the system call) when sigprocmask()
is called and the application is not threaded.  This works around
a problem when an application that hasn't yet become threaded
tries to jump out of a signal handler.

Reported by: mbr
Approved by: re@ (rwatson)

21 years agoCorrect the fix in rev 1.70
Bernd Walter [Thu, 29 May 2003 23:47:12 +0000 (23:47 +0000)]
Correct the fix in rev 1.70
Some lines were misslocated

Submitted by: Jay Cornwall <jay@evilrealms.net>
Approved by: re (rwatson)

21 years agoAllow threading libraries to register their own locking
Alexander Kabaev [Thu, 29 May 2003 22:58:26 +0000 (22:58 +0000)]
Allow threading libraries to register their own locking
implementation in case default one provided by rtld is
not suitable.

Consolidate various identical MD lock implementation into
a single file using appropriate machine/atomic.h.

Approved by: re (scottl)

21 years agoUse strsep() in preference to manual string parsing for Biba and MLS
Robert Watson [Thu, 29 May 2003 22:51:52 +0000 (22:51 +0000)]
Use strsep() in preference to manual string parsing for Biba and MLS
label internalization.  Use sensible variable names.  Include comments.
Doesn't fix any known bugs, but may fix unknown ones.

Approved by: re (scottl)

21 years agoDon't return -1 and abort if msg.msg_controllen is 0. For
Martin Blapp [Thu, 29 May 2003 22:06:06 +0000 (22:06 +0000)]
Don't return -1 and abort if msg.msg_controllen is 0. For
some strange reason recvmsg() never sets errno to EAGAIN
on a non-blocking socket and just returns 0.

Reviewed by: jhb
Approved by: re

21 years agoAssorted mdoc(7) fixes.
Ruslan Ermilov [Thu, 29 May 2003 21:41:11 +0000 (21:41 +0000)]
Assorted mdoc(7) fixes.

21 years agoAssorted mdoc(7) fixes.
Ruslan Ermilov [Thu, 29 May 2003 21:28:36 +0000 (21:28 +0000)]
Assorted mdoc(7) fixes.

Approved by: re (blanket)

21 years agoWhen loading a module that contains a sysctl which is already compiled
Maxime Henrion [Thu, 29 May 2003 21:19:18 +0000 (21:19 +0000)]
When loading a module that contains a sysctl which is already compiled
in the kernel, the sysctl_register() call would fail, as expected.
However, when unloading this module again, the kernel would then panic
in sysctl_unregister().  Print a message error instead.

Submitted by: Nicolai Petri <nicolai@catpipe.net>
Reviewed by: imp
Approved by: re@ (jhb)

21 years agoMake the mutex static initializers look more like the one for
Mike Makonnen [Thu, 29 May 2003 20:58:31 +0000 (20:58 +0000)]
Make the mutex static initializers look more like the one for
condition variables. Cosmetic.

Explicitly compare against PTHREAD_MUTEX_INITIALIZER. We shouldn't
encourage calls to the mutex functions with null pointers to mutexes.

Approved by: re/jhb

21 years agoUse a static lock to ake sure pthread_cond_* functions called
Mike Makonnen [Thu, 29 May 2003 20:54:00 +0000 (20:54 +0000)]
Use a static lock to ake sure pthread_cond_* functions called
from multiple threads don't initialze the same condition variable
more than once.

Explicitly compare cond pointers with PTHREAD_COND_INITIALIZER instead
of NULL. Just because it happens to be defined as NULL is no reason
to encourage the idea that people can call those functions with
NULL pointers to a condition variable.

Approved by: re/jhb

21 years agoMissing unlock.
Mike Makonnen [Thu, 29 May 2003 20:49:17 +0000 (20:49 +0000)]
Missing unlock.

Approved by: re/jhb

21 years agoDon't hold the active thread list lock when signaling the gc thread.
Mike Makonnen [Thu, 29 May 2003 20:46:53 +0000 (20:46 +0000)]
Don't hold the active thread list lock when signaling the gc thread.
The dead list thread is sufficient for synchronization.

Retire the arch_id (ldt array slot) in the gc thread instead of the
doing it in the thread itself.

Approved by: re/jhb

21 years agoIt's unnecessary to lock the thread during creation. Simply extend
Mike Makonnen [Thu, 29 May 2003 20:40:50 +0000 (20:40 +0000)]
It's unnecessary to lock the thread during creation. Simply extend
the scope of the active thread list lock.

Approved by: re/jhb

21 years agoFix a problem introduced in the last commit. sa and cm
Martin Blapp [Thu, 29 May 2003 19:43:22 +0000 (19:43 +0000)]
Fix a problem introduced in the last commit. sa and cm
are not initialized at this place. Move the initializing
before the non-blocking check.

Submitted by: Marius Strobl <marius@alchemy.franken.de>
Reviewed by: jhb
Approved by: re

21 years agoAdd an INVARIENTS only check to make sure Giant is held if mbuf
David Malone [Thu, 29 May 2003 18:38:24 +0000 (18:38 +0000)]
Add an INVARIENTS only check to make sure Giant is held if mbuf
allocation is attempted with M_TRYWAIT.

Reviewed by: bmilekic
Approved by: re (scottl)

21 years agoGrab giant in sendit rather than kern_sendit because sockargs may
David Malone [Thu, 29 May 2003 18:36:26 +0000 (18:36 +0000)]
Grab giant in sendit rather than kern_sendit because sockargs may
allocate mbufs with M_TRYWAIT, which may require Giant.

Reviewed by: bmilekic
Approved by: re (scottl)

21 years agoCompletely disable interrupts (not just raise %pil) when calculating the
Thomas Moestl [Thu, 29 May 2003 17:49:21 +0000 (17:49 +0000)]
Completely disable interrupts (not just raise %pil) when calculating the
value to be written into tick_compare in tick_hardclock(). While
we were taking care that the value to be written was at least TICK_GRACE
ticks in the future, a vector interrupt could happen between calculating
the value and writing it. If it took longer than TICK_GRACE to complete
(which is doubtful for a single device-triggered vector interrupt, but
quite likely for some IPIs), the value written would be in the past
and tick interrupts (which drive hardclock and statclock) would stop
until %tick wraps around, which takes a long time.
Also, increase TICK_GRACE from 1000 to 10000 for good measure.

Reported by: kris
Reviewed by: jake
Approved by: re (scottl)

21 years agoDon't really spin on a spinlock; silently convert it to the same
Daniel Eischen [Thu, 29 May 2003 17:10:45 +0000 (17:10 +0000)]
Don't really spin on a spinlock; silently convert it to the same
low-level lock used by the libpthread implementation.  In the
future, we'll eliminate spinlocks from libc but that will wait
until after 5.1-release.

Don't call an application signal handler if the handler is
the same as the library-installed handler.  This seems to
be possible after a fork and is the cause of konsole hangs.

Approved by: re@ (jhb)

21 years agoThis commit was generated by cvs2svn to compensate for changes in r115379,
Martin Blapp [Thu, 29 May 2003 09:18:22 +0000 (09:18 +0000)]
This commit was generated by cvs2svn to compensate for changes in r115379,
which included commits to RCS files with non-trunk default branches.

21 years agoUse non-blocking mode for amd(8) too. The fix will be part
Martin Blapp [Thu, 29 May 2003 09:18:22 +0000 (09:18 +0000)]
Use non-blocking mode for amd(8) too. The fix will be part
of the next amd(8) snap.

Reviewed by: rwatson
Approved by: re
Obtained from: NetBSD

21 years agoMove the sysctls of the misalignment handler to where they belong
Marcel Moolenaar [Thu, 29 May 2003 06:30:36 +0000 (06:30 +0000)]
Move the sysctls of the misalignment handler to where they belong
and use OID_AUTO instead of fixed IDs.

Approved by: re@ (blanket)

21 years agoFix what I think is a cut-n-paste bug: use OID_AUTO for the
Marcel Moolenaar [Thu, 29 May 2003 05:09:15 +0000 (05:09 +0000)]
Fix what I think is a cut-n-paste bug: use OID_AUTO for the
print_usertrap sysctl instead of CPU_UNALIGNED_PRINT. The
latter is used already.

Approved by: re@ (blanket)

21 years agoMerge the following from the English version:
Hideyuki KURASHINA [Thu, 29 May 2003 00:10:11 +0000 (00:10 +0000)]
Merge the following from the English version:

1.155 -> 1.156 hardware/common/dev.sgml
1.572 -> 1.573 relnotes/common/new.sgml

Approved by: re (bmah)

21 years agoMerge the following from the English version:
Hiroki Sato [Wed, 28 May 2003 21:01:34 +0000 (21:01 +0000)]
Merge the following from the English version:

1.36  -> 1.38  errata/article.sgml
1.553 -> 1.572 relnotes/common/new.sgml

Approved by: re (bmah)

21 years ago- Fix to use the official vendor name (s/Melco/MELCO/).
Hiroki Sato [Wed, 28 May 2003 21:01:22 +0000 (21:01 +0000)]
- Fix to use the official vendor name (s/Melco/MELCO/).

hardware/common/dev.sgml

Pointed out by: rushani
Approved by: re (bmah)

- Fix a typo.

relnotes/common/new.sgml

Approved by: re (bmah)

21 years agoFix off-by-one and initialization errors which prevented sshd from
Dag-Erling Smørgrav [Wed, 28 May 2003 19:39:33 +0000 (19:39 +0000)]
Fix off-by-one and initialization errors which prevented sshd from
restarting when sent a SIGHUP.

Submitted by: tegge
Approved by: re (jhb)

21 years agoThis commit was generated by cvs2svn to compensate for changes in r115367,
Nate Lawson [Wed, 28 May 2003 17:32:31 +0000 (17:32 +0000)]
This commit was generated by cvs2svn to compensate for changes in r115367,
which included commits to RCS files with non-trunk default branches.

21 years agoRevert to using TABLE_ID_DSDT as the default. It looks like the dynamic
Nate Lawson [Wed, 28 May 2003 17:32:31 +0000 (17:32 +0000)]
Revert to using TABLE_ID_DSDT as the default.  It looks like the dynamic
ID allocation is not there yet.  This fixes a few warnings about \_OS_ not
being found and an S3 freeze for one user.
Re-staticize AcpiNsRemoveReference() since it is not needed elsewhere.

Approved by: re (scottl)

21 years agoIn cluster_wbuild(), initialise b_iocmd to BIO_WRITE before calling
Ian Dowse [Wed, 28 May 2003 13:22:10 +0000 (13:22 +0000)]
In cluster_wbuild(), initialise b_iocmd to BIO_WRITE before calling
buf_start() to avoid triggering a panic in softdep_disk_io_initiation()
if b_iocmd happened to be BIO_READ. The later initialisation of
b_iocmd in cluster_wbuild() could probably be moved to before the
buf_start() call, but this patch keeps the change as simple as
possible.

This is reported to fix occasional "softdep_disk_io_initiation: read"
panics, especially on NFS servers.

Reported by: Nick Hilliard <nick@netability.ie>
Tested by: Nick Hilliard <nick@netability.ie>
Approved by: re (rwatson)

21 years agoIf AF_LOCAL is used, we need to use __msgread_withcred() instead of
Martin Blapp [Wed, 28 May 2003 09:16:35 +0000 (09:16 +0000)]
If AF_LOCAL is used, we need to use __msgread_withcred() instead of
just read() in non-blocking mode too. The reason is obvious. NetBSD
uses a complete different way to get the credentials so this patch
only applies to FreeBSD.

Reviewed by: rwatson
Approved by: re

21 years agoFix amd(8) clients, if a FreeBSD mountd(8) server is used.
Martin Blapp [Wed, 28 May 2003 09:13:09 +0000 (09:13 +0000)]
Fix amd(8) clients, if a FreeBSD mountd(8) server is used.

Remove the special treatment of non-blocking mode in
the "look ahead function" xdrrec_eof(). It currently
assumes that the last read() in a row of several reads
does not have zero lenght. If this is the case, svc_vc_stat()
does return XPRT_MOREREQS, and the RPC-request aborts because
there is no data to read anymore.

To fix this, go back to the original version of the code
for non-blocking mode until NetBSD comes up with another
possible fix like this one in xdrrec_eof()

if (rstrm->last_frag && rstrm->in_finger == rstrm->in_boundry) {
return TRUE;
}

Return always FALSE in set_input_fragment() for non-blocking
mode. Since this was not used in FreeBSD, I omitted it at the
first time. Now we use this function and we should always
return FALSE for it.

Reviewed by: rwatson
Approved by: re

21 years agoFix stripping last path component when only one path component left.
Max Khon [Wed, 28 May 2003 08:23:01 +0000 (08:23 +0000)]
Fix stripping last path component when only one path component left.

PR: 52686
MFC after: 1 day

21 years agoFrom FSF Binutils CVS repo:
David E. O'Brien [Wed, 28 May 2003 03:32:33 +0000 (03:32 +0000)]
From FSF Binutils CVS repo:
2003-04-09  Richard Henderson  <rth@redhat.com>
* elf64-alpha.c (elf64_alpha_relocate_section) <R_ALPHA_GPREL32>:
Ignore relocations against r_symndx == 0.

Requested by: kris,re(scottl)

21 years agoReplace a handrolled defrag function with m_defrag. The handrolled
Mike Silbersack [Wed, 28 May 2003 02:04:33 +0000 (02:04 +0000)]
Replace a handrolled defrag function with m_defrag.  The handrolled
function couldn't handle chains of > MCLBYTES, and it had a bug which
caused corruption and panics in certain low mbuf situations.

Additionally, change the failure case so that looutput returns ENOBUFS
rather than attempting to pass on non-defragmented mbuf chains.

Finally, remove the printf which would happen every time the low memory
situation occured.  It served no useful purpose other than to clue me
in as to what was causing the panic in question. :)

MFC after: 4 days

21 years agoUpdate AMD Features vector to include NX (page table entry no-execute bit)
Peter Wemm [Tue, 27 May 2003 21:59:56 +0000 (21:59 +0000)]
Update AMD Features vector to include NX (page table entry no-execute bit)
and LM (long mode) etc.

21 years agoMinimize the potential for deadlocks between an exiting thread and it's
Mike Makonnen [Tue, 27 May 2003 21:48:42 +0000 (21:48 +0000)]
Minimize the potential for deadlocks between an exiting thread and it's
joiner by making sure all locks and unlocks occur in the same order. For
the record the lock order is: DEAD_LIST, THREAD_LIST, exiting thread, joiner
thread.

Approved by: re/rwatson

21 years agoRevert part of the last commit. I don't know what I was smoking.
Mike Makonnen [Tue, 27 May 2003 21:43:49 +0000 (21:43 +0000)]
Revert part of the last commit. I don't know what I was smoking.

Approved by: re/rwatson

21 years agoFix support for 256 MB aperture sizes on chipsets such as the 845 and
John Baldwin [Tue, 27 May 2003 20:13:44 +0000 (20:13 +0000)]
Fix support for 256 MB aperture sizes on chipsets such as the 845 and
865.  The APSIZE register has a variable-sized field of enabled bits.
To figure out how many bits a specific host bridge supports, write the
maximum width and see how many bits are set in the hardware.  We then
use this mask for setting and getting the aperture size.  Prior to this,
the agp(4) driver would treat an aperture size of 256 MB as 128 MB and
would not allocate enough physical memory for the GART as a result.

MFC after: 3 days
Sponsored by: The Weather Channel
Approved by: re (rwatson)

21 years agoGrr, fix compile. The bane of trying to split out patches into two
John Baldwin [Tue, 27 May 2003 19:42:18 +0000 (19:42 +0000)]
Grr, fix compile.  The bane of trying to split out patches into two
commits.

Reported by: Lukas Ertl <l.ertl@univie.ac.at>
With hat: re
Pointy hat to: jhb

21 years agoFix false AE_NOT_FOUND messages, reported in NetBSD port-i386/20897.
Nate Lawson [Tue, 27 May 2003 19:19:05 +0000 (19:19 +0000)]
Fix false AE_NOT_FOUND messages, reported in NetBSD port-i386/20897.
NetBSD dsmethod.c rev 1.7

Fix parent-child loop problem
Fix a reference count problem that may cause unexpected memory free
Intel 20030512 ACPICA drop (nsalloc.c)

Approved by: re (jhb)
Obtained from: NetBSD, Intel
Reported by: mbr, kochi AT netbsd.org

21 years agoThis commit was generated by cvs2svn to compensate for changes in r115351,
Nate Lawson [Tue, 27 May 2003 19:19:05 +0000 (19:19 +0000)]
This commit was generated by cvs2svn to compensate for changes in r115351,
which included commits to RCS files with non-trunk default branches.

21 years agoFix compile: the type is spelled bus_dmasync_op_t rather than
John Baldwin [Tue, 27 May 2003 18:32:24 +0000 (18:32 +0000)]
Fix compile: the type is spelled bus_dmasync_op_t rather than
bus_dmamap_sync_t.

With hat: re

21 years agoAdd support for the Intel 865 chipset.
John Baldwin [Tue, 27 May 2003 18:23:56 +0000 (18:23 +0000)]
Add support for the Intel 865 chipset.

MFC after: 3 days
Sponsored by: The Weather Channel
Approved by: re (murray)

21 years agoRemove the redundant declaration of bus_dmasync_op_t.
Scott Long [Tue, 27 May 2003 16:34:52 +0000 (16:34 +0000)]
Remove the redundant declaration of bus_dmasync_op_t.

21 years agoMFbed: Translation updates: Sync with the English 5.1 relnotes.
Alexander Langer [Tue, 27 May 2003 16:11:10 +0000 (16:11 +0000)]
MFbed: Translation updates: Sync with the English 5.1 relnotes.

Approved by: re (bmah)

21 years agoModified release note: Add missing word in rue(4) item.
Bruce A. Mah [Tue, 27 May 2003 15:43:59 +0000 (15:43 +0000)]
Modified release note:  Add missing word in rue(4) item.

Submitted by: murray
Approved by: re (implicitly)

21 years agoA flushrs must be the first in an instruction group.
Marcel Moolenaar [Tue, 27 May 2003 07:10:58 +0000 (07:10 +0000)]
A flushrs must be the first in an instruction group.

Approved by: re@ (blanket)

21 years agoBring back bus_dmasync_op_t. It is now a typedef to an int, though the
Scott Long [Tue, 27 May 2003 04:59:59 +0000 (04:59 +0000)]
Bring back bus_dmasync_op_t.  It is now a typedef to an int, though the
BUS_DMASYNC_ definitions remain as before.  The does not change the ABI,
and reverts the API to be a bit more compatible and flexible.  This has
survived a full 'make universe'.

Approved by: re (bmah)

21 years agoHave the unwinder allocate memory with M_NOWAIT. The unwinder is
Marcel Moolenaar [Tue, 27 May 2003 01:15:16 +0000 (01:15 +0000)]
Have the unwinder allocate memory with M_NOWAIT. The unwinder is
used by DDB and we cannot know in advance whether it's save to
sleep. It often enough isn't. We may want to pre-allocate space
to cover the most common cases without having to use malloc at
all, but that requires some analysis. We leave that for later.

Approved by: re@ (blanket)

21 years agoFix fu{byte|word*} and su{byte|word*}:
Marcel Moolenaar [Tue, 27 May 2003 01:00:12 +0000 (01:00 +0000)]
Fix fu{byte|word*} and su{byte|word*}:
o  If the address was not within user space we jumped to fusufault
   where we would clear pcb_onfault and return 0. There are two
   bugs here:
   1. We never got to the point where we assigned the address of
      pcb_onfault to r15, which means that we would clobber some
      random memory location, including I/O space or ROM.
   2. We're supposed to return -1 on error.
o  Make sure we have proper memory ordering for setting pcb_onfault,
   doing the memory access to user space and clearing pcb_onfault.
   For the fu* family of functions this means that we need a mf
   instruction, because we don't have acquire semantics on stores
   and release semantics on loads (hence st;ld cannot be ordered
   without intermediate mf).

While here, implement casuptr() so that we are a (small) step
closer to supporting libthr and deobfuscate the non-implementation
of {f|s}uswintr.

Approved by: re@ (blanket)

21 years agoRevision 1.99 of this file changed the allocation request from
Marcel Moolenaar [Mon, 26 May 2003 22:54:18 +0000 (22:54 +0000)]
Revision 1.99 of this file changed the allocation request from
VM_ALLOC_INTERRUPT to VM_ALLOC_SYSTEM. There was no mention of
this in commit log as it was considered harmless. Guess what:
it does harm. WITNESS showed that we can not safely grab the
page queue lock in vm_page_alloc() in all cases as we may have
to sleep on it. Revert the request to VM_ALLOC_INTERRUPT to
circumvent this. We panic if vm_page_alloc returns 0. I'm not
entirely happy about this, but we have bigger fish to fry.

Approved by: re@ (blanket)

21 years agoThis driver supports the 2920C not the 2920.
Justin T. Gibbs [Mon, 26 May 2003 21:45:09 +0000 (21:45 +0000)]
This driver supports the 2920C not the 2920.
Make this clear in our card identification string.

PR: kern/50428
Approved by: RE

21 years agoConsistently use #ifdef for testing AHC_TARGET_MODE.
Justin T. Gibbs [Mon, 26 May 2003 21:44:03 +0000 (21:44 +0000)]
Consistently use #ifdef for testing AHC_TARGET_MODE.

Approved by: RE

21 years agoaic79xx.c:
Justin T. Gibbs [Mon, 26 May 2003 21:43:29 +0000 (21:43 +0000)]
aic79xx.c:
aic79xx_osm.h:
aic7xxx_osm.h:
Explicitly define functions that take no arguments
with "(void)"

Approved by: RE

21 years agoCorrect/Simplify ignore wide residue message handling
Justin T. Gibbs [Mon, 26 May 2003 21:26:52 +0000 (21:26 +0000)]
Correct/Simplify ignore wide residue message handling

aic79xx.c:
In ahd_handle_ign_wide_residue():
o Use SCB_XFERLEN_ODD SCB field to determine transfer
  "oddness" rather than the DATA_COUNT_ODD logic.
  SCB_XFERLEN_ODD is toggled on every ignore wide
  residue message so that multiple ignore wide residue
  messages for the same transaction are properly supported.
o If the sg list has been exausted, the sequencer
  doesn't bother to update the residual data count
  since it is known to be zero.  Perform the zeroing
  manually before calculating the remaining data count.
o Use multibyte in/out macros instead of shifting/masking
  by hand.

aic79xx_inline.h:
In ahd_setup_scb_common(), setup the SCB_XFERLEN_ODD field.

aic79xx.reg:
Use the SCB_TASK_ATTRIBUTE field as a bit field in the
non-packetized case.  We currently only define one bit,
SCB_XFERLEN_ODD.

Remove the ODD_SEG bit field that was used to carry the odd
transfer length information through the SG cache.  This
is obviated by SCB_XFERLEN_ODD field.

Remove the DATA_COUNT_ODD scratch ram byte that was used
dynamicaly compute data transfer oddness.  This is obviated
by SCB_XFERLEN_ODD field.

aic79xx.seq:
Remove all updates to the DATA_COUNT_ODD scratch ram field.
Remove all uses of ODD_SEG.  These two save quite a few
sequencer instructions.

Use SCB_XFERLEN_ODD to validate the end of transfer
ignore wide residue message case.

21 years agoFIFOEMP can lag LAST_SEG_DONE in the Ultra2 and U160
Justin T. Gibbs [Mon, 26 May 2003 21:24:55 +0000 (21:24 +0000)]
FIFOEMP can lag LAST_SEG_DONE in the Ultra2 and U160
hardware.  Wait a few extra clocks for FIFOEMP to assert
before calling an overrun.

Approved by: RE

21 years agoCorrect/Simplify ignore wide residue message handling
Justin T. Gibbs [Mon, 26 May 2003 21:24:01 +0000 (21:24 +0000)]
Correct/Simplify ignore wide residue message handling

aic7xxx.c:
In ahc_handle_ign_wide_residue():
o Use SCB_XFERLEN_ODD SCB field to determine transfer
  "oddness" rather than the DATA_COUNT_ODD logic.
  SCB_XFERLEN_ODD is toggled on every ignore wide
  residue message so that multiple ignore wide residue
  messages for the same transaction are properly supported.
o If the sg list has been exausted, the sequencer
  doesn't bother to update the residual data count
  since it is known to be zero.  Perform the zeroing
  manually before calculating the remaining data count.
o Ensure that SG_LIST_NULL is cleared in the
  residual sg pointer for "mid-transfer" ignore
  wide residue cases.
o Use multibyte in/out macros instead of shifting/masking
  by hand.

aic7xxx.h:
Modify the SCB_GET_LUN() macro to mask the lun hardware
SCB field with LID.  This leaves two bits in the LUN
field that can be used for other purposes.

aic7xxx.reg:
Change LID to be 0x3F.  This is the maximum supported
lun size for non-packetized SCSI.  Map the top bit
of the lun to SCB_XFERLEN_ODD.  The host must set
this bit whenever a transfer is an odd length.

Remove the ODD_SEG bit field that was used to carry the odd
transfer length information through the SG cache.  This
is obviated by SCB_XFERLEN_ODD field.

Remove the DATA_COUNT_ODD scratch ram byte that was used
dynamicaly compute data transfer oddness.  This is obviated
by SCB_XFERLEN_ODD field.

aic7xxx.seq:
Be more careful in our handling of the SCB_LUN field.  It
must be masked with LID if only lun information is desired.

Remove all updates to the DATA_COUNT_ODD scratch ram field.
Remove all uses of ODD_SEG.  These two save quite a few
sequencer instructions.

Use SCB_XFERLEN_ODD to validate the end of transfer
ignore wide residue message case.

aic7xxx_inline.h:
In ahc_queue_scb(), setup the SCB_XFERLEN_ODD field.

Approved by: RE

21 years agoFix disabling of PCI parity error interrupts. We need to set
Justin T. Gibbs [Mon, 26 May 2003 21:20:47 +0000 (21:20 +0000)]
Fix disabling of PCI parity error interrupts.  We need to set
FAILDIS in the SEQCTL register, not the HCNTRL register.

aic7xxx.c:
Remeber SEQCTL settings in the "seqctl" field of our
softc.  seqctl defaults to just having FASTMODE set,
but the bus attachments can override this.

aic7xxx.h:
Add the seqctl softc field.

aic7xxx_pci.c:
Update the seqctl softc field and manually update SEQCTL
when to many PCI errors occur

Approved by: RE

21 years agoChange hadling of the Rev. A packetized lun output bug
Justin T. Gibbs [Mon, 26 May 2003 21:18:48 +0000 (21:18 +0000)]
Change hadling of the Rev. A packetized lun output bug
to be more efficient by having the sequencer copy the
single byte of valid lun data into the long lun field.

aic79xx.c:
Memset our hardware SCB to 0 so that untouched
fields don't confuse diagnostic output.  With the
old method for handling the Rev A bug, if the long
lun field was not 0, this could result in bogus
lun information being sent to drives.

Use the same SCB transfer size for all chip types
now that the long lun is not DMA'ed to the chip.

aic79xx.seq:
Add code to copy lun information for Rev.A hardware.

aic79xx_inline.h:
Remove host update of the long_lun field on every
packetized command.

21 years agoAdd 7901B support.
Justin T. Gibbs [Mon, 26 May 2003 21:15:52 +0000 (21:15 +0000)]
Add 7901B support.

Sort IDs based on chip type.

Remove IROC IDs.  We'll switch to using the IROC masks
if/when we want to start attaching to IROC controllers.

Approved by: RE

21 years agoFixup spelling of "coalesce" and derivatives.
Justin T. Gibbs [Mon, 26 May 2003 21:10:58 +0000 (21:10 +0000)]
Fixup spelling of "coalesce" and derivatives.

Approved by: RE

21 years agoRemove stray K&R style function definition.
Justin T. Gibbs [Mon, 26 May 2003 21:09:15 +0000 (21:09 +0000)]
Remove stray K&R style function definition.

Approved by: RE

21 years ago pkg_create incorrectly does not add trailing '\n' when it receives
Mario Sergio Fujikawa Ferreira [Mon, 26 May 2003 17:12:22 +0000 (17:12 +0000)]
 pkg_create incorrectly does not add trailing '\n' when it receives
either COMMENT or DESCR from the command line. When a port is
installed, one gets both +COMMENT and +DESCR files with a trailing
'\n' character. However, +COMMENT does not contain a trailing '\n'
when it is installed from a package due to this behavior of pkg_create.

 Therefore, make sure it behaves exactly the same regardless of
where got its information; either command line or files. The modified
functions are used by pkg_create.

PR: 52097
Reviewed by: bento, kris,
portmgr, re,
Michael Nottebrock <michaelnottebrock@gmx.net>,
Martin Horcicka <horcicka@FreeBSD.cz>
Approved by: re (scottl)
MFC after: 1 week

21 years agoAdd a trailing '\n' character if none is found in the information
Mario Sergio Fujikawa Ferreira [Mon, 26 May 2003 17:06:05 +0000 (17:06 +0000)]
Add a trailing '\n' character if none is found in the information
obtained from a package. Patch show_file() [1] and show_index() [2]
functions.

PR: 52097
Reviewed by: bento, kris,
portmgr, re,
Michael Nottebrock <michaelnottebrock@gmx.net>,
Martin Horcicka <horcicka@FreeBSD.cz>
Approved by: re (scottl)
Obtained from: NetBSD [1],
OpenBSD [2]
MFC after: 1 week

21 years agoFix two typos from the last commit
Scott Long [Mon, 26 May 2003 16:59:00 +0000 (16:59 +0000)]
Fix two typos from the last commit

21 years agoMerge the following from the English version:
Hideyuki KURASHINA [Mon, 26 May 2003 15:32:34 +0000 (15:32 +0000)]
Merge the following from the English version:

1.12  -> 1.15 early-adopter/article.sgml
1.143 -> 1.155 hardware/common/dev.sgml
1.5   -> 1.6 hardware/common/intro.sgml
1.9   -> 1.11 hardware/i386/proc-i386.sgml
1.2   -> 1.3 hardware/ia64/article.sgml
1.3   -> 1.7 hardware/ia64/proc-ia64.sgml
1.6   -> 1.7 share/sgml/release.dsl

Approved by: re (blanket)

21 years agoDe-orbit bus_dmamem_alloc_size from here too.
Scott Long [Mon, 26 May 2003 14:38:48 +0000 (14:38 +0000)]
De-orbit bus_dmamem_alloc_size from here too.

Pointed out by: des
Pointy hat to: me

21 years agoRemember to close the read end of the pipe.
Dag-Erling Smørgrav [Mon, 26 May 2003 12:12:45 +0000 (12:12 +0000)]
Remember to close the read end of the pipe.

21 years agoRemove uninitialized local variable in favor of global.
Matthew N. Dodd [Mon, 26 May 2003 04:58:26 +0000 (04:58 +0000)]
Remove uninitialized local variable in favor of global.

PR:  bin/52685
Submitted by:  Alexander Nedotsukov <bland@mail.ru>
Approved by:  re (scottl)

21 years agoDe-orbit bus_dmamem_alloc_size(). It's a hack and was never used anyways.
Scott Long [Mon, 26 May 2003 04:00:52 +0000 (04:00 +0000)]
De-orbit bus_dmamem_alloc_size().  It's a hack and was never used anyways.
No need for it to pollute the 5.x API any further.

Approved by: re (bmah)

21 years agoDecouple the thread stack [de]allocating functions from the 'dead threads list'
Mike Makonnen [Mon, 26 May 2003 00:37:07 +0000 (00:37 +0000)]
Decouple the thread stack [de]allocating functions from the 'dead threads list'
lock. It's not really necessary and we don't need the added complexity
or potential for deadlocks.

Approved by: re/blanket libthr

21 years agoRevise the unlock order in _pthread_join(). Also, if the joined
Mike Makonnen [Mon, 26 May 2003 00:28:49 +0000 (00:28 +0000)]
Revise the unlock order in _pthread_join(). Also, if the joined
thread is not dead, the join loop is guaranteed to execute at least
once, so there is no need to pick up the thread list lock after
we return from suspenstion only to release it after the loop.

Approved by: re/blanket libthr

21 years agoReturn gracefully, rather than aborting, when the maximum concurrent
Mike Makonnen [Sun, 25 May 2003 22:40:57 +0000 (22:40 +0000)]
Return gracefully, rather than aborting,  when the maximum concurrent
threads per process has been reached. Return EAGAIN, as per spec.

Approved by: re/blanket libthr

21 years agoCopy the va_list in sbuf_vprintf() before passing it to vsnprintf(),
Peter Wemm [Sun, 25 May 2003 19:03:08 +0000 (19:03 +0000)]
Copy the va_list in sbuf_vprintf() before passing it to vsnprintf(),
because we could fail due to a small buffer and loop and rerun.  If this
happens, then the vsnprintf() will have already taken the arguments off
the va_list.  For i386 and others, this doesn't matter because the
va_list type is a passed as a copy.  But on powerpc and amd64, this is
fatal because the va_list is a reference to an external structure that
keeps the vararg state due to the more complicated argument passing system.
On amd64, arguments can be passed as follows:
First 6 int/pointer type arguments go in registers, the rest go on
  the memory stack.
Float and double are similar, except using SSE registers.
long double (80 bit precision) are similar except using the x87 stack.
Where the 'next argument' comes from depends on how many have been
processed so far and what type it is.  For amd64, gcc keeps this state
somewhere that is referenced by the va_list.

I found a description that showed the va_copy was required here:
http://mirrors.ccs.neu.edu/cgi-bin/unixhelp/man-cgi?va_end+9
The single unix spec doesn't mention va_copy() at all.

Anyway, the problem was that the sysctl kern.geom.conf* nodes would panic
due to walking off the end of the va_arg lists in vsnprintf.  A better fix
would be to have sbuf_vprintf() use a single pass and call kvprintf()
with a callback function that stored the results and grew the buffer
as needed.

Approved by: re (scottl)

21 years ago - Create a new lock, umtx_lock, for use instead of the proc lock for
Jeff Roberson [Sun, 25 May 2003 18:18:32 +0000 (18:18 +0000)]
 - Create a new lock, umtx_lock, for use instead of the proc lock for
   protecting the umtx queues.  We can't use the proc lock because we need
   to hold the lock across calls to casuptr, which can fault.

Approved by: re

21 years agoDon't do silly thing if the disk_create() event gets canceled.
Poul-Henning Kamp [Sun, 25 May 2003 16:57:10 +0000 (16:57 +0000)]
Don't do silly thing if the disk_create() event gets canceled.

Approved by: re/scottl

21 years ago - Reset the free ent to NULL if we have consumed the last free entry. This
Jeff Roberson [Sun, 25 May 2003 08:48:42 +0000 (08:48 +0000)]
 - Reset the free ent to NULL if we have consumed the last free entry.  This
   fixes a problem where we would overwrite old data if we ran out of free
   entries.

Submitted by: sam
Approved by: re (scottl)

21 years ago_pthread_cancel() breaks the normal lock order of first locking the
Mike Makonnen [Sun, 25 May 2003 08:48:11 +0000 (08:48 +0000)]
_pthread_cancel() breaks the normal lock order of first locking the
joined and then the joiner thread. There isn't an easy (sane?) way
to make it use the correct order without introducing races involving
the target thread and finding which (active or dead) list it is on. So,
after locking the canceled thread it will try to lock the joined thread
and if it fails release the first lock and try again from the top.

Introduce a new function, _spintrylock, which is simply a wrapper arround
umtx_trylock(), to help accomplish this.

Approved by: re/blanket libthr

21 years agoPart of the last patch.
Mike Makonnen [Sun, 25 May 2003 08:35:37 +0000 (08:35 +0000)]
Part of the last patch.
Modify the thread creation and thread searching routine
to lock the thread lists with the new locks instead of GIANT_LOCK.

Approved by: re/blanket libthr

21 years agoStart locking up the active and dead threads lists. The active threads
Mike Makonnen [Sun, 25 May 2003 08:31:33 +0000 (08:31 +0000)]
Start locking up the active and dead threads lists. The active threads
list is protected by a spinlock_t, but the dead list uses a pthread_mutex
because it is necessary to synchronize other threads with the garbage
collector thread. Lock/Unlock macros are used so it's easier to make
changes to the locks in the future.

The 'dead thread list' lock is intended to replace the gc mutex.
This doesn't have any practical ramifications. It simply makes it
clearer what the purpose of the lock is. The gc will use this lock,
instead of the gc mutex, to synchronize access to the dead list with
other threads.

Modify _pthread_exit() to use these two new locks instead of GIANT_LOCK,
and also to properly lock and protect thread state changes,
especially with respect to a joining thread.

The gc thread was also re-arranged to be more organized and less nested.

_pthread_join() was also modified to use the thread list locks. However,
locking and unlocking here needs special care because a thread could find
itself in a position where it's joining an exiting thread that is
waiting on the dead list lock, which this thread (joiner) holds. If the
joiner doesn't take care to lock *and* unlock in the same order they
(the joiner and the joinee) could deadlock against each other.

Approved by: re/blanket libthr

21 years agoThe libthr code makes use of higher-level primitives (pthread_mutex_t and
Mike Makonnen [Sun, 25 May 2003 07:58:22 +0000 (07:58 +0000)]
The libthr code makes use of higher-level primitives (pthread_mutex_t and
pthread_cond_t) internaly in addition to the low-level spinlock_t. The
garbage collector mutex and condition variable are two such examples. This
might lead to critical sections nested within critical sections. Implement
a reference counting mechanism so that signals are masked only on the first
entry and unmasked on the last exit.

I'm not sure I like the idea of nested critical sections, but if
the library is going to use the pthread primitives it might be necessary.

Approved by: re/blanket libthr

21 years agoAdd a pretty cheesy hack to avoid a gcc-3.2.2 ICE (internal compiler
Peter Wemm [Sun, 25 May 2003 07:39:06 +0000 (07:39 +0000)]
Add a pretty cheesy hack to avoid a gcc-3.2.2 ICE (internal compiler
error) on amd64 when doing pointer subtraction.  This bug is already
fixed in gcc-3.3 (waiting for after the branch), and the hack will be
backed out at the first opportunity.  This is in the ipv6 code path.

Approved by:  re (scottl)

21 years agoThe struct mcontext has changed. It's using the register sets. Bring
Marcel Moolenaar [Sun, 25 May 2003 06:49:19 +0000 (06:49 +0000)]
The struct mcontext has changed. It's using the register sets. Bring
this in line.

21 years agoBeat vnode locking in the NFS server code into submission. This change
Don Lewis [Sun, 25 May 2003 06:17:33 +0000 (06:17 +0000)]
Beat vnode locking in the NFS server code into submission.  This change
is not pretty, but it fixes the code so that it no longer violates the
vnode locking rules in the VFS API and doesn't trip any of the locking
assertions enabled by the DEBUG_VFS_LOCKS kernel configuration option.
There is one report that this patch fixed a "locking against myself"
panic on an NFS server that was tripped by a diskless client.

Approved by: re (scottl)

21 years agoAlways set the hardware parse bit in the IPCB structure when this
Don Lewis [Sun, 25 May 2003 05:04:26 +0000 (05:04 +0000)]
Always set the hardware parse bit in the IPCB structure when this
structure, which is new to the 82550 and 82551, is used to transmit
a packet.  This appears to fix the packet truncation problem that was
observed when using 82550-based fxp cards to transmit ICMP or fragmented
UDP packets of certain lengths which only had one to three bytes in the
second and final mbuf of the packet.  This matches a note in the "Intel
8255x 10/100 Mbps Ethernet Controller Family Open Source Software Developer
Manual", which says that the hardware parse bit should be set when sending
these types of packets.

There have also been unconfirmed reports of similar problems when
transmitting TCP packets, which should not be affected by the above
mentioned change because the hardware parse bit was already being set
if the stack requested hardware checksumming of the packet.  If the
problem remains, the use of the IPCB structure can be disabled to
cause the driver to fall back to using the older 82559 interface with
82550-based cards by setting
        hint.fxp.UNIT_NUMBER.ipcbxmit_disable
to a non-zero value at boot time, or using kenv to set this variable
before using kldload to load the fxp driver.

Approved by: re (jhb)

21 years agoAdd textproc/opensp into $MINIMALDOCPORTS when openjade is used.
Jun Kuriyama [Sun, 25 May 2003 03:41:41 +0000 (03:41 +0000)]
Add textproc/opensp into $MINIMALDOCPORTS when openjade is used.

Reported by: scottl (by alpha building breakage)
Approved by: re (scottl)

21 years agoNow that we define user mode as any IP address that isn't in the
Marcel Moolenaar [Sun, 25 May 2003 01:01:28 +0000 (01:01 +0000)]
Now that we define user mode as any IP address that isn't in the
kernel's VA regions, we cannot limit the use of break-based
syscalls to user mode only. The signal trampolines are in the
gateway page, which is mapped into the process address space in
region 5 and thus is kernel space.

We don't special case the gateway page here. Allow break-based
syscalls from anywhere in the kernel VA space.

Approved by: re@ (blanket)

21 years agoIgnore the 'must allocate below 1MB' flag for the TPL_BAR_REG. It is
Warner Losh [Sat, 24 May 2003 23:23:41 +0000 (23:23 +0000)]
Ignore the 'must allocate below 1MB' flag for the TPL_BAR_REG.  It is
set on realtek cards, but they work without it (and don't work with
it).  The standard seems to imply that this is just a hint anyway, so
this should be harmless.  It doesn't appear to be set on any other
cardbus cards that I have (or have seen).

This should make the rl based CardBus cards work again.  I've been
running it for about a month now.

Approved by: re@ (jhb)