Andrew Thompson [Mon, 23 Jun 2008 15:40:56 +0000 (15:40 +0000)]
- Fix compile if WPI_DEBUG is not defined
- Allow debug.wpi to be set from a tunable
- Put ring reset messages back under debug
- Add more debug output around channel init
Mike Makonnen [Mon, 23 Jun 2008 12:06:35 +0000 (12:06 +0000)]
Set the sysctl(8) value in the same shell, not a subshell. This was
causing calls to netoptions_init() to not properly set a global variable,
which ended up being in the parent shell.
Ed Schouten [Mon, 23 Jun 2008 05:22:06 +0000 (05:22 +0000)]
Turn execvpe() into an internal libc routine.
Adding exevpe() has caused some ports to break. Even though execvpe() is
a useful routine, it does not conform to any standards.
This patch is a little bit different from the patch sent to the mailing
list. I forgot to remove execvpe from the Symbol.map (which does not
seem to miscompile libc, though).
Mike Makonnen [Mon, 23 Jun 2008 05:09:09 +0000 (05:09 +0000)]
Move the diagnostic output when the rc.subr(8) glue automatically starts a
service behind $rc_quiet. Instead, output a warning if the pre-command
routine or the command itself failed. Arguably, it's more useful to know when
a command failed to start than it is to have an endless list of
"Starting ...." lines[1].
[1] - This change actually helped me to discover a bug in rc.d/{lockd,statd}
(fixed in r179941) that used to fail silently before.
Robert Watson [Sun, 22 Jun 2008 21:51:32 +0000 (21:51 +0000)]
If S_IFIFO is passed to mknod(2), invoke kern_mkfifoat(9) to create a
FIFO, as required by SUSv3. No specific privilege check is performed
in this case, as FIFOs may be created by unprivileged processes
(subject to the normal file system name space restrictions that may be
in place).
Unlike the Apple implementation, we reject requests to create a FIFO
using mknod(2) if there is a non-zero dev argument to the system call,
which is permitted by the Open Group specification ("... undefined
..."). We might want to revise this if we find it causes
compatibility problems for applications in practice.
Robert Watson [Sun, 22 Jun 2008 21:03:26 +0000 (21:03 +0000)]
Teach fifo_create regression test to also try to use mknod(2) to create
fifos, as this is required by the Single UNIX Specification, although
not currently implemented on FreeBSD.
While here, fix a bug in the directory timestamp checking test by
sleeping after querying the starting timestamp, rather than before.
Get pointer to devfs_ruleset struct after garbage collection has been
performed. Otherwise if ruleset is used by given mountpoint and is empty
it's freed by devfs_ruleset_reap and pointer becomes bogus.
Marius Strobl [Sun, 22 Jun 2008 13:54:51 +0000 (13:54 +0000)]
o The FreeBSD bus_dmamap_sync(9) supports ored together flags for quite
some time now so collapse calls accordingly.
o Given that gem_load_txmbuf() is allowed to fail resulting in a packet
drop also for quite some time now implement the functionality of
gem_txcksum() by means of m_pullup(9), which de-obfuscates the code
and allows to always retrieve the correct length of the IP header.
o Add missing BUS_DMASYNC_PREREAD when syncing the control DMA maps in
gem_rint() and gem_start_locked().
o Correct some bus_barrier(9) calls to do a read/write barrier as we
do a read after a write. Add some missing ones in gem_mii_readreg()
and gem_mii_writereg().
o According to the Apple GMAC driver, the GEM ASIC specification and
the OpenSolaris eri(7D) the TX FIFO threshold has to be set to 0x4ff
for the Gigabit variants and 0x100 for the ERI in order do avoid TX
underruns.
o In gem_init_locked():
- be conservative and enable the RX and TX MACs,
- don't clear GEM_LINK otherwise we don't ever mark the link as up
again if gem_init_locked() is called from gem_watchdog(),
- remove superfluous setting of sc_ifflags.
o Don't bother to check whether the interface is running or whether its
queue is empty before calling gem_start_locked() in gem_tint(), the
former will check these anyway.
o Call gem_start_locked() in gem_watchdog() in order to try to get
some more packets going.
o In gem_mii_writereg() after reseting the PCS restore its configuration.
Alexander Motin [Sun, 22 Jun 2008 11:39:42 +0000 (11:39 +0000)]
Partially revert previous commit. DeleteLink() does not deletes permanent
links so we should be aware of it and try to delete every link only once
or we will loop forever.
Alan Cox [Sun, 22 Jun 2008 04:54:27 +0000 (04:54 +0000)]
Make preparations for increasing the size of the kernel virtual address space
on the amd64 architecture. The amd64 architecture requires kernel code and
global variables to reside in the highest 2GB of the 64-bit virtual address
space. Thus, the memory allocated during bootstrap, before the call to
kmem_init(), starts at KERNBASE, which is not necessarily the same as
VM_MIN_KERNEL_ADDRESS on amd64.
Alan Cox [Sat, 21 Jun 2008 21:02:13 +0000 (21:02 +0000)]
KERNBASE is not necessarily an address within the kernel map, e.g.,
PowerPC/AIM. Consequently, it should not be used to determine the maximum
number of kernel map entries. Intead, use VM_MIN_KERNEL_ADDRESS, which marks
the start of the kernel map on all architectures.
Alan Cox [Sat, 21 Jun 2008 19:19:09 +0000 (19:19 +0000)]
Prepare for a larger kernel virtual address space. Specifically, once
KERNBASE and VM_MIN_KERNEL_ADDRESS are no longer the same, the physical
memory allocated during bootstrap will be offset from the low-end of the
kernel's page table.
Tim Kientzle [Sat, 21 Jun 2008 19:11:51 +0000 (19:11 +0000)]
Refactor one of the ISO extraction tests: Move the reference
file into a separate file (instead of embedding it in the C code)
and use later timestamps (timestamps too close to the Epoch fail
predictably on systems that lack timegm(), whose mktime() doesn't
support dates before the Epoch and which are running in timezones
with negative offsets from GMT). The goal here is to test the ISO
extraction, not the local platform's time support.
Tim Kientzle [Sat, 21 Jun 2008 19:06:37 +0000 (19:06 +0000)]
MfP4: Joerg Sonnenberg's extensions to the mtree support for more
complete quoting. In particular, this handles escaped newlines
and common C-style escapes.
Tim Kientzle [Sat, 21 Jun 2008 19:05:29 +0000 (19:05 +0000)]
A security-check failure here should be ARCHIVE_FAILED (cannot continue this
operation) and not ARCHIVE_WARN, since we don't actually open the file.
Both bsdtar and bsdcpio will try to copy file contents after an ARCHIVE_WARN,
which will fail loudly.
Tim Kientzle [Sat, 21 Jun 2008 17:47:56 +0000 (17:47 +0000)]
If we're using -l and can't hardlink the file because of a cross-device
link, just ignore the -l option and copy the file instead.
In particular, this should fix the COPYTREE_* macros used in the
ports infrastructure which use -l to preserve space but often get
used for cross-device copies.
Alexander Motin [Sat, 21 Jun 2008 16:22:56 +0000 (16:22 +0000)]
Add support for PORT/EPRT FTP commands in lowercase.
Use strncasecmp() instead of huge local implementation to reduce code size.
Check space presence after command/code.
Alan Cox [Fri, 20 Jun 2008 20:59:31 +0000 (20:59 +0000)]
Make preparations for increasing the size of the kernel virtual
address space on the amd64 architecture. The amd64 architecture
requires kernel code and global variables to reside in the highest 2GB
of the 64-bit virtual address space. Thus, KERNBASE cannot change.
However, KERNBASE is sometimes used as the start of the kernel virtual
address space. Henceforth, VM_MIN_KERNEL_ADDRESS should be used
instead. Since KERNBASE and VM_MIN_KERNEL_ADDRESS are still the same
address, there should be no visible effect from this change (yet).
That said, kris@ has tested crash dumps under the full patch that
increases the kernel virtual address space on amd64 to 6GB.
Warner Losh [Fri, 20 Jun 2008 16:58:15 +0000 (16:58 +0000)]
Split out the probing magic of device_probe_and_attach into
device_probe() so that it can be used by busses that may wish to do
additional processing between probe and attach.
Joerg Wunsch [Fri, 20 Jun 2008 08:39:42 +0000 (08:39 +0000)]
Make the search for sources in PATH_PORTS more accurate. I only
noticed that a "whereis -qs qemu" matched the distfiles subdir of qemu
rather than /usr/ports/emulators/qemu.
It now ignores all dot entries in /usr/ports, plus all entries
starting with a capital letter (maintenance stuff like Templates, but
also includes subdir CVS), plus /usr/ports/distfiles which is simply a
magic name in that respect.
Alan Cox [Fri, 20 Jun 2008 05:22:09 +0000 (05:22 +0000)]
Make preparations for increasing the size of the kernel virtual
address space on the amd64 architecture. The amd64 architecture
requires kernel code and global variables to reside in the highest 2GB
of the 64-bit virtual address space. Thus, KERNBASE cannot change.
However, KERNBASE is sometimes used as the start of the kernel virtual
address space. Henceforth, VM_MIN_KERNEL_ADDRESS should be used
instead. Since KERNBASE and VM_MIN_KERNEL_ADDRESS are still the same
address, there should be no visible effect from this change (yet).
Renew semaphore's pointer after wakeup since during msleep
sem_base may have been modified by destroying one of semaphores
and semptr would not be valid in this case.
Ed Schouten [Thu, 19 Jun 2008 07:30:32 +0000 (07:30 +0000)]
Remove __restrict keywords from array arguments to make GCC's -std=c99 work.
When GCC is invoked with -std=c99, the following errors are displayed when
including <spawn.h>:
/usr/include/spawn.h:69: error: static or type qualifiers in abstract declarator
/usr/include/spawn.h:69: error: static or type qualifiers in abstract declarator
/usr/include/spawn.h:72: error: static or type qualifiers in abstract declarator
/usr/include/spawn.h:72: error: static or type qualifiers in abstract declarator
We'd better remove the __restrict keywords here. The same is also done
in <regex.h>.
Submitted by: Andrzej Tobola <ato iem pw edu pl>
Reviewed by: davidxu
Approved by: philip (mentor, implicit)
Mike Makonnen [Thu, 19 Jun 2008 06:11:34 +0000 (06:11 +0000)]
Move the check for enabled knobs further down in run_rc_command() so
that bogus commands cause usage information to be printed instead of
diagnostics about enabling the knob.
John Baldwin [Wed, 18 Jun 2008 14:23:28 +0000 (14:23 +0000)]
Catch up to recentish kgdb changes:
- Use ptid_get_pid() rather than ptid_get_tid() (part of the changes to
let 'tid' work for remote kgdb).
- Add a stub kgdb_trgt_new_objfile() hook.
Weongyo Jeong [Wed, 18 Jun 2008 06:35:37 +0000 (06:35 +0000)]
handle .INF files for PCMCIA correctly that specify multiple entries in
their [Manufacturer] sections and prevent a case that NDIS_PCI_DEV_TABLE
definition was always emitted that it's only emitted once if a .INF file
is for PCI.
Marcel Moolenaar [Wed, 18 Jun 2008 01:13:34 +0000 (01:13 +0000)]
Add the set and unset verbs used to set and clear attributes for
partition entries. Implement the setunset method for the MBR
scheme to control the active flag.
Ed Schouten [Tue, 17 Jun 2008 14:05:03 +0000 (14:05 +0000)]
Don't export the unused __use_pts() routine.
The __use_pts() routine was once probably used by libutil to determine
if we are using BSD or UNIX98 style PTY device names. It doesn't seem to
be used outside grantpt.c, which means we can make it static and remove
it from the Symbol.map.
Reviewed by: cognet, kib
Approved by: philip (mentor)
David Xu [Tue, 17 Jun 2008 06:26:29 +0000 (06:26 +0000)]
Add POSIX routines called posix_spawn() and posix_spawnp(), which
can be used as replacements for exec/fork in a lot of cases. This
change also added execvpe() which allows environment variable
PATH to be used for searching executable file, it is used for
implementing posix_spawnp().
Stephan Uphoff [Mon, 16 Jun 2008 19:56:59 +0000 (19:56 +0000)]
Fix a check in SYN cache expansion (syncache_expand()) to accept packets that arrive in the receive window instead of just on the left edge of the receive window.
This is needed for correct behavior when packets are lost or reordered.
PR: kern/123950
Reviewed by: andre@, silby@
Reported by: Yahoo!, Wang Jin
MFC after: 1 week
Oliver Fromme [Mon, 16 Jun 2008 17:04:04 +0000 (17:04 +0000)]
Implement a workaround for a long-standing problem in
libi386's time(), caused by a qemu bug. The bug might
be present in other BIOSes, too.
qemu either does not simulate the AT RTC correctly or
has a broken BIOS 1A/02 implementation, and will return
an incorrect value if the RTC is read while it is being
updated.
The effect is worsened by the fact that qemu's INT 15/86
function ("wait" a.k.a. usleep) is non-implmeneted or
broken and returns immediately, causing beastie.4th to
spin in a tight loop calling the "read RTC" function
millions of times, triggering the problem quickly.
Therefore, we keep reading the BIOS value until we get
the same result twice. This change fixes beastie.4th's
countdown under qemu.