Gordon Tetlow [Sun, 29 Jun 2003 18:16:26 +0000 (18:16 +0000)]
Add ${CRUNCH_CFLAGS} support for adding compile options to crunch
components. This is generally considered a non-optimal solution but
it gets the job done for the /rescue case.
Gordon Tetlow [Sun, 29 Jun 2003 17:53:48 +0000 (17:53 +0000)]
Convert fsck and mount to using execvP to find fsck_foo and mount_foo.
This simplifies the code path and makes the default path easy to override
in the /rescue case.
Gordon Tetlow [Sun, 29 Jun 2003 17:33:34 +0000 (17:33 +0000)]
Add a libc function execvP that takes the search path as an arguement.
Change execvp to be a wrapper around execvP. This is necessary for some
of the /rescue pieces. It may also be more generally applicable as well.
Submitted by: Tim Kientzle <kientzle@acm.org>
Approved by: Silence on arch@
Bill Paul [Sun, 29 Jun 2003 17:33:33 +0000 (17:33 +0000)]
In order to set the MAC address on RealTek NICs, you must flip WRITECFG
bit in the EEPROM mode register on. Also, the address must be written
in two 32-bit register accesses instead of 6 8-bit accesses.
Tested with my 8139B cardbus NIC.
PR: kern/35900
Submitted by: Mark Kettenis <kettenis@chello.nl>
John Polstra [Sun, 29 Jun 2003 15:55:44 +0000 (15:55 +0000)]
Make _thread_suspend work with both the old broken sigtimedwait
implementation and the new improved one. We now precompute the
signal set passed to sigtimedwait, using an inverted set when
necessary for compatibility with older kernels.
John Polstra [Sun, 29 Jun 2003 15:51:38 +0000 (15:51 +0000)]
Bump __FreeBSD_version because the semantics of sigtimedwait and
sigwaitinfo have been corrected. Some existing code relied on the
original broken semantics.
Alan Cox [Sun, 29 Jun 2003 06:10:32 +0000 (06:10 +0000)]
- Remove the calls to pmap_install() from pmap_object_init_pt(); they are
redundant. Discussed with: marcel
- MFi386: Add vm object locking to pmap_object_init_pt().
Mike Makonnen [Sun, 29 Jun 2003 05:34:41 +0000 (05:34 +0000)]
Implement individual operations on static and dhcp interfaces. Previously
network interfaces could only be turned on and off as a group (all
static interfaces or all dhcp interfaces).
When used to start the interface a 'long form' ifconfig output is
used to show the status of the interface, but when stopping an interface
the script will simply output the name of the interface. This is simply my
personal preference. Hopefully as this functionality matures we can
stabilize on a prefered form of output for these scripts.
A stop command to the dhclient script now explicitly releases the dhcp lease.
Behaviour at system shutdown; however, is unchanged since dhclient is not,
by default, run at that time. The client will not release its lease
at shutdown.
Mike Makonnen [Sun, 29 Jun 2003 05:15:57 +0000 (05:15 +0000)]
o Hookup rc.d/routing and rc.d/netoptions
o Ensure rc.d/network2 and rc.d/network3 are not automatically run
during boot
o Modify script headers so rcorder(8) can put the two scripts in the
correct sequence.
Mike Makonnen [Sun, 29 Jun 2003 05:09:48 +0000 (05:09 +0000)]
o Repocopied routing and netoptions from network2 and network3, respectively.
o Change the provider names.
o Separate routing into two parts: static routing and routing options. The
start command will run both parts, but they can be run separately using
the static and options command, respectively:
(/etc/rc.d/routing static; /etc/rc.d/routing options)
Tim J. Robbins [Sun, 29 Jun 2003 03:05:59 +0000 (03:05 +0000)]
XXX Copy workaround from UFS: open device for write access even if
the user requests a read-only mount. This is necessary because we
don't do the VOP_OPEN again if they upgrade a read-only mount to
read-write.
Fixes lockup when creating files on msdosfs mounts that have been
mounted read-only then upgraded to read-write. The exact cause of
the lockup is not known, but it is likely to be the kernel getting
stuck in an infinite loop trying to write dirty buffers to a device
without write permission.
Bill Paul [Sun, 29 Jun 2003 01:38:57 +0000 (01:38 +0000)]
Modify the xl_reset() routine slightly so that, if we're using memory
mapped I/O mode, we pause for .1 seconds after issuing the reset command
before trying to poll the 'command busy' bit in the status register.
With my 3c575C cardbus NIC, my Sony Picturebook locks up when it tries
to read the status register immediately after the reset. This appears
to be a problem only with certain NICs on certain hardware, but the
added delay should not hurt cards that already work.
This bug seems to have been brought to light by the fact that the xl
driver now defaults to memory mapped I/O mode instead of programmed
I/O mode like it used to. With PIO mode, the delay isn't needed and
everything works (which is why this NIC worked with 5.0-RELEASE but
not 5.1). I suspect that what's happening is that when the chip is
reset, it takes a little while for the memory-mapped decoding logic
to recover. Trying to access the chip's registers during this period
causes an error condition of some kind that wedges the system.
Mike Makonnen [Sun, 29 Jun 2003 00:12:40 +0000 (00:12 +0000)]
The move to _retire() a thread in the GC instead of in the thread's
exit function has invalidated the need for _spin[un]lock_pthread().
The _spin[un]lock() functions can now dereference curthread without
the danger that the ldtentry containing the pointer to the thread
has been cleared out from under them.
Thomas Moestl [Sat, 28 Jun 2003 21:52:16 +0000 (21:52 +0000)]
Small fixes for the IOMMU code:
1.) Handle maximum segment sizes which are smaller than the IOMMU page
size by splitting up pages across multiple segments if needed; this case
was previously unimplemented, and would cause panics.
2.) KASSERT that the physical address is in range; remove a KASSERT that
has become pointless.
3.) Add a comment describing what remains to be fixed in the IOMMU code;
I plan to address these issues soon.
Marcel Moolenaar [Sat, 28 Jun 2003 19:45:15 +0000 (19:45 +0000)]
Don't use fuword() and suword() on struct members of type int. This
happens to work on 32-bit platforms as sizeof(long)=sizeof(int), but
wrecks all kinds of havoc (garbage reads, corrupting writes and
misaligned loads/stores) on 64-bit architectures.
The fix for now is to use fuword32() and suword32() and change the
type of the applicable int fields to int32. This is to make it
explicit that we depend on these fields being 32-bit. We may want
to revisit this later.
Marcel Moolenaar [Sat, 28 Jun 2003 19:32:07 +0000 (19:32 +0000)]
Don't map LINUX_POSIX_VDISABLE to _POSIX_VDISABLE and vice versa for
the VMIN and VTIME members of the c_cc array. These members are not
special control characters. By not excluding these members we
changed the noncanonical mode input processing when both members
were 0 on entry (=LINUX_POSIX_VDISABLE) as we would remap them to 255
(=_POSIX_VDISABLE). See termios(4) case A for how that screws up
your terminal I/O.
PR: 23173
Originator: Bjarne Blichfeldt <bbl@dk.damgaard.com>
Patch by: Boris Nikolaus <bn@dali.tellique.de> (original submission)
Philipp Mergenthaler <philipp.mergenthaler@stud.uni-karlsruhe.de>
Reminders by: Joseph Holland King <gte743n@cad.gatech.edu>
MFC after: 5 days
Fix several problems related to resume:
- Initialize fc->status to process bus reset correctly after resume.
- Initialize AT ring buffer pointer.
- Requeue stdma to stfree for active IR buffer.
- Stop DMA before suspend for safe.
- Set powerstate after resume.
David Xu [Sat, 28 Jun 2003 09:55:02 +0000 (09:55 +0000)]
o Use a daemon thread to monitor signal events in kernel, if pending
signals were changed in kernel, it will retrieve the pending set and
try to find a thread to dispatch the signal. The dispatching process
can be rolled back if the signal is no longer in kernel.
o Create two functions _thr_signal_init() and _thr_signal_deinit(),
all signal action settings are retrieved from kernel when threading
mode is turned on, after a fork(), child process will reset them to
user settings by calling _thr_signal_deinit(). when threading mode
is not turned on, all signal operations are direct past to kernel.
o When a thread generated a synchoronous signals and its context returned
from completed list, UTS will retrieve the signal from its mailbox and try
to deliver the signal to thread.
o Context signal mask is now only used when delivering signals, thread's
current signal mask is always the one in pthread structure.
o Remove have_signals field in pthread structure, replace it with
psf_valid in pthread_signal_frame. when psf_valid is true, in context
switch time, thread will backout itself from some mutex/condition
internal queues, then begin to process signals. when a thread is not
at blocked state and running, check_pending indicates there are signals
for the thread, after preempted and then resumed time, UTS will try to
deliver signals to the thread.
o At signal delivering time, not only pending signals in thread will be
scanned, process's pending signals will be scanned too.
o Change sigwait code a bit, remove field sigwait in pthread_wait_data,
replace it with oldsigmask in pthread structure, when a thread calls
sigwait(), its current signal mask is backuped to oldsigmask, and waitset
is copied to its signal mask and when the thread gets a signal in the
waitset range, its current signal mask is restored from oldsigmask,
these are done in atomic fashion.
o Two additional POSIX APIs are implemented, sigwaitinfo() and sigtimedwait().
o Signal code locking is better than previous, there is fewer race conditions.
o Temporary disable most of code in _kse_single_thread as it is not safe
after fork().
David Xu [Sat, 28 Jun 2003 09:47:22 +0000 (09:47 +0000)]
Temporary disable rwlock based code, replace it with low level KSE locking
code until rtld-elf and libkse can cooperate better, those code can be
restored.
David Xu [Sat, 28 Jun 2003 09:39:35 +0000 (09:39 +0000)]
if thread is exiting, just returns. kse_thr_interrupt interface
was changed, it needs signal parameter, pass -1 to it, it indicates to
interrupt syscall.
Marcel Moolenaar [Sat, 28 Jun 2003 09:22:25 +0000 (09:22 +0000)]
Implement cpu_set_upcall_kse(). Elementary testing shows that this
function behaves correctly in principle, but is not expected to be
100% complete. In any case, with this commit we have KSE ported
enough to start runtime testing with threaded applications and fix
whatever bugs or omissions we encounter. Yay!
David Schultz [Sat, 28 Jun 2003 09:03:25 +0000 (09:03 +0000)]
Update to reflect changes in vfscanf.c,v 1.32. Remove bogus
documentation for %a, and document it correctly instead.
s/one of aefg/one of a, e, f, or g/
David Schultz [Sat, 28 Jun 2003 09:03:05 +0000 (09:03 +0000)]
Revamp scanf's floating-point-parsing algorithm to support
[+|-]Inf, [+|-]NaN, nan(...), and hexidecimal FP constants.
While here, add %a and %A, which are aliases for %e, and
add support for long doubles.
David Xu [Sat, 28 Jun 2003 08:29:05 +0000 (08:29 +0000)]
o Change kse_thr_interrupt to allow send a signal to a specified thread,
or unblock a thread in kernel, and allow UTS to specify whether syscall
should be restarted.
o Add ability for UTS to monitor signal comes in and removed from process,
the flag PS_SIGEVENT is used to indicate the events.
o Add a KMF_WAITSIGEVENT for KSE mailbox flag, UTS call kse_release with
this flag set to wait for above signal event.
o For SA based thread, kernel masks all signal in its signal mask, let
UTS to use kse_thr_interrupt interrupt a thread, and install a signal
frame in userland for the thread.
o Add a tm_syncsig in thread mailbox, when a hardware trap occurs,
it is used to deliver synchronous signal to userland, and upcall
is schedule, so UTS can process the synchronous signal for the thread.
David Xu [Sat, 28 Jun 2003 08:03:28 +0000 (08:03 +0000)]
Fix POSIX compatible bug for sigwaitinfo and sigtimedwait.
POSIX says siginfo pointer parameter can be NULL and if the
function success, it should return signal number but not zero.
The waitset it past should be negatived before it can be
used as thread signal mask.
Alan Cox [Sat, 28 Jun 2003 07:58:10 +0000 (07:58 +0000)]
- Use an int rather than a vm_pindex_t to represent the desired page
color in vm_page_alloc(). (This also has small performance benefits.)
- Eliminate vm_page_select_free(); vm_page_alloc() might as well
call vm_pageq_find() directly.
David Xu [Sat, 28 Jun 2003 06:34:08 +0000 (06:34 +0000)]
Add a machine depended function thread_siginfo, SA signal code
will use the function to construct a siginfo structure and use
the result to export to userland.
Sam Leffler [Sat, 28 Jun 2003 06:22:23 +0000 (06:22 +0000)]
o update for new 802.11 support
o relax some error handling so other drivers (e.g. ath) are usable
o revert ap scanning logic to old scheme
o add to capability info printing for 11a and 11g
Jeff Roberson [Sat, 28 Jun 2003 06:19:56 +0000 (06:19 +0000)]
- Throttle the inherited sleep and run time in sched_fork_kseg(). This
allows us to learn the behavior of a thread much more quickly after it
starts up.
Scott Long [Sat, 28 Jun 2003 06:07:06 +0000 (06:07 +0000)]
Catch amd64 up with the pending busdma async callback locking. Though this
mechanism might change in the near future, it's best to keep everything in
sync right now.
Jeff Roberson [Sat, 28 Jun 2003 06:04:47 +0000 (06:04 +0000)]
- Adjust the default maximum slice value to ~140ms. This has improved the
nice distribution without significantly impacting interactive response.
As a side effect it should also allow batch processes to run for a
slightly longer period which will positively impact their performance.
Scott Long [Sat, 28 Jun 2003 05:45:55 +0000 (05:45 +0000)]
Add 'umct', a driver for MCT Corp. and Belkin F5U109 USB-Serial adapters.
This is based on the ubsa driver by Alexander Kabaev along with documentation
gleaned from the Linux mct_u232 driver. I've had this driver sitting in my
tree for almost 6 months, and several others have found it useful.
Justin T. Gibbs [Sat, 28 Jun 2003 04:46:54 +0000 (04:46 +0000)]
Fix a race condition in the flushing of commands that
have completed across the bus but not to the host before
processing of an exception condition (busfree, bus reset,
etc.). When flushing the controller of completed commands,
we also look for packetized commands that have completed
with good status and are stored in the "good status fifo".
The hardware will post to the good status fifo even if
data for that command is still active in a FIFO. In
one particular failure case, a command outstanding on the
bus reconnected, transferred data into a FIFO, and provided
good status while the host driver was processing an expected
busfree event (PPR message negotiation). This resulted in
an entry in the good status fifo that we completed, but
since the sequencer was paused, the data in the data FIFO
for this command had never been transferred to the host.
Once the busfree processing was complete, the sequencer
was unpaused, and the data completed its transfer to the
host. In some instances, the client for the data was notified
of the completion and attempted to view the data before
it arrived. This case only occurred during FreeBSD's
multi-target probe of the SCSI bus while some devices are
negotiating to go packetized and some devices are already
running in packetized.
The fix is to run and FIFOs active with a context in the
good status fifo to completion before completing the command
to the SCSI layer. This requies duplicating the FIFO rundown
operations in the host driver that would usually be handled
by the firmware, but there is no other alternative.
Don't blindly shutdown the SCB dma engine when restarting
the sequencer. We may be killing an operation that is
not supposed to be cancelled. The cases where we need to
shutdown these dma engines are already handled elsewhere in
the driver.
Fix a few more ahd_in?() -> ahd_in?_scbram() instances.
Justin T. Gibbs [Sat, 28 Jun 2003 04:45:25 +0000 (04:45 +0000)]
aic79xx.h:
Add softc flag to indicate that we have seen at
least one selection since the last bus reset or
SE/LVD bus change.
aic79xx.c:
Fix a few style nits.
In ahd_update_pending_scbs(), only touch card registers
once we have found an SCB that needs to be updated.
This removes lots of clutter from PCI traces taken of
error recovery performed by the driver.
Short circuit the first selection iocell workaround handler
if we've run once since the last bus reset or iocell change.
This also removes clutter from PCI traces.
Note if completions are pending in the qoutfifo when we dump
card state.
Justin T. Gibbs [Sat, 28 Jun 2003 04:42:11 +0000 (04:42 +0000)]
Correct a typo in a comment.
Add a comment in ahd_clear_critical_sections() about
our need to leave ENBUSFREE set in SIMODE1 while single
stepping.
Re-arrange some delay loops so that we always perform
a read after any register write and before the delay.
This should make the delay loop more accurate.
When completing message processing for a packetized
commention, return the controller to a state where
invalid non-packetized phases will still cause protocol
violations. These are the same operations as those
performed in the clear_target_state routine in the
firmware.
Now that we have a chip with working ABORTPENDING
support (the 7901B), comment out the automatic use
of this feature until we can adequately test it.
The previous checkin updated the bug mask for the
7901B so this code was exercised.
When resetting the bus, perform an ahd_flush_device_writes()
call so that our reset assertion delay is acurately
timed from when the reset bit is written to the controller.
Justin T. Gibbs [Sat, 28 Jun 2003 04:40:46 +0000 (04:40 +0000)]
aic79xx.seq:
Remove an old comment that no longer applies.
Fix a jump in our unexpected non-packetized phase
handler to use an explicit lable. The old code
had a hardcoded jump offset that was off by one
instruction.
Justin T. Gibbs [Sat, 28 Jun 2003 04:39:49 +0000 (04:39 +0000)]
aic79xx.h:
Add a 7901A specific feature definition.
aic79xx_pci.c:
Split out the general aic790X setup into it's own
setup handler that works on single and dual controllers.
Adjust all other PCI setup handlers to initialize the
chips basic features and type before calling the generic
handler.
Turn off a few Rev B workarounds that are not required
on the 7901B.
Peter Wemm [Fri, 27 Jun 2003 23:10:58 +0000 (23:10 +0000)]
Fix pointer/int warnings so this compiles on amd64. The driver wants
to store an int in the bio->bio_driver1 (a void *). It is big enough,
but you have to match the int sizes first before doing the cast.