Commit Graph

40138 Commits

Author SHA1 Message Date
Paul Saab
3284b9ee87 Make ciss usable under PAE
Approved by:	re (scottl)
2003-05-21 07:17:06 +00:00
Paul Saab
487a8c7e61 - Make this work with PAE.
- atomically load and clear the status block so we dont miss an
  update.
  Submitted by: jdp

Approved by:	re (scottl)
2003-05-21 07:00:49 +00:00
Nate Lawson
742d91f211 Quirk for Hitachi DVD USB drive. It returns "invalid field in cdb" for
normal INQUIRY requests so enable the NO_INQUIRY quirk.

Submitted by:	Lars Eggert <larse@ISI.EDU>
Approved by:	re (scottl)
2003-05-21 00:22:07 +00:00
John Baldwin
7f4725bd09 The per-CPU spinlocks list is only maintained when WITNESS is enabled.
Thus, treat all page faults while in a critical section as fatal rather
than just those that occur with a non-empty spinlocks list.  All such page
faults are fatal anyways.  Calling trap_fatal() earlier increases the
chances of getting more useful panic messages and a possible DDB prompt.

Approved by:	re (scottl)
2003-05-20 20:50:33 +00:00
Nate Lawson
2f8f9581dd Remove a redundant quirk. Instead, we wildcard all Asahi Optical chips.
Approved by:	re
2003-05-20 18:04:42 +00:00
Marcel Moolenaar
bfaccb767c o Fix a definite bogon: the dirty bity fault, instruction access
failt and data access fault install the PTE in question into
   the VHPT table. However, a post-increment was missing and we
   wrote the raw PTE data into the pagesize/access key field.
   This leaves a corrupt VHPT entry.
o  While here, remove the explicit cache purge. Insertion into
   the translation implicitly purges any overlapping entries.
o  Make sure there's a cycle break between the itc and the rfi.
o  Whitespace fixes.
2003-05-20 06:57:20 +00:00
Marcel Moolenaar
14d2ae56c7 Rename the "IA64 ITC" counter to "ITC" counter. We don't call the
"TSC" counter on i386 "I386 TSC".

Approved by: re@ (blanket)
2003-05-20 06:51:20 +00:00
Marcel Moolenaar
9b9ce577d4 Prevent corruption of the VHPT collision chain by protecting it with
a mutex. The only volatile chain operations are insertion and deletion
but since updating an existing PTE also updates the VHPT entry itself,
and we have the VHPT mutex in both other cases, we also lock when we
update an existing PTE even though no chain operation is involved.
Note that we perform the insertion and deletion careful enough that
we don't need to lock traversals. If we need to lock traversals, we
also need to lock from the exception handler, which we can't without
creating a trapframe.

We're now able to withstand a -j8 buildworld. More work is needed to
withstand Murphy fields. In other words: we still have a bogon...

Approved by: re@ (blanket)
2003-05-20 02:52:41 +00:00
Peter Wemm
62d8fb93d0 Deal with the possibility of negative available space from the file server
to avoid Bad Things(TM) happening (eg: df crashing with a floating point
exception).

Submitted by:	Harold Gutch <logix@foobar.franken.de>
Approved by:	re (scottl)
2003-05-19 22:35:00 +00:00
Peter Wemm
3830dc4629 Another x86-64 comment fixup
Approved by:	re (blanket amd64 stuff)
2003-05-19 22:19:02 +00:00
Peter Wemm
92f0cd89a0 s/x86_64/amd64/ in comments in header.
Approved by:	re (blanket amd64)
2003-05-19 22:15:30 +00:00
Alexander Kabaev
980ded9a7d sys/sys/limits.h:
- Fix visibilty test for LONG_BIT and WORD_BIT.  `#if defined(__FOO_VISIBLE)'
   is alays wrong because __FOO_VISIBLE is always defined (to 0 for
   invisibility).

sys/<arch>/include/limits.h
sys/<arch>/include/_limits.h:

 - Style fixes.

Submitted by:	bde
Reviewed by:	bsdmike
Approved by:	re (scottl)
2003-05-19 20:29:07 +00:00
Søren Schmidt
e1750fb855 Print the right position on disk errors
Approved by: re@
2003-05-19 13:43:12 +00:00
Søren Schmidt
c9f5649b3e Unbork the chip locating code.
Approved by: re@
2003-05-19 13:42:23 +00:00
Marcel Moolenaar
b8c4149cff Turn pmap_install_pte() into a critical section. We better not get
interrupted while writing into the VHPT table. While here, make sure
memory accesses a properly ordered. Tag invalidation must happen
first so that the hardware VHPT walker will not be able to match
this entry while we're updating it and we have to make sure the new
new tag gets written only after the PTE is completely updated.

Approved by: re (blanket)
2003-05-19 08:02:36 +00:00
Marcel Moolenaar
a75b99ea2d Unconditionally set pcb_current_pmap. WIP versions of the code
previously committed cleared pcb_current_pmap prior to changing
the region registers, but that was removed before committing.
Since we don't normally (at all?) pass a NULL pointer, the bug
was mostly harmless. Fix it while I'm here...

I'm here because we need to have data serialization after writing
to the region registers. Not doing so was likely the cause of the
hangs we were experiencing. General exceptions in cpu_switch may
also be caused by the lack of serialization.

Approved by: re (blanket)
2003-05-19 06:05:30 +00:00
Marcel Moolenaar
dc0bde0f18 pmap_install() needs to be atomic WRT to context switching. Protect
switching user regions (region 0-4) with schedlock. Avoid unnecessary
recursion on schedlock by moving the core functionality to another
function (pmap_switch()) where we assert schedlock is held. Turn
pmap_install() into a wrapper that grabs schedlock. This minimizes
the number of callsites that need to be changed.
Since we already have schedlock in cpu_switch() and cpu_throw(),
have them call pmap_switch() directly. These were also the only two
calls to pmap_install() outside pmap.c, so make pmap_install() static
and remove its prototype from pmap.h

Approved by: re (blanket)
2003-05-19 04:16:30 +00:00
Greg Lehey
4555a3de62 print_config:
Change config format slightly to save plex preferences correctly.

vinum_scandisk: reinitialise volatile pointer after function call.
This is the "deafc0de" bug.

Approved by: re (scottl)
2003-05-19 02:21:31 +00:00
David Schultz
e92686d065 If we seem to be out of VM, don't allow the pagedaemon to kill
processes in the first pass.  Among other things, this will give
us a chance to launder vnode-backed pages before concluding that
we need more swap.  This is particularly useful for systems that
have no swap.

While here, update a comment and remove some long-unused code.

Reported by:	Lucky Green <shamrock@cypherpunks.to>
Suggested by:	dillon
Approved by:	re (rwatson)
2003-05-19 00:51:07 +00:00
Alan Cox
7f758dabbb Lock the vm object when performing vm_object_page_clean().
Approved by:	re (rwatson)
2003-05-18 22:02:51 +00:00
Bernd Walter
d7a1c636e1 Recreate devnodes on USB_SET_ALTINTERFACE ioctl.
This fixes net/pppoa port for Alcatel Speedtouch devices.

Submitted by: Jay Cornwall <jay@evilrealms.net>
Tested by: Francois Rogler <francois@rogler.org>
Approved by: re (scottl)
2003-05-18 21:22:00 +00:00
Ruslan Ermilov
517f3f1ae5 There's just no reason to not have these in GENERIC.
Found by:	release/*/drivers.conf cleaning script
Approved by:	re (scottl)
2003-05-18 20:39:15 +00:00
Søren Schmidt
05688ceccc Support the ICH5 SATA part.
Fix HPT374 UDMA133 timing.
Fix Promise ID.
Cosmetics on probe print for Promise & HPT.

Approved by: re
2003-05-18 16:45:48 +00:00
Søren Schmidt
27409aa046 Add string for SATA150
Approved by: re
2003-05-18 16:43:08 +00:00
Søren Schmidt
347ebe4c41 Add define for SATA150
Approved by: re
2003-05-18 16:40:38 +00:00
Alan Cox
1c500307d1 Reduce the size of a vm object by converting its shadow list from a TAILQ
to a LIST.

Approved by:	re (rwatson)
2003-05-18 04:10:16 +00:00
Scott Long
8c33536c7f Add the MUTEX_NOINLINE option that explicitely de-inlines the mutex
operations.

Submitted by:	jhb
2003-05-18 03:46:30 +00:00
Ruslan Ermilov
2f0e162dc0 Fixed the markup and wording of the kern.ipc.nsfbufs tunable.
(It does not modify NSFBUFS, but just overrides it if set.)

Approved by:	re (blanket)
2003-05-17 22:17:23 +00:00
Marcel Moolenaar
040c5b92bb Remove unused files. cpu_switch() and cpu_throw(), normally in swtch.s,
can be found in machdep.c.

Approved: re@
2003-05-17 04:55:04 +00:00
Peter Wemm
5c0fe26236 Actually get all the bits for sd_hibase.. it was 16 bits short. oops.
Approved by:	re (amd64/* blanket)
2003-05-17 02:05:10 +00:00
Peter Wemm
728ec271c1 Fix a bug in the AMD64 trampoline. I misunderstood the implicit
32->64 bit zero extend.  This changes a movl to an orq.

Approved by:	re (amd64 bits)
2003-05-17 00:30:51 +00:00
Marcel Moolenaar
f2c49dd248 Revamp of the syscall path, exception and context handling. The
prime objectives are:
o  Implement a syscall path based on the epc inststruction (see
   sys/ia64/ia64/syscall.s).
o  Revisit the places were we need to save and restore registers
   and define those contexts in terms of the register sets (see
   sys/ia64/include/_regset.h).

Secundairy objectives:
o  Remove the requirement to use contigmalloc for kernel stacks.
o  Better handling of the high FP registers for SMP systems.
o  Switch to the new cpu_switch() and cpu_throw() semantics.
o  Add a good unwinder to reconstruct contexts for the rare
   cases we need to (see sys/contrib/ia64/libuwx)

Many files are affected by this change. Functionally it boils
down to:
o  The EPC syscall doesn't preserve registers it does not need
   to preserve and places the arguments differently on the stack.
   This affects libc and truss.
o  The address of the kernel page directory (kptdir) had to
   be unstaticized for use by the nested TLB fault handler.
   The name has been changed to ia64_kptdir to avoid conflicts.
   The renaming affects libkvm.
o  The trapframe only contains the special registers and the
   scratch registers. For syscalls using the EPC syscall path
   no scratch registers are saved. This affects all places where
   the trapframe is accessed. Most notably the unaligned access
   handler, the signal delivery code and the debugger.
o  Context switching only partly saves the special registers
   and the preserved registers. This affects cpu_switch() and
   triggered the move to the new semantics, which additionally
   affects cpu_throw().
o  The high FP registers are either in the PCB or on some
   CPU. context switching for them is done lazily. This affects
   trap().
o  The mcontext has room for all registers, but not all of them
   have to be defined in all cases. This mostly affects signal
   delivery code now. The *context syscalls are as of yet still
   unimplemented.

Many details went into the removal of the requirement to use
contigmalloc for kernel stacks. The details are mostly CPU
specific and limited to exception_save() and exception_restore().
The few places where we create, destroy or switch stacks were
mostly simplified by not having to construct physical addresses
and additionally saving the virtual addresses for later use.

Besides more efficient context saving and restoring, which of
course yields a noticable speedup, this also fixes the dreaded
SMP bootup problem as a side-effect. The details of which are
still not fully understood.

This change includes all the necessary backward compatibility
code to have it handle older userland binaries that use the
break instruction for syscalls. Support for break-based syscalls
has been pessimized in favor of a clean implementation. Due to
the overall better performance of the kernel, this will still
be notived as an improvement if it's noticed at all.

Approved by: re@ (jhb)
2003-05-16 21:26:42 +00:00
Don Lewis
1e9bc9f889 Detect that a vnode has been reclaimed while vflush() was waiting to lock
the vnode and restart the loop.  Vflush() is vulnerable since it does not
hold a reference to the vnode and it holds no other locks while waiting
for the vnode lock.  The vnode will no longer be on the list when the
loop is restarted.

Approved by:	re (rwatson)
2003-05-16 19:46:51 +00:00
Marcel Moolenaar
baf74b8876 o In pmap_install, don't prevent switching the pmap if we're
switching to kernel_pmap. The pmap is not special enough.
o  Clear the active bit on the pmap we're switching out.
o  Fix some nearby style(9) bugs.

Approved by: re@
2003-05-16 07:57:44 +00:00
Alan Cox
f820bc501e Use vm_object_deallocate(), not vm_pager_deallocate(), to destroy a
vm object.  (vm_pager_deallocate() does not, in fact, destroy a vm object.)

Approved by:	re (scottl)
Reviewed by:	phk
2003-05-16 07:28:27 +00:00
Marcel Moolenaar
906f065725 Indent a comment. This makes 1.100.
Still approved by: re@ (blanket)
2003-05-16 07:05:08 +00:00
Marcel Moolenaar
164d4986fd Turn pmap_growkernel() into a critical section. While here, initialize
kernel_vm_end in pmap_bootstrap. Don't delay the initialization until
we need to grow the kernel VM space. This BTW happens twice before
we enter either single- or multi-user mode. Don't adjust kernel_vm_end
while growing based on whether the KPT contains a non-NULL entry. We
trust kernel_vm_end to be correct and we make sure it's still correct
after growing.
Define virtual_avail and virtual_end in terms of VM_MIN_KERNEL_ADDRESS
and VM_MAX_KERNEL_ADDRESS (resp). Don't hardcode region knowledge.
2003-05-16 07:03:15 +00:00
Marcel Moolenaar
8cc31ae5be Revamp the RID allocation code:
o  Limit the size of the region ID map to 64KB. This gives a bitmap
   that is large enough to keep track of 2^19 numbers. The minimal map
   size is 32KB. The reason we limit the map size is that processor
   models may have implemented a 24-bit region ID, which would give
   a 2MB bitmap while the maximum number of allocations is always
   less than PID_MAX*5, which is less than 2^19.
o  Allocate all region IDs up-front. The slight downside of reserving
   more RIDs then a process needs (3 for ia64 native and 1 for ia32)
   is preferable over the call to pmap_ensure_rid() where RIDs are
   allocated on demand. On SMP systems this may lead to a race
   condition.
o  When allocating a region ID, don't use arc4random(). We're not
   interested in randomness or uniform distribution across the
   spectrum. We only need uniqueness. Random numbers may easily
   collide when the number of allocated RIDs is high, creating a
   possibly unbounded retry rate.
2003-05-16 06:40:40 +00:00
Marcel Moolenaar
75189cff08 Move the conditional definition of KSTACK_MAX_PAGES up ahead where
it's more visible.

Approved by: re@ (blanket)
2003-05-16 06:17:34 +00:00
Marcel Moolenaar
5551d84398 Sync the linker script with the one used by default for userland. Since
ia64 only uses relocations with addend, remove the sections specific to
non-addend relocations (.rel.*). Also remove C++ specific sections.

Approved by: re@ (blanket)
2003-05-16 06:03:45 +00:00
Murray Stokely
a8a084fc17 Add variables for missing network drivers.
PR:		kern/51911
Submitted by:	David Yeske <dyeske@yahoo.com>
Approved by:	re
2003-05-16 04:31:00 +00:00
Murray Stokely
4001e1ee2e Add E-Tech ISA PnP modem ID.
PR:		kern/36692
Submitted by:	Theo van Klaveren <t.vanklaveren@student.utwente.nl>
Approved by:	re (murray)
MFC After:	3 days
2003-05-16 04:04:04 +00:00
David E. O'Brien
04ddc5dea6 Run $S/kern/genassym.sh with the correct NM.
Approved by:	re(blanket)
2003-05-16 02:27:17 +00:00
David E. O'Brien
8d542cb56d Fix long standing bug that prevents the PT_CONTINUE, PT_KILL and
PT_DETACH ptrace(2) requests from functioning as advertised in the
manual page.  As described in kern/35175, the PT_DETACH request will,
under certain circumstances, pass an unwanted signal on to the traced
process upan detaching from it.  The PT_CONTINUE request will
sometimes fail if you make it pass a signal that has "properties" that
differ from the properties of the signal that origionally caused the
traced process to be stopped.  Since PT_KILL is nothing than
PT_CONTINUE with SIGKILL, it is broken too.  In the PT_KILL case, this
leads to an unkillable process.

PR:		44011
Submitted by:	Mark Kettenis <kettenis@chello.nl>
Approved by:	re(jhb)
2003-05-16 01:34:23 +00:00
Robert Watson
98b2788832 Add a tunable/sysctl "hw.fxp_noflow" which disables flow control support
on if_fxp cards.  When flow control is enabled, if the operating system
doesn't acknowledge the packet buffer filling, the card will begin to
generate ethernet quench packets, but appears to get into a feedback
loop of some sort, hosing local switches.  This is a temporary workaround
for 5.1: the ability to configure flow control should probably be
exposed by some or another management interface on ethernet link layer
devices.

Approved by:	re (bmah)
Reviewed by:	mux
2003-05-16 01:13:16 +00:00
Thomas Moestl
a93b6bf5e9 In cpu_fork(), initialize pcb_psl for the new process to PSL_KERNEL,
instead of taking the (userland) eflags from the trap frame and masking
out PSL_I. There is no need to inherit any flags from the forking process;
the old method however can cause flags set in userland for the forking
process to be bogusly set in kernel mode when the newly forked process
runs for the first time (in particular PSL_T, which is set for userland
when the process is single-stepped; this would cause trace traps in
kernel mode).

Approved by:	re (jhb)
2003-05-16 01:10:33 +00:00
Robert Watson
c1dca9ab07 VOP_PATHCONF() requires a vnode lock; this patch adds locking to
fpathconf(). The lock is held for direct calls to VOP_PATHCONF() in
pathconf() already.

Approved by:	re (jhb)
Pointed out by:	DEBUG_VFS_LOCKS
2003-05-15 21:13:08 +00:00
Robert Watson
7042ac8cd7 This change grabs the vnode lock for NFS client vnodes when calling
VOP_SETATTR() or VOP_GETATTR(); without these locks (a) VFS_DEBUG_LOCKS
will panic, and (b) it may be possible to corrupt entries in the cached
vnode attributes in the nfsnode, since nfsnode attribute cache data is
also protected by the vnode lock.

Approved by:	re (jhb)
Pointed out by:	VFS_DEBUG_LOCKS
2003-05-15 21:12:08 +00:00
Robert Watson
62d4b85ec1 Jeff added locking assertions that the VV_ flags on vnodes were modified
only while holding appropriate vnode locks.  This patch slides the lock
release for ufs_extattr_enable() to continue to hold the active vnode lock
on a backing file until after the flag change; it also acquires a vnode
lock when disabling an attribute and hence clearing a flag on the backing
vnode.  This permits VFS_DEBUG_LOCKS to run UFS1 extended attributes
without panicking, as well as preventing a potential race and vnode flag
problem.

Approved by:	re (jhb)
Pointed out by:	DEBUG_VFS_LOCKS
2003-05-15 21:07:33 +00:00
Bosko Milekic
11583f6c93 Make the mb_alloc low-watermark sysctl-tunable read-only and make
netstat(1) not display it for now because its effects are not yet
completely implemented and we're about to cut 5.2-RELEASE.
This is temporary.

Approved by: re (scottl, rwatson)
2003-05-15 19:05:28 +00:00
Julian Elischer
95f04def4b fix a cut-n-paste error.
in the case where the bridge node was closed down but a timeout
still applied to it, the final reference to the node was freeing the private
data structure using the wrong malloc type.

Approved by:	re@
2003-05-15 18:51:28 +00:00
Nate Lawson
d6061de923 Generalize a quirk for Asahi Optical-based cameras (i.e. Pentax). It appears
all of the Optio series have the same problems.  It might be a better
approach eventually to add wildcard support to USB quirks.

PR:		kern/50271, kern/46369
Approved by:	re (rwatson)
2003-05-15 17:36:22 +00:00
Nate Lawson
f410510b09 Add a quirk for OTi USB flash key.
PR:		kern/51825
Approved by:	re (rwatson)
2003-05-15 17:35:35 +00:00
Thomas Moestl
18100346d1 Miscellaneous fixes:
- Fix compilation without GEM_DEBUG.
- Do not #define GEM_DEBUG by default; it adds overhead (due to bzero()ing
  RX space) and is not needed any more, since the driver is quite stable
  now.
- Fix watchdog timeouts when failing to load TX packets.
- Do not forcibly limit the number of descriptors used for a packet to
  GEM_NTXSEGS, by passing this number to bus_dma_tag_create(). There is
  no requirement for a limit any lower than the total number of
  available descriptors, and the present limit caused network problems
  due to mbuf chains requiring more descriptors.
  GEM_NTXSEGS is still used to estimate the interrupt window size, for
  which we just need an estimate.

Approved by:	re (rwatson)
2003-05-15 16:57:55 +00:00
Martin Blapp
f956e0b3f0 Only use a SIA/SYM media info block if no MII block is detected.
The submitter of PR 32118 told me that this patch also fixes autoselecting
for znyx 4 port cards (10baseT, 100baseTX did work already).

PR:		32118
Reviewed by:	imp
Approved by:	rwatson (re)
2003-05-15 16:53:29 +00:00
Marcel Moolenaar
794518cd6d This file creates register sets based on the runtime specification.
The advantage of using register sets is that you don't focus on each
register seperately, but instead instroduce a level of abstraction.
This reduces the chance of errors, and also simplifies the code.
The register sers form the basis of everything register.
The sets in this file are:

struct _special
contains all of the control related registers, such as instruction
pointer and stack pointer. It also contains interrupt specific registers
like the faulting address. The set is roughly split in 3 groups. The
first contains the registers that define a context or thread. This is
the only group that the kernel needs to switch threads.  The second group
contains registers needed in addition to the first group needed to switch
userland threads. This group contains the thread pointer and the FP control
register. The third group contains those registers we need for execption
handling and are used on top of the first two groups.

struct _callee_saved, struct _callee_saved_fp
These sets contain the preserved registers, including the NaT after
spilling. The general registers (including branch registers) are
seperated from the FP registers for ptrace(2).

struct _caller_saved, struct _caller_saved_fp
These sets contain the scratch registers based on SDM 2.1, This means that
both ar.csd and ar.ccd are included here, even though they contain ia32
segment register descriptions. We keep seperate NaT bits for scratch and
preserved registers, because they are never saved/restored at the same
time.

struct _high_fp
The upper 96 FP registers that can be enabled/disabled seperately on
the CPU from the lower 32 FP registers. Due to the size of this set,
we treat them specially, even though they are defined as scratch
registers.

CVS ----------------------------------------------------------------------
2003-05-15 08:36:03 +00:00
Marcel Moolenaar
4bae872201 This file contains elementary context related functions used to
save and restore "sets" of registers in various places.
The restorectx and swapctx functions are used by cpu_switch()
and deal with the special registers, as well as the preserved
registers.
The *callee_saved* functions are used to save and restore the
preserved registers (integer and floating-point). They are
useful for signal delivery and ptrace support.
The save_high_fp and restore_high_fp functions are used to
"load" and "unload" to and from the CPU as part of lazy context
switching.
The ia32 specific context functions have been kept with the ia32
code.

Approved by: re@ (blanket)
2003-05-15 08:08:32 +00:00
Marcel Moolenaar
1d67adffd6 This file contains the code that implements the syscall path based
on the epc instruction. The epc instruction, given the permissions
of the page in which the epc is located, allows the privilege level
to be increased with little or no overhead. The previous privilege
level is recorded in the current frame marker and is restored by
a regular (function) return.
Since the epc instruction has to live in a page with non-standard
properties, we hardwire a "gateway" page in the address space. The
address of the gateway page is exported to userland in ar.k7. This
allows us to rewire the page without breaking the ABI.
The syscall stubs in libc are regular function calls that slightly
differ from the normal runtime. The difference is mostly to simplify
the stubs themselves by by moving some of the logic to the kernel.
The libc stubs call into the gateway page (offset 0), from where the
kernel trampolines to the code that sets up a minimal trapframe and
arranges to execute from the kernel stack.
The way back is basicly the same. The kernel returns to the gateway
page, whereby privilege is dropped, and jumps back to the syscall
stub.
Only the special registers are saved in the trapframe. None of the
scratch registers are preserved and since the kernel follows the
same runtime model, none of the preserved registers are saved.
Future enhancements can include the implementation of lightweight
syscalls, where kernel functions are performed without setting up
a trapframe. Good candidates are the *context syscalls for example.

Now that there's a gateway page from which code can be executed in
a non-privileged context, we also have the ideal place to put the
signal trampolines. By moving the signal trampolines from the user
stack to the gateway page, we open up the doors to unexecutable
stacks. The gateway page contains signal trampolines for both the
"legacy" break-based syscall code and the new and improved epc-
based syscall code.

Approved: re@ (blanket)
2003-05-15 07:51:22 +00:00
Alan Cox
4a0d6dfd2c Initialize logical_cpus_mask when the logical CPUs are enumerated in
the mptable.  (Previously, logical_cpus_mask was only initialized if
the hyperthreading fixup was executed.)

Approved by:	re (jhb)
Reviewed by:	ps
2003-05-15 05:12:24 +00:00
Marcel Moolenaar
2a9fc22645 This commit was generated by cvs2svn to compensate for changes in r115013,
which included commits to RCS files with non-trunk default branches.
2003-05-15 05:04:44 +00:00
Marcel Moolenaar
35859e5946 This is beta4 of libuwx; an ia64 stack unwinder. This code is made
available by Hewlett-Packard under the MIT license. The unwinder is
small, clean and fast and needed little adaptation for use in the
kernel.

This import has embedded in it the changes needed to make it build
in a kernel environment.

To optimize the common case, the kernel will minimize the number
of registers saved by not saving the preserved registers. In case
access to preserved registers is needed (signal handling, ptrace)
the kernel will unwind to the context of the syscall or exception.
For this we need an unwinder.

Approved by: re (blanket)
2003-05-15 05:04:44 +00:00
Juli Mallett
7bbf05a2c3 Clear up that COMPAT_43 may not do the same thing on every architecture
and clear up that COMPAT_SUNOS is similarly MI, and does something
relatively similar.

Approved by:	re/rwatson
2003-05-15 02:10:30 +00:00
Peter Wemm
c0a54ff621 Collect the nastiness for preserving the kernel MSR_GSBASE around the
load_gs() calls into a single place that is less likely to go wrong.

Eliminate the per-process context switching of MSR_GSBASE, because it
should be constant for a single cpu.  Instead, save/restore it during
the loading of the new %gs selector for the new process.

Approved by:	re (amd64/* blanket)
2003-05-15 00:23:40 +00:00
Peter Wemm
be52ef1399 Use compile time constants for things like PTmap[] etc because they're
about to move outside of the +/- 2GB range

Suggested by:	jake
Approved by:	re (amd64/* blanket)
2003-05-15 00:20:17 +00:00
Maxime Henrion
4d340ec485 GCC 3.3 complains about anonymous structures in unions, so
give the fxp_ipcb structure a name in the fxp_rfa structure.

Submitted by:	peter
Approved by:	re (jhb)
2003-05-14 20:33:41 +00:00
John Baldwin
aa7ba84232 Fix a typo that broke the pc98 kernel build.
Reported by:	des@'s tinderbox
Pointy hat to:	jhb
Approved by:	re (blanket/scottl)
2003-05-14 20:21:42 +00:00
John Baldwin
ce130a9573 Add <sys/queue.h> to unbreak world.
Approved by:	re (scottl)
2003-05-14 15:00:24 +00:00
Thomas Quinot
b3c957133a In atapi_cam_reinit_bus, only call reinit_bus if the ATAPI channel
has already been registered with ATAPI/CAM (else there is nothing
to do). atapi_cam_reinit_bus may be called before the bus is
registered if an ATAPI command times out during the boot sequence.

PR:		i386/51421
Reviewed by:	roberto
Approved by:	re (rwatson)
MFC after:	1 week
2003-05-14 14:20:22 +00:00
Wilko Bulte
5adbf8fb4d add support for NetMos 4S0P PCI: 4S, 0P
tested on -current: ceri
tested on -stable:  wilko

approved: re (scottl)
2003-05-14 09:37:46 +00:00
Peter Wemm
e14528b349 Regen
Approved by: re (amd64 blanket)
2003-05-14 04:11:25 +00:00
Peter Wemm
d85631c4ac Add BASIC i386 binary support for the amd64 kernel. This is largely
stolen from the ia64/ia32 code (indeed there was a repocopy), but I've
redone the MD parts and added and fixed a few essential syscalls.  It
is sufficient to run i386 binaries like /bin/ls, /usr/bin/id (dynamic)
and p4.  The ia64 code has not implemented signal delivery, so I had
to do that.

Before you say it, yes, this does need to go in a common place.  But
we're in a freeze at the moment and I didn't want to risk breaking ia64.
I will sort this out after the freeze so that the common code is in a
common place.

On the AMD64 side, this required adding segment selector context switch
support and some other support infrastructure.  The %fs/%gs etc code
is hairy because loading %gs will clobber the kernel's current MSR_GSBASE
setting.  The segment selectors are not used by the kernel, so they're only
changed at context switch time or when changing modes.  This still needs
to be optimized.

Approved by:	re (amd64/* blanket)
2003-05-14 04:10:49 +00:00
Peter Wemm
5d5ca6d75e Fix some misunderstandings about 64 bit extension.
Fix fuword/suword - they're supposed to be 'long' - ie: point them
at fuword64/suword64 instead of the incorrect 32 bit versions.
2003-05-14 03:38:13 +00:00
Paul Saab
13d56a9a90 p_sigignore moved into struct sigacts. move one which was missed.
Approved by:	re (scottl)
2003-05-14 00:03:55 +00:00
John Baldwin
90af4afacb - Merge struct procsig with struct sigacts.
- Move struct sigacts out of the u-area and malloc() it using the
  M_SUBPROC malloc bucket.
- Add a small sigacts_*() API for managing sigacts structures: sigacts_alloc(),
  sigacts_free(), sigacts_copy(), sigacts_share(), and sigacts_shared().
- Remove the p_sigignore, p_sigacts, and p_sigcatch macros.
- Add a mutex to struct sigacts that protects all the members of the struct.
- Add sigacts locking.
- Remove Giant from nosys(), kill(), killpg(), and kern_sigaction() now
  that sigacts is locked.
- Several in-kernel functions such as psignal(), tdsignal(), trapsignal(),
  and thread_stopped() are now MP safe.

Reviewed by:	arch@
Approved by:	re (rwatson)
2003-05-13 20:36:02 +00:00
John Baldwin
25b4d3a8a6 In setitimer(2), if the it_value of the new itimer value is clear, then
don't add the current time to it, but leave it as clear so that when the
timer is disabled, the it_value is always clear.

Reviewed by:	bde
Approved by:	re (rwatson)
2003-05-13 19:21:46 +00:00
John Baldwin
dea7cce585 Add some extra #ifdef stubs so that this compiles on 4.8.
Approved by:	re (rwatson/bmah)
2003-05-13 16:59:46 +00:00
Yoshihiro Takahashi
3e4e484918 Move the ips driver from ${MACHINE_ARCH} == "i386" to ${MACHINE} == "i386".
Approved by:	re (scottl)
2003-05-13 11:26:08 +00:00
Alan Cox
099e981aa1 Optimize the use of splay in gbincore(). During a "make buildworld" the
desired buffer is found at one of the roots more than 60% of the time.
Thus, checking both roots before performing either splay eliminates
unnecessary splays on the first tree splayed.

Approved by:	re (jhb)
2003-05-13 04:36:02 +00:00
Poul-Henning Kamp
3eb8c738fd When a disk disappears, destroy the class from the event thread
to avoid race condtion.

Approved by:	re/rwatson
2003-05-12 20:15:28 +00:00
Martin Blapp
7eac366be1 Add support for 3Com OfficeConnect 10/100B.
PR:		49059, 50747
Submitted by:	Dax Eckenberg <daxbert@dweebsoft.com>
Reviewed by:	imp, jhb
Approved by:	jhb
MFC after:	2 weeks
2003-05-12 19:50:21 +00:00
Peter Wemm
8a6d52c3f8 Really stop the loader from trying to load the acpi module by lying and
pretending that it is already here.

Approved by:	re (amd64/* stuff)
2003-05-12 18:37:56 +00:00
Peter Wemm
0fe93e7480 For the page fault handler, save %cr2 in the outer trap handler so that
we do not have to run so long with interrupts disabled.  This involved
creating tf_addr in the trapframe.  Reorganize the trap stubs so that
they consistently reserve the stack space and initialize any missing
bits.

Approved by:	re (amd64 stuff)
2003-05-12 18:33:19 +00:00
Peter Wemm
0f6241620b Sync ucontext with reality. The struct trapframe changes need to be
reflected here.

Approved by:	re (blanket amd64/*)
2003-05-12 18:23:04 +00:00
Maxime Henrion
72490791a8 Fix the unaligned access problems that some people saw on alpha
by using a __packed keyword for the fxp_rfa structure.  The Intel
guys who designed this structure with unaligned fields deserve
to be shot.

Tested by:	kris
Approved by:	re@ (jhb)
2003-05-12 18:15:33 +00:00
Nate Lawson
014ed75b27 Move some printfs under bootverbose since they are not true errors.
Approved by:	re (bmah)
2003-05-12 16:54:55 +00:00
Søren Schmidt
69d691371a Fix typo (that even got cut/pasted 2 times)
Found by:	phk
Approved by:	re@
2003-05-12 16:43:13 +00:00
Poul-Henning Kamp
df1970aa55 Fix an off-by-1 error.
Found by:	FlexeLint
Reviewed by:	sos
Approved by:	re/rwatson
2003-05-12 15:26:05 +00:00
Poul-Henning Kamp
87b1831f1d Bail out if there were not two loadable sections. Add XXX comment about
one other issue.

Approved by:	re/rwatson.
2003-05-12 15:08:10 +00:00
Robert Watson
1964fb9ba2 Remove bogus locking from DDB's "show lockedvnods" command: using
synchronization primitives from inside DDB is generally a bad idea,
and in this case it frequently results in panics due to DDB commands
being executed from the sio fast interrupt context on a serial
console.  Replace the locking with a note that a lack of locking
means that DDB may get see inconsistent views of the mount and vnode
lists, which could also result in a panic.  More frequently,
though, this avoids a panic than causes it.

Discussed with ages ago:	bde
Approved by:			re (scottl)
2003-05-12 14:37:47 +00:00
Peter Wemm
ab6859fd2f Fix lookup of module metadata on amd64 systems. While this is in
common code, the non-trivial part is #ifdef'ed and only executes when
loading amd64 kernels. The rest is trivial but needed for the the amd64
case. (Two variables changed from char ** to Elf_Addr).

Approved by:	re (amd64 "low-risk" stuff)
2003-05-12 05:48:09 +00:00
Poul-Henning Kamp
1282e9acea Don't pass NULL pointer to memset if we are compiled with DIAGNOSTIC
Approved by:	re/rwatson
2003-05-12 05:09:56 +00:00
Poul-Henning Kamp
3d5371a1a6 Don't #define memset() to bzero(), it is far too prone to bite somebody.
Approved by:	re/scottl
2003-05-12 05:08:38 +00:00
Peter Wemm
063107e21d Revert leftover AMD64 disable-acpi-module stuff. 2003-05-12 04:57:05 +00:00
Murray Stokely
281b971b68 Regen.
Approved by:	re
2003-05-12 04:27:22 +00:00
Peter Wemm
e9b193dc33 AMD64 physical space is much larger than i386, de-i386 the bus_space and
bus_dma MD code for AMD64.  (And a trivial ifdef update in dev/kbd because
of this).  More updates are needed here to take advantage of the 64 bit
instructions.

Approved by:	re (blanket amd64/*)
2003-05-12 02:44:37 +00:00
Peter Wemm
bf1e897425 Give a %fs and %gs to userland. Use swapgs to obtain the kernel %GS.base
value on entry and exit.  This isn't as easy as it sounds because when
we recursively trap or interrupt, we have to avoid duplicating the
swapgs instruction or we end up back with the userland %gs.  I implemented
this by testing TF_CS to see if we're coming from supervisor mode
already, and check for returning to supervisor. To avoid a race with
interrupts in the brief period after beginning executing the handler and
before the swapgs, convert all trap gates to interrupt gates, and reenable
interrupts immediately after the swapgs.  I am not happy with this.
There are other possible ways to do this that should be investigated.
(eg: storing the GS.base MSR value in the trapframe)

Add some sysarch functions to let the userland code get to this.

Approved by:	re (blanket amd64/*)
2003-05-12 02:37:29 +00:00
Hidetoshi Shimokawa
96c7c6dd58 Make it compiled on 4-stable.
Approved by: re (scottl)
2003-05-12 00:42:28 +00:00
Josef Karthauser
8e274c38c2 Extend the digital camera support (umass) to the PENTAX Optio 330GS.
Submitted by:	Jan-Oliver Neumann <neumannj@arcor.de>
By way of:	n_hibma
Approved by:	re (jhb & bmah)
MFC After:	7 days
2003-05-11 23:55:28 +00:00
Peter Wemm
85983c59cd Call it an AMD64 Processor, not a Hammer. Also, it seems that the cpuid
model numbers are wider than I first thought.

Approved by: re (blanket amd64/*)
2003-05-11 23:01:04 +00:00
Peter Wemm
f75b005a99 I missed another printf format error while extracting the patch.
Approved by: re (blanket amd64/*)
2003-05-11 22:55:40 +00:00
Peter Wemm
eeee69d45c Make atdevbase long for the KERNBASE > 4GB case
Approved by: re (amd64/* blanket)
2003-05-11 22:53:43 +00:00
Peter Wemm
573044a926 For amd64 kernels, repeat the 1GB mapping over the entire address space
instead of just at 0GB and 1GB marks.  This gives more flexibility for
the choice of KERNBASE.

Approved by:	re (amd64 stuff)
2003-05-11 22:42:29 +00:00
Peter Wemm
5a337b2589 Fix printf format errors that were undetected due to using the standard
FSF compiler during early development.
2003-05-11 22:40:25 +00:00
Peter Wemm
5048926df9 Export PML4SHIFT and PDPSHIFT
Approved by: re (blanket amd64/*)
2003-05-11 22:39:40 +00:00
Peter Wemm
4ce3e250ce Since compiling natively, the compile environment has been less forgiving
about silly typos.  Use the correct comment sequences.
2003-05-11 22:38:54 +00:00
Matthew N. Dodd
598d45be84 Provide exec_linux_setregs() to override exec_setregs().
Linux initializes %gs to 0.  Mimic this behavior.

Submitted by:	 Christian Zander <zander@minion.de>
Reviewed by:	 jake
Approved by:	 re
2003-05-11 21:51:11 +00:00
Hidetoshi Shimokawa
6902ee83c7 - Use moderate gap counts listed in IEEE1394a.
- Simplify and correct the bus manager election process.
- Check link_active when choosing cycle master.
- Fix location of the cmr bit.

Approved by: re (scottl)
2003-05-11 10:32:20 +00:00
Scott Long
3bd9d6f570 Hook up the ips module 2003-05-11 06:40:09 +00:00
Scott Long
1b20702e45 Add notes about the 'ips' driver. 2003-05-11 06:39:05 +00:00
Scott Long
21157fae1c Add files for the 'ips' driver. 2003-05-11 06:37:52 +00:00
Scott Long
2aedd662d8 Add the 'ips' driver for the IBM (now Adaptec) ServeRAID controller
series.  This driver was generously developed and released by David
Jeffreys and Adaptec.  I've updated it to work with 5.x and fixed a
few bugs.

MFC After:	1 week
2003-05-11 06:36:49 +00:00
Scott Long
5639836dcf garbage collect the reserved major for the ips disk device. GEOM makes
it unneeded.
2003-05-11 06:18:33 +00:00
Julian Elischer
335d40c8ff Last commit of the bluetooth upgrade. (this patch was forgotten in the first
commit)

Submitted by: Maksim Yevmenkin <m_evmenkin@yahoo.com>
Approved by: re@
2003-05-10 22:11:25 +00:00
Julian Elischer
f2bb1cae36 Part one of undating the bluetooth code to the newest version
Submitted by:   Maksim Yevmenkin <m_evmenkin@yahoo.com>
Approved by: re@
2003-05-10 21:44:42 +00:00
Bosko Milekic
969bab3efb Make m_freem() just use m_free() instead of duplicating the code. The
reason for the duplication was that m_freem() was meant to eventually
be optimized to hold the lock of the cache being freed to as long as
possible across frees but the difficulty of implementing said
optimization right now is too high, given that in some cases (see MAC
and non-cluster external buffers), we need to call into other subsytems,
something not permissible when the cache lock is held.

This change minimizes code duplication while keeping at least the
atomic mbuf+cluster free optimization.

Suggested by: luigi
2003-05-10 18:08:23 +00:00
Søren Schmidt
60ad94dea4 Add a couble new Intel PCI id's
Approved by: re@
2003-05-10 14:49:19 +00:00
Peter Wemm
b2744ab9c4 Remove special hacks for FSF cross tools now that it builds natively. 2003-05-10 01:12:24 +00:00
Peter Wemm
0fe0f2515b Provide a fake varargs implementation for lint's benefit. This way
it can see the intent of the va_* macros, even though it cannot work.

Approved by:	re (blanket amd64/*)
2003-05-10 00:55:15 +00:00
Peter Wemm
e1ef71de2b Remove _ARCH_INDIRECT ifdefs. They existed for lib/msun/* on i386, which
could use different versions of the math code depending on whether there
was real floating point hardware or math emulation.  Since the fpu is
part of the core specification on amd64, there is no need for this here.

Approved by:	re (blanket amd64/*)
2003-05-10 00:53:34 +00:00
Peter Wemm
2e4f687a1d bcopyb() isn't used on amd64 kernel (it only exists for i386/pcvt)
Approved by:	re (blanket amd64/*)
2003-05-10 00:51:29 +00:00
Peter Wemm
5826a47e9b Finish translating i386/support.s into amd64 asm - replace bcopy etc with
asm versions.  This yields about a 5% kernel compile time speedup.
2003-05-10 00:49:56 +00:00
Poul-Henning Kamp
4da6e74ce4 When a GEOM (/dev-)device is closed and we find that I/O requests are
still outstanding, give them a chance to complete.

If after 10 seconds we still find outstanding I/O requests, complete
the close with a console warning that the system is likely to panic
later on.

This is a workaround for umount -f not quite doing the right thing.

Approved by:    re/scottl
2003-05-09 21:25:28 +00:00
John Baldwin
b1bf1c3a98 Remove Giant from kern_sigsuspend() and osigsuspend() as these should now
be MP safe.

Approved by:	re (scottl)
2003-05-09 19:11:32 +00:00
Peter Wemm
395e65aa29 Include the MXCSR initial values, based on the AMD docs. This file
should really be renamed to fpu.h and npx.c to fpu.c since its part of
the core architecture on amd64 systems, not an isa 'numeric processor
extension'.
2003-05-09 18:28:05 +00:00
Peter Wemm
14426b9c3b Turn syscons on now that it works, so that anybody trying to run this
can see something.  Probing for keyboard still works for auto serial
console mode.
2003-05-09 18:26:06 +00:00
Peter Wemm
7edc7b0d3b Trivial addition of __amd64__ to the ifdefs for platforms that use
i386-style vga console support.

Approved by:  re
2003-05-09 18:24:40 +00:00
Mike Silbersack
b9697d572f Redefine M_FREELIST to be 0x8000; 0x4000 conflicted with two other
uses of m_flags in the kernel.  (A future commit will move all
private m_flags users here so they're obvious without a great
deal of searching.)

This should fix the mbuf double-free panics those using ppp or
ipfw reset rules have been seeing since the double-free detection
code went in.
2003-05-09 02:15:52 +00:00
Alan Cox
3a12f5da1f Give the kmem object's mutex a unique name, instead of "vm object",
to avoid false reports of lock-order reversal with a system map mutex.

Approved by:	re (jhb)
2003-05-09 02:13:23 +00:00
Robert Watson
b2aef57123 Rename MAC_MAX_POLICIES to MAC_MAX_SLOTS, since the variables and
constants in question refer to the number of label slots, not the
maximum number of policies that may be loaded.  This should reduce
confusion regarding an element in the MAC sysctl MIB, as well as
make it more clear what the affect of changing the compile-time
constants is.

Approved by:	re (jhb)
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-05-08 19:49:42 +00:00
John Baldwin
258dbbab69 Acquire Giant at the start of the raid rebuild kthreads.
Reported by:	Masachika ISHIZUKA <ishizuka@ish.org>
Reviewed by:	sos
Approved by:	re (bmah)
2003-05-08 16:38:14 +00:00
Peter Wemm
b3f7680e49 Oops. Turn T_PAGEFLT back into an interrupt gate. It is *critical*
that interrupts be disabled and remain disabled until %cr2 is read.
Otherwise we can preempt and another process can fault, and by the
time we read %cr2, we see a different processes fault address.  This
Greatly Confuses vm_fault() (to say the least).  The i386 port has
got this marked as a bug workaround for a Cyrix CPU, which is what
lead me astray.  Its actually necessary for preemption, regardless
of whether Cyrix cpus had a bug or not.
2003-05-08 08:25:51 +00:00
Peter Wemm
34da59975b Exclude sys/boot for amd64. There are still toolchain issues to deal
with.  In theory, gcc -m32 should work, but for now, do not tempt fate.

Approved by:	re (scottl)
2003-05-08 06:35:39 +00:00
Greg Lehey
108b696afe ioctl VINUM_READCONFIG: Don't lock configuration here. vinum_scandisk
needs to do it anyway to handle the startup case.  This is
            part of a fix for the recently reported hangs.

Approved by:  re (scottl)
2003-05-08 00:36:20 +00:00
Peter Wemm
2dbe628162 Leave space for the 128 byte red-zone on the stack. 2003-05-08 00:13:24 +00:00
Peter Wemm
f3b234157e #include <machine/metadata.h> was missing; add it 2003-05-08 00:12:37 +00:00
Peter Wemm
9c43b77ff5 Fix a preemption race. I was reenabling interrupts in the fast system
call handler before it was safe.  It was possible for to lose context
and for something else to clobber the PCPU scratch variable.  This
moves the interrupt enable *way* too late, but its better safe than
sorry for the moment.
2003-05-08 00:05:00 +00:00
Paul Saab
e0ced69666 - Change the full Asic revision defines to CHIPID to better since the
ASIC revision is really the major number of the CHIPID.  Also store
  the chipid, asic rev and chip revision in the softc for later use.

- The write twice to send producer index workaround only applies to
  the 5700_BX chips, so only do it there.
  Requested by: jdp

- Do not initalize the LED's to 0x00.  The default configuration
  the chip comes up in should yeild proper operation of the LED's.
  Confirmed by: John Cagle <john.cagle@hp.com>

Approved by:	re (blanket)
2003-05-07 21:51:13 +00:00
Robert Watson
41a17fe326 Clean up locking for the MAC Framework:
(1) Accept that we're now going to use mutexes, so don't attempt
    to avoid treating them as mutexes.  This cleans up locking
    accessor function names some.

(2) Rename variables to _mtx, _cv, _count, simplifying the naming.

(3) Add a new form of the _busy() primitive that conditionally
    makes the list busy: if there are entries on the list, bump
    the busy count.  If there are no entries, don't bump the busy
    count.  Return a boolean indicating whether or not the busy
    count was bumped.

(4) Break mac_policy_list into two lists: one with the same name
    holding dynamic policies, and a new list, mac_static_policy_list,
    which holds policies loaded before mac_late and without the
    unload flag set.  The static list may be accessed without
    holding the busy count, since it can't change at run-time.

(5) In general, prefer making the list busy conditionally, meaning
    we pay only one mutex lock per entry point if all modules are
    on the static list, rather than two (since we don't have to
    lower the busy count when we're done with the framework).  For
    systems running just Biba or MLS, this will halve the mutex
    accesses in the network stack, and may offer a substantial
    performance benefits.

(6) Lay the groundwork for a dynamic-free kernel option which
    eliminates all locking associated with dynamically loaded or
    unloaded policies, for pre-configured systems requiring
    maximum performance but less run-time flexibility.

These changes have been running for a few weeks on MAC development
branch systems.

Approved by:	re (jhb)
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-05-07 17:49:24 +00:00
John Baldwin
ace85d0a3c Style nits.
Approved by:	re (bmah)
2003-05-07 17:21:38 +00:00
Poul-Henning Kamp
8b7e2de80c #include <sys/resource.h> to limit ports damage.
Approved by:	re/rwatson
2003-05-07 15:26:43 +00:00
Poul-Henning Kamp
2cc9686e52 Hide the "ENOMEM" notice messages behind bootverbose. They are still
a valuable debugging tool for certain kinds of problems.

Approved by:	re/scottl
2003-05-07 05:37:31 +00:00
Robert Watson
430c635447 Correct a bug introduced with reduced TCP state handling; make
sure that the MAC label on TCP responses during TIMEWAIT is
properly set from either the socket (if available), or the mbuf
that it's responding to.

Unfortunately, this is made somewhat difficult by the TCP code,
as tcp_twstart() calls tcp_twrespond() after discarding the socket
but without a reference to the mbuf that causes the "response".
Passing both the socket and the mbuf works arounds this--eventually
it might be good to make sure the mbuf always gets passed in in
"response" scenarios but working through this provided to
complicate things too much.

Approved by:	re (scottl)
Reviewed by:	hsu
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-05-07 05:26:27 +00:00
Robert Watson
688fe1d954 Trim a call to mac_create_mbuf_from_mbuf() since m_tag meta-data
copying for mbuf headers now works properly in m_dup_pkthdr(), so
we don't need to do an explicit copy.

Approved by:	re (jhb)
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-05-06 20:34:04 +00:00
Poul-Henning Kamp
c9e629297a Fix the WARNING for wrong rawoffset, I tested incompatible units.
Approved by:	re/jhb
2003-05-06 19:36:13 +00:00
John Baldwin
6e52134c70 Add PCI ID's for the Intel ICH5 (82801EB) chipset.
Approved by:	re (murray)
Sponsored by:	The Weather Channel
2003-05-06 19:31:56 +00:00
John Baldwin
d40a3f6f47 Add PCI ID's for the 4 USB hubs on the ICH5 controller.
Approved by:	re (murray)
2003-05-06 19:30:41 +00:00
Scott Long
bc2de3dac0 We are now in 5.1-BETA 2003-05-06 03:55:24 +00:00
Dag-Erling Smørgrav
88b1e0bc5b Fix a printf() format error which broke the ia64 GENERIC build. 2003-05-06 03:55:12 +00:00
Alan Cox
658ad5fff5 Lock the vm_object when performing vm_pager_deallocate(). 2003-05-06 02:45:28 +00:00
Olivier Houchard
0be8f80357 Don't call timeout() in sis_tick(), this is done earlier by mii_tick(), and it
leads to a panic at unload time, as we own 2 instances of callout and
untimeout() only one.
Will I'm there, remove a call to callout_handler_init(), one is enough.

Reviewed by:	wpaul
2003-05-06 02:00:01 +00:00
John Baldwin
01de25134f Tweak the clearing of TDF_DEADLKTREAT so that we only bother grabbing the
lock and clearing the flag if it was clear when uiomove() was called.
2003-05-05 21:27:29 +00:00
John Baldwin
854dc8c2a1 Mostly sort the includes. 2003-05-05 21:26:25 +00:00
Poul-Henning Kamp
069accaa6a Put descriptive comments on the GEOM_* options 2003-05-05 21:21:31 +00:00
John Baldwin
18440c7fe7 Lock the proc lock around calls to tdsignal() in the sigwait() family of
syscalls.
2003-05-05 21:18:10 +00:00
John Baldwin
6711f10fb6 Make issignal() private to kern_sig.c since it is only called from cursig()
and cursig() is now a function rather than a macro.
2003-05-05 21:16:28 +00:00
John Baldwin
e668d8d834 Remove TD_ON_RUNQ() from a check to make sure Giant is not held when
calling mi_switch().  The kernel would panic on an earlier KASSERT() in
mi_switch() if TD_ON_RUNQ() was true.
2003-05-05 21:12:36 +00:00
David Malone
710c5645af Split sendit into two parts. The first part, still called sendit, that
does the copyin stuff and then calls the second part kern_sendit to do
the hard work. Don't bother holding Giant during the copyin phase.

The intent of this is to allow the Linux emulator to impliment send*
syscalls without using the stackgap.
2003-05-05 20:33:38 +00:00
David E. O'Brien
2875867356 Fix usages of %ll[dx] with typedef'ed created types.
In the kernel it is wrong 99.9 times out of 100 to use %ll rather than cast
to intmax_t and use %j.
2003-05-05 16:56:44 +00:00
Hartmut Brandt
2102bdf21a Define a link layer MIB for ATM. Most fields of this MIB are needed by
ILMI daemons. Factor out common softc fields for all ATM interfaces that
need to be externally visible into an ifatm structure and make the midway
driver using this structure and fill the MIB.
2003-05-05 16:35:52 +00:00
Poul-Henning Kamp
af3e2db5de Avoid double-free panic.
Tripped up:	DougB
2003-05-05 15:52:11 +00:00
Robert Watson
587ffa4508 Clean up proc locking in procfs: make sure the proc lock is held before
entering sys_process.c debugging primitives, or we violate assertions.
Also, be more careful about releasing the process lock around calls
to uiomove() which may sleep waiting for paging machinations or
related notions.  We may want to defer the uiomove() in at least
one case, but jhb will look into that at a later date.

Reported by:	Philippe Charnier <charnier@xp11.frmug.org>
Reviewed by:	jhb
2003-05-05 15:12:51 +00:00
Hidetoshi Shimokawa
d7398f2363 Write to RESET_START register if TARGET_RESET ORB doesn't work for timeout. 2003-05-05 14:50:24 +00:00
Hidetoshi Shimokawa
2b68d77fdd Don't panic for FWXF_START state in fw_xfer_unload(). 2003-05-05 10:14:52 +00:00
Søren Schmidt
b4074fb04d Add a missing ~ when clearing flags in close.
PR: 35392
2003-05-05 10:11:17 +00:00
David E. O'Brien
28e257139a Things run thru the C preprocessor must use C-style comments. 2003-05-05 10:01:10 +00:00
Martin Blapp
f130dcf22a Change the semantics of sysv shm emulation to take a additional
argument to the functions shm{at,ctl}1 and shm_find_segment_by_shmid{x}.
The BSD semantics didn't allow the usage of shared segment after
being marked for removal through IPC_RMID.

The patch involves the following functions:
  - shmat
  - shmctl
  - shm_find_segment_by_shmid
  - shm_find_segment_by_shmidx
  - linux_shmat
  - linux_shmctl

Submitted by:	Orlando Bassotto <orlando.bassotto@ieo-research.it>
Reviewed by:	marcel
2003-05-05 09:22:58 +00:00
David E. O'Brien
824eb9dc1b Back out rev 1.146 -- it broke the LINT build.
We are about to enter the 5.1 code freeze and things must be buildable.
2003-05-05 09:15:50 +00:00
David E. O'Brien
7aaa845578 Revert rev 1.396 -- it broke the Alpha kernel build. 2003-05-05 09:09:16 +00:00
Poul-Henning Kamp
c0c393a2aa Re-order the the initialization slightly to improve structure. 2003-05-05 08:58:12 +00:00
Greg Lehey
3cff2a7306 Add sector size member to subdisk, plex and volume objects. 2003-05-05 08:43:15 +00:00
Greg Lehey
7f55835e9c Remove an accidental #include.
Maintain sector sizes for all objects, not just for drives.  Some of
this could do with improvement: in particular, we get an error if the
components of an object have different sector sizes.

Clean up some comments.
2003-05-05 08:42:42 +00:00
Greg Lehey
63deaeffac Implement DIOCGSECTORSIZE and DIOCGMEDIASIZE ioctls. It appears that
they are now necessary to use newfs(8).
2003-05-05 08:41:53 +00:00
Poul-Henning Kamp
0195276f54 Use a dedicated malloc(9) bucket for sector storage. 2003-05-05 08:37:07 +00:00
Poul-Henning Kamp
8cb72d6174 Add two KASSERTS which trigger if free(9) would drag the "memuse" statistic
for a malloc bucket under zero.  This typically happens if you malloc(9)
from one bucket and free to another.
2003-05-05 08:32:53 +00:00
Poul-Henning Kamp
3fd530f7ec Don't warn if the rawoffset is zero, that is actually the best value it
could have.
2003-05-05 08:30:59 +00:00
Murray Stokely
c4ed9fe323 regen. 2003-05-05 08:22:15 +00:00
Murray Stokely
60260d67c1 Add KEYSPAN USA19QW, JRC PHONE, SANDISK SDDR75.
PR:		misc/48141, bin/51265, kern/49053, kern/50144
2003-05-05 08:18:53 +00:00
Greg Lehey
2154a1eed3 Correct failed checkin. Only one of the hunks in the last checkin
seems to have made it.
2003-05-05 07:50:15 +00:00
David E. O'Brien
1536224009 Since we insist on loading the POS ACPI by default, give the poor user
instructions on the main help screen for disabling it.
2003-05-05 07:33:12 +00:00
Poul-Henning Kamp
c0c0300f51 Use le32dec() instead of le32toh() because we are not guaranteed to have
a word aligned input.
2003-05-05 07:22:35 +00:00
Poul-Henning Kamp
b9275c8fc6 Turn the check that rawoffset == mbroffset into a warning instead. 2003-05-05 06:46:49 +00:00
Greg Lehey
e4d5ded9c8 Clarify comments. 2003-05-05 05:35:52 +00:00
Greg Lehey
3f49535d38 Add "preferred" keyword. 2003-05-05 05:35:28 +00:00
Greg Lehey
8b2087987e White space fixes. 2003-05-05 05:34:39 +00:00
Greg Lehey
e802b7f05e Remove DIOCGDINFO ioctl. This almost makes newfs work again without
the -v option, though it's not clear that it won't bite us elsewhere.

Forgotten by: phk

Implement setreadpol() function for the VINUM_READPOL ioctl.

Submitted by:  Allan Saddi <allan@saddi.com>
2003-05-05 05:33:59 +00:00
Greg Lehey
fdfcec3b7c vinum_scandisk: Make sure the config is locked before we mess around
with it.

Finally implement read policies.  The previous "implementation" didn't
work because it referred to plexes which were almost invariably when
referred to.  Instead, deprecate the "prefer" keyword for volumes
(though it's still there for the moment) and add a keyword "preferred"
to the plex definition.  The relationship is like this:

Old:

  vol foo ... prefer foo.p3

New:

  plex foo.p3 volume foo preferred

print_config: Print "preferred" where appropriate.
	      No longer print "prefer" on volume config entries.
2003-05-05 05:32:52 +00:00
Greg Lehey
780bedeaa5 Finally implement read policies. The previous "implementation" didn't
work because it referred to plexes which were almost invariably when
referred to.  Instead, deprecate the "prefer" keyword for volumes
(though it's still there for the moment) and add a keyword "preferred"
to the plex definition.  The relationship is like this:

Old:

  vol foo ... prefer foo.p3

New:

  plex foo.p3 volume foo preferred

give_plex_to_volume: set preferred plex if specified on plex
definition entry.  This involves adding a parameter to the function to
specify the preferred plex.

config_plex: Implement preferred keyword.
2003-05-05 05:32:15 +00:00
Greg Lehey
d1cbfb622b free_vinum: Rearrange sequence of actions to avoid potential race
condition when shutting down.
2003-05-05 05:28:15 +00:00
Warner Losh
efc7a12c6d Back out accidentally committed debugging 2003-05-04 23:58:37 +00:00
Alexander Kabaev
0eda4c08a5 Style fixes.
Remove DBL_DIG, DBL_MIN, DBL_MAX and their FLT_ counterparts, they
were marked for deprecation ever since SUSv1 at least.
Only define ULLONG_MIN/MAX and LLONG_MAX if long long type is
supported.
Restore a lost comment in MI _limits.h file and remove it from
sys/limits.h where it does not belong.
2003-05-04 22:13:04 +00:00
Poul-Henning Kamp
b624374de8 Only accept a rawoffset if it is identical to the mbroffset. 2003-05-04 19:26:31 +00:00
Poul-Henning Kamp
7f9e81b703 Add a way to read the current mbroffset from a BSD label class. 2003-05-04 19:25:48 +00:00
Poul-Henning Kamp
1ee055e692 Add gctl_set_param() function. 2003-05-04 19:24:34 +00:00
Alan Cox
f7dd7b637b Extend the scope of the vm_object lock in vm_object_terminate(). 2003-05-04 19:23:40 +00:00
Poul-Henning Kamp
ce40bcd0d1 Remove debugging printfs which should not have been committed. 2003-05-04 18:48:25 +00:00
Søren Schmidt
64ff745cf5 Change the way loadbalancing works on RAID1's.
Based on code partially by me and by <Tor.Egge@cvsup.no.freebsd.org>.
2003-05-04 16:17:54 +00:00
Warner Losh
452855111a fix typo in TI1515 ID. 2003-05-04 12:49:37 +00:00
Søren Schmidt
cf764e45ae Implement dump function for ATA RAID's. Minor fixes by me...
Submitted by: Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
2003-05-04 12:16:47 +00:00
Søren Schmidt
9c51ecf436 Grap the ATA lock on all channels before suspend, this makes certain
that we have no outstanding ops in transit, which would cause problems
on resume.
2003-05-04 09:34:14 +00:00
Murray Stokely
dab0c25bf9 Fix a bunch of typos and grammatical errors.
PR:		docs/40234
Submitted by:	Chris Pepper <pepper@rockefeller.edu>  (mostly)
MFC After:	3 days
2003-05-04 08:23:24 +00:00
Scott Long
b243b76c82 Eliminate the separate malloc type for the sparing table. 2003-05-04 07:41:07 +00:00
Scott Long
185416b425 Add a missing __inline. Strange that gcc never complained about it.
Implement udf_readlblks() in terms of RDSECTOR.
2003-05-04 07:40:29 +00:00
Scott Long
1830bca169 Correctly calculate the size of the extent that should be read in
udf_readatoffset().  This should fixe problems with reading udf filesystems
created with mkisofs.
2003-05-04 07:39:11 +00:00
Jake Burkholder
6e11162c7b Forgot to update string and signal tables when some of the trap types
changed.
2003-05-04 07:21:04 +00:00
Alan Cox
c4a1d732a3 Avoid a lock-order reversal and implement vm_object locking
in vm_pageout_page_free().
2003-05-04 06:56:27 +00:00
Warner Losh
cf808dab3f Grab some of the latest TI cardbus bridge IDs. Inspired by a similar
commit to NetBSD.  I'll add these to various tables soon.
2003-05-04 06:10:05 +00:00
Martin Blapp
aa2e39baed My previous commit broke builds for restricted namespaces. Add
a underscore to fix this.

Reviewed by:	peter
2003-05-04 05:57:50 +00:00
Greg Lehey
af5e35e6ad Update declaration of vinum_scandisk (only one parameter). 2003-05-04 05:19:48 +00:00
Greg Lehey
f911210e72 Rewrite of startup code:
Add ioctl VINUM_READCONFIG which implements both the "read" and
"start" commands in vinum(8).  Aim for marginally better error
messages when something goes wrong.
2003-05-04 05:16:02 +00:00
Greg Lehey
8ffac9562e Rewrite of startup code:
Add ioctl VINUM_READCONFIG which implements both the "read" and
"start" commands in vinum(8).
2003-05-04 05:15:32 +00:00
Greg Lehey
acf0d9331b Rewrite of startup code:
parse_config: Remove kw_read case.  It's not used any more.

parse_user_config: Remove check for failed read.
2003-05-04 05:15:07 +00:00
Greg Lehey
60500a5ca2 Rewrite of startup code:
vinumattach: Move the startup code to vinum_scandisk.
2003-05-04 05:13:45 +00:00
Scott Long
c9c0dc5bcd Implement the node cache as a hash table. 2003-05-04 03:40:11 +00:00
Paul Saab
20430a6b04 Something I missed in my tree.
If the media changes, poke the DSP on the 5401/5411 Broadcom PHY's.

Obtained from:	NetBSD
2003-05-04 02:03:20 +00:00
Justin T. Gibbs
d7cff4ab97 Correct spelling errors.
Switch to handling bad SCSI status as a sequencer interrupt
instead of having the kernel proccess these failures via
the completion queue.  This is done because:

 o The old scheme required us to pause the sequencer and clear
   critical sections for each SCB.  It seems that these pause
   actions, if coincident with a sequencer FIFO interrupt, would
   result in a FIFO interrupt getting lost or directing to the
   wrong FIFO.  This caused hangs when the driver was stressed
   under high "queue full" loads.
 o The completion code assumed that it was always called with
   the sequencer running.  This may not be the case in timeout
   processing where completions occur manually via
   ahd_pause_and_flushwork().
 o With this scheme, the extra expense of clearing critical
   sections is avoided since the sequencer will only self pause
   once all pending selections have cleared and it is not in
   a critical section.

  aic79xx.c
	Add code to handle the new BAD_SCB_STATUS sequencer
	interrupt code.  This just redirects the SCB through
	the already existing ahd_complete_scb() code path.
	Remove code in ahd_handle_scsi_status() that paused
	the sequencer, made sure that no selections where
	pending, and cleared critical sections.  Bad
	status SCBs are now only processed when all of these
	conditions are true.

  aic79xx.reg:
	Add the BAD_SCB_STATUS sequencer interrupt code.

  aic79xx.seq:
	When completing an SCB upload to the host, if
	we are doing this because the SCB contains non-zero
	SCSI status, defer completing the SCB until there
	are no pending selection events.  When completing
	these SCBs, use the new BAD_SCB_STATUS sequencer
	interrupt.  For all other uploaded SCBs (currently
	only for underruns), the SCB is completed via the
	normal done queue.  Additionally, keep the SCB that
	is currently being uploaded on the COMPLETE_DMA_SCB
	list until the dma is completed, not just until the
	DMA is started.  This ensures that the DMA is restarted
	properly should the host disable the DMA transfer for
	some reason.

	In our RevA workaround for Maxtor drives, guard against
	the host pausing us while trying to pause I/O until the
	first data-valid REQ by clearing the current snapshot
	so that we can tell if the transfer has completed prior
	to us noticing the REQINIT status.

	In cfg4data_intr, shave off an instruction before getting
	the data path running by adding an entrypoint to the
	overrun handler to also increment the FIFO use count.

	In the overrun handler, be sure to clear our LONGJMP
	address in both exit paths.

Perform a few sequencer optimizations.

  aic79xx.c:
	Print the full path from the SCB when a packetized
	status overrun occurs.

	Remove references to LONGJMP_SCB which is being
	removed from firmware usage.

	Print the new SCB_FIFO_USE_COUNT field in the
	per-SCB section of ahd_dump_card_state().  The
	SCB_TAG field is now re-used by the sequencer,
	so it no longer makes sense to reference this
	field in the kernel driver.

  aic79xx.h:
	Re-arrange fields in the hardware SCB from largest
	size type to smallest.  This makes it easier to
	move fields without changing field alignment.

	The hardware scb tag field is now down near the
	"spare" portion of the SCB to facilitate reuse
	by the sequencer.

  aic79xx.reg:
	Remove LONGJMP_ADDR.

	Rearrange SCB fields to match aic79xx.h.
	Add SCB_FIFO_USE_COUNT as the first byte
	of the SCB_TAG field.

  aic79xx.seq:
	Add a per-SCB "Fifos in use count" field and use
	it to determine when it is safe (all data posted)
	to deliver status back to the host.  The old method
	involved polling one or both FIFOs to verify that
	the current task did not have pending data.  This
	makes running down the GSFIFO very cheap, so we
	will empty the GSFIFO in one idle loop pass in
	all cases.

	Use this simplification of the completion process
	to prune down the data FIFO teardown sequencer for
	packetized transfers.  Much more code is now shared
	between the data residual and transfer complete cases.

	Correct some issues in the packetized status handler.
	It used to be possible to CLRCHN our FIFO before status
	had fully transferred to the host.  We also failed to
	handle NONPACKREQ phases that could occur should a CRC
	error occur during transmission of the status data packet.

Correct a few big endian issues:

  aic79xx.c:
  aic79xx_inline.h:
  aic79xx_pci.c:
  aic79xx_osm.c:
	o Always get the SCB's tag via the SCB_GET_TAG acccessor
	o Add missing use of byte swapping macros when touching
	  hscb fields.
	o Don't double swap SEEPROM data when it is printed.
	  Correct a big-endian bug.  We cannot assign a
	o When assigning a 32bit LE variable to a 64bit LE
	  variable, we must be explict about how the words
	  of the 64bit LE variable are initialized.  Cast to
	  (uint32_t*) to do this.

aic79xx.c:
	In ahd_clear_critical_section(), hit CRLSCSIINT
	after restoring the interrupt masks to avoid what
	appears to be a glitch on SCSIINT.  Any real SCSIINT
	status will be persistent and will immidiately
	reset SCSIINT.  This clear should only get rid of
	spurious SCSIINTs.

	This glitch was the cause of the "Unexpected PKT busfree"
	status that occurred under high queue full loads

	Call ahd_fini_scbdata() after shutdown so that
	any ahd_chip_init() routine that might access
	SCB data will not access free'd memory.

	Reset the bus on an IOERR since the chip doesn't
	seem to reset to the new voltage level without
	this.

	Change offset calculation for scatter gather maps
	so that the calculation is correct if an integral
	multiple of sg lists does not fit in the allocation
	size.

	Adjust bus dma tag for data buffers based on 39BIT
	addressing flag in our softc.

	Use the QFREEZE count to simplify ahd_pause_and_flushworkd().
	We can thus rely on the sequencer eventually clearing ENSELO.

	In ahd_abort_scbs(), fix a bug that could potentially
	corrupt sequencer state.  The saved SCB was being
	restored in the SCSI mode instead of the saved mode.
	It turns out that the SCB did not need to be saved at all
	as the scbptr is already restored by all subroutines
	called during this function that modify that register.

aic79xx.c:
aic79xx.h:
aic79xx_pci.c:
	Add support for parsing the seeprom vital product
	data.  The VPD data are currently unused.

aic79xx.h:
aic79xx.seq:
aic79xx_pci.c:
	Add a firmware workaround to make the LED blink
	brighter during packetized operations on the H2A.

aic79xx_inline.h:
	The host does not use timer interrupts, so don't
	gate our decision on whether or not to unpause
	the sequencer on whether or not a timer interrupt
	is pending.
2003-05-04 00:20:07 +00:00
Paul Saab
3927098f93 Implement the write twice to send producer index workaround for
BCM5700 chips as described in the Broadcom Errata documents.

Obtained from:	NetBSD and Broadcom Errata documentation
2003-05-04 00:07:21 +00:00
Justin T. Gibbs
9bf327a70c aic7xxx.c:
aic7xxx.h:
	Split out core chip initialization into ahc_chip_init().
	This will allow us to reset the chip correctly at times
	other than initial chip setup.

aic7770.c
aic7xxx_pci.c:
	Flesh out bus chip init methods for our two
	bus attachments and use these, in addition to
	bus suspend/resume hooks to get the core in
	better shape for handling these events.

	When disabling PCI parity error checking, use FAILDIS.
	Although the chip docs indicate that clearing PERRESPEN
	should also work, it does not.

	Auto-disable pci parity error checking after informing
	the user of AHC_PCI_TARGET_PERR_THRESH number of parity
	errors observed as a target.

aic7xxx.h:
aic7xxx_pci.c
aic7770.c
aic7xxx.c
	Add the instruction_ram_size softc field.

	Remove the now unused stack_size softc field.

	Modify ahc_loadseq to return a failure code
	and to actually check the downloaded instruction
	count against the limit set in our softc.

	Modify callers of ahc_loadseq to handle load
	failures as appropriate.

	Set instruction RAM sizes for each chip type.

aic7xxx_pci.c:
	Add some delay in the aic785X termination
	control code.  This may fix problems with
	the 2930.

	Be consistent in how we access config space
	registers.  16bit registers are accessed using
	16bit ops.

aic7xxx.c:
	Correct spelling errors.

	Have ahc_force_renegotiation() take a devinfo as is done
	in the U320 driver.  Use this argument to correct a bug
	in the selection timeout handler where we forced a renegotiation
	with the last device that had set SAVED_SCSIID.  SAVED_SCSIID
	is only updated once a selection is *sucessfull* and so is
	stale for any selection timeout.

	Cleanup the setup of the devinfo for busfree events.  We
	now use this devinfo for a call to ahc_force_renegotiation()
	at the bottom of the routine, so it must be initialized in
	all cases.

	In ahc_pause_and_flushwork(), adjust the loop so that it
	will exit in the hot-eject case even if the INT_PEND mask
	is something other than 0xFF (as it is in this driver).

	Correct a wrapping string constant.

	Call ahc_fini_scbdata() after shutdown so that
	any ahc_chip_init() routine that might access
	SCB data will not access free'd memory.

	Correctly setup our buffer tag to indicate that 39bit
	addressing is available if in 39bit addressing mode.

	Rearrange some variable declarations based on
	type size.

aic7xxx.c
aic7xxx.h:
aic7xxx.reg:
	Consistently use MAX_OFFSET for the user max syncrate
	set from non-volatile storage.  This ensures that the
	offset does not conflict with AHC_OFFSET_UNKNOWN.

	Change AHC_OFFSET_UNKNOWN to 0xFF.  This is
	a value that the curr->offset can never be,
	unlike '0' which we previously used.  This
	fixes code that only checks for a non-zero
	offset to determine if a sync negotiation
	is required since it will fire in the unknown
	case even if the goal is async.

	Change MAX_OFFSET to 0x7f which is the max
	offset U160 aic7xxx controllers can negotiate.
	This ensures that curr->offset will not
	match AHC_OFFSET_UNKNOWN.

aic7xxx_inline.h:
	Have our inline interrupt handler return with a value
	indicating whether we serviced a real interrupt.  This
	is required for Linux support.

	Return earlier if the interrupt is not for us.
2003-05-03 23:55:38 +00:00
Justin T. Gibbs
8270490a58 hc_eisa.c:
ahc_pci.c:
ahd_pci.c:
        Don't bogusly use the BUS_DMA_ALLOCNOW flag in our psuedo
        parent bus dma tag.
2003-05-03 23:27:57 +00:00
Marcel Moolenaar
e126260569 Fix c99 victim: the accepted character '0 most now be types as '0'. 2003-05-03 23:05:16 +00:00
Paul Saab
5cba12d3bc - Change the short hand representation of the various ASIC revisions
- Implement the ONEDMA_AT_ONCE workaround as described in the
  5703/5704 eratta documents.
  Obtained from: NetBSD & Broadcom documentation
2003-05-03 22:58:45 +00:00
Alan Cox
ad682c4825 Lock the vm_object on entry to vm_object_vndeallocate(). 2003-05-03 20:28:26 +00:00
Paul Saab
37ceeb4d9f - Move bge_phy_hack into the phy code and implement the various DSP
patch workarounds for each phy revision.
  Obtained from: NetBSD & Broadcom Linux driver

- Disable AUTOPOLL when accessing the PHY as it may cause PCI errors.
  Obtained from: NetBSD

- Check the UPDATED bit in the status block so the driver knows
  that the status block as indeed changed since the last access.
  Broadcom documentation states drivers should unset the UPDATED/CHANGED
  bits after reading them.

- When changing media types, first loop the phy then set the media.
  Broadcom documentation and Linux drivers do this and I observed
  much better handling of link after this change.

- Broadcom documentation states that for 1000BaseT operation,
  autonegotiation must be enabled.  Fix hard coding of media so that
  the driver only advertises 1000BaseT as the supported media type
  and enable autonegotition.

- Only set Master/Slave on the 5701.
  Obtained from Broadcom Linux driver.
2003-05-03 19:06:50 +00:00
Søren Schmidt
7af89aab59 Fix locking on reinit. 2003-05-03 18:28:43 +00:00
Søren Schmidt
a23507bcff Add the pdc20268r as candidate for the TX test. 2003-05-03 18:26:00 +00:00
David E. O'Brien
1d7157c5c3 Use C99 for the kernel. 2003-05-03 18:05:56 +00:00
Warner Losh
0f78c17f6f Fix halt -p. I've done this with an import because kochi-san reports
this is fixed in a newer version of ACPICA and I don't want to take
this off the vendor branch for a trivial reason.  This patch was
applied to NetBSD by kochi-san, who also posted the patch to
acpi-jp@jp.freebsd.org.

# My Dell Inspiron 8000 now powers off!

Submitted by: takayoshi kochi-san kochi at netbsd dot org
2003-05-03 17:16:40 +00:00
Warner Losh
d2d8d8cf9d This commit was generated by cvs2svn to compensate for changes in r114584,
which included commits to RCS files with non-trunk default branches.
2003-05-03 17:16:40 +00:00
Shunsuke Akiyama
3dfc942fa1 Regen. 2003-05-03 10:19:43 +00:00
Shunsuke Akiyama
11e04b0528 Add RealTek RTL8150 USB to fast Ethernet controller driver.
This driver now supports the Melco LUA-KTX and the GREEN HOUSE
GH-USB100B.

Reviewed by:	imp
MFC after:	2 weeks
2003-05-03 10:16:56 +00:00
Alan Cox
bff99f0d12 - Revert kern/vfs_subr.c revision 1.444. The vm_object's size isn't
trustworthy for vnode-backed objects.
 - Restore the old behavior of vm_object_page_remove() when the end
   of the given range is zero.  Add a comment to vm_object_page_remove()
   regarding this behavior.

Reported by:	iedowse
2003-05-03 08:09:24 +00:00
Poul-Henning Kamp
a767c3daa3 Add a OAM interface for changing the label and writing the boot code. 2003-05-03 08:01:34 +00:00
Prafulla Deuskar
bc93b4de0e - Fix breakage on PAE enabled kernel
- Don't use vtophys when you can get physical address using bus_dma API

Submitted by:	jake (Jake Burkholder)
2003-05-03 07:35:47 +00:00
Poul-Henning Kamp
951fd0d157 remove unused variables.
Spotted by:	dougb
2003-05-03 07:12:15 +00:00
Alan Cox
f92039a1fc Move a declaration to its proper place. 2003-05-03 04:21:16 +00:00
Peter Wemm
7dca36c92c Spell cpu_switch correctly. 2003-05-03 03:30:29 +00:00
Yoshihiro Takahashi
7571a866b9 Force PnP devices to set SMIT mode.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2003-05-03 02:04:58 +00:00
Yoshihiro Takahashi
0e7902c6cd Fix off-by-one bug.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2003-05-03 01:47:38 +00:00
Peter Wemm
5b27e93419 Repocopy *.s to *.S 2003-05-03 00:21:43 +00:00
Kenneth D. Merry
3674802f42 Fix three problems in large (>2TB) device handling:
- Make sure we don't release the READ CAPACITY CCB twice
 - If we have a device that needs a 16 byte READ CAPACITY command, make
   sure we call xpt_schedule() so we can get a CCB.
 - Don't unlock the peripheral until we're fully probed.

Many thanks to Julian Elischer for providing hardware and testing this.

Tested by:	julian
2003-05-03 00:21:40 +00:00
Peter Wemm
278286256b Rename amd64/*.s to amd64/*.S 2003-05-03 00:19:42 +00:00
Poul-Henning Kamp
56dde750d5 Make bsd_disklabel_le_enc calculate the checksum and fill it in.
(If there is a legitimate need to correctly encode and pack a
disklabel with an invalid checksum custom tools can be built for
that.)

Make bsd_disklabel_le_dec() validate the magics, number of partitions
(against a new parameter) and the checksum.

Vastly simplify the logic of the GEOM::BSD class implementation:

Let g_bsd_modify() always take a byte-stream label.

This simplifies all users, except the ioctl's which now have to
convert to a byte-stream first.  Their loss.

g_bsd_modify() is called with topology held now, and it returns
with it held.

Always update the md5sum in g_bsd_modify(), otherwise the check
is no use after the first modification of the label.  Make the
MD5 over the bytestream version of the label.

Move the rawoffset hack to g_bsd_modify() and remove all the
inram/ondisk conversions.

Don't configure hotspots in g_bsd_modify(), do it in taste instead,
we do not support moving the label to a different location on the
fly anyway.

This passes all current regression tests.
2003-05-02 22:46:13 +00:00
Prafulla Deuskar
a9cbe07958 - Bus DMA'fy the driver
- Use htole* macros where appropriate so that the driver could work on non-x86 architectures
- Use m_getcl() instead of MGETHDR/MCLGET macros
Submitted by:	sam (Sam Leffler)
2003-05-02 21:17:08 +00:00
Marcel Moolenaar
aea4a02702 Option KADB does not exist. It came from alpha, where it still exists. 2003-05-02 20:34:15 +00:00
Poul-Henning Kamp
81377a3f17 Pull in bcopy() prototype from <string.h> when compiled in userland. 2003-05-02 19:53:55 +00:00
Paul Saab
6ac6d2c895 Add untested support for the Broadcom 5704.
Obtained from:	NetBSD
2003-05-02 19:53:40 +00:00
Alan Cox
12352fdcaa Lock access to the vm_object's flags in vop_stdcreatevobject(). 2003-05-02 19:33:21 +00:00
Poul-Henning Kamp
039b4cba75 Considering that I did cast the arguments to (intmax_t) I must have
been sleepy since I used %qd instead of %jd.
2003-05-02 19:08:57 +00:00
Jake Burkholder
eadb8f358b Fix printf format errors. 2003-05-02 17:21:07 +00:00
Søren Schmidt
93f307bbea Add flushing of devices on shutdown.
Note: this might print failure messages on some systems, unfortunatly
the info from the device, stating if flushing is supported, cannot be trusted
so the operation is always issued on all devices, just in case...
2003-05-02 13:47:44 +00:00
Poul-Henning Kamp
3daf7274a1 Style improvement. 2003-05-02 12:57:40 +00:00