bde [Sun, 28 Mar 2004 04:17:36 +0000 (04:17 +0000)]
Fixed s style bug in previous commit (tab lossage). Fixed some nearby
style bugs (more tab lossage, unclear description of TDF_USTATCLOCK,
and English usage errors).
gad [Sun, 28 Mar 2004 03:00:56 +0000 (03:00 +0000)]
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.
My earlier attempt to fix this (v1.65) only seemed to work because of a
lucky random value in nentries (which was not being initialized back
when I tested that earlier patch).
gad [Sat, 27 Mar 2004 22:14:42 +0000 (22:14 +0000)]
If a non-existent user is given as part of `-U userlist', treat it as
a fatal error instead of a minor warning. It is possible that a few
users are used to the previous behavior, but I'm claiming it was a bug.
gad [Sat, 27 Mar 2004 21:56:49 +0000 (21:56 +0000)]
Change the #if-ish logic which is used to add the `-f' option when `ps'
is compiled with LAZY_PS, so that there is only one PS_ARGS string to
modify when changing the option-list. Also get `-f' to show up in the
usage() statement when compiled with LAZY_PS.
pjd [Sat, 27 Mar 2004 21:05:46 +0000 (21:05 +0000)]
Reduce 'td' argument to 'cred' (struct ucred) argument in those functions:
- in_pcbbind(),
- in_pcbbind_setup(),
- in_pcbconnect(),
- in_pcbconnect_setup(),
- in6_pcbbind(),
- in6_pcbconnect(),
- in6_pcbsetport().
"It should simplify/clarify things a great deal." --rwatson
alc [Sat, 27 Mar 2004 19:50:23 +0000 (19:50 +0000)]
Revise the direct or optimized case to use uiomove_fromphys() by the reader
instead of ephemeral mappings using pmap_qenter() by the writer. The
writer is still, however, responsible for wiring the pages, just not
mapping them. Consequently, the allocation of KVA for the direct case is
unnecessary. Remove it and the sysctls limiting it, i.e.,
kern.ipc.maxpipekvawired and kern.ipc.amountpipekvawired. The number
of temporarily wired pages is still, however, limited by
kern.ipc.maxpipekva.
Note: On platforms lacking a direct virtual-to-physical mapping,
uiomove_fromphys() uses sf_bufs to cache ephemeral mappings. Thus,
the number of available sf_bufs can influence the performance of pipes
on platforms such i386. Surprisingly, I saw the greatest gain from this
change on such a machine: lmbench's pipe bandwidth result increased from
~1050MB/s to ~1850MB/s on my 2.4GHz, 400MHz FSB P4 Xeon.
gad [Sat, 27 Mar 2004 18:22:17 +0000 (18:22 +0000)]
Support more POSIX/SUSv3 options:
- Change `-p' to allow a list of process IDs, and `-t' to allow a list
of terminal names, instead of only a single value for each.
- Add the `-A' option of SUSv3, which is exactly the same as `-ax'.
- Add the `-G gidlist' (group id).
- Allow any of these "selector options" to be specified multiple times,
and have `ps' keep adding to a given list -- instead of replacing the
previously-specified values.
- Fix interactions between selector-options, so that: "If any are
specified, ... ps shall select the processes represented by the
inclusive OR of all the selection-criteria options." (from SUSv3)
- Add a `-X' option, which is the reverse of the `-x' option.
- various minor improvements in parsing and error handling.
This does not get us to match POSIX/SUSv3, but it gets us closer. The
`-g pgidlist', `-R ruserlist' and `-s sidlist' options mentioned in
freebsd-standards are still under debate, so they skipped for now.
It should be true that this introduces no user-visible incompatible
changes, except to support "new stuff" that was not supported before.
marcel [Sat, 27 Mar 2004 18:21:24 +0000 (18:21 +0000)]
Change the type of the various CPU masks to cpumask_t. Note that as
long as there are still explicit uses of int, whether in types or
in function names (such as atomic_set_int() in sched_ule.c), we can
not change cpumask_t to be anything other than u_int. See also the
commit log for sys/sys/types.h, revision 1.84.
marcel [Sat, 27 Mar 2004 17:44:25 +0000 (17:44 +0000)]
MFi386: correctly calculate the top-of-stack when a kthread is created
with a larger kernel stack. Remove inclusion of opt_kstack_pages.h now
that it's unused.
mtm [Sat, 27 Mar 2004 15:05:28 +0000 (15:05 +0000)]
o Since we're not using signals for thread synchronization anymore,
sigprocmask no longer needs to be wrapped.
o raise(3) is applied to the calling thread in a threaded program.
o In the sigaction wrapper reference the correct structure.
o Don't treat SIGTHR especially anymore (infact it won't exist in
a little while).
dougb [Sat, 27 Mar 2004 09:26:22 +0000 (09:26 +0000)]
A few small cleanups:
1. Add the shutdown keyword so that the script is run at shutdown time,
and the mixer* files are saved.
2. Twiddle whitespace.
3. Remove an unecessary function, and therefore collapse one variable.
pjd [Sat, 27 Mar 2004 08:39:28 +0000 (08:39 +0000)]
- Add a description for vfs.usermount sysctl.
- Add the vfs_equalopts() function for mount options comparsion.
Now it looks much more clear.
- Style fixed.
tjr [Sat, 27 Mar 2004 08:14:15 +0000 (08:14 +0000)]
Add UTF-8 versions of all the currently supported system locales. Most of
the hard work was done by Hye-Shik Chang in the misc/utf8locale port; I made
a few minor adjustments and merged the makefiles.
gad [Sat, 27 Mar 2004 06:49:57 +0000 (06:49 +0000)]
bde also tells me that he is confident that P_SYSTEM will not work
any better on 4.x than it does on 5.2. If that's true then there
is no point to the __FreeBSD_version check that I had added.
simokawa [Fri, 26 Mar 2004 23:17:10 +0000 (23:17 +0000)]
MFp4: FireWire
* all
- s/__FUNCTION__/__func__/.
Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at>
- Compatibility for RELENG_4 and DragonFly.
* firewire
- Timestamp just before queuing.
- Retry bus probe if it fails.
- Use device_printf() for debug message.
- Invalidiate CROM while update.
- Don't process minimum/invalid CROM.
* sbp
- Add ORB_SHORTAGE flag.
- Add sbp.tags tunable.
- Revive doorbell support. It's not enabled by default.
pjd [Fri, 26 Mar 2004 21:12:14 +0000 (21:12 +0000)]
We probably shouldn't allow users to mount file systems with MNT_SUIDDIR.
There should be not shell access when SUIDDIR is compiled in, but
better be sure.
gad [Fri, 26 Mar 2004 17:51:49 +0000 (17:51 +0000)]
Switch to checking P_KTHREAD instead of P_SYSTEM when deciding what
"system processes" to always ignore. Based on my testing with `-D',
I am pretty sure this is what we want for 5.x-current. If my thinking
is wrong, this also makes it easier to switch to a different check.
mtm [Fri, 26 Mar 2004 14:47:54 +0000 (14:47 +0000)]
o The mutex locking functions aren't normally cancellation points. But,
we still have to DTRT when an asynchronously cancellable thread is
cancelled while waiting for a mutex.
o While dequeueing a waiting mutex don't skip a thread if it has
a cancel pending. Only skip it if it is also async cancellable.
mtm [Fri, 26 Mar 2004 14:45:35 +0000 (14:45 +0000)]
o Initialize a local variable before referencing it. This was not
the cause of any bugs because it is *always* indirectly set
in the for...loop, but better to be explicit about it.
o Check the magic number of the passed in thread only after it has
been found in the active thread list. Otherwise, if the check is done
at the very beginning we may end up pointing to garbage if the
thread was once a valid thread, but has now been destroyed.
ru [Fri, 26 Mar 2004 08:54:27 +0000 (08:54 +0000)]
Avoid the manpage layering violation and low-level implementation
details of libkvm, and just tell what the getbootfile(3) function
will return, by using the text from netstat(1) and dmesg(8).
ru [Fri, 26 Mar 2004 08:29:38 +0000 (08:29 +0000)]
- Remove references to /dev/kmem -- ps(1) utilizes the
sysctl(3) interface in kvm(3).
- Document the correct default when no -N is specified.
- Remove stale reference to /var/db/kvm_kernel.db.
- Remove stale reference to /var/run/dev.db.
ru [Fri, 26 Mar 2004 08:05:39 +0000 (08:05 +0000)]
Document that kvm_open(3) also accepts "/dev/null" as a special
"corefile" argument, to access the running system via sysctl(3)
if possible, thus not requring special setgid privileges.
rwatson [Fri, 26 Mar 2004 03:26:15 +0000 (03:26 +0000)]
Correct the definition of the multilabel flag: it enables multilabel
MAC support on the file system, if supported, which causes MAC to treat
each object as having its own label, rather than using a single label
for all objects on the file system. This doesn't have to be used in
combination with the tunefs/newfs flags -- it's an alternative.
gad [Fri, 26 Mar 2004 00:36:27 +0000 (00:36 +0000)]
Add a cast to get this to compile with WARNS=5 on sparc64. This is
needed because off_t == __int64_t, while size_t == __uint64_t. This
also compiles with WARNS=5 on amd64, but I haven't tested the other
platforms yet.
gad [Thu, 25 Mar 2004 23:19:16 +0000 (23:19 +0000)]
Add `-M' and `-N' options to `pkill' and `pgrep', similar to
what are supported in `ps':
-M Extract values associated with the name list from the
specified core instead of the default /dev/kmem.
-N Extract the name list from the specified system instead
of the default /kernel.
Written by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
Obtained from: the sysutils/pkill port
imp [Thu, 25 Mar 2004 21:58:55 +0000 (21:58 +0000)]
Add support for a new variant of the prism3 that has appaered in the
wild. This one is marketed by D-Link model DWL-650, but appears to be
a ISL3710P-10 under the hood.
vkashyap [Thu, 25 Mar 2004 19:30:35 +0000 (19:30 +0000)]
1. Better handle a return value of EINPROGRESS from bus_dmamap_load.
2. Check for bad return value from twe_map_request in places where there
was no checking.
gad [Thu, 25 Mar 2004 19:08:48 +0000 (19:08 +0000)]
Add the `pkill' and `pgrep' commands from NetBSD. This is the source
straight from NetBSD (except to add the RCS-ID lines for FreeBSD).
These will probably require a few updates before they are added to
the FreeBSD buildworld. I might MFC these to 4.x-stable after 4.10.
Discussed on: freebsd-arch
Obtained from: NetBSD (and OpenBSD also has these)
wpaul [Thu, 25 Mar 2004 18:31:52 +0000 (18:31 +0000)]
- In subr_ndis.c:ndis_init_event(), initialize events as notification
objects rather than synchronization objects. When a sync object is
signaled, only the first thread waiting on it is woken up, and then
it's automatically reset to the not-signaled state. When a
notification object is signaled, all threads waiting on it will
be woken up, and it remains in the signaled state until someone
resets it manually. We want the latter behavior for NDIS events.
- In kern_ndis.c:ndis_convert_res(), we have to create a temporary
copy of the list returned by BUS_GET_RESOURCE_LIST(). When the PCI
bus code probes resources for a given device, it enters them into
a singly linked list, head first. The result is that traversing
this list gives you the resources in reverse order. This means when
we create the Windows resource list, it will be in reverse order too.
Unfortunately, this can hose drivers for devices with multiple I/O
ranges of the same type, like, say, two memory mapped I/O regions (one
for registers, one to map the NVRAM/bootrom/whatever). Some drivers
test the range size to figure out which region is which, but others
just assume that the resources will be listed in ascending order from
lowest numbered BAR to highest. Reversing the order means such drivers
will choose the wrong resource as their I/O register range.
Since we can't traverse the resource SLIST backwards, we have to
make a temporary copy of the list in the right order and then build
the Windows resource list from that. I suppose we could just fix
the PCI bus code to use a TAILQ instead, but then I'd have to track
down all the consumers of the BUS_GET_RESOURCE_LIST() and fix them
too.
ru [Thu, 25 Mar 2004 08:46:27 +0000 (08:46 +0000)]
Untangle IP multicast routing interaction with delayed payload checksums.
Compute the payload checksum for a locally originated IP multicast where
God intended, in ip_mloopback(), rather than doing it in ip_output() and
only when multicast router is active. This is more correct as we do not
fool ip_input() that the packet has the correct payload checksum when in
fact it does not (when multicast router is inactive). This is also more
efficient if we don't join the multicast group we send to, thus allowing
the hardware to checksum the payload.