dfr [Thu, 19 May 2005 07:36:07 +0000 (07:36 +0000)]
Align the stack to a 16 byte boundary so that we can safely call functions
that use SSE. The compiler does attempt to do this in main() but not very
successfully - it still manages to use unaligned offsets from %ebp in some
cases. Also we need to have an aligned stack in case something uses SSE
via _init().
dfr [Thu, 19 May 2005 07:31:06 +0000 (07:31 +0000)]
Keep the stack aligned to a 16 byte boundary when calling init functions
so that we don't cause a bus error if they start storing SSE math stuff
on the stack.
grehan [Thu, 19 May 2005 07:21:46 +0000 (07:21 +0000)]
Change ofw_readin/ofw_copyin to map the entire region before
copying, rather than a page at a time. This was creating far
too many single-page mappings, and eventually OFW overflowed
some internal data structure and refused to map any more.
The new algorithm creates far less mappings and fixed a bug
where multiple mappings for the same page would be created.
'Twas known this was a problem, but only became urgent when the
install CD's mfs_root grew large enough to cause the overflow.
wpaul [Thu, 19 May 2005 04:44:26 +0000 (04:44 +0000)]
Fix some of the things I broke so that the SMC2602W (AMD Am1772) driver
works again.
This driver uses NdisScheduleWorkItem(), and we have to take special steps
to insure that its workitems don't collide with any of the other workitems
used by the NDISulator. In particular, if one of the driver's work jobs
blocks, it can prevent NdisMAllocateSharedMemoryAsync() from completing
when expected.
The original hack to fix this was to have NdisMAllocateSharedMemoryAsync()
defer its work to the DPC queue instead of the general task queue. To
fix it now, I decided to add some additional workitem threads. (There's
supposed to be a pool of worker threads in Windows anyway.) Currently,
there are 4. There should be at least 2. One is reserved for the legacy
ExQueueWorkItem() API, while the others are used in round-robin by the
IoQueueWorkItem() API. NdisMAllocateSharedMemoryAsync() uses the latter
API while NdisScheduleWorkItem() uses the former, so the deadlock is
avoided.
Fixed NdisMRegisterDevice()/NdisMDeregisterDevice() to work a little
more sensibly with the new driver_object/device_object framework. It
doesn't really register a working user-mode interface, but the existing
code was completely wrong for the new framework.
Fixed a couple of bugs dealing with the cancellation of events and
DPCs. When cancelling an event that's still on the timer queue (i.e.
hasn't expired yet), reset dh_inserted in its dispatch header to FALSE.
Previously, it was left set to TRUE, which would make a cancelled
timer appear to have not been cancelled. Also, when removing a DPC
from a queue, reset its list pointers, otherwise a cancelled DPC
might mistakenly be treated as still pending.
Lastly, fix the behavior of ntoskrnl_wakeup() when dealing with
objects that have nobody waiting on them: sync event objects get
their signalled state reset to FALSE, but notification objects
should still be set to TRUE.
ups [Thu, 19 May 2005 01:08:30 +0000 (01:08 +0000)]
Fix a bug that caused preemption to happen for a thread in the same
ksegrp with the same priority as the currently running thread.
This can cause propagate_priority() to panic.
emax [Wed, 18 May 2005 23:03:44 +0000 (23:03 +0000)]
Fix problem with session termination. bthidd(8) maintains two L2CAP
connections to Bluetooth HID device. As soon as Bluetooth HID device
is powered off (or goes out of RF range) the stack will terminate both
connections. File descriptors for both connections will become active
on next select(2) call. Because bthidd(8) processes file descriptors
in order, it will detect descriptor for one of the closed connections
first and kill the session. However, there is still a second (active)
descriptor that used to point to the same session. bthidd(8) used to
assert() if it cant find session by file descriptor, which was wrong.
While I'm here fix a couple of typos in parser.y
Reported by: Eric Anderson anderson AT centtech DOT com
MFC after: 3 days
mckusick [Wed, 18 May 2005 22:18:21 +0000 (22:18 +0000)]
Allow removal of empty directories with high link counts. These can
occur on a filesystem running with soft updates after a crash and
before a background fsck has been run. To prevent discrepancies
from arising in a background fsck that may already be running,
the directory is removed but its inode is not freed and is left
with the residual reference count. When encountered by the
background fsck it will be reclaimed.
keramida [Wed, 18 May 2005 17:08:15 +0000 (17:08 +0000)]
The correct copyright notice for manpages that copy material from Open
Group's documentation is `/usr/share/examples/mdoc/POSIX-copyright',
not the one I copied from `/usr/share/examples/etc/bsd-copyright'.
Suggested by: simon
2nd pointy hat of the day: yours truly
which should be ok, since Daniel Eischen had mailed me about Open
Group manpages and the fact that they have granted permission to
FreeBSD to use their material. Any differences from the OG text are
my changes to the original manpage text submitted by Alex Vasylenko:
- In an effort to clean up the part that describes hooks and their
calling order, I used a list instead of a single paragraph for all the three
types of fork() hooks.
- After a short discussion with Dima Dorfman a long long time ago in a
far away galaxy, I changed the RETURN VALUES section to look more
like the rest of the pthread_xxx.3 manpages.
PR: docs/68201
Submitted by: Alex Vasylenko <lxv@omut.org>
harti [Wed, 18 May 2005 14:50:35 +0000 (14:50 +0000)]
Get rid of global variables for argument vectors produced by brk_string()
introduce a struct that holds all the information about an argument
vector and pass that around.
Author: Max Okumoto <okumoto@ucsd.edu>
Obtained from: DragonFlyBSD
keramida [Wed, 18 May 2005 13:48:33 +0000 (13:48 +0000)]
Properly trim the header line too, to fix wrap-around problems that
have been noticed by running top(1) in terminals that are too narrow
(or on systems with usernames that were too long, pushing everything
too far to the right).
Note that this does *not* solve the wrap-around problem of the system
statistics, which is an entirely different matter :-/
Tested on: i386, sparc64 (panther), amd64 (sledge)
Approved by: davidxu (in principle)
keramida [Wed, 18 May 2005 13:42:51 +0000 (13:42 +0000)]
(1) Revert unnecessary indentation changes I committed as part of the
last version and (2) remove a disabled debugging fprintf() that I
accidentally committed here.
keramida [Wed, 18 May 2005 13:30:08 +0000 (13:30 +0000)]
Merge the CPU and WCPU columns in a single %6.2f column, add a new 'C'
command that toggles between the two and update the ORDER_PCTCPU()
macro to sort correctly by the visible "cpu" value.
This saves 6 more columns in 80-column terminals, making things a lot
better for the COMMAND column.
Tested on: i386, sparc64 (panther), amd64 (sledge)
Approved by: davidxu (in principle)
harti [Wed, 18 May 2005 06:50:39 +0000 (06:50 +0000)]
Get rid of the ReturnStatus obscuration that was anyway used only
in two places. While here don't bother returning anything from
Lst_Replace - nobody ever checks the return code.
kan [Wed, 18 May 2005 05:24:08 +0000 (05:24 +0000)]
Unbreak r1.11 by delhij. Blind change from unsigned to signed char
pointer causes problems with sign extension and leads to compress(1)
dumping core on any non-trivial incoming data.
keramida [Tue, 17 May 2005 17:52:27 +0000 (17:52 +0000)]
Add manpages for devfs.conf and devfs.rules. These have been
initially written by Roland, but hacked for a while by me. Any
good parts are the results of Roland's hard work. Any typos or
style mistakes are mine.
Submitted by: Roland Smith <rsmith@xs4all.nl>
PR: docs/63808, docs/75433, docs/80458, docs/80459
MFC after: 2 weeks
le [Tue, 17 May 2005 16:38:30 +0000 (16:38 +0000)]
When a drive dies, don't call g_wither_geom() directly, but instead
post an event to the geom event queue that will take care of it,
letting outstanding bios finish, and closing the consumers.
ru [Tue, 17 May 2005 14:54:33 +0000 (14:54 +0000)]
Add temporary patches to make one-true-awk respect locale's collating order
in [a-z] bracket expressions, until a more complete fix (like handing BREs)
is ready.
glebius [Tue, 17 May 2005 12:18:13 +0000 (12:18 +0000)]
- Unwind NG_SEND_MSG_PATH() macro and merge it with already unwinded
version under TRACE_MESSAGES.
- Pass NG_WAITOK flag to ng_package_data() in unwinded macro.
des [Tue, 17 May 2005 11:14:11 +0000 (11:14 +0000)]
Add a zless script which invokes less using the lesspipe script. This is
similar to the zmore script that comes with gzip (and in fact, in most
Linux distros, zless is a symlink to that very same zmore script) but has
the advantage that you get the correct file name on the less status line,
and can use :n and :p to navigate back and forth between multiple files.
mikeh [Tue, 17 May 2005 03:11:29 +0000 (03:11 +0000)]
Import latest NetBSD version...changes:
* Whitespace and gcc 4.x fixes.
* Fix deallocation bug in fetch.c.
* Implement timeouts for accept(2) and connect(2),
which accept timeout values with '-q quittime'.
(intended to help with active mode through firewalls)
* Fix bin/77158 by Ryoji Kanai <rkanai@eeye.com>.
glebius [Mon, 16 May 2005 18:50:26 +0000 (18:50 +0000)]
- Fix build with TRACE_MESSAGES on.
- Reformat code under TRACE_MESSAGES to make it more readable.
- Move linker hackery out of #ifdef.
- Break long lines in linker hackery block.
obrien [Mon, 16 May 2005 18:17:38 +0000 (18:17 +0000)]
Hardcode username to 8 characters. This makes top(1) output sane when
there are users on the system (even if not running a single process)
with a login > 8 chars.
I'm not all that happy limiting the username width like this, but it
restores sanity to top(1) output.
glebius [Mon, 16 May 2005 17:07:03 +0000 (17:07 +0000)]
- Extend interface of ng_getqblk(), so that malloc wait flags are
specified by caller.
- Change ng_send_item() interface - use 'flags' argument instead of
boolean 'queue'.
- Extend ng_send_fn(), ng_package_data() and ng_package_msg()
interface - add possibility to pass flags. Rename ng_send_fn() to
ng_send_fn1(). Create macro for ng_send_fn().
- Update all macros, that use ng_package_data() and ng_package_msg().
wpaul [Mon, 16 May 2005 15:29:21 +0000 (15:29 +0000)]
Correct some problems with workitem usage. NdisScheduleWorkItem() does
not use exactly the same workitem sturcture as ExQueueWorkItem() like
I originally thought it did.
sos [Mon, 16 May 2005 13:07:27 +0000 (13:07 +0000)]
Change the way ioctls are issue to ATA.
The most prominent part is that its now possible to issue ata_requests
directly to say acd0, instead of going through the cumbersome /dev/ata
device.
imp [Mon, 16 May 2005 05:37:32 +0000 (05:37 +0000)]
cleanup a danging reference to cleaning up /etc/fstab. Since we don't
support 4->6 upgrades, this is moot. Most 4.x installations even,
have things compatible with 5 at thsi point, but some don't, so I'll
leave it in the branch...
gad [Mon, 16 May 2005 04:32:41 +0000 (04:32 +0000)]
A second attempt to adjust option-parsing on a shell command, for the
benefit of scripts start out as: #!/bin/sh -- # -*- perl -*-
With this fix in place, we can commit a change to kern/imgact_shell.c
so FreeBSD will process the `#!' line in shell-scripts in a more
standard fashion.
ume [Sun, 15 May 2005 20:15:15 +0000 (20:15 +0000)]
- The ai_addrlen of a struct addrinfo used to be a size_t, per
RFC 2553. In XNS5.2, and subsequently in POSIX-2001 and RFC
3493, it was changed to a socklen_t. And, the n_net of a
struct netent used to be an unsigned long integer. In XNS5,
and subsequently in POSIX-2001, it was changed to an uint32_t.
To accomodate for this while preserving ABI compatibility with
the old interface, we need to prepend or append 32 bits of
padding, depending on the (LP64) architecture's endianness.
- Correct 1st argument of getnetbyaddr() to uint32_t on 32
bit arch. Stay as is on 64 bit arch for ABI backward
compatibility for now.