rink [Thu, 19 Oct 2006 19:46:49 +0000 (19:46 +0000)]
My previous commit made it impossible to export / over NFS; this small
change fixes this.
Reported by: Lin Jui-Nan Eric < ericlin dot jnlin at gmail dot com >
Submitted by: Erik Trulsson < ertr1013 at student dot uu dot se > (commit is inspired by a patch from Erik)
Pointyhat to: me
Reviewed by: stable@
Approved by: imp (mentor)
MFC after: 3 days
jhb [Thu, 19 Oct 2006 14:36:41 +0000 (14:36 +0000)]
- Define time_t in sys/sem.h so it doesn't require sys/types.h.
- Move the pid_t, size_t, and time_t definitions earlier in the file, sort
them, and fix whitespace.
- Drop redundant includes of sys/cdefs.h and sys/_types.h as sys/ipc.h
already includes them.
scottl [Thu, 19 Oct 2006 08:01:43 +0000 (08:01 +0000)]
I can't find any reason why an 8 byte alignment should be enforced on rx
and tx buffers. Fix it there, and also don't have it be overridden by the
parent tag.
iedowse [Thu, 19 Oct 2006 01:15:58 +0000 (01:15 +0000)]
Use a different task queue for host controller and peripheral driver
tasks. Since the host controllers rely on tasks to process transfer
timeouts, if a synchronous transfer from a driver was invoked from
a task and timed out, it would never complete because the single
task thread was stuck performing the synchronous transfer so couldn't
process the timeout.
marcel [Thu, 19 Oct 2006 00:53:35 +0000 (00:53 +0000)]
Fix previous revision:
o day and mday are the same. No need to subtract 1 from mday.
o Set dow to -1 as clock_ct_to_ts() checks this field and
returns EINVAL on any day of the week but Sunday.
imp [Wed, 18 Oct 2006 21:09:43 +0000 (21:09 +0000)]
Package the dumpcisfile functionality into a new dumpcis command.
Also, don't build pccardc now. I've left it in place for people that
wish to build it to test experimental support for oldcard
functionality that may have been lost in newcard.
bde [Wed, 18 Oct 2006 04:48:09 +0000 (04:48 +0000)]
kern_intr.c:
- Count (scheduling of) software interrupts (SWIs) as SWIs, not as
hardware interrupts.
- Don't count (scheduling of) delayed SWIs as interrupts at all, since
in the delayed case it is expected that there are many more scheduling
calls than handling calls. Perhaps all interrupts should be counted
only when they are handled, but it is only counts of delayed SWIs that
shouldn never be combined with the other counts.
subr_trap.c:
- Count (handling of) Asynchronous System Traps (ASTs) as traps, not as
software interrupts.
Before these changes, the counter for SWIs only counted ASTs, and SWIs
weren't counted separately, but a subcounter for ASTs alone is less
needed than for most other exception sources.
4.4BSD-Lite uses the counters for similar things (actually matching
their names) on its main arches (hp300, ..., !i386) where more of the
exceptions are in hardware.
imp [Tue, 17 Oct 2006 18:08:04 +0000 (18:08 +0000)]
Collapse the two identical emu10k1-alsa%diked.h creation rules for
snd_emu10k1 and snd_emu10kx into one line. The 'pci' dependency here
adds no value, so I eliminted it (we don't have a snd.all file that
might make it mildly useful, and even then it wouldn't be that
useful). With the pci optional component eliminated, I could use the
'|' operator. I could have also include pci on both sides of the |
operator, but since it isn't a value add at all, it was better to
eliminate it.
glebius [Tue, 17 Oct 2006 16:52:09 +0000 (16:52 +0000)]
Some clenaup of ngs_rcvmsg():
- Inline ship_msg() into ngs_rcvmsg().
- Plug memory leak in case if no control socket present.
- Remove malloc() and allocate the sockaddr on stack.
- style(9).
gallatin [Tue, 17 Oct 2006 14:39:19 +0000 (14:39 +0000)]
Fix a driver bug which could result in frames MHLEN or (MHLEN - 1) bytes
long being DMA'ed 2 (or 1) bytes past the end of the mbuf and corrupting
random kernel memory. I had forgotten about the 2 bytes of implict
padding the firmware assumes.
glebius [Tue, 17 Oct 2006 12:21:48 +0000 (12:21 +0000)]
Some cleanup and small changes:
- Use malloc() and free() instead of MALLOC() and FREE() macros.
- Do not check malloc results if M_WAITOK was used.
- Remove linked list of all netgraph sockets. It isn't needed.
- Use ng_findhook() instead of searching the list ourselves.
- Use NG_WAITOK in syscalls.
- Remove unneeded includes.
- style(9)
davidxu [Tue, 17 Oct 2006 02:24:47 +0000 (02:24 +0000)]
o Add keyword volatile for user mutex owner field.
o Fix type consistent problem by using type long for old
umtx and wait channel.
o Rename casuptr to casuword.
jb [Mon, 16 Oct 2006 22:09:48 +0000 (22:09 +0000)]
Add a .PATH entry to search for sources in the ${MACHINE}/${MACHINE}
directory before the ${MACHINE_ARCH}/${MACHINE_ARCH} directory so that
machine-specific files take precedence of architecture-specific ones.
This fixes the build on sun4v which doesn't use the sparc64 version
of mem.c.
jhb [Mon, 16 Oct 2006 20:06:32 +0000 (20:06 +0000)]
Restore the 'proc' and 'tid' commands which allow one to switch to the
first thread in a process or to a specific thread via PIDs and TIDs,
respectively.
ache [Mon, 16 Oct 2006 14:31:56 +0000 (14:31 +0000)]
file == NULL:
Issue __sflush() before possible setting O_APPEND mode or ftruncate(),
write to wrong place may occurse oserwise.
Use simplified _sseek() to the start, if no O_APPEND is set, instead
of _fseeko() (_sseek() to the end, if O_APPEND, occurse later, as for
file != NULL).
Don't check seek error return, as original fopen() and freopen() never
does.
yar [Mon, 16 Oct 2006 13:01:45 +0000 (13:01 +0000)]
Improve cleartmp in a number of aspects:
+ Use rc.subr(8) features properly.
+ Do the whole job of obliterating /tmp contents in find(1).
+ Leave lost+found and quota.{user,group} in /tmp only if root-owned.
+ Make the overall structure clearer by first removing the X dirs
(perhaps along with the rest of /tmp) and then re-creating them.
+ Use "find -exec rm -rf {} +" for efficiency: each rm instance gets
a chance to kill as much files in /tmp as ARG_MAX permits.
scottl [Mon, 16 Oct 2006 04:18:38 +0000 (04:18 +0000)]
- Add a command validator for use in debugging.
- Fix the locking protocol to eliminate races between normal I/O and AENs.
- Various small improvements and usability tweaks.
scottl [Sun, 15 Oct 2006 23:42:56 +0000 (23:42 +0000)]
Overhaul the transmit and dma paths:
- Use bus_dmamap_load_mbuf_sg() to eliminate the need for the callback and
all of the extra bookkeeping associated with it.
- Eliminate the bce_dmamap_arg structure and streamline the memory allocation
routines to not need it. This does change some of the debugging messages.
- Refactor the loop that fills the buffer descriptor so that it can be done
with a single set of logic in a single loop instead of two sets of logic.
- Eliminate the need to cache and pass descriptor indexes between the start
loop and the encap function.
- Change the start loop to always check the ifnet sendq for more work.
This significantly helps the driver withstand large UDP workloads, though
it's still not perfect. I suspect the remaining work lies with handling
the OACTIVE flag, and also in possibly streamlining the interrupt handler
some. It is, however, nearly on par with the other popular gigabit drivers
in terms of stability now.
dwmalone [Sun, 15 Oct 2006 17:34:51 +0000 (17:34 +0000)]
Add a -D option to traceroute that prints the differences between
the probe packet we sent and the packet quoted by the ICMP response.
Can be useful for spotting hops that change the packet in-flight
or have problems generating correct ICMP responses.
netchild [Sun, 15 Oct 2006 14:22:14 +0000 (14:22 +0000)]
MFP4 (with some minor changes):
Implement the linux_io_* syscalls (AIO). They are only enabled if the native
AIO code is available (either compiled in to the kernel or as a module) at
the time the functions are used. If the AIO stuff is not available there
will be a ENOSYS.
From the submitter:
---snip---
DESIGN NOTES:
1. Linux permits a process to own multiple AIO queues (distinguished by
"context"), but FreeBSD creates only one single AIO queue per process.
My code maintains a request queue (STAILQ of queue(3)) per "context",
and throws all AIO requests of all contexts owned by a process into
the single FreeBSD per-process AIO queue.
When the process calls io_destroy(2), io_getevents(2), io_submit(2) and
io_cancel(2), my code can pick out requests owned by the specified context
from the single FreeBSD per-process AIO queue according to the per-context
request queues maintained by my code.
2. The request queue maintained by my code stores contrast information between
Linux IO control blocks (struct linux_iocb) and FreeBSD IO control blocks
(struct aiocb). FreeBSD IO control block actually exists in userland memory
space, required by FreeBSD native aio_XXXXXX(2).
3. It is quite troubling that the function io_getevents() of libaio-0.3.105
needs to use Linux-specific "struct aio_ring", which is a partial mirror
of context in user space. I would rather take the address of context in
kernel as the context ID, but the io_getevents() of libaio forces me to
take the address of the "ring" in user space as the context ID.
To my surprise, one comment line in the file "io_getevents.c" of
libaio-0.3.105 reads:
Ben will hate me for this
REFERENCE:
1. Linux kernel source code: http://www.kernel.org/pub/linux/kernel/v2.6/
(include/linux/aio_abi.h, fs/aio.c)
2. Linux manual pages: http://www.kernel.org/pub/linux/docs/manpages/
(io_setup(2), io_destroy(2), io_getevents(2), io_submit(2), io_cancel(2))
3. Linux Scalability Effort: http://lse.sourceforge.net/io/aio.html
The design notes: http://lse.sourceforge.net/io/aionotes.txt
4. The package libaio, both source and binary:
http://rpmfind.net/linux/rpm2html/search.php?query=libaio
Simple transparent interface to Linux AIO system calls.
5. Libaio-oracle: http://oss.oracle.com/projects/libaio-oracle/
POSIX AIO implementation based on Linux AIO system calls (depending on
libaio).
---snip---
alc [Sat, 14 Oct 2006 23:21:48 +0000 (23:21 +0000)]
Long ago, revision 1.22 of vm/vm_pager.h introduced a bug. Specifically,
it introduced a check after the call to file system's get pages method
that assumes that the get pages method does not change the array of pages
that is passed to it. In the case of vnode_pager_generic_getpages(),
this assumption has been incorrect. The contents of the array of pages
may be shifted by vnode_pager_generic_getpages(). Likely, the problem
has been hidden by vnode_pager_haspage() limiting the set of pages that
are passed to vnode_pager_generic_getpages() such that a shift never
occurs.
The fix implemented herein is to adjust the pointer to the array of pages
rather than shifting the pages within the array.
ru [Sat, 14 Oct 2006 19:01:55 +0000 (19:01 +0000)]
Prevent IOC_IN with zero size argument (this is only supported
if backward copatibility options are present) from attempting
to free memory that wasn't allocated. This is an old bug, and
previously it would attempt to free a null pointer. I noticed
this bug when working on the previous revision, but forgot to
fix it.
Security: local DoS
Reported by: Peter Holm
MFC after: 3 days