Commit graph

56943 commits

Author SHA1 Message Date
Craig Rodrigues 93d9c69ff4 Initial import of read-only support for SGI's XFS filesystem.
Contributed by:		XFS for FreeBSD project
2005-12-12 01:04:32 +00:00
Craig Rodrigues 92f44a3f3c Contributions from XFS for FreeBSD project:
- Implement cv_wait_unlock() method which has semantics compatible
  with the sv_wait() method in IRIX.  For cv_wait_unlock(), the lock
  must be held before entering the function, but is not held when the
  function is exited.

- Implement the existing cv_wait() function in terms of cv_wait_unlock().

Submitted by:	kan
Feedback from:	jhb, trhodes, Christoph Hellwig <hch at infradead dot org>
2005-12-12 00:02:22 +00:00
Alan Cox 05406e6f33 Remove unneeded calls to pmap_remove_all(). The given page is not mapped.
Reviewed by: tegge
2005-12-11 22:06:57 +00:00
Max Laier 2694019753 Fix calculation of meminfo's swaptotal and swapfree on at least amd64.
MFC after:	3 days
2005-12-11 21:37:42 +00:00
Florent Thoumie 17e41731b7 - Rename UQ_BROKEN_IPOD to UQ_NO_OPEN_CLEARSTALL since it's likely to be used
by more devices than iPods.

Proposed by:	iedowse
Approved by:	ssouhlal
MFC after:	3 days
2005-12-11 20:14:38 +00:00
Andre Oppermann 36ae3fd3c3 Hide the 4k mbuf clusters if the normal clusters are defined to be
4k already.

This unbreaks tinderbox.

Submitted by:	ru
2005-12-10 15:21:04 +00:00
Scott Long d29dab303f Allocate the jumbo rx frame buffer with busdma. 2005-12-10 08:58:48 +00:00
Scott Long 33ffa5853a if_ti has been operating with locks for a while, so remove the GIANT markers.
Also fix man potential locking problems in the cdev ioctl handler.
2005-12-10 01:25:46 +00:00
Scott Long 73c8420784 The if_ti Tigon I/II driver has moved to /sys/dev/ti 2005-12-10 00:38:33 +00:00
Olivier Houchard ac28e95795 - Better use of the busdma API.
- Use spin locks instead of sleep locks.
2005-12-09 23:55:41 +00:00
Olivier Houchard e89ab9292f Fix a harmless bug in the way we allocate the early PTEs. 2005-12-09 23:54:50 +00:00
Olivier Houchard 527962c8c7 The IQ80321 clock is 200MHz, but the IQ80321 is 198MHz, so add a kernel option
to override the frequency
2005-12-09 23:52:51 +00:00
Olivier Houchard b34658e8a9 A #define is not enough, we need to cast from u_long * to uint32_t *. 2005-12-09 22:58:07 +00:00
Olivier Houchard 858b811f34 Define atomic_whatever_long 2005-12-09 22:33:20 +00:00
Olivier Houchard 3e1e996645 In copyout(), quad-align the source buffer, and use ldrd if possible. 2005-12-09 15:31:02 +00:00
Søren Schmidt fb504bef5c Unbreak hotplug support on the ICH6 and ICH7 chipsets. 2005-12-09 14:23:24 +00:00
David Xu 992ee51fc0 Sync with i386, fix compiling for non-SMP. 2005-12-09 13:30:34 +00:00
David Xu 3e70c6f047 Fix compiling warning on 64 bits system. 2005-12-09 13:16:48 +00:00
Pawel Jakub Dawidek 64806a739b Fix build breakage by fixing typo.
Reported by:	glebius
2005-12-09 11:38:02 +00:00
David Xu f71a882f15 Add a sysctl to force a process to sigexit if a trap signal is
being hold by current thread or ignored by current process,
otherwise, it is very possible the thread will enter an infinite loop
and lead to an administrator's nightmare.
2005-12-09 08:29:29 +00:00
David Xu 528b9bcd6e Remove itimers_event_hook, now it is a private function in kern_time.c. 2005-12-09 08:19:31 +00:00
Ruslan Ermilov 1fb27d4388 Fix memory leak.
PR:		kern/90113
Submitted by:	Antoine Brodin
2005-12-09 07:09:44 +00:00
David Xu d26b1a1fb9 Register itimers_event_hook as a kernel event handler, so I don't
have to duplicate code to call it in exec() and exit1().
2005-12-09 05:43:26 +00:00
SUZUKI Shinsuke 7014e0eb11 fixed a kernel crash at the initialization time of PIM-SM register interface
MFC after: 2 days
2005-12-09 04:42:19 +00:00
David Xu 102178d0df Comment out mqfs_create_link. Inline some small functions. 2005-12-09 02:38:29 +00:00
David Xu 5c4745177f Now SIGCHLD is always queued. 2005-12-09 02:27:55 +00:00
David Xu 761a4d9423 Cleanup sigqueue sysctl. 2005-12-09 02:26:44 +00:00
Pawel Jakub Dawidek 24e1fdcd1a - Allow to specify the byte which will be used for filling read buffer.
- Improve sysctl description a bit.

Submitted by:	Ivan Voras <ivoras@gmail.com>
2005-12-08 23:06:59 +00:00
Pawel Jakub Dawidek df3d5a19fc Teach NOP GEOM class how to gather the following statistics:
- number of read I/O requests,
- number of write I/O requests,
- number of read bytes,
- number of written bytes.
Add 'reset' subcommand for resetting statistics.
2005-12-08 23:00:31 +00:00
Warner Losh c46a4f9afd Careful measurement of the ST Labs card shows that the pulse width of
transmitted bits was between 8.6180us and 8.6200us when we used a RCLK
of 16.500MHz.  This is a little low (should be 8.6805us).  This error
is exactly the error one would expect if it actually had a 16.384MHz
watch oscillator (as suggested by garrett) instead of using the PCI
RCLK.  Assume that the pci clock therefore wasn't really used, but
instead the cheap 16.384MH watch quartz oscillator.  This gives bits
in the 8.6800us to 8.6810us ranage, which matches theoretical.

Submitted by: garrett
2005-12-08 22:29:42 +00:00
Doug Ambrisko 204634a652 Regen for futimes. 2005-12-08 22:15:09 +00:00
Doug Ambrisko 8e7604db06 Add 32bit version of futimes so untar doesn't result in bad dates
(Jan 1, 1970) when run on amd64.

Reviewed by:	ps
2005-12-08 22:14:25 +00:00
Craig Rodrigues 16f99fe169 Add support for 7320 and 915 PCIe chipsets.
Submitted by:	Gavin Atkinson <gavin.atkinson at ury dot york dot ac dot uk>
PR:		kern/79139
Reviewed by:	scottl
2005-12-08 18:55:15 +00:00
John Baldwin 47d65ba4d0 Whitespace: reduce diffs with amd64. 2005-12-08 18:33:48 +00:00
John Baldwin 333b8de537 MFi386:
- Move PUSH_FRAME and POP_FRAME to asmacros.h and use PUSH_FRAME in
  atpic entry points.
- Move PCPU_* asm macros out of the middle of the asm profiling macros.
- Pass IRQ vector argument as an int rather than void * to reduce diffs
  with i386.
- EOI the lapic in C for the lapic timer handler.
- GC unused Xcpuast function.
- Split IPI_STOP handling code of ipi_nmi_handler() out into a
  cpustop_handler() function and call it from Xcpustop rather than
  duplicating all the logic in assembly.
- Fixup the list of symbols with interrupt frames in ddb traces.
  Xatpic_fastintr* have never existed on amd64, and the lapic timer
  handler and various IPI handlers were missing.
- Use trapframe instead of intrframe for interrupt entry points (on amd64
  the interrupt vector was already a separate argument, so the two frames
  were already identical) and GC intrframe.

Submitted by:	peter (3)
2005-12-08 18:33:30 +00:00
Gleb Smirnoff 1be6acb7c0 A big rewrite of receive Jumbo frame handling. Remove the local Jumbo
cluster allocator, that wasn't MPSAFE. Instead, utilize our new generic
UMA jumbo cluster allocator. Since UMA gives us a 9k piece that is contigous
in virtual memory, but isn't contigous in physical memory we need to handle
a few segments. To deal with this we utilize Tigon chip feature - extended
RX descriptors, that can handle up to four DMA segments for one frame.

Details:

o Remove bge_alloc_jumbo_mem(), bge_free_jumbo_mem(),
  bge_jalloc(), bge_jfree() functions.
o Remove SLIST heads, bge_jumbo_tag, bge_jumbo_map from softc.
o Use extended RX BDs for Jumbo receive producer ring, and
  initialize it appropriately.
o New bge_newbuf_jumbo():
  - Allocate an mbuf with Jumbo cluster with help of m_cljget().
  - Load the cluster for DMA with help of bus_dmamap_load_mbuf_sg().
  - Assert that we got 3 segments in the DMA mapping.
  - Fill in these 3 segments into the extended RX descriptor.
2005-12-08 16:11:45 +00:00
Gleb Smirnoff 7a14354549 Suppress logging about unimplemented syscalls to one time per process. This
prevents hard flood of the system console.

Reviewed by:	bde
2005-12-08 13:33:57 +00:00
Oleg Bulyzhin dab5cd0588 1) fix tiny bug in bge_start_locked()
2) rework link state detection code & use it in POLLING mode
3) fix 2 bugs in link state detection code:
	a) driver unable to detect link loss on bcm5721
	b) on bcm570x chips (tested on bcm5700 bcm5701 bcm5702) driver fails
	   to detect link loss with probability 1/6 (solved in brgphy.c)

Devices working in TBI mode should not be affected by this change.

Approved by:	glebius (mentor)
MFC after:	1 month
2005-12-08 13:31:52 +00:00
Andre Oppermann d5269a636b Add an API for jumbo mbuf cluster allocation and also provide
4k clusters in addition to 9k and 16k ones.

 struct mbuf *m_getjcl(int how, short type, int flags, int size)
 void *m_cljget(struct mbuf *m, int how, int size)

m_getjcl() returns an mbuf with a cluster of the specified size attached
like m_getcl() does for 2k clusters.

m_cljget() is different from m_clget() as it can allocate clusters
without attaching them to an mbuf.  In that case the return value
is the pointer to the cluster of the requested size.  If an mbuf was
specified, it gets the cluster attached to it and the return value
can be safely ignored.

For size both take MCLBYTES, MJUM4BYTES, MJUM9BYTES, MJUM16BYTES.

Reviewed by:	glebius
Tested by:	glebius
Sponsored by:	TCP/IP Optimization Fundraise 2005
2005-12-08 13:13:06 +00:00
Yoshihiro Takahashi 944b597264 Switch MACHINE to "pc98" on FreeBSD/pc98.
Add copyright.

Approved by:	FreeBSD/pc98 development team.
2005-12-08 12:35:12 +00:00
David Xu ac98951601 o Remove SI_KERNEL until I really implemented it.
o Add definition SI_NOINFO for zero si_code.
2005-12-08 09:00:54 +00:00
Hajimu UMEMOTO 4a3df7fe7b the response NS to a DAD NS was not sent correctly due to the
invalid destination address.

Submitted by:	JINMEI Tatuya <jinmei__at__isl.rdc.toshiba.co.jp>
MFC after:	1 day
2005-12-08 06:43:39 +00:00
Craig Rodrigues d5989f64cf In devfs_first(), set mp->mnt_opt to a valid empty list of mount options
instead of leaving it NULL.  This eliminates a kernel panic
when trying to do a mount -o update of /dev.

Noticed by:	cjsp
Reviewed by:	phk
2005-12-08 04:27:53 +00:00
Craig Rodrigues 8539ca4cde Add "errmsg" to list of global mount options. 2005-12-08 04:09:29 +00:00
Ian Dowse 2b58bea7c0 Reorder the calling of the completion callback and the transfer
"done" method so that for non-repeat operations we have completely
finished with the transfer by the time the callback is invoked.
This makes it possible to recycle a transfer from within the callback
routine for the same transfer. Previously this almost worked, but
with OHCI controllers calling the "done" method after the callback
would zero out some important fields needed by the recycled transfer.
Only some usb peripheral drivers such as ucom appear to rely on the
ability to reuse a transfer from its callback.

MFC after:	1 week
2005-12-08 03:08:17 +00:00
Jung-uk Kim 200bc1f049 Do not accept an empty bpf program. 2005-12-08 00:05:03 +00:00
Jung-uk Kim ae2cb97e54 Fix build without BPF_JITTER option. 2005-12-07 21:41:45 +00:00
Jung-uk Kim 848c454cc1 Add BPF Just-In-Time compiler support for ng_bpf(4).
The sysctl is changed from net.bpf.jitter.enable to net.bpf_jitter.enable
and this controls both bpf(4) and ng_bpf(4) now.
2005-12-07 21:30:47 +00:00
David E. O'Brien 9da0c15871 Add support for the nVidia nForce MCP12 & MCP13 Networking Adapters. 2005-12-07 17:38:03 +00:00
David E. O'Brien 6e24020ff6 Catch up to the nvenetlib 1.0-0310 import. 2005-12-07 17:36:53 +00:00
David E. O'Brien d5d59bade9 This commit was generated by cvs2svn to compensate for changes in r153200,
which included commits to RCS files with non-trunk default branches.
2005-12-07 17:32:13 +00:00
David E. O'Brien b734606dff Update the nForce MCP NIC bits. This is version 1.0-0310 23-Nov-2005. 2005-12-07 17:32:13 +00:00
Warner Losh 5d4d5ea6e1 Use __DEVOLATILE to cast conspeed. 2005-12-07 07:23:53 +00:00
David E. O'Brien ed698028bd style(9) nits 2005-12-07 03:41:12 +00:00
David E. O'Brien 87b00cfafe Add Sparc TLS relocation definitions. 2005-12-07 03:39:37 +00:00
Craig Rodrigues 6951bea6c8 Changes imported from XFS for FreeBSD project:
- add fields to struct buf (needed by XFS)
    - 3 private fields: b_fsprivate1, b_fsprivate2, b_fsprivate3
    - b_pin_count, count of pinned buffer

- add new B_MANAGED flag
- add breada() function to initiate asynchronous I/O on read-ahead blocks.
- add bufdone_finish(), bpin(), bunpin_wait() functions

Patches provided by:	kan
Reviewed by:		phk
Silence on:		arch@
2005-12-07 03:39:08 +00:00
Peter Wemm 79880f7327 Catch up to the system siginfo changes. Use a union for the ia32 layout
of siginfo just like the system one.  There are now two fields to copy
instead of one.
2005-12-06 23:06:29 +00:00
John Baldwin 696effb697 - Cleanup whitespace and extra ()s in vtophys() macros.
- Move vtophys() macros next to vtopte() where vtopte() exists to match
  comments above vtopte().
- Remove references to the alternate address space in the comment above
  vtopte().  amd64 never had the alternate address space, and i386 lost it
  prior to PAE support being added.
- s/entires/entries/ in comments.

Reviewed by:	alc
2005-12-06 21:09:01 +00:00
Jung-uk Kim 50c9fad9ce Fix ZERO_EDX() macro from the previous commit. It was emitting
`xor %ecx, %ecx', not `xor %edx, %edx'.
2005-12-06 20:11:07 +00:00
Marius Strobl b6c63e2a81 Use <sys/ktr.h> directly in .S files instead of exporting the
KTR_* class macros via genassym.c. Together with sys/sys/ktr.h
rev. 1.34 this has the desired side-effect of providing a default
value for KTR_COMPILE. Thus this fixes warnings from -Wundef
regarding KTR_COMPILE not being defined for .S files.

Requested by:	ru
Reviewed by:	ru
2005-12-06 16:38:08 +00:00
Marius Strobl 3e4e0e14f6 Extend the scope of #ifndef LOCORE to also cover the prototype of
ktr_tracepoint() and the macros using it. This allows this header
to be included in .S files for obtaining the KTR_* class macros
directly and providing a default value for KTR_COMPILE in case it's
not specified in the kernel config file including defining it to 0
when not using 'options KTR' at all.

Requested by:	ru
Reviewed by:	ru
2005-12-06 16:37:01 +00:00
Ruslan Ermilov 81ee234642 When compiling with the kernel, detect if INET6 support should be disabled. 2005-12-06 14:55:46 +00:00
Nate Lawson 31bef809aa Revert two changes I was testing regarding polling delay. 2005-12-06 14:51:55 +00:00
Nate Lawson c4a9fa4529 Add KTR support and move some performance debugging variables in the EC
to KTR.  We're reusing the KTR_DEV level.
2005-12-06 14:47:28 +00:00
Ruslan Ermilov 224d140293 Drop _MACHINE_ARCH and _MACHINE defines (not to be confused with
MACHINE_ARCH and MACHINE).  Their purpose was to be able to test
in cpp(1), but cpp(1) only understands integer type expressions.
Using such unsupported expressions introduced a number of subtle
bugs, which were discovered by compiling with -Wundef.
2005-12-06 13:27:21 +00:00
Ruslan Ermilov 5219ffdbe0 cpp(1) only understand integer arithmetical expressions, so
_MACHINE == i386 test always succeeds, even on non-i386 (both
sides of expressions become 0).  Remove the comment since
_MACHINE and _MACHINE_ARCH are going away.
2005-12-06 13:22:14 +00:00
Yoshihiro Takahashi acd892b65d MFi386: Add BPF Just-In-Time compiler. 2005-12-06 12:26:24 +00:00
Ruslan Ermilov 44e09d2fa2 Fix -Wundef warnings from compiling GENERIC and LINT kernels of
all architectures.
2005-12-06 11:19:37 +00:00
Gleb Smirnoff bbce982bd5 When we drop packet due to no space in output interface output queue, also
increase the ifp->if_snd.ifq_drops.

PR:		72440
Submitted by:	ikob
2005-12-06 11:16:11 +00:00
Gleb Smirnoff 95d1f36f82 Optimize parallel processing of ipfw(4) rulesets eliminating the locking
of the radix lookup tables. Since several rnh_lookup() can run in
parallel on the same table, we can piggyback on the shared locking
provided by ipfw(4).
  However, the single entry cache in the ip_fw_table can't be used lockless,
so it is removed. This pessimizes two cases: processing of bursts of similar
packets and matching one packet against the same table several times during
one ipfw_chk() lookup. To optimize the processing of similar packet bursts
administrator should use stateful firewall. To optimize the second problem
a solution will be provided soon.

Details:
  o Since we piggyback on the ipfw(4) locking, and the latter is per-chain,
    the tables are moved from the global declaration to the
    struct ip_fw_chain.
  o The struct ip_fw_table is shrunk to one entry and thus vanished.
  o All table manipulating functions are extended to accept the struct
    ip_fw_chain * argument.
  o All table modifing functions use IPFW_WLOCK_ASSERT().
2005-12-06 10:45:49 +00:00
David Xu d38c190054 Sync with signal.h. 2005-12-06 07:54:10 +00:00
Alan Cox 8ad398d089 Reduce the scope of the page queues lock in exec_map_first_page(). The vm
object lock is sufficient for reading a page's PG_BUSY and busy flags.

MFC after: 1 week
2005-12-06 07:39:36 +00:00
Jung-uk Kim 6a96c4832f s/M_WAITOK/M_NOWAIT/ while mutex is held.
Pointed out by:	csjp
2005-12-06 07:22:01 +00:00
Jung-uk Kim 23a8fc28c2 - Micro-optimize mov $0, %edx' -> xor %edx, %edx'.
- Correct amd64 macro style (no functional change).
2005-12-06 06:45:39 +00:00
David Xu 9da8a32aae o Turn on MPSAFE flag for mqueuefs.
o Reuse si_mqd field in siginfo_t, this also gives userland
  information about which descriptor is notified.
2005-12-06 06:22:12 +00:00
David Xu 1a2d6e30c8 o Add some pad fields into struct sigevent for future extension.
(suggested by alfred@)
o Reuse si_band field in struct __siginfo, add a mqd member which will
  be used by mqueue.
o Add code SI_KERNEL to indicate a signal is queued by kernel.
2005-12-06 06:02:35 +00:00
David Xu 027f760408 Fix a lock leak in childproc_continued(). 2005-12-06 05:30:13 +00:00
Jung-uk Kim ae275efcae Add experimental BPF Just-In-Time compiler for amd64 and i386.
Use the following kernel configuration option to enable:

	options BPF_JITTER

If you want to use bpf_filter() instead (e. g., debugging), do:

	sysctl net.bpf.jitter.enable=0

to turn it off.

Currently BIOCSETWF and bpf_mtap2() are unsupported, and bpf_mtap() is
partially supported because 1) no need, 2) avoid expensive m_copydata(9).

Obtained from:	WinPcap 3.1 (for i386)
2005-12-06 02:58:12 +00:00
Warner Losh 7640c87195 The Oxford 16C950 based CardBus Serial device that I was given some
time ago appears to be based not on the typical 1.8432MHz clock, or
the other more typical multiple of 8 of this (14.7456MHz), but instead
it appears to be 1/2 the PCI clock rate or 16.50000MHz.  I'm not 100%
sure that this is right, but since I did the original entry, I'm going
to go ahead and modify it.  With the 14.7456MHz value, I was getting
bits that were ~7.3us instead of ~8.6us like they are supposed to be.

My measuring gear for today is a stupid handheld scope with two
signficant digits.  So I don't know if it is 33.000000/2 MHz or some
other value close to 16.5MHz, but 16.5MHz works well enough for me to
use a couple of different devices at 115200 baud, and is a nice even
multiple of a well known clock frequency...
2005-12-05 23:30:28 +00:00
John Baldwin 2dce95a085 Change the i386 code to pass the interrupt vector as a separate argument
rather than embedding it in the intrframe as if_vec.  This reduces diffs
with amd64 somewhat.
- Remove cf_vec from clockframe (it wasn't used anyway) and stop pushing
  dummy vector arguments for ipi_bitmap_handler() and lapic_handle_timer()
  since clockframe == trapframe now.
- Fix ddb to handle stack traces across interrupt entry points that just
  have a trapframe on their stack and not a trapframe + vector.
- Change intr_execute_handlers() to take a trapframe rather than an
  intrframe pointer.
- Change lapic_handle_intr() and atpic_handle_intr() to take a vector and
  trapframe rather than an intrframe.
- GC struct intrframe now that nothing uses it anymore.
- GC CLOCK_TO_TRAPFRAME() and INTR_TO_TRAPFRAME().

Reviewed by:	bde
Requested by:	peter
2005-12-05 22:39:09 +00:00
Scott Long dc7a8b0067 FreeBSD has had endian conversion macros for a long time. Axe the custom
macros in this driver.

MFC After: 3 days
2005-12-05 22:37:37 +00:00
Søren Schmidt b39424ba7a Dont use the BUS_DMA_ALLOCNOW flag. Instead use BUS_DMA_NOWAIT and return
ENOMEM to the upper layers if we run out of memory.

This solves part of the trouble with running on >4GB memory systems.
2005-12-05 22:31:55 +00:00
John Baldwin f0b9813920 - Move the code to deal with handling an IPI_STOP IPI out of
ipi_nmi_handler() and into a new cpustop_handler() function.  Change
  the Xcpustop IPI_STOP handler to call this function instead of
  duplicating all the same logic in assembly.
- EOI the local APIC for the lapic timer interrupt in C rather than
  assembly.
- Bump the lazypmap IPI counter if COUNT_IPIS is defined in C rather than
  assembly.
2005-12-05 22:25:41 +00:00
John Baldwin 7e70788a5c Remove unused local variable misssed in previous commit. 2005-12-05 22:20:23 +00:00
Sam Leffler a196b35f08 correct handling of dtim for periods > 1
Obtained from:	madwifi
2005-12-05 22:14:13 +00:00
John Baldwin ac7326e338 Don't panic if IRQ 13 doesn't exist. On some machines (see previous
commit to atpic.c) there may not be an IRQ 13.  Instead, just keep going.
If the INT16 interface doesn't work then we will eventually panic anyway.

FWIW: We could probably just axe the support for IRQ 13 altogether at this
point.  The only thing we'd lose support for are 486sx systems with
external 487 FPUs.

MFC after:	1 week
2005-12-05 22:11:44 +00:00
John Baldwin 5ae84c09e7 Really slam the door on mixed mode now that we don't depend on it for a
working IRQ0 with APIC anymore.  Previously, it was possible to have
some other ATPIC IRQS "leak" through in a few edge cases.  For example, on
my x86 test machine, ACPI re-routes the SCI (IRQ 9) to intpin 13 on the
first I/O APIC.  This leaves a hole for IRQ 13 (since the APIC doesn't
provide a source for IRQ 13 in that case) with the result that the ATPIC
IRQ13 source was registered instead.  This changes the 8259A drivers to
only register their interrupt sources if none of the 16 ISA IRQs have an
interrupt source already installed.

MFC after:	1 week
2005-12-05 22:09:30 +00:00
John Baldwin 48c8cbcb82 - Move PUSH_FRAME and POP_FRAME into machine/asmacros.h.
- Add a new SET_KERNEL_SREGS macro that sets up %ds and %es to point to
  kernel data and %fs to point to per-CPU data and use the new macro
  in several kernel entry points including trap and interrupt handlers.
- Convert the IPI_STOP handler Xcpustop to push a standard trap frame
  rather than an application frame.
- Make the TRAP() macro private to exception.s since it is only used
  there.
- Move the PCPU_*() macros in asmacros.h out of the middle of the
  profiling macros.

Reviewed by:	bde
Requested by:	bde (4, 5)
2005-12-05 21:44:47 +00:00
John Baldwin 5714e9ea59 - Don't make the driver lock recursive, it shouldn't be recursively
acquired anywhere in the driver now.
- Axe the spin mutex used for the nve_oslock*() routines.  The driver lock
  already provides sufficient synchronization.
- Don't mess around with IFF_UP when the link state changes.  IFF_UP is
  an administrative flag, not a link status indicator.

MFC after:	1 week
2005-12-05 20:49:45 +00:00
John Baldwin 5d2162b2f8 Tweak witness handling of lock object to shave 2 pointers off of each
lock object (and thus off of each mutex and sx lock):
- Rename the all_locks list to pending_locks and only put locks initialized
  before SI_SUB_WITNESS on the list so that the SI_SUB_WITNESS can add them
  to witness once it starts up.
- Now that pending_locks is only used during early startup, change it from
  a TAILQ to an STAILQ.  This removes a pointer from the STAILQ_ENTRY in
  struct lock_object.
- Since the pending_locks list is only used during the single-threaded
  early boot it no longer needs to be protected by a mutex, so remove
  all_mtx.
- Since the lo_list member of struct lock_object is now only used during
  early boot before witness is running, collapse lo_list and lo_witness
  into a union.  This shaves the second pointer off of struct lock_object.
- Axe lock_cur_cnt and lock_max_cnt.

With these changes, struct mtx shrinks from 36 to 28 bytes on 32-bit
platforms and from 72 to 56 bytes on 64-bit platforms.  Note that this
commit will completely and utterly destroy the kernel ABI, so no MFC.

Tested on:	alpha, amd64, i386, sparc64
2005-12-05 20:45:24 +00:00
John Baldwin f9959468bb If pci_link has been disabled via the acpi_disable tunable, then bail
immediately from acpi_pci_link_route_interrupt() since we aren't going
to have a valid pci_link device to talk to try to route interrupts.  This
fixes a page fault if you disable just pci_link.  Note that trying to use
ACPI without pci_link is probably not advised however.

MFC after:	1 week
Tested by:	Eugene Grosbein eugen at kuzbass dot ru
2005-12-05 19:50:00 +00:00
Tai-hwa Liang 8bfc230455 Recent nmount(2) adoption in mount_smbfs(8) did not flag the "long" option
since mount_smbfs(8) assumed long name mounting by default unless "-n long"
was explicitly specified.

Rather than supplying a "long" option in mount_smbfs(8), this commit brings
back the original behaviour by associating SMBFS_MOUNT_NO_LONG with the
"nolong" option.  This should fix the broken long file names on smbfs people
observed recently.

Reported by:	Vladimir Grebenschikov <vova at fbsd dot ru>
Reviewed by:	phk
Tested by:	Slawa Olhovchenkov <slw at zxy dot spb dot ru>
2005-12-05 19:05:06 +00:00
Søren Schmidt 02268a2d11 Switch off debugging that was left on in last commit. 2005-12-05 17:58:11 +00:00
Søren Schmidt eed08844c9 Add support for writing Intel MatrixRAID arrays.
Do a little better on handling volumes as well, however we cant create
multiple volumes from FreeBSD yet.

HW sponsored by:        Mullet Scandinavia AB
2005-12-05 17:33:57 +00:00
Ruslan Ermilov 8c7a62275a Prepare for MACHINE and hw.machine switching to "pc98" on FreeBSD/pc98.
Reviewed by:	nyan
2005-12-05 14:22:12 +00:00
Olivier Houchard 5b6aaee426 Try to use contigmalloc() even if M_NOWAIT has been specified. 2005-12-05 12:58:44 +00:00
Olivier Houchard d0cd9702ef Teach the elf trampoline how to deal with gzipped kernels. 2005-12-05 12:55:46 +00:00
Marius Strobl 802cab0330 - Rev. 1.175 fixed compilation on sparc64 but also backed out zeroing of
the eaddr array (introduced in rev. 1.174) prior to writing to it. As
  dc_read_eeprom() is told to write only 3 16-bit words to eaddr but eaddr
  in fact is somewhat larger removal of the zeroing defeated the check
  whether the MAC address is all zero as there can be some random garbage
  in eaddr past the 3 words written to it and the check verifys all bits
  in eaddr. Solve this by changing the check to verify only the 3 words
  (happenning to be ETHER_ADDR_LEN bytes) written to eaddr.
- While here change the notation of "FCode" in a nearby comment to the
  official way.

Ok'ed by:	marcel, ru
2005-12-05 12:32:20 +00:00
Ruslan Ermilov 342ed5d948 Fix -Wundef warnings found when compiling i386 LINT, GENERIC and
custom kernels.
2005-12-05 11:58:35 +00:00
Craig Rodrigues 1bcf331236 Bump __FreeBSD_version to reflect removal of MNT_NODEV mount option.
Requested by:	marcus
2005-12-05 09:13:35 +00:00
David Xu 052ea11c71 After reading some documents, I realized SIGEV_NONE != NULL, also
fix code in mqueue_send_notification to handle SIGEV_NONE.
2005-12-05 04:41:32 +00:00
David Xu 9947b45978 Handle SIGEV_NONE, if notification is SIGEV_NONE, error status and
return status will be set, but no notification will be registered.
Increase hard limit of maxmsg to 100, so posixtestsuite ports can run.
2005-12-05 03:23:27 +00:00
Florent Thoumie 645cf3805a - Add Product IDs for iPod 3G and iPod Video.
- Add an USB quirk for iPods, da(4) devices are now successfully created.

Approved by:	ssouhlal
MFC after:	1 week
2005-12-05 01:51:28 +00:00
Alan Cox 717f7d5962 Simplify vmspace_dofree(). 2005-12-04 22:55:41 +00:00
Ruslan Ermilov 2a40d89ff4 Use compile-time detection of 64-bit addressing. 2005-12-04 12:37:19 +00:00
Ruslan Ermilov 69a7db097e Use a compile-time detection of 64-bit addressing so that this
compiles on 32-bit machines.

Reported by:	ale
2005-12-04 12:30:34 +00:00
Ruslan Ermilov 3238c6bd33 Fix -Wundef from compiling the amd64 LINT. 2005-12-04 10:06:06 +00:00
Ruslan Ermilov 4cbc44fb19 Fix -Wunder and make the sbus code really compile only on sparc64. 2005-12-04 10:03:00 +00:00
Ruslan Ermilov 77cd5a64cf Fix -Wundef warnings and properly check the size of long, FWIW. 2005-12-04 10:01:44 +00:00
Ruslan Ermilov b2be20597c Oops, the bug is still here, but reimplement the cpp(1) conditional properly. 2005-12-04 09:57:09 +00:00
Ruslan Ermilov 44dbe53f04 There no longer seems to be this bug in gcc(1). Remove the
badly implemented workaround that caused a workaround to be
applied to all architectures, not only amd64.
2005-12-04 09:47:20 +00:00
Ruslan Ermilov 8069c79ddd Fix on sparc64. 2005-12-04 07:45:12 +00:00
Bruce A. Mah 71ddfdfb45 Recognize the Sony Clie PEG-TJ37.
Tested on:	My PEG-TJ37 and my RELENG_6 workstation
MFC after:	1 week
2005-12-04 07:34:19 +00:00
Sam Leffler be425a0f40 Adhoc mode fixups:
o plug memory leak in adhoc mode: on rx the sender may be the
  current master so simply checking against ic_bss is not enough
  to identify if the packet comes from an unknown sender; must
  also check the mac address
o split neighbor node creation into two routines and fillin state
  of nodes faked up on xmit when a beacon or probe response frame
  is later received; this ensures important state like the rate set
  and advertised capabilities are correct

Obtained from:	netbsd
MFC after:	1 week
2005-12-04 04:50:27 +00:00
Ruslan Ermilov f4e9888107 Fix -Wundef. 2005-12-04 02:12:43 +00:00
Ruslan Ermilov c7e7950d2d Use __LP64__ to check for the 64-bit pointer type, and fix -Wundef. 2005-12-04 00:25:03 +00:00
Alan Cox 51016cdfd7 Eliminate unneeded preallocation at initialization.
Reviewed by: tegge
2005-12-03 22:41:15 +00:00
Ruslan Ermilov 570cc5c1b0 Use a simpler way to reach the <machine> include dir, which should
also work on pc98.
2005-12-03 21:37:54 +00:00
John Baldwin d37d99c4aa Force any hardwire-routed interrupts to level trigger and active low
polarity.  Some machines route PCI IRQs to an ISA IRQ but fail to include
an interrupt override entry to set the polarity and trigger of the given
ISA IRQ in their MADT table.

PR:		usb/74989
Reported by:	Julien Gabel jpeg at thilelli dot net
MFC after:	1 week
2005-12-03 21:17:17 +00:00
Marius Strobl 58299dd09e - Move the declaration of struct upa_ranges and the UPA_RANGE_* macros
from sys/sparc64/include/ofw_upa.h to sys/sparc64/pci/ofw_pci.h and
  rename them to struct ofw_pci_ranges and OFW_PCI_RANGE_* respectively.
  This ranges struct only applies to host-PCI bridges but no to other
  bridges found on UPA. At the same time it applies to all host-PCI
  bridges regardless of whether the interconnection bus is Fireplane/
  Safari, JBus or UPA.
- While here rename the PCI_CS_* macros in sys/sparc64/pci/ofw_pci.h
  to OFW_PCI_CS_* in order to be consistent and change this header to
  use uintXX_t instead of u_intXX_t.
2005-12-03 19:52:20 +00:00
Alan Cox 8215781ba2 Eliminate unneeded preallocation at initialization.
Reviewed by: tegge
2005-12-03 19:37:29 +00:00
Marius Strobl a244680c0f - Adhere style(9) (don't use function calls in initializers).
- Use FBSDID.
2005-12-03 18:52:31 +00:00
Marius Strobl 2c5bc54014 Remove unused sc_node from softc. 2005-12-03 18:14:47 +00:00
Marius Strobl 9ec0f71c35 - Adhere style(9) (don't use function calls in initializers, use uintXX_t
instead of u_intXX_t).
- Use FBSDID.
2005-12-03 18:11:26 +00:00
Marius Strobl 3a721a33cf - Register the PCI bus error interrupt handler according to which half of
the bridge (PCI bus A or B) we are attaching to rather than registering
  both handlers at once when attaching to the first half we encounter.
  This is a bit cleaner as it corresponds to which PCI bus error interrupt
  actually is assigned to the respective half by the OFW and allows to
  collapse both PCI bus error interrupt handlers into one function easily.
- Use the actual RID of the respective interrupt resource as index into
  sc_irq_res and also use it when allocating the resource. For now this
  is a bit cleaner and will be mandatory later on.
- According to OpenSolaris the spare hardware interrupt is used as the
  over-temperature interrupt in systems with Psycho bridges. Unlike as
  with the SBus-based workstations I didn't manage to trigger it when
  covering the fan outlets of an U60 but better be safe than sorry and
  register a handler anyway.

MFC after:	1 month
2005-12-03 16:36:54 +00:00
Marius Strobl 114bfbb64e - Improve the comment regarding the workaround for the E250 interrupt map
bug by explaining what the problem is and how the workaround works.
- Fix some cosmetics nits, mainly properly terminate sentences in comments,
  which I missed when backporting the style changes to psycho(4) in psycho.c
  rev. 1.54 due to lack of corresponding code.
- The "USIIe version of the Sabre bridge" actually is termed "Hummingbird";
  name it as such in comments and messages.
2005-12-03 13:08:05 +00:00
Craig Rodrigues 1245b3433e Add "rdonly" to global_opts, and parse it in vfs_donmount().
Requested by:	rwatson
2005-12-03 12:04:20 +00:00
Marius Strobl d8154a2aeb Convert to use the recently introduced set of ofw_bus_gen_get_*() for
providing the ofw_bus KOBJ interface.

Tested by:	grehan
2005-12-03 11:59:26 +00:00
David Xu 0e263b06af Add option P1003_1B_MQUEUE. 2005-12-03 01:40:38 +00:00
Craig Rodrigues ec528a3472 - Add "rw" mount option to global_opts.
- In vfs_donmount(), parse "ro", "noro", and "rw", in order to set or
  unset the MNT_RDONLY filesystem flag.
2005-12-03 01:26:27 +00:00
Eric Anholt 69b9fffc84 Merge DRM CVS as of 2005-12-02, adding i915 DRM support thanks to Alexey Popov,
and a new r300 PCI ID.
2005-12-03 01:23:50 +00:00
Eric Anholt c703850cb4 Make cleaner diffs by munging the $FreeBSD$s from the FreeBSD CVS sources back
into the new sources.
2005-12-03 00:43:57 +00:00
Eric Anholt 8ec9a6c5a6 Add support for i915 GMCH AGP. This diff is a combination of work by myself
and some fixes from Motomichi Matsuzaki.  Testing involved many people, but the
final, successful testing was from rwatson who endured several rounds of "it
crashes at XYZ stage" "oh, please correct this typo and try again."  The Linux
driver, and to a small extent the limited specs, were both used as a reference
for how to program the chipset.

PR:		kern/80396
Submitted by:	Martin Mersberger
2005-12-02 23:51:36 +00:00
Peter Grehan e2b03d4d48 Register definitions for the ancient via6522. This 20+ year-old chip
still exists as a cell in the Macio asic on Apples, and is used to communicate
through the shift register with the external PMU microcontroller.
2005-12-02 22:36:14 +00:00
Doug Barton 0f3ce2b32c Introduce startup scripts from the local_startup directories to
the base rcorder. This is accomplished by running rcorder twice,
first to get all the disks mounted (through mountcritremote),
then again to include the local_startup directories.

This dramatically changes the behavior of rc.d/localpkg, as
all "local" scripts that have the new rc.d semantics are now
run in the base rcorder, so only scripts that have not been
converted yet will run in rc.d/localpkg.

Make a similar change in rc.shutdown, and add some functions in
rc.subr to support these changes.

Bump __FreeBSD_version to reflect this change.
2005-12-02 20:06:07 +00:00
Alan Cox 4e067a8592 Change pmap_enter_quick() to use the vm_prot_t parameter introduced in
revision 1.179 to correctly set/clear execute permission on the mapping
it creates.  Thus, mmap(2)ing a memory resident file will not result in
the file being mapped with execute permission when execute permission was
not requested.

Eliminate an unneeded Instruction Memory Barrier (IMB) in
pmap_enter_quick().  Since there was no previous (instruction) mapping
for the given virtual address prior to pmap_enter_quick(), there can be
no instructions from the given virtual address in the pipeline that need
flushing.

MFC after: 1 week
2005-12-02 18:02:54 +00:00
David Xu 5b40ce27b2 Add option P1003_1B_MQUEUE for POSIX message queue. 2005-12-02 14:23:39 +00:00
David Xu 5ee2d4ac5a 1. Cleanup including.
2. Set configuration value for CTL_P1003_1B_MESSAGE_PASSING.
2005-12-02 14:09:32 +00:00
John Baldwin 80f049d359 Add a missing newline to a printf.
MFC after:	1 week
2005-12-02 13:35:14 +00:00
Søren Schmidt ddaf769709 Update the ICH7 support so it deals better with chips without AHCI.
Update Intel MatrixRAID support to be able to pick up RAID0+1 (RAID10)
and RAID5 arrays without panic'ing.
This has the side effect of now also supporting multiple volumes on
MatrixRAID's now I have the metadata better understood..

HW sponsored by:	Mullet Scandinavia AB
2005-12-02 10:13:53 +00:00
Eric Anholt 45160a070a Restore the enabling of debugging by default by the DRM_DEBUG kernel option.
It remains controlled by hw.dri.*.debug no matter what.

PR:		kern/85479
Submitted by:	Oliver Fromme <olli@secnetix.de>
2005-12-02 08:53:51 +00:00
Gleb Smirnoff 9d6457b44c On the 82571 and newer chipset the ICR register is meaningful only
if the E1000_ICR_INT_ASSERTED bit is set.

Submitted by:	Jack Vogel
2005-12-02 08:33:56 +00:00
David Xu a6de716d7e 1. Check if message priority is less than MQ_PRIO_MAX.
2. Use getnanotime instead of getnanouptime.
3. Don't free message in _mqueue_send, mqueue_send will free it.
2005-12-02 08:23:49 +00:00
David Xu 06a7aa696e Define MQ_PRIO_MAX, it seems it is the only place
the definition will be shared by kernel and userland.
2005-12-02 07:45:28 +00:00
David Xu e94466c604 messqge queue has been implemented, set _POSIX_MESSAGE_PASSING to 200112L. 2005-12-02 02:52:17 +00:00
David Xu 780523024c We've already implemented all TMO functions, set _POSIX_TIMEOUTS to 200112L. 2005-12-02 02:33:28 +00:00
Marcel Moolenaar 8df1ebe9aa Fix the misalignment bugs differently than was done in the previous
commit. Copy the ethernet address into a local buffer, which we know
is sufficiently aligned for the width of the memory accesses that we
do. This also eliminates all suspicious and potentionally harmful
casts.

In collaboration with: ru
2005-12-02 01:23:20 +00:00
Ruslan Ermilov 6a4cb6fd25 Fix the type of "eaddr" to guarantee the required alignment.
Suggested by:	marcel
2005-12-01 21:18:04 +00:00
David Xu 77e718f773 1. Set timer configuration values for sysconf().
2. Set overrun limit to INT_MAX, report ERANGE error if overrun will be
   greater than INT_MAX.
2005-12-01 07:56:15 +00:00
Ariff Abdullah 964e14b04a Add kernel module loading option for snd_atiixp(4). 2005-12-01 03:10:12 +00:00
David Xu b51d237a67 set signal queue values for sysconf(). 2005-12-01 00:25:50 +00:00
David Xu 045d4ae3f6 Avoid using signal 127 and 128 as RT signals, these two signals confuse
wait4 interfaces, see PR: kern/19402.
2005-11-30 23:47:31 +00:00
Maxim Sobolev 6023800194 It is unclear who is wrong and who is right, but when operating on
plain file bsdlabel(8) always writes label at a fixed offset from
its beginning (512 bytes), regardless of the sector size. At the same
time, bsdlabel geom class expects label to be available at the very
beginning of the second sector.

As a result, images prepared in userland for media with sector size
different from 512 bytes (i.e. 2k for cdroms) are not recognized by
the tasting mechanism.

Solve the problem by always looking for the label at 512-byte offset
if we can't find it at the beginning of the second sector and sector
size is not 512 bytes.
2005-11-30 22:54:41 +00:00
Maxim Sobolev b53a1cf306 Don't pass error value pointer to g_read_data(9) at all if we don't
have any use of it.

Suggested by:	pjd
2005-11-30 22:15:00 +00:00
Sam Leffler f219c9d3d3 fix dynamic changes in short slottime for 11g sta mode: set the
slot time based on the rcvd capabilities, not the existing ones

Obtained from:	atheros
MFC after:	1 week
2005-11-30 19:54:41 +00:00
Maxim Sobolev 8a4a44b5aa Check for g_read_data(9) errors properly:
o The only indication of error condition is NULL value returned by
  the function;

o value pointed to by error argument is undefined in the case when
  operation completes successfully.

Discussed with: phk
2005-11-30 19:24:51 +00:00
Maxim Sobolev 6dfb88de83 Kill leading whilespace. 2005-11-30 19:07:28 +00:00
Ruslan Ermilov a90232e1f7 Teach this to create the "machine" and ${MACHINE_ARCH} (for pc98
only now) symbolic links in the kernel compile directory, rather
than relying on config(8) to do this.  (The changes to config(8)
will be committed separately.)  This is aimed towards making the
config(8) as lightweight as possible.

Idea by:	bde (all bugs are mine)
2005-11-30 18:15:06 +00:00
Ruslan Ermilov 3faffd5dae Byte copy IF_LLADDR() on stack to align it to be safe for typecasts.
Tested by:	jhb
2005-11-30 17:48:23 +00:00
Marius Strobl abffa5185a Remove superfluous bzero()'ing of the softc. 2005-11-30 16:13:49 +00:00
Marius Strobl 0b5f0b533a Remove superfluous inclusion of upa.h. 2005-11-30 16:09:10 +00:00
Gleb Smirnoff f7cea1494f If bus_dmamap_load() failed, we free the mbuf. We also need to clear
the pointer, to avoid double free on next bge_stop().
2005-11-30 12:37:07 +00:00
Yoshihiro Takahashi 54586e49a3 MFi386: revision 1.1215 (add savagedrm). 2005-11-30 11:58:01 +00:00
David Xu b2f92ef96b Last step to make mq_notify conform to POSIX standard, If the process
has successfully attached a notification request to the message queue
via a queue descriptor, file closing should remove the attachment.
2005-11-30 05:12:03 +00:00
Pyun YongHyeon b7994e3488 Add codec ID for Avance Logic ALC203 2005-11-30 01:44:22 +00:00
John Baldwin 398293a8de Fix snderr() to not leak the socket buffer lock if an error occurs in
sosend().  Robert accidentally changed the snderr() macro to jump to the
out label which assumes the lock is already released rather than the
release label which drops the lock in his previous change to sosend().
This should fix the recent panics about returning from write(2) with the
socket lock held and the most recent LOR on current@.
2005-11-29 23:07:14 +00:00
Damien Bergamini 5a69e86294 Tell Rx radiotap that hardware leaves FCS at the end of the frame.
Obtained from:	NetBSD (drochner@)
2005-11-29 21:36:15 +00:00
Damien Bergamini 8a7d0b1d3c Sync with ural:
o Send management frames at the lowest possible rate.
o Cosmetic tweaks.
2005-11-29 21:30:16 +00:00
Damien Bergamini 635df8de16 Use usbd_clear_endpoint_stall_async() instead of usbd_clear_endpoint_stall()
in Tx/Rx callbacks.

Obtained from:	NetBSD
2005-11-29 21:07:32 +00:00
Damien Bergamini 3d5dc80e4d o Send management frames at the lowest possible rate.
o Include rate in the Rx radiotap code.
o Fix RSSI value in the Rx path.
o Minor tweaks.
2005-11-29 20:55:53 +00:00
Andrew Thompson 53b5c4604a The bridge is capable of sending broadcast packets so enable IFF_BROADCAST
Requested by:	des
2005-11-29 20:29:44 +00:00
Søren Schmidt e9bd25bff0 Fix the ata_composite/ata_request leak when using RAID0+1.
Submitted by:	Michael Butler

Minor changes to fit ATA style by me.
2005-11-29 20:08:26 +00:00
Ruslan Ermilov 0d86ed2bc8 Let kmod.mk create empty opt_*.h files. 2005-11-29 19:39:04 +00:00
Hajimu UMEMOTO 8846bbf3ce obey opt_inet6.h and opt_ipsec.h in kernel build directory.
Requested by:	hrs
2005-11-29 17:56:11 +00:00
Pawel Jakub Dawidek 88d172946f We do nothing with returned error value, so just remove it. 2005-11-29 12:07:10 +00:00
Ruslan Ermilov 2f1b461447 Unexpand LLADDR(). 2005-11-29 09:51:47 +00:00
Scott Long f94dfeb481 Separate the hardware definitions into ipsreg.h so they can be used by
future userland tools.
2005-11-29 09:39:41 +00:00
Ruslan Ermilov 35ad1b00b4 Drop the -I/usr/include (or any of its variants) from CFLAGS.
The sys/sys/stddef.h is here for some time now to fulfil the
kernel needs.  It also was not reliable due to the exists(@)
check: in an empty module directory, "make depend; mv .depend
.depend~; make depend" ran mkdep(1) with different arguments.
2005-11-29 09:37:42 +00:00
Gleb Smirnoff b090e4ce1f Garbage-collect now unused struct _ipfw_insn_pipe and flush_pipe_ptrs(),
thus removing a few XXXes.
  Document the ABI breakage in UPDATING.
2005-11-29 08:59:41 +00:00
Ariff Abdullah d9bde1ad7e Add notes about ATI IXP audio controller. 2005-11-29 05:31:46 +00:00
Eric Anholt f0fc8e98b3 Add support for the i855GM, tested by an r300 user. 2005-11-29 04:53:22 +00:00
Maxim Sobolev 5c8a6f63b2 Check value returned by g_read_data(9), otherwise we can end in panic(9)
if read error happens.

MFC after:	1 week
2005-11-29 03:03:34 +00:00
Craig Rodrigues 2207c7648e Remove MNT_NODEV mount option. In RELENG_6, MNT_NODEV was a no-op.
The presence of MNT_NODEV was confusing the am-utils autoconf scripts.

PR:	conf/79715
2005-11-29 00:28:17 +00:00
Gleb Smirnoff 99b41b34fb First step in removing welding between ipfw(4) and dummynet.
o Do not use ipfw_insn_pipe->pipe_ptr in locate_flowset(). The
  _ipfw_insn_pipe isn't touched by this commit to preserve ABI
  compatibility.
o To optimize the lookup of the pipe/flowset in locate_flowset()
  introduce hashes for pipes and queues:
  - To preserve ABI compatibility utilize the place of global list
    pointer for SLIST_ENTRY.
  - Introduce locate_flowset(queue nr) and locate_pipe(pipe nr).
o Rework all the dummynet code to deal with the hashes, not global
  lists. Also did some style(9) changes in the code blocks that were
  touched by this sweep:
  - Be conservative about flowset and pipe variable names on stack,
    use "fs" and "pipe" everywhere.
  - Cleanup whitespaces.
  - Sort variables.
  - Give variables more meaningful names.
  - Uppercase and dots in comments.
  - ENOMEM when malloc(9) failed.
2005-11-29 00:11:01 +00:00
Eric Anholt 9fb0767374 Update DRM to CVS snapshot as of 2005-11-28. Notable changes:
- S3 Savage driver ported.
- Added support for ATI_fragment_shader registers for r200.
- Improved r300 support, needed for latest r300 DRI driver.
- (possibly) r300 PCIE support, needs X.Org server from CVS.
- Added support for PCI Matrox cards.
- Software fallbacks fixed for Rage 128, which used to render badly or hang.
- Some issues reported by WITNESS are fixed.
- i915 module Makefile added, as the driver may now be working, but is untested.
- Added scripts for copying and preprocessing DRM CVS for inclusion in the
  kernel.  Thanks to Daniel Stone for getting me started on that.
2005-11-28 23:13:57 +00:00
Søren Schmidt 7c7e96f58c Fix SiS SATA support, the SATA registers was off.
Add support for SiS metadata.

HW donated by:	obrien
2005-11-28 23:08:37 +00:00
Robert Watson 66dd8a6f99 Move zero copy statistics structure before sosend_copyin().
MFC after:	1 month
Reported by:	tinderbox, sam
2005-11-28 21:45:36 +00:00
John Baldwin d6ef938e56 If we get a stray interrupt, return after logging it. In the extremely
rare case of a stray interrupt to an unregistered source (such as a stray
interrupt from the 8259As when using APIC), this could result in a page
fault when it tried to walk the list of interrupt handlers to execute
INTR_FAST handlers.  This bug was introduced with the intr_event changes,
so it's not present in 5.x or 6.x.

Submitted by:	Mark Tinguely tinguely at casselton dot net
2005-11-28 20:18:43 +00:00
John Baldwin ef627e7da0 When checking to see if a process has exceeded its time limit, flag the
process as over the limit when its time is >= to the limit rather than >
the limit.  Technically, if p->p_rux.rux_runtime.sec == p->p_pcpulimit
and p->p_rux.rux_runtime.frac == 0, the process hasn't exceeded the limit
yet.  However, having the fraction exactly equal to 0 is rather rare, and
it is not worth the overhead to handle that edge case.  With just the >
comparison, the process would have to exceed its limit by almost a second
before it was killed.

PR:		kern/83192
Submitted by:	Maciej Zawadzinski mzawadzinski at gmail dot com
Reviewed by:	bde
MFC after:	1 week
2005-11-28 19:09:08 +00:00
Robert Watson a725629cf8 Break out functionality in sosend() responsible for building mbuf
chains and copying in mbufs from the body of the send logic, creating
a new function sosend_copyin().  This changes makes sosend() almost
readable, and will allow the same logic to be used by tailored socket
send routines.

MFC after:	1 month
Reviewed by:	andre, glebius
2005-11-28 18:09:03 +00:00
Warner Losh 9fe342e741 Version 600004 is better than 700000 given other changes that are in
the pipeline.  We had to bump the version for 600004 because the old
parser got confused and generated bogus output.

Approved by: ru@
2005-11-28 17:51:31 +00:00
Giorgos Keramidas 6f26936c0f Fix two identical harmless typos in ata error messages:
s/issueing/issuing/

PR:		kern/89481
Submitted by:	John Nielsen
Approved by:	sos
MFC after:	1 week
2005-11-28 13:23:15 +00:00
Gleb Smirnoff 62f0bf3250 Take if_baudrate from the parent. This fixes problem with SNMP
daemons reporting zero speed for vlan(4) interfaces.
2005-11-28 12:46:35 +00:00
Scott Long 72da70062f mqueue.h has been superceded by sys/mqueue.h thanks to David Xu's work.
Submitted by: dolt
2005-11-28 02:58:30 +00:00
Ruslan Ermilov 6646524f34 - Allow duplicate "machine" directives with the same arguments.
- Move existing "machine" directives to DEFAULTS.
2005-11-27 23:17:00 +00:00
David Xu f72b11a40c Fix a stupid compiler warining, remove a redundant line. 2005-11-27 22:59:47 +00:00
Ruslan Ermilov 9f7e6c7ceb Reduction. 2005-11-27 21:52:30 +00:00
Ruslan Ermilov a8e06f2a52 Make config(8) understand ORed dependecies in "files*" and
improve tracking of known devices.  Bump config(8) version.
2005-11-27 21:41:58 +00:00
Ian Dowse d63700b023 The ohci driver's processing of completed transfer descriptors (TDs)
appeared to rely on all kinds of non-guaranteed behaviours: the
transfer abort code assumed that TDs with no interrupt timeout
configured would end up on the done queue within 20ms, the done
queue processing assumed that all TDs from a transfer would appear
at the same time, and there were access-after-free bugs triggered
on failed transfers.

Attempt to fix these problems by the following changes:
 - Use a maximum (6-frame) interrupt delay instead of no interrupt
   delay to ensure that the 20ms wait in ohci_abort_xfer() is enough
   for the TDs to have been taken off the hardware done queue.
 - Defer cancellation of timeouts and freeing of TDs until we either
   hit an error or reach the final TD.
 - Remove TDs from the done queue before freeing them so that it
   is safe to continue traversing the done queue.

This appears to fix a hang that was reproducable with revision 1.67
or 1.68 of ulpt.c (earlier revisions had a different transfer
pattern). With certain HP printers, the command "true > /dev/ulpt0"
would cause ohci_add_done() to spin because the done queue had a
loop. The list corruption was caused by a 3-TD transfer where the
first TD completed but remained on the internal host controller
done queue because it had no interrupt timeout. When the transfer
timed out, the TD got freed and reused, so it caused a loop in the
done queue when it was inserted a second time from a different
transfer.

Reported by:	Alex Pivovarov
MFC after:	1 week
2005-11-27 09:05:37 +00:00
David Xu 47bf2cf9fe Change filesystem name from mqueue to mqueuefs for style consistent.
Suggested by: rwatson
2005-11-27 08:30:12 +00:00
Ariff Abdullah d5688b6a5b Support for ATI IXP 200 / 300 / 400 series audio controllers. 2005-11-27 03:29:59 +00:00
Gleb Smirnoff 14379bfbba - Update the flow sequence before converting count to
network byte order.
- Update the flow sequence in one atomic op instead of two.

Reported by:	Denis Shaposhnikov <dsh vlink.ru>
Reported by:	Daniil Kharoun <kdl chelcom.ru>
PR:		kern/89417
2005-11-27 02:43:08 +00:00
David Xu 6829585c43 Regen. 2005-11-27 01:23:31 +00:00
David Xu 94e1294b06 Don't use OpenBSD syscall numbers, instead, use new syscall numbers
for POSIX message queue.

Suggested by: rwatson
2005-11-27 01:13:00 +00:00
Robert Watson 5e758b9561 Add several aliases for existing clockid_t names to indicate that the
application wishes to request high precision time stamps be returned:

Alias                           Existing

CLOCK_REALTIME_PRECISE          CLOCK_REALTIME
CLOCK_MONOTONIC_PRECISE         CLOCK_MONOTONIC
CLOCK_UPTIME_PRECISE            CLOCK_UPTIME

Add experimental low-precision clockid_t names corresponding to these
clocks, but implemented using cached timestamps in kernel rather than
a full time counter query.  This offers a minimum update rate of 1/HZ,
but in practice will often be more frequent due to the frequency of
time stamping in the kernel:

New clockid_t name              Approximates existing clockid_t

CLOCK_REALTIME_FAST             CLOCK_REALTIME
CLOCK_MONOTONIC_FAST            CLOCK_MONOTONIC
CLOCK_UPTIME_FAST               CLOCK_UPTIME

Add one additional new clockid_t, CLOCK_SECOND, which returns the
current second without performing a full time counter query or cache
lookup overhead to make sure the cached timestamp is stable.  This is
intended to support very low granularity consumers, such as time(3).

The names, visibility, and implementation of the above are subject
to change, and will not be MFC'd any time soon.  The goal is to
expose lower quality time measurement to applications willing to
sacrifice accuracy in performance critical paths, such as when taking
time stamps for the purpose of rescheduling select() and poll()
timeouts.  Future changes might include retrofitting the time counter
infrastructure to allow the "fast" time query mechanisms to use a
different time counter, rather than a cached time counter (i.e.,
TSC).

NOTE: With different underlying time mechanisms exposed, using
different time query mechanisms in the same application may result in
relative non-monoticity or the appearance of clock stalling for a
single clockid_t, as a cached time stamp queried after a precision
time stamp lookup may be "before" the time returned by the earlier
live time counter query.
2005-11-27 00:55:18 +00:00
Ian Dowse c20e7ce621 Revision 5.0 of the Sony DSC camera appears to require RBC commands
to be padded to 12 bytes in length. Otherwise the requests just
time out.

Reported by:	anders
MFC after:	1 week
2005-11-26 17:11:31 +00:00
David Xu 62d8535278 Bring in mqueue.h to define struct mq_attr. 2005-11-26 12:48:11 +00:00
David Xu 6c59755414 Compile mqueue module. 2005-11-26 12:46:01 +00:00
David Xu 7023331e59 Regen. 2005-11-26 12:45:22 +00:00
David Xu 655291f2ae Bring in experimental kernel support for POSIX message queue. 2005-11-26 12:42:35 +00:00
Ruslan Ermilov abb6a9b820 Remove duplicates. 2005-11-26 08:50:20 +00:00
Nate Lawson c02106f3cc Add a locking stub to call acpi_cmbat_get_bif() now that it is directly
run from the taskqueue.  There should probably be a better way to do this
later, but this suffices for now.

Submitted by:	yongari
2005-11-26 07:36:53 +00:00
Scott Long da7851e1e6 The CAM interface is broken and seems to be causing lockups on boot. It
doesn't appear to have worked in a long time, so just disable it completely
for now.

MFC After: 3 days
2005-11-26 07:30:09 +00:00
Ariff Abdullah 187879feee Added mono to stereo and stereo to mono feeder functions for both
24 and 32 bit format.
2005-11-26 03:54:17 +00:00
Ariff Abdullah b327ee5148 Added codec id for Avance Logic (ALC250) 2005-11-26 03:51:25 +00:00
Ruslan Ermilov 20209868a2 Whitespace. 2005-11-25 22:36:40 +00:00
Damien Bergamini 26664f807c o Pass received frames to radiotap.
o Remove some unsupported flags from the ic_caps field.
o Various cosmetic tweaks.

MFC after:	6 days
2005-11-25 21:15:07 +00:00
Damien Bergamini 38e00d27ea Fix AMRR initialization.
MFC after:	6 days
2005-11-25 19:32:29 +00:00
Hidetoshi Shimokawa 9e2cdfd1d1 Fix panic when we cannot find self-id of probing nodes.
This shouldn't happen as far as the self-id buffer is vaild but
some people have this problem.

PR: kern/83999
Submitted by: Markus Wild <fbsd-lists@dudes.ch>
MFC after: 3 days
2005-11-25 14:29:24 +00:00
Lukas Ertl 8c957640aa Add sysctl descriptions. 2005-11-25 10:09:30 +00:00
Søren Schmidt 6c22760c61 When IOCATAGPARM is called, update the capabilities page that is stored
in the kernel and return the new values.
2005-11-25 09:00:56 +00:00
Olivier Houchard 19ddaa6566 Use the correct file name for the ldscript. 2005-11-25 03:30:45 +00:00
Damien Bergamini f850597399 Send the packet to BPF after setting the duration field of the frame.
MFC after:	1 week
2005-11-24 21:40:24 +00:00
Damien Bergamini 08403499e7 o Force the sending of an extra URB if there is less than 2 bytes left
at the end of the last URB (URB = USB Request Block = 64 bytes).
o Free the AMRR reserved xfer in detach.
o Minor tweaks.

MFC after:	1 week
2005-11-24 21:31:39 +00:00
Ruslan Ermilov 434dbbb396 Fix the following bugs:
- In ifc_name2unit(), disallow leading zeroes in a unit.

  Exploit: ifconfig lo01 create

- In ifc_name2unit(), properly handle overflows.  Otherwise,
  either of two local panic()'s can occur, either because
  no interface with such a name could be found after it was
  successfully created, or because the code will bogusly
  assume that it's a wildcard (unit < 0 due to overflow).

  Exploit: ifconfig lo<overflowed_integer> create

- Previous revision made the following sequence trigger
  a KASSERT() failure in queue(3):

  Exploit: ifconfig lo0 destroy; ifconfig lo0 destroy

  This is because IFC_IFLIST_REMOVE() is always called
  before ifc->ifc_destroy() has been run, not accounting
  for the fact that the latter can fail and leave the
  interface operating (like is the case for "lo0").
  So we ended up calling LIST_REMOVE() twice.  We cannot
  defer IFC_IFLIST_REMOVE() until after a call to
  ifc->ifc_destroy() because the ifnet may have been
  removed and its memory has been freed, so recover from
  this by re-inserting the ifnet in the cloned interfaces
  list if ifc->ifc_destroy() indicates a failure.
2005-11-24 18:56:14 +00:00
Lukas Ertl ae5a74ec72 Fix typo. 2005-11-24 15:28:32 +00:00
Olivier Houchard 5498dbb282 Remember the bus_dmamap_t where we loaded the mbuf, and sync this map instead
of tx_buffer->map, or we could end up syncing the wrong map.
2005-11-24 15:13:47 +00:00
Lukas Ertl e30534d50b Since we want a vinum geom created anytime the module loads, move
the geom creation to a seperate init function and ignore the tasting.

The config is now parsed only in the vinumdrive geom, which hopefully
fixes the problem, that the drive class tasted before the vinum class
had a chance, for good.

Also restore the behaviour that the module can be loaded at boot time
and on a running system.
2005-11-24 15:11:41 +00:00
Craig Rodrigues b6bd025c35 Fix parsing of atime, clusterr, clusterw, exec, suid, symfollow
mount options.

Noticed by:	Amir Shalem < amir at boom dot org dot il>
2005-11-24 15:06:40 +00:00
Ruslan Ermilov fc1eaecf4a Fix prototype. 2005-11-24 14:17:35 +00:00
Ruslan Ermilov b484d9f687 Fix prototype to match the code and documentation. 2005-11-24 09:51:59 +00:00
Ruslan Ermilov 1a581012df Add missing "struct" in i386/i386/machdep.c,v 1.497 by deischen@. 2005-11-24 08:16:18 +00:00
Nate Lawson 1f6e47a324 Only copy out the battery status/info if there was no error. 2005-11-24 05:23:56 +00:00
Olivier Houchard ce4210d673 Use a magic number to know we were started from the elf wrapper.
Add a dummy _start function to make the non-elf version of the wrapper work.
2005-11-24 02:27:55 +00:00
Olivier Houchard f5a9ac9ca4 Create a non-elf pure binary version of the kernel as well. 2005-11-24 02:25:49 +00:00
Gleb Smirnoff 7ddd4e4126 Merge in new driver version from Intel - 3.2.18.
The most important change is support for adapters based on
82571 and 82572 chips.

Tested on:	82547EI on i386
Tested on:	82540EM on sparc64
2005-11-24 01:44:49 +00:00
Kris Kennaway 12f6e63d15 Correct division by zero error in comment. 2005-11-24 00:53:14 +00:00
Craig Rodrigues 5e6b93a014 In nmount() and vfs_donmount(), do not strcmp() the options in the iovec
directly.  We need to copyin() the strings in the iovec before
we can strcmp() them.  Also, when we want to send the errmsg back
to userspace, we need to copyout()/copystr() the string.

Add a small helper function vfs_getopt_pos() which takes in the
name of an option, and returns the array index of the name in the iovec,
or -1 if not found.  This allows us to locate an option in
the iovec without actually manipulating the iovec members. directly via
strcmp().

Noticed by:	kris on sparc64
2005-11-23 20:51:15 +00:00
John Baldwin b05223a327 Add locking and mark MPSAFE:
- Add locked variants of start, init, and ifmedia_upd.
- Add a mutex to the softc and remove spl calls.
- Use callout(9) rather than timeout(9).
- Setup interrupt handler last in attach.
- Use M_ZERO rather than bzero.

MFC after:	1 week
Tested by:	wpaul
2005-11-23 18:51:34 +00:00
John Baldwin addfb88d47 MFi386: Sort and add COUNT_{IPIS,XINVLTLB_HITS}.
Pointy hat to:	jhb (2)
2005-11-23 18:12:05 +00:00
John Baldwin 0c43612a35 Sort. 2005-11-23 18:11:24 +00:00
Olivier Houchard 2ec9d05328 MFP4: Bring in arm9 cache-related functions
Obtained from:	NetBSD
2005-11-23 18:02:40 +00:00
Damien Bergamini 8ea9781eed Optimize PLCP length field computation for 802.11b rates. 2005-11-23 17:32:57 +00:00
Bill Paul f1b78ee016 Somehow memmove() got mapped to memset() in the patch table. Create a
real memmove() implementation and use that instead.
2005-11-23 17:10:46 +00:00
John Baldwin ef2cda76c0 - Quiet the pci_link(4) devices so that they don't show up in dmesg now.
- Improve panic message if we fail to read the PCI bus number from a bridge
  device.
- Don't try to lookup a BIOS IRQ for a link unless the link is routed via
  an ISA IRQ since BIOSen currently only route PCI link devices via ISA
  IRQs.

Tested by:	Mathieu Prevot bsdhack at club-internet dot fr
MFC after:	1 week
2005-11-23 16:36:13 +00:00
Ed Maste d4fd73659c Userland applications may include queue.h and define INVARIANTS
but not provide a panic(9) implementation.  Thus, enable the sanity
checks under INVARIANTS only if _KERNEL is also defined.

Submitted by:	jmallett
Approved by:	rwatson (mentor)
2005-11-23 04:02:27 +00:00
Nate Lawson 2010798dab Try to fix problems with periodic hangs by never directly calling _BIF.
Instead, re-evaluate _BIF only when we get a notify and use the cached
results.  We also still evaluate _BIF once on boot.  Also, optimize the
init loop a little by only querying for a particular info if it's not valid.

MFC after:	2 days
2005-11-23 00:57:51 +00:00
Nate Lawson f08e63dc4d Simplify checks for valid battery info via DeMorgan's Rule. No
functional change.
2005-11-23 00:53:01 +00:00
John Baldwin 1dab802e37 Garbage collect machine/smptests.h now that it is empty and no longer used. 2005-11-22 22:55:48 +00:00
John Baldwin c21ba8d166 Make COUNT_IPIS and COUNT_XINVLTLB_HITS real kernel options and take
them out of machine/smptests.h.
2005-11-22 22:54:42 +00:00