Peter Wemm [Sun, 21 Mar 2004 01:39:01 +0000 (01:39 +0000)]
Adjust stack alignment so that when the 'call xxx' functions are
gathered into the middle of the _init and _fini sections, they get
executed with their expected stack alignment.
Peter Wemm [Sun, 21 Mar 2004 01:21:26 +0000 (01:21 +0000)]
Add initial support for compiling a special 32 bit version of
ld-elf.so.1 on 64 bit systems. Most of this involves using alternate
paths, environment variables and diagnostic messages.
Bill Paul [Sat, 20 Mar 2004 23:39:43 +0000 (23:39 +0000)]
- Rewrite the timer and event API routines in subr_ndis.c so that they
are actually layered on top of the KeTimer API in subr_ntoskrnl.c, just
as it is in Windows. This reduces code duplication and more closely
imitates the way things are done in Windows.
- Modify ndis_encode_parm() to deal with the case where we have
a registry key expressed as a hex value ("0x1") which is being
read via NdisReadConfiguration() as an int. Previously, we tried
to decode things like "0x1" with strtol() using a base of 10, which
would always yield 0. This is what was causing problems with the
Intel 2200BG Centrino 802.11g driver: the .inf file that comes
with it has a key called RadioEnable with a value of 0x1. We
incorrectly decoded this value to '0' when it was queried, hence
the driver thought we wanted the radio turned off.
- In if_ndis.c, most drivers don't accept NDIS_80211_AUTHMODE_AUTO,
but NDIS_80211_AUTHMODE_SHARED may not be right in some cases,
so for now always use NDIS_80211_AUTHMODE_OPEN.
NOTE: There is still one problem with the Intel 2200BG driver: it
happens that the kernel stack in Windows is larger than the kernel
stack in FreeBSD. The 2200BG driver sometimes eats up more than 2
pages of stack space, which can lead to a double fault panic.
For the moment, I got things to work by adding the following to
my kernel config file:
options KSTACK_PAGES=8
I'm pretty sure 8 is too big; I just picked this value out of a hat
as a test, and it happened to work, so I left it. 4 pages might be
enough. Unfortunately, I don't think you can dynamically give a
thread a larger stack, so I'm not sure how to handle this short of
putting a note in the man page about it and dealing with the flood
of mail from people who never read man pages.
Scott Long [Sat, 20 Mar 2004 21:07:36 +0000 (21:07 +0000)]
Don peril-sensitive sunglasses and add PCI Id's for two new cards. I've
only done minimal testing on one of these cards and the firmware folks
have been extremely uncooperative in answering my qeustions about them, so
hopefully they will work ok for everyone.
Nate Lawson [Sat, 20 Mar 2004 20:47:08 +0000 (20:47 +0000)]
Fix loop termination condition for parsing resources in _PRS buffers.
This completes the effort to handle dependent functions, which are used
in some machines for irq link resources. Also, clean up some nearby
comments while I'm at it.
Marcel Moolenaar [Sat, 20 Mar 2004 20:41:40 +0000 (20:41 +0000)]
Introduce the cpumask_t type. The purpose of the type is to create a
level of abstraction for any and all CPU mask and CPU bitmap variables
so that platforms have the ability to break free from the hard limit
of 32 CPUs, simply because we don't have more bits in an u_int. Note
that the type is not supposed to solve massive parallelism, where
the number of CPUs can be larger than the width of the widest integral
type. As such, cpumask_t is not supposed to be a compound type. If
such would be necessary in the future, we can deal with the issues
then and there. For now, it can be assumed that the type is integral
and unsigned.
With this commit, all MD definitions start off as u_int. This allows
us to phase-in cpumask_t at our leasure without breaking anything.
Once cpumask_t is used consistently, platforms can switch to wider
(or smaller) types if such would be beneficial (or not; whatever :-)
Alan Cox [Sat, 20 Mar 2004 19:36:29 +0000 (19:36 +0000)]
Introduce uiomove_fromphys(). This is a variant of uiomove() that takes
a collection of physical pages as the source. On amd64 it is implemented
using the direct virtual-to-physical map.
Scott Long [Sat, 20 Mar 2004 19:02:46 +0000 (19:02 +0000)]
Fix the ioctl types for two ioctls. I'm not sure if the switch was my
fault or the vendor's fault when I brought in rev 1.5. This allows
the 'storcon' utility to work again.
Added entries for ibm151 and ibm3151-25.
Style:
o Use tabs instead of 8 spaces
o Space after # beginning comment
o Fix entries lacking ":" after tab
o Removed whitespace at EOL
PR: misc/62749 (the ibm additions)
Submitted by: Gerhard Gonter <gonter@wu-wien.ac.at>
MFC after: 3 days
Julian Elischer [Sat, 20 Mar 2004 07:31:11 +0000 (07:31 +0000)]
Put the event notification back where it was for freeBSD, after device creation.
Since NetBSD doesn't have devfs the order for them doesn't matter..
Reverses one part of 1.60->1.61 NetBSD diff reduction.
Brian Feldman [Sat, 20 Mar 2004 07:10:16 +0000 (07:10 +0000)]
Add a way for rc.d/devfs to set more than just the system devfs up.
Yes, this means for stuff OTHER than jails, too. Example usage:
#devfs_system_ruleset="root"
devfs_set_rulesets="/dev=root /etc/namedb/dev=named_devfs"
Marcel Moolenaar [Sat, 20 Mar 2004 04:38:21 +0000 (04:38 +0000)]
Actually program the list of recording devices in sv_mix_setrecsrc().
This change has not been tested.
This change was triggered by a gcc(1) warning on ia64 at -O2. The
variable v was not used after being computed, which resulted in enough
dead code elimination (DCE) to confuse the compiler and emit a bogus
warning about the use of the variable i without prior definition. The
variable i is the loop variable.
Marcel Moolenaar [Sat, 20 Mar 2004 04:23:03 +0000 (04:23 +0000)]
Remove the last traditional hints. These hints only served the purpose
for uart(4) to figure out which device to use as console. Use this file
to define hw.uart.console instead so that we don't have to put it in
the default loader.conf, which makes it hard to override.
Marcel Moolenaar [Sat, 20 Mar 2004 02:14:02 +0000 (02:14 +0000)]
Introduce the hw.uart.console and hw.uart.dbgport environment variables
to select a serial console and debug port (resp). On ia64 these replace
the use of hints completely and take precedence over hints on alpha,
amd64 and i386. On sparc64 these variables are not yet recognised.
The reasons for introducing these variables are:
1. Hints have side-effects. They reserve the unit number for use by
isa or acpi devices and therefore cannot be used to select a pci
device. Also, the use of a unit number to select a device prior
to bus enumeration is nonsense. The new variables have no side-
effects and are not based on unit numbers.
2. Hints don't have the expression power to allow the sysadmin to
select UARTs that are not legacy PC devices and need the support
of compile-time constants to give the sysadmin some level of
flexibility.
The hw.uart.console and hw.uart.dbgport variables specify a list of
attributes. An attribute is a tag-value pair, seperated by a colon.
Attributes are seperated by a comma. Where possible, tags are the
same as those in /etc/remote (only br and pa in practice). Details
can be found in the manpage (not part of this commit).
Tim Kientzle [Fri, 19 Mar 2004 22:37:06 +0000 (22:37 +0000)]
Many fixes:
* Disabled shared-library building, as some API breakage is
still likely. (I didn't realize it was turned on by default.) If
you have an existing /usr/lib/libarchive.so.2, I recommend deleting it.
* Pax interchange format now correctly stores and reads UTF8
for extended attributes. In particular, pax format can portably
handle arbitrarily long pathnames containing arbitrary characters.
* Library compiles cleanly at -O2, -O3, and WARNS=6 on all
FreeBSD-CURRENT platforms.
* Minor portability improvements inspired by Juergen Lock
and Greg Lewis. (Less reliance on stdint.h, isolating of
various portability-challenged constructs.)
* archive_entry transparently converts multi-byte <-> wide character
strings, allowing clients and format handlers to deal with either
one, as appropriate.
* Support for reading 'L' and 'K' entries in standard tar archives
for star compatibility.
* Recognize (but don't yet handle) ACL entries from Solaris tar.
* Pushed format-specific data for format readers down into
format-specific storage and out of library-global storage. This
should make it easier to maintain individual formats without mucking
with the core library management.
* Documentation updates to track the above changes.
* Updates to tar.5 to correct a few mistakes and add some additional
information about GNU tar and Solaris tar formats.
Notes:
* The basic 'tar' reader is getting more general; there's not much
point in keeping the 'gnutar' reader separate. Merging the two
would lose a bunch of duplicate code.
* The libc ACL support is looking increasingly inadequate for my needs
here. I might need to assemble some fairly significant code for
parsing and building ACLs. <sigh>
Ruslan Ermilov [Fri, 19 Mar 2004 15:08:58 +0000 (15:08 +0000)]
Create /usr/sbin in ${WORLDTMP}. I've accidentally removed it in
revision 1.343, but it's needed for btxld(8), and this fix (along
with the --enable-64-bit-bfd configured BFD on i386) allows other
architectures to successfully cross-build the i386 world.
Nate Lawson [Fri, 19 Mar 2004 07:05:01 +0000 (07:05 +0000)]
Move the poweroff handler to a separate function. Make sure it is run
on the boot processor (cpuid == 0). Some chipsets do not power off the
system if the shutdown handler runs on an AP.
Guido van Rooij [Thu, 18 Mar 2004 21:10:11 +0000 (21:10 +0000)]
Prevent the strange situation that after each load/unload of a ppbus
device, the device is probed multiple times (so each device is
detected N times after unloading/loading the module N-1 times).
The real fix is (quote Doug and Warner):
> : In an ideal world, there should be some kind of BUS_UNIDENTIFY method
> : which a driver could use to delete the devices it created in
> : BUS_IDENTIFY.
>
> Or the bus would have a driver deleted routine that got called and it
> would remove all instances of the devclass attached to it.
Ruslan Ermilov [Thu, 18 Mar 2004 21:07:54 +0000 (21:07 +0000)]
Fixed a nasty old bug where a visual bell in the currently active
VTY prevented waking up processes waiting for the output queue to
get free on other VTYs.
In collaboration with: Vsevolod Lobko
MFC after: 1 week
Guido van Rooij [Thu, 18 Mar 2004 20:58:51 +0000 (20:58 +0000)]
When mmap-ing a file from a noexec mount, be sure not to grant the right
to mmap it PROT_EXEC. This also depends on the architecture, as some
architextures (e.g. i386) do not distinguish between read and exec pages
Nate Lawson [Thu, 18 Mar 2004 18:42:22 +0000 (18:42 +0000)]
Add tunables for disabling serialized method execution and disabling the
new _OSI method. These can be used if these new features end up causing
regression for users.
Alan Cox [Thu, 18 Mar 2004 18:23:37 +0000 (18:23 +0000)]
Utilize sf_buf_alloc() and sf_buf_free() to implement the ephemeral
mappings required by mdstart_swap(). On i386, if the ephemeral mapping
is already in the sf_buf mapping cache, a swap-backed md performs
similarly to a malloc-backed md. Even if the ephemeral mapping is not
cached, this implementation is still faster. On 64-bit platforms, this
change has the effect of using the direct virtual-to-physical mapping,
avoiding ephemeral mapping overheads, such as TLB shootdowns on SMPs.
On a 2.4GHz, 400MHz FSB P4 Xeon configured with 64K sf_bufs and
"mdmfs -S -o async -s 128m md /mnt"
David E. O'Brien [Thu, 18 Mar 2004 18:05:08 +0000 (18:05 +0000)]
For AMD64, lets officially support a -O2 kernel build!
I've added -fno-strict-aliasing for now so we can ease into this.
I wanted to shoot for -O3, but the inlining caused problems due to GCC's
size heuristics; so also add -frename-registers, which is one of the things
-O3 would have given us.
Jacques Vidrine [Thu, 18 Mar 2004 16:33:05 +0000 (16:33 +0000)]
Verify more bits of the ELF header: the program header table
entry size and the ELF version. Also, avoid a potential integer
overflow when determining whether the ELF header fits entirely
within the first page.
Reviewed by: jdp
A panic when attempting to execute an ELF binary with a bogus program
header table entry size was
Robert Watson [Thu, 18 Mar 2004 14:18:51 +0000 (14:18 +0000)]
Correct a bug introduced with the recent clone API chang: when the clone
event handler for if_tap fails, make sure to clean up clone state to
prevent a clone memory leak.
Ruslan Ermilov [Thu, 18 Mar 2004 10:55:47 +0000 (10:55 +0000)]
Install /bin/sh safely. This allows a shell script to be used
to strip binaries by specifying it in the STRIPBIN environment
variable honoured by install(1).
Robert Watson [Thu, 18 Mar 2004 09:55:11 +0000 (09:55 +0000)]
sAdd a comment indicating why there continues to be a race condition in
the tap driver, even with Giant over the cdev operation vector, due to
a non-atomic test-and-set of the si_drv1 field in the dev_t. This bug
exists with Giant under high memory pressure, as malloc() may sleep
in tapcreate(), but is less likely to occur. The resolution will
probably be to cover si_drv1 using the global tapmtx since no softc is
available, but I need to think about this problem more generally
across a range of drivers using si_drv1 in combination with SI_CHEAPCLONE
to defer expensive allocation to open().
Correct what appears to be a bug in the original if_tap implementation,
in which tapopen() will panic if a tap device instance is opened more
than once due to an incorrect assertion -- only triggered if INVARIANTS
is compiled in (i.e., when built into a kernel). Return EBUSY instead.
Expand mtx_lock() coverage using tp->tap_mtx to include tp->ether_addr.
Ruslan Ermilov [Thu, 18 Mar 2004 07:21:31 +0000 (07:21 +0000)]
More cleanups:
- 0 should have been -1 in previous commit (just to stay consistent),
- Spell null pointers as NULL, not 0,
- Fixed the comment about pr_usesysctl to not confuse it with boolean.
Move "is consumer attached?" check before G_VALID_PROVIDER() check,
because if consumer is not attached, its provider never will be valid,
so we never reach this check.
Fix 'ps -p proclist' and 'ps -u userlist' so the command returns non-zero
if no processes were matched. Also sorts the list of 'int's in main, as
long as I had to add another one...
Alan Cox [Wed, 17 Mar 2004 23:25:04 +0000 (23:25 +0000)]
Revise socow_iodone() in light of recent sf_buf changes. Specifically,
use sf_buf_free() instead of sf_buf_mext() to consolidate all actions
that require the page queues lock in one critical section. While I'm
here remove unnecessary splvm() and splx() calls.
Improvements to 'ps -p <x>'. If <x> is a process id that does not exist, then
just print the header (if any) and exit, thus matching the behavior on -stable
and other OS's.
Also adds support for <x> being a comma-separated list of processes, and does
a much better checking for invalid-values of <x>, such as 'ps -p someword'.
Reviewed by: mentioned on freebsd-current
MFC after: 10 days
Brian Feldman [Wed, 17 Mar 2004 21:54:52 +0000 (21:54 +0000)]
Eliminate bogus usage of WI_RSSI_TO_DBM(). Not only does it bogusly
clip/destroy the dB value contained in the wi(4)'s receive frames,
it doesn't match with the flag set in the radiotap header
(unperturbed dB versus dBm).