Commit Graph

22714 Commits

Author SHA1 Message Date
John Baldwin
700bfa750f - GC some #if 0'd code regarding the non-existant safepri variable.
- Don't dink with the witness state of Giant unless we actually own it
  during mi_switch().
2000-10-20 07:52:10 +00:00
John Baldwin
d1182da2cf Actually harvest interrupt threads when the last handler is removed from a
thread.
2000-10-20 07:46:12 +00:00
John Baldwin
13b0500f02 - machine/mutex.h -> sys/mutex.h
- Use cpu_throw() instead of cpu_switch() during cpu_exit() since we don't
  need to save our previous state.
2000-10-20 07:43:55 +00:00
John Baldwin
ab4f2c187a Catch up to SMP_DEBUG -> MUTEX_DEBUG. 2000-10-20 07:41:50 +00:00
John Baldwin
bce7f05af8 - machine/mutex.h -> sys/mutex.h
- Catch up to the MI mutex structure due to saveflags,saveipl,savepsr
  becoming saveintr.
2000-10-20 07:38:44 +00:00
John Baldwin
557b927eca - machine/mutex.h -> sys/mutex.h
- Use MUTEX_DECLARE() and MTX_COLD for Giant and sched_lock.
2000-10-20 07:32:48 +00:00
John Baldwin
02660e29a8 - machine/mutex.h -> sys/mutex.h
- machine/ipl.h -> sys/ipl.h
- Use MUTEX_DECLARE() for clock_lock
2000-10-20 07:31:00 +00:00
John Baldwin
1e9b3e8eb0 - machine/mutex.h -> sys/mutex.h
- Use MUTEX_DECLARE() and MTX_COLD for vm86pcb_lock
2000-10-20 07:30:11 +00:00
John Baldwin
eec258d257 - machine/mutex.h -> sys/mutex.h
- Use MUTEX_DECLARE() and MTX_COLD for the malloc_mtx mutex
2000-10-20 07:29:16 +00:00
John Baldwin
d8881ca31d - machine/mutex.h -> sys/mutex.h
- The initial lock_mtx mutex used in the lockmgr code is initialized very
  early, so use MUTEX_DECLARE() and MTX_COLD.
2000-10-20 07:28:00 +00:00
John Baldwin
36412d79b4 - Make the mutex code almost completely machine independent. This greatly
reducues the maintenance load for the mutex code.  The only MD portions
  of the mutex code are in machine/mutex.h now, which include the assembly
  macros for handling mutexes as well as optionally overriding the mutex
  micro-operations.  For example, we use optimized micro-ops on the x86
  platform #ifndef I386_CPU.
- Change the behavior of the SMP_DEBUG kernel option.  In the new code,
  mtx_assert() only depends on INVARIANTS, allowing other kernel developers
  to have working mutex assertiions without having to include all of the
  mutex debugging code.  The SMP_DEBUG kernel option has been renamed to
  MUTEX_DEBUG and now just controls extra mutex debugging code.
- Abolish the ugly mtx_f hack.  Instead, we dynamically allocate
  seperate mtx_debug structures on the fly in mtx_init, except for mutexes
  that are initiated very early in the boot process.   These mutexes
  are declared using a special MUTEX_DECLARE() macro, and use a new
  flag MTX_COLD when calling mtx_init.  This is still somewhat hackish,
  but it is less evil than the mtx_f filler struct, and the mtx struct is
  now the same size with and without mutex debugging code.
- Add some micro-micro-operation macros for doing the actual atomic
  operations on the mutex mtx_lock field to make it easier for other archs
  to override/optimize mutex ops if needed.  These new tiny ops also clean
  up the code in some places by replacing long atomic operation function
  calls that spanned 2-3 lines with a short 1-line macro call.
- Don't call mi_switch() from mtx_enter_hard() when we block while trying
  to obtain a sleep mutex.  Calling mi_switch() would bogusly release
  Giant before switching to the next process.  Instead, inline most of the
  code from mi_switch() in the mtx_enter_hard() function.  Note that when
  we finally kill Giant we can back this out and go back to calling
  mi_switch().
2000-10-20 07:26:37 +00:00
John Baldwin
ccbdd9ee59 - Expand the set of atomic operations to optionally include memory barriers
in most of the atomic operations.  Now for these operations, you can
  use the normal atomic operation, you can use the operation with a read
  barrier, or you can use the operation with a write barrier.  The function
  names follow the same semantics used in the ia64 instruction set.  An
  atomic operation with a read barrier has the extra suffix 'acq', due to
  it having "acquire" semantics.  An atomic operation with a write barrier
  has the extra suffix 'rel'.  These suffixes are inserted between the
  name of the operation to perform and the typename.  For example, the
  atomic_add_int() function now has 3 variants:
  - atomic_add_int() - this is the same as the previous function
  - atomic_add_acq_int() - this function combines the add operation with a
    read memory barrier
  - atomic_add_rel_int() - this function combines the add operation with a
    write memory barrier
- Add 'ptr' to the list of types that we can perform atomic operations
  on.  This allows one to do atomic operations on uintptr_t's.  This is
  useful in the mutex code, for example, because the actual mutex lock is
  a pointer.
- Add two new operations for doing loads and stores with memory barriers.
  The new load operations use a read barrier before the load, and the
  new store operations use a write barrier after the load.  For example,
  atomic_load_acq_int() will atomically load an integer as well as
  enforcing a read barrier.
2000-10-20 07:00:48 +00:00
John Baldwin
3f4809dd0d Axe the barrier_{read,write,rw}() helper functions as this method of
doing memory barriers doesn't really scale well for the ia64.  Also,
memory barriers are more a property of the CPU than bus space.

Requested by:	dfr
2000-10-20 06:45:48 +00:00
KATO Takenori
1ae7243298 Convert the type of bus_space_handle_t of pc98 from structure into
pointer to structure.

Reviewed by:	nyan
2000-10-20 02:42:06 +00:00
Nick Hibma
a6bf18b222 Add the quirk entry for the Sony Memory Stick Adapter.
Add NO_SYNQ_CACHE to the Sony DSC camera entry.
2000-10-20 00:53:30 +00:00
Nick Hibma
64b78d815a Bugfix: The data is not stored only in the first cblock, calculate the
length of the data properly. This should be moved into a tty_subr
function.

Also, disanle the setting of the CDC_CM_OVER_DATA flag. It breaks some
modems. I don't think that ther actually is a modem that needs this.

Submitted by:		Brad Karp <bkarp@ICSI.Berkeley.EDU>
2000-10-20 00:35:52 +00:00
Nick Hibma
3cf950d1c5 Regen. 2000-10-20 00:30:01 +00:00
Nick Hibma
9258cec045 Add the Sony MSC Memory Stick Adaptor (in the Sony PCS laptops) 2000-10-20 00:29:21 +00:00
Peter Wemm
9b57bb4ef5 execsw_set hasn't been used for a while and does not exist. 2000-10-20 00:26:33 +00:00
Josef Karthauser
5da9f8fa97 Augment the 'ifaddr' structure with a 'struct if_data' to keep
statistics on a per network address basis.

Teach the IPv4 and IPv6 input/output routines to log packets/bytes
against the network address connected to the flow.

Teach netstat to display the per-address stats for IP protocols
when 'netstat -i' is evoked, instead of displaying the per-interface
stats.
2000-10-19 23:15:54 +00:00
Warner Losh
7ae6b1ebd2 o Fix memory leak in ivars
o Change name of bus
o Change the panic on resource allocation failure to just a message.  We'll
  work out why this fails later in the pcic/pccbb code merge.
2000-10-19 22:36:41 +00:00
Doug Rabson
4e94026a72 Don't force bootverbose anymore. 2000-10-19 20:39:48 +00:00
Doug Rabson
45b56a5505 Decrease the number of ticks between clock interrupts by a factor of ten
to place more pressure on the exception handling code.
2000-10-19 20:37:28 +00:00
Doug Rabson
2a4f0b6fd4 * Disable interrupts when restoring a trapframe.
* Make sure we reset ar.k6 (used to hold the kernel stack pointer when
  we are returning to user mode after a syscall.
2000-10-19 20:36:31 +00:00
John Baldwin
d8f831678d Reparent a kernel thread to init during kthread_exit() so that the zombie
can be reaped.
2000-10-19 19:53:44 +00:00
John Baldwin
bd788f7aca - Move the prototype for proc_reparent from sys/ptrace.h to sys/proc.h
- Fix the sorting of function prototypes in sys/proc.h
2000-10-19 18:55:22 +00:00
John Baldwin
0cfbef3288 Quiet a silly warning.
Pointy-hat to:	ps
2000-10-19 18:52:20 +00:00
Ruslan Ermilov
f136389613 A failure to allocate memory for auxiliary TCP data is now fatal.
This fixes a null pointer dereference problem that is unlikely to
happen in normal circumstances.
2000-10-19 10:44:44 +00:00
Jonathan Chen
feb78939ee NEWCARD/Cardbus -
This commit adds support for Xircom X3201 based cardbus cards.
Support for the TDK 78Q2120 MII is also added.
IBM Etherjet, Intel and Xircom cards uses these chips.

Note that as a result of this commit, some Intel/DEC 21143 based cardbus
cards will also attach, but not get link.  That is being looked at.
2000-10-19 08:34:32 +00:00
John Baldwin
cbbee1e4e6 Move init_clocks earlier in the system startup so that hardclock and clock
interrupts are started before the device probe.  This allows interrupt
threads to run during the device probe among other things.
2000-10-19 08:16:34 +00:00
Mike Smith
c7e95d0abe Write the routed interrupt back to PCI configuration space. 2000-10-19 08:07:23 +00:00
Mike Smith
9d55863400 Call the BIOS to route the selected interrupt. Correctly calculate the
interrupt from the PCI routing table (ffs returns 1 for the rightmost
bit, not 0).
2000-10-19 08:06:50 +00:00
Mike Smith
4bbbd5e215 Add PCI BIOS function codes for IRQ routing fetch and route. 2000-10-19 08:02:46 +00:00
Robert Watson
47460a23a0 o Introduce new VOP_ACCESS() flag VADMIN, allowing file systems to perform
"administrative" authorization checks.  In most cases, the VADMIN test
  checks to make sure the credential effective uid is the same as the file
  owner.
o Modify vaccess() to set VADMIN as an available right if the uid is
  appropriate.
o Modify references to uid-based access control operations such that they
  now always invoke VOP_ACCESS() instead of using hard-coded policy checks.
o This allows alternative UFS policies to be implemented by replacing only
  ufs_access() (such as mandatory system policies).
o VOP_ACCESS() requires the caller to hold an exclusive vnode lock on the
  vnode: I believe that new invocations of VOP_ACCESS() are always called
  with the lock held.
o Some direct checks of the uid remain, largely associated with the QUOTA
  and SUIDDIR code.

Reviewed by:	eivind
Obtained from:	TrustedBSD Project
2000-10-19 07:53:59 +00:00
John Baldwin
dc13e6dfbb Axe the idle_event eventhandler, and add a MD cpu_idle function used
for things such as halting CPU's, idling CPU's, etc.

Discussed with:	msmith
2000-10-19 07:47:16 +00:00
Roger Hardiman
de2c745ce3 Add Daniel's name and fix release data 2000-10-19 07:34:18 +00:00
Roger Hardiman
97e1cf9c1b Update to driver 2.17
Fixes bugs in devfs when unloading and reloading
Syncs with NetBSD changes

Submitted by:	Alexander Langer <alex@big.endian.de>
Submitted by:	Thomas Klausner <wiz@netbsd.org>
Submitted by:	Daniel O'Connor" <doconnor@gsoft.com.au>
2000-10-19 07:33:28 +00:00
Søren Schmidt
550abec2a0 Minor changes to the ATA RAID support code, remove some verbosity
and put some under bootverbose..
2000-10-18 18:49:42 +00:00
Peter Wemm
5d391f75d6 EVENTHANDLER_INVOKE() takes two arguments. 2000-10-18 17:56:06 +00:00
Peter Wemm
df58517066 This didn't compile. Fix typo: s/rmang_get_start/rman_get_start/ 2000-10-18 17:45:29 +00:00
KATO Takenori
d430064589 Converted da' and wd' into rda' and rwd', respectively.
Submitted by:	MURAMATSU Atsushi <amura@ma3.seikyou.ne.jp>
2000-10-18 15:28:10 +00:00
Ruslan Ermilov
0531ca1fd8 If we do not byte-swap the ip_id in the first place, don't do it in
the second.  NetBSD (from where I've taken this originally) needs
to fix this too.
2000-10-18 11:36:09 +00:00
Peter Wemm
93d88e0056 Attempt to fix the random read blocking. The old code slept at
priority "0" and without PCATCH, so it was uninterruptable.  And
even when it did wake up after entropy arrived, it exited after the
wakeup without actually reading the freshly arrived entropy.  I
sent this to Mark before but it seems he is in transit.
Mark: feel free to replace this if it gets in your way.
2000-10-18 10:39:18 +00:00
John Baldwin
25f3f7c530 Add in a simple API for memory barriers to machine/bus.h:
- barrier_read() enforces a memory read barrier
- barrier_write() enforces a memory write barrier
- barrier_rw() enforces a memory read/write barrier
2000-10-18 10:30:12 +00:00
Warner Losh
b8493884df Go ahead and disable the legacy mapping of the pcic registers on the
RF5C47x.  Before the code would only do this on the RF5C46x bridges.

Submitted by: Jonathan Chen
2000-10-18 09:55:39 +00:00
Hellmuth Michaelis
8ccc600fa4 Add ifpnp driver to list of i4b hardware drivers. 2000-10-18 09:16:30 +00:00
KATO Takenori
a5414135aa Merged from sys/i386/i386/machdep.c revision 1.416. 2000-10-18 09:05:09 +00:00
Hellmuth Michaelis
5682901b52 Add a debug flag bit for a new driver. 2000-10-18 08:39:24 +00:00
John Baldwin
86bc23af90 Don't needlessly pass the diagnostic counter to the idle_event event
handlers.
2000-10-18 08:10:25 +00:00
Matthew N. Dodd
0cb53e2487 Add new bus method 'GET_RESOURCE_LIST' and appropriate generic
implementation.

Add bus_generic_rl_{get,set,delete,release,alloc}_resource() functions
which provide generic operations for devices using resource list style
resource management.

This should simplify a number of bus drivers.  Further commits to follow.
2000-10-18 05:15:40 +00:00
Jonathan Chen
6672edd320 Initial commit of NEWCARD cardbus side (that actually compiles and works)
Files:
	dev/cardbus/cardbus.c
	dev/cardbus/cardbusreg.h
	dev/cardbus/cardbusvar.h
	dev/cardbus/cardbus_cis.c
	dev/cardbus/cardbus_cis.h
	dev/pccbb/pccbb.c
	dev/pccbb/pccbbreg.h
	dev/pccbb/pccbbvar.h
	dev/pccbb/pccbb_if.m

This should support:
  - cardbus controllers:
    * TI 113X
    * TI 12XX
    * TI 14XX
    * Ricoh 47X
    * Ricoh 46X
    * ToPIC 95
    * ToPIC 97
    * ToPIC 100
    * Cirrus Logic CLPD683x
  - cardbus cards
    * 3c575BT
    * 3c575CT
    * Xircom X3201 (includes IBM, Xircom and, Intel cards)
    [ 3com support already in kernel, Xircom will be committed real soon now]

This doesn't work with 16bit pccards under NEWCARD.

Enable in your config by having "device pccbb" and "device cardbus".
(A "device pccard" will attach a pccard bus, but it means you system have
a high chance of panicing when a 16bit card is inserted)

It should be fairly simple to make a driver attach to cardbus under
NEWCARD -- simply add an entry for attaching to cardbus on a new
DRIVER_MODULE and add new device IDs as necessary.  You should also make
sure the card can be detached nicely without the interrupt routine doing
something weird, like going into an infinite loop.  Usually that should
entail adding an additional check when a pci register or the bus space is
read to check if it equals 0xffffffff.

Any problems, please let me know.

Reviewed by: imp
2000-10-18 03:37:21 +00:00
Jonathan Chen
0db7e66cdc Initial commit of NEWCARD cardbus side (that actually compiles and works)
Files:
	dev/cardbus/cardbus.c
	dev/cardbus/cardbusreg.h
	dev/cardbus/cardbusvar.h
	dev/cardbus/cardbus_cis.c
	dev/cardbus/cardbus_cis.h
	dev/pccbb/pccbb.c
	dev/pccbb/pccbbreg.h
	dev/pccbb/pccbbvar.h
	dev/pccbb/pccbb_if.m

This should support:
  - cardbus controllers:
    * TI 113X
    * TI 12XX
    * TI 14XX
    * Ricoh 47X
    * Ricoh 46X
    * ToPIC 95
    * ToPIC 97
    * ToPIC 100
    * Cirrus Logic CLPD683x
  - cardbus cards
    * 3c575BT
    * 3c575CT
    * Xircom X3201 (includes IBM, Xircom and, Intel cards)
    [ 3com support already in kernel, Xircom will be committed real soon now]

This doesn't work with 16bit pccards under NEWCARD.

Enable in your config by having "device pccbb" and "device cardbus".
(A "device pccard" will attach a pccard bus, but it means you system have
a high chance of panicing when a 16bit card is inserted)

It should be fairly simple to make a driver attach to cardbus under
NEWCARD -- simply add an entry for attaching to cardbus on a new
DRIVER_MODULE and add new device IDs as necessary.  You should also make
sure the card can be detached nicely without the interrupt routine doing
something weird, like going into an infinite loop.  Usually that should
entail adding an additional check when a pci register or the bus space is
read to check if it equals 0xffffffff.

Any problems, please let me know.

Reviewed by: imp
2000-10-18 03:25:13 +00:00
Warner Losh
e8f9f4ecd4 Remove some silly debug writes and code that we don't need 2000-10-18 02:22:39 +00:00
Warner Losh
cc8e7d4250 o Remove a boatload of debugging printfs.
o Report function number and config index on probe line
o Activate the resources (I hope) when RF_ACTIVE is set on those resources
  I'm allocating on behalf of my children.
o Always enable interrupts on multifunction cards in the multifunction
  register.
2000-10-18 02:21:00 +00:00
Matthew N. Dodd
a4a64f2f0a Use appropriate resource management accessors instead of directly
referencing structure members.

Use rman_get_size() instead of end - start + 1.
2000-10-18 00:09:26 +00:00
Matthew N. Dodd
7f9b204636 Add rman_get_size(), which does what you would expect.
Further commits to make use of this will follow.
2000-10-17 23:45:28 +00:00
John Baldwin
3650b37578 - Wrap the sanity checks for staying in the idle loop for absurdly long
amounts of time in #ifdef DIAGNOSTIC
- Call vm_page_zero_idle() during the idle loop.
2000-10-17 23:12:37 +00:00
John Baldwin
ffc2c9e3ee - Catch up to moving headers, machine/ipl.h -> sys/ipl.h
- Fix some whitespace bogons.

Submitted by:	bde (2)
2000-10-17 23:10:23 +00:00
Warner Losh
85d693f9d8 Implement resource alignment as discussed in arch@ a long time ago.
This was implemented by Shigeru YAMAMOTO-san and Jonathan Chen.  I've
cleaned them up somewhat and they seem to work well enough to boot
current (but given current's state it can be hard to tell).  Doug
Rabson also reviewed the design and signed off on it.
2000-10-17 22:08:03 +00:00
Matt Jacob
e92fbe47e2 Roll minor revision- for once we'll use this because.... if revision >= 5.4,
compile time will build in mutex locks, otherwise the old locking (splcam/splx
with a recursion counter) will be compiled in.

We still depend on config_intr_hook to tell us when it's okay to call
msleep instead of polling. It'd be real nice if we could do this early
enough to not hang up a machine struggling with a bad Fibre Channel loop,
but that's still to come.
2000-10-17 18:18:14 +00:00
Matt Jacob
39f3fc6f69 remove "SERVICING_INTERRUPT" nonsense 2000-10-17 18:15:30 +00:00
Paul Saab
c794ceb56a Implement write combining for crashdumps. This is useful when
write caching is disabled on both SCSI and IDE disks where large
memory dumps could take up to an hour to complete.

Taking an i386 scsi based system with 512MB of ram and timing (in
seconds) how long it took to complete a dump, the following results
were obtained:

Before:				After:
	WCE           TIME		WCE           TIME
	------------------		------------------
	1	141.820972		1	 15.600111
	0	797.265072		0	 65.480465

Obtained from:	Yahoo!
Reviewed by:	peter
2000-10-17 10:05:49 +00:00
Roger Hardiman
63883894bf Add new bktr options 2000-10-17 07:59:56 +00:00
Warner Losh
c5cdd6f29e More NEWCARD fixes. We now almost properly print the probe message.
o Remember the resources we allocate for the config entry.
o When we get the resource, do an resource_list_add and do a
  resource_list_delete if we fail later in the resource list.
o In the pccard bus, we allocate the resources.  When a child asks for
  them, just return the resources that we allocated (thanks to Paul
  Richards and Mike Smith for the idea).
2000-10-17 06:29:21 +00:00
Andrew Gallatin
242fae60f0 Some linux apps, such as IBM's JDK 1.3, will attempt to mmap thread
stacks near the top of their address space.  If their TOS is greater
than vm_maxsaddr, vm_map_growstack() will confuse the thread stack
with the process stack and deliver a SEGV if they attempt to grow the
thread stack past their current stacksize rlimit.  To avoid this,
adjust vm_maxsaddr upwards to reflect the current stacksize rlimit
rather than the maximum possible stacksize.  It would be better to
adjust the mmap'ed region, but some apps (again, IBM's JDK 1.3) do not
check mmap's return value..

This commit (in conjunction with setting MINSIGSTKSZ to 2048 &
rebuilding your kernel and modules) will get IBM's JDK 1.3 working
with FreeBSD at least well enough to run many of the example applets.

Reviewed by: marcel
Tested by:   sto@stat.duke.edu, many others on freebsd-java@
2000-10-17 00:25:43 +00:00
Andrew Gallatin
21b0b22ce3 regen after addition of linux_rt_sigreturn 2000-10-17 00:03:02 +00:00
Andrew Gallatin
7936339495 A start at an implemention of linux_rt_sendsig & linux_rt_sigreturn
and associated user-level signal trampoline glue.

Without this patch, an SA_SIGINFO style handler can be installed by a linux
app, but if the handler accesses its sip argument, it will get a garbage
pointer and likely segfault.

We currently supply a valid pointer, but its contents are mainly
garbage.  Filling this in properly is future work.

This is the second of 3 commits that will get IBM's JDK 1.3 working with
FreeBSD ...
2000-10-17 00:00:20 +00:00
Warner Losh
dc1aef34f1 Add support for cardbus card's chips. This will make the 3c575 cards
work once the rest of the cardbus infrastructure has been committed.

Submitted by: Jonathan Chen <jon@spook.org>
2000-10-16 23:16:02 +00:00
Matt Jacob
3fdd89c865 Very early and very *very* lightly tested support for LIVENGOOD chipset
(followon to WISEMAN). Presumably some flavors are also no multimode copper
as well.
2000-10-16 23:08:45 +00:00
Warner Losh
a7103127cf When wierdreset flag is set, turn on the DISADVFD flag when we reset
rather than all the flags.  This prevents setting being read from ROM,
which is a problem.  If this breaks anything, it will only break the
3C556B cards minipci cards, which mainly exist at rpi as far as rpi
has been able to tell.

Submitted by: Louis Gerbarg <gerbal@rpi.edu>
2000-10-16 23:02:21 +00:00
Andrew Gallatin
1e78526274 Fix problems booting large kernels on alphas. The symptom is that the kernel
loads, prints the copyright, and either hangs or locks solid.  The
PC tends to be in the data segment and the RA is in XentMM

Doug really came up with the fix, I'm just the monkey typing.  Doug says:
	The alpha can only support 64k of globals with $gp pointing at
	base+32k so that the code can use 16bit signed offsets from $gp to
	access it. ....  it is possible to have multiple .got subsections
	and the linker handles this with the relocations for 'ldgp' pseudo
	instructions.  [Without this patch] the code in exception.s has been
	linked  to use a different gp from locore.s (where pal_kgp is set).

Reviewed by: dfr
2000-10-16 20:15:43 +00:00
Doug Rabson
0d409bfdac Add section for building ia64 kernels. 2000-10-16 20:04:52 +00:00
David E. O'Brien
c2606cffec Convert from the Alpha compontents to PowerPC ones. 2000-10-16 19:58:32 +00:00
Warner Losh
29f0d43398 Add types and prototypes.
Submitted by: msmith
2000-10-16 19:49:30 +00:00
Warner Losh
8302c16686 Forgot to commit this last night.
Define interrupt routing method.

Submitted by: msmith
2000-10-16 19:43:44 +00:00
Bill Paul
707f355368 Remove an errant splimp() that I missed when I went through this driver
the first time.
2000-10-16 18:51:32 +00:00
Nick Hibma
ebcc7b37d5 Undo previous commit. <machine/clock.h> is needed for the prototype
for DELAY().
2000-10-16 18:50:00 +00:00
Nick Hibma
8b677600f9 Sync with NetBSD:
Add more Usages.
2000-10-16 17:45:27 +00:00
Nick Hibma
b78cc80b0d Sync with NetBSD:
Add seatbelts.
Be more lenient towards restarting the ports: If a port manages to connect
successfully reset the restartcount.
2000-10-16 17:40:59 +00:00
Brian Somers
0910581ff1 Move __uint16_swap_uint32, __uint8_swap_uint32 and
__uint8_swap_uint16 inside __GNUC__.

Reviewed by: bde
2000-10-16 17:06:48 +00:00
Doug Rabson
e296c9c9f7 In pmap_remove_pv(), only manipulate the page's list if the pv is
managed.
2000-10-16 17:06:32 +00:00
Doug Rabson
85a25ab3d5 Do a full exception_restore after an execve syscall to ensure that the
new program gets the right values for its arguments etc.
2000-10-16 17:03:51 +00:00
Doug Rabson
4f8d61b521 Clear the register stack frame before using loadrs to invalidate the
stacked registers.
2000-10-16 16:59:32 +00:00
Doug Rabson
48ac0f7c79 Clear ar.pfs for the child process in cpu_fork - switch_trampoline
doesn't want a stack frame.
2000-10-16 16:55:59 +00:00
Andrew Gallatin
68ab2e8672 The previous commit broke kernel builds on alpha (and probably ia64).
#ifdef away the offending code until somebody with more newbus fu than
me can figure out where to put a default function that returns 255
without touching each alpha chipset driver..
2000-10-16 15:38:11 +00:00
David E. O'Brien
146a7d5318 "Ok, my loader's now up to putting up a prompt. It probes disks partially
but can't boot from them yet."

Thanks to Stephane Potvin for the some of the code in this set.

Submitted by:	Benno Rice <benno@jeamland.net>
2000-10-16 10:46:22 +00:00
Doug Rabson
9c4e05709a Track changes to trapframe. 2000-10-16 09:18:05 +00:00
Doug Rabson
7fcf71bc40 * Correct some of my misunderstandings about how best to switch to the
kernel backing store.
* Implement syscalls via break instructions.
* Fix backing store copying in cpu_fork() so that the child gets the right
  register values.

This thing is actually starting to work now. This set of changes takes me
up to the second execve (the one which runs the first shell). Next stop
single-user mode :-).
2000-10-16 08:54:40 +00:00
Ruslan Ermilov
df4443ffa6 Added support for i815. 2000-10-16 08:53:00 +00:00
Doug Rabson
2e8a70354f Use the right mask for extracting sof from cr.ifs. 2000-10-16 08:47:56 +00:00
Doug Rabson
eded8b5cfa Remember to re-initialise cr.itm on clock interrupts so that we get more
than just one tick.
2000-10-16 08:46:57 +00:00
Doug Rabson
ecfff41c65 Merge a fix from the alpha port - put softintr in the right place in the
table.
2000-10-16 08:45:45 +00:00
Doug Rabson
a3f05798c1 Give names to app registers and control registers. Fix a typo handling
mov from branch register instructions.
2000-10-16 08:44:34 +00:00
Warner Losh
9344caaf08 First cut at allocating the resources from the CIS after the probe, but
before the attach.  Things aren't completely working, but this is a good
checkpoint.

Also, initialize the dev member of the function as soon as we add it
to the parent.
2000-10-16 07:51:12 +00:00
Warner Losh
a37932521c Remove debug writes introduced in prior commit 2000-10-16 07:31:13 +00:00
Warner Losh
54c9005faf Add the ability to use the $PIR table in the BIOS to route interrupts
on demand.

Submitted by: msmith
2000-10-16 07:25:08 +00:00
Warner Losh
9bf4bbcaf7 When a pci device hasn't had an interrupt routed to it (signified by
the intline of 255) go ahead and route the interrupt when we allocate
an interrupt.

Submitted by: msmith
2000-10-16 07:24:00 +00:00
Bill Paul
67db683bc9 Fix one instance of XL_LOCK() that should have been XL_UNLOCK(). After
doing this so many times, I guess I was entitled to at least one typo.
Thanks to all who spotted this.
2000-10-15 21:15:38 +00:00
Mike Smith
1b97a6c6a9 Network modules are all "if_foo" not "foo". Avoid the confusing spew that
ensues when ifconfig tries to load if_ed.ko when it's already in the kernel.
2000-10-15 20:23:27 +00:00
Brian Somers
abf94dbd10 Remove namespace polution (x -> __x) introduced in the last
revision.

Pointed out by: bde
2000-10-15 19:31:24 +00:00
Brian Somers
f68d731adb BPF wants packets in host byte order whereas TUN_IFHEAD wants them
in network byte order.
When we've got TUN_IFHEAD set, swap the AF byte order before passing
a packet to bpf_mtap().
2000-10-15 18:49:17 +00:00
Bosko Milekic
7ba0dcf1ae Correct check for NULL in MEXT_INIT_REF() which should be checking whether
mbuf->m_ext.ref_cnt is NULL, and not whether mbuf is.
Also, remove spaces before "mbtypes" in MGET and MGETHDR macros.

Pointed out by: dwmalone
2000-10-15 17:57:00 +00:00
Warner Losh
d62abc771f Lots of little fixes. We no longer panic on card insert:
o initialize ivars with bzero.
o remove interrupt function pointer.  netbsd needs it, but we don't.
o add lots of comments about bogus things that I've been kludging to try
  to make the simple cases work.
o add new ivar accessor for cis4 to match cis3.  likely neither will be
  needed, but it doesn't hurt to have it.
2000-10-15 17:21:50 +00:00
Nick Hibma
d686268728 Put the header section in the header file not the c file.
Submitted by:	Jonathan Chen <jon@spock.org>
PR:		21982
2000-10-15 15:19:35 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Peter Wemm
642f0c46bf Slight cleanup - this is logically equivalent code but means one less
use of the evil resource_locate() function.
2000-10-15 10:17:55 +00:00
Poul-Henning Kamp
398bc678aa Move DELAY() from <machine/clock.h> to <sys/systm.h> 2000-10-15 09:51:49 +00:00
Peter Wemm
1198579d7b Clean up as in isa/* - resource_query_string() loop cosmetic tweaks. 2000-10-15 09:32:58 +00:00
Peter Wemm
efed28b046 Repeat after me: I will test *before* commit, not after.... *blush* 2000-10-15 09:18:14 +00:00
Yoshihiro Takahashi
b48b645254 Fixed warnings. 2000-10-15 09:04:21 +00:00
Peter Wemm
ada54f9e54 Untangle some resource matching loops that were getting on my nerves
and seemed to be getting cut/pasted to places they shouldn't be.
2000-10-15 08:50:45 +00:00
Boris Popov
c523a62949 Make nfs PDIRUNLOCK aware. Now it is possible to use nullfs mounts on top
of nfs mounts, but there can be side effects because nfs uses shared locks
for vnodes.
2000-10-15 08:06:32 +00:00
Boris Popov
823548e131 Add missed vop_stdunlock() for fifo's vnops (this affects only v2 mounts).
Give nfs's node lock its own name.
2000-10-15 08:01:28 +00:00
Bosko Milekic
6c041b7532 While I'm here:
Small change (remove tab in one of the MEXT* macros) - probably slipped
through (accidently?) in dwmalone's KASSERT() addition (rev 1.58).
2000-10-15 06:27:01 +00:00
Boris Popov
d45a191e99 Fix nullfs breakage caused by incomplete migration of v_interlock from
simple_lock to mutex.

Reset LK_INTERLOCK flag when interlock released manually.
2000-10-15 06:25:42 +00:00
Bosko Milekic
181d2a1564 Add nmbcnt sysctl and make it tunable at boottime; nmbcnt is the
number of ext_buf counters that are possibly allocatable.

Do this because:

  (i) It will make it easier to influence EXT_COUNTERS for if_sk,
      if_ti (or similar) users where the driver allocates its own
      ext_bufs and where it is important for the mbuf system to take
      it into account when reserving necessary space for counters.

  (ii) Facilitate some percentile calculation for netstat(1)
2000-10-15 06:24:07 +00:00
Yoshihiro Takahashi
6bf6c91f5d Fixed warnings. 2000-10-15 04:54:17 +00:00
Yoshihiro Takahashi
54bb2a24af Merged from sys/boot/i386/loader/main.c revision 1.21. 2000-10-15 02:56:48 +00:00
Brian Somers
d6c1f63959 Redefine __word_swap_long, __byte_swap_long and __byte_swap_word
as inline functions, renaming them to __uint16_swap_uint32,
__uint8_swap_uint32 and __uint8_swap_uint16.

Doing it properly suggested by: msmith
Reviewed by: msmith
2000-10-15 00:45:19 +00:00
Alan Cox
e0284d2eb1 Change the text for the ServerWorks north bridge chips. RCC is now
officially listed as ServerWorks by www.pcisig.com.
2000-10-14 23:45:09 +00:00
Alan Cox
34fc4aef48 Recognize the ServerWorks IB6566 south bridge. 2000-10-14 23:16:42 +00:00
Poul-Henning Kamp
afd05ac212 Remove the HPFPLIB copyright which we have never used. 2000-10-14 19:14:48 +00:00
Poul-Henning Kamp
1f22e63352 Remove even more unneeded #includes. 2000-10-14 17:37:32 +00:00
Poul-Henning Kamp
2d99f9a72c Remove even more nneeded #includes. 2000-10-14 15:57:44 +00:00
Mark Murray
a6278a2a42 After some complaints about the dir names, the random device is
now in dirs called sys/*/random/ instead of sys/*/randomdev/*.

Introduce blocking, but only at startup; the random device will
block until the first reseed happens to prevent clients from
using untrustworthy output.

Provide a read_random() call for the rest of the kernel so that
the entropy device does not need to be present. This means that
things like IPX no longer need to have "device random" hardcoded
into thir kernel config. The downside is that read_random() will
provide very poor output until the entropy device is loaded and
reseeded. It is recommended that developers do NOT use the
read_random() call; instead, they should use arc4random() which
internally uses read_random().

Clean up the mutex and locking code a bit; this makes it possible
to unload the module again.
2000-10-14 10:59:56 +00:00
Poul-Henning Kamp
1b3c07c893 Duh! LINT is called NOTES these days.
Make sure LINT checks profiling code as well.
2000-10-14 08:40:47 +00:00
Poul-Henning Kamp
990e680b90 Fix compilation of profiled kernels by including <machine/lock.h> 2000-10-14 08:34:27 +00:00
Poul-Henning Kamp
412916079c Make it possible to specify profiling in the kernel config file.
Do so for LINT.
2000-10-14 08:33:22 +00:00
John W. De Boskey
2ec40c9aac Remove the signal value check from the PT_STEP codepath. It
can cause an bogus failure.

Reviewed by:    Sean Eric Fagan <sef@kithrup.com>
                and no other response to the review request.
2000-10-14 03:56:01 +00:00
Adrian Chadd
0b0c10b48d Initial commit of IFS - a inode-namespaced FFS. Here is a short
description:

How it works:
--

Basically ifs is a copy of ffs, overriding some vfs/vnops. (Yes, hack.)
I didn't see the need in duplicating all of sys/ufs/ffs to get this
off the ground.

File creation is done through a special file - 'newfile' . When newfile
is called, the system allocates and returns an inode. Note that newfile
is done in a cloning fashion:

fd = open("newfile", O_CREAT|O_RDWR, 0644);
fstat(fd, &st);

printf("new file is %d\n", (int)st.st_ino);

Once you have created a file, you can open() and unlink() it by its returned
inode number retrieved from the stat call, ie:

fd = open("5", O_RDWR);

The creation permissions depend entirely if you have write access to the
root directory of the filesystem.

To get the list of currently allocated inodes, VOP_READDIR has been added
which returns a directory listing of those currently allocated.

--

What this entails:

* patching conf/files and conf/options to include IFS as a new compile
  option (and since ifs depends upon FFS, include the FFS routines)

* An entry in i386/conf/NOTES indicating IFS exists and where to go for
  an explanation

* Unstaticize a couple of routines in src/sys/ufs/ffs/ which the IFS
  routines require (ffs_mount() and ffs_reload())

* a new bunch of routines in src/sys/ufs/ifs/ which implement the IFS
  routines. IFS replaces some of the vfsops, and a handful of vnops -
  most notably are VFS_VGET(), VOP_LOOKUP(), VOP_UNLINK() and VOP_READDIR().
  Any other directory operation is marked as invalid.

What this results in:

* an IFS partition's create permissions are controlled by the perm/ownership of
  the root mount point, just like a normal directory

* Each inode has perm and ownership too

* IFS does *NOT* mean an FFS partition can be opened per inode. This is a
  completely seperate filesystem here

* Softupdates doesn't work with IFS, and really I don't think it needs it.
  Besides, fsck's are FAST. (Try it :-)

* Inodes 0 and 1 aren't allocatable because they are special (dump/swap IIRC).
  Inode 2 isn't allocatable since UFS/FFS locks all inodes in the system against
  this particular inode, and unravelling THAT code isn't trivial. Therefore,
  useful inodes start at 3.

Enjoy, and feedback is definitely appreciated!
2000-10-14 03:02:30 +00:00
Mike Smith
d1eefff418 Whoops, add the 'twe' files.
Submitted by:	Chris Faulhaber <jedgar@fxp.org>
2000-10-14 01:23:29 +00:00
Bill Paul
4c2efe270a Clean up a few things in dc_setcfg() pointed out to be me by
aaron@openbsd.com on IRC earlier today.
2000-10-14 00:40:14 +00:00
Jonathan Lemon
834801e8af Look at both the vendor and subvendor information when determining
whether this is a Smart Array.  This fixes a problem where the driver
would incorrectly match a Dell RAID device.

Reviewed by: msmith
2000-10-13 23:34:47 +00:00
Bill Paul
a95b77ec78 Remember to assign an_dev to device_t before calling an_attach(). 2000-10-13 22:04:20 +00:00
Peter Wemm
ac5f943c37 savectx() is now used exclusively by the crash dump system. Move the
i386 specific gunk (copy %cr3 to the pcb) from the MI dumpsys() to the
MD savectx().
2000-10-13 22:03:29 +00:00
Bill Paul
736f03e49a Convert the Aironet driver to use mutexes instead of spls. 2000-10-13 21:58:36 +00:00
Paul Saab
16a011f973 Do not allocate a callout for all crashdumps, not just when you panic. 2000-10-13 21:49:19 +00:00
Bill Paul
9fa3f7b0f2 Update the wi driver to use mutexes instead of spls. 2000-10-13 20:33:24 +00:00
Bill Paul
d308faacc2 Add #include <machine/mutex.h> since these files need it and don't
include anything else that includes mutex.h. Needed to resolve struct mtx
from struct dc_softc.
2000-10-13 19:15:50 +00:00
Chuck Paterson
f59dd3ae6a Make mutex name reflect device driver name.
Destroy mutex when detaching the device.
Submitted by: John Baldwin <jhb@FreeBSD.ORG>
2000-10-13 18:59:29 +00:00
Bill Paul
1e856a7b34 Use device_get_nameunit(dev) as the mutex string when calling
mtx_init() instead of hard-coded string constant. Also remember to do
the mutex changes to the ste driver, which I forgot in the first commit.
2000-10-13 18:35:49 +00:00
Bill Paul
d1ce910572 First round of converting network drivers from spls to mutexes. This
takes care of all the 10/100 and gigE PCI drivers that I've done.
Next will be the wireless drivers, then the USB ones. I may pick up
some stragglers along the way. I'm sort of playing this by ear: if
anyone spots any places where I've screwed up horribly, please let me
know.
2000-10-13 17:54:19 +00:00
Robert Watson
ab024bb02e o Simplify capability types away from an array of ints to a single
u_int64_t flag field, bounding the number of capabilities at 64,
  but substantially cleaning up capability logic (there are currently
  43 defined capabilities).

o Heads up to anyone actually using capabilities: the constant
  assignments for various capabilities have been redone, so any
  persistent binary capability stores (i.e., '$posix1e.cap' EA
  backing files) must be recreated.  If you have one of these,
  you'll know about it, so if you have no idea what this means,
  don't worry.

o Update libposix1e to reflect this new definition, fixing the
  exposed functions that directly manipulate the flags fields.

Obtained from:	TrustedBSD Project
2000-10-13 17:12:58 +00:00
Matthew Dillon
64bcb9c815 The swap bitmap allocator was not calculating the bitmap size properly
in the face of non-stripe-aligned swap areas.  The bug could cause a
      panic during boot.

      Refuse to configure a swap area that is too large (67 GB or so)

      Properly document the power-of-2 requirement for SWB_NPAGES.

      The patch is slightly different then the one Tor enclosed in the P.R.,
      but accomplishes the same thing.

PR: kern/20273
Submitted by: Tor.Egge@fast.no
2000-10-13 16:44:34 +00:00
Søren Schmidt
7c6d7d5f82 Add ata-raid.c to the ata driver 2000-10-13 15:42:58 +00:00
Hellmuth Michaelis
5d113d0ac0 Submitted by: phk
Remove not needed includes.
2000-10-13 14:10:51 +00:00
Bruce Evans
6092d1874e Fixed namespace pollution in rev.1.78. Don't export <sys/stat.h> to
userland from here; just forward declare struct stat.  fhstat.2
(== fhopen.2 == fhstatfs.2) has always specified including
<sys/stat.h> before using any of the fh functions although this is
only necessary for dereferencing the "struct stat *" arg of fhstat(),
so applications should not notice this change.

Fixed unsorting of user prototypes in rev.1.78.
2000-10-13 14:04:26 +00:00
Bruce Evans
3d7613a6e2 Avoid impending world breakage.
1. Don't include <sys/conf.h> in userland.  It is not used, and including it
   without including its prerequisite <sys/time.h> should have broken the
   world.
2. Don't include <sys/mount.h>.  It is not used, except in -current it
   bogusly includes <sys/stat.h> which bogusly includes <sys/time.h> and
   thus accidentally provides the prerequisite in (1).
3. Cleaned up nearby include messes.

Not approved by despite 5 weeks notice: MAINTAINER
2000-10-13 13:43:37 +00:00
Søren Schmidt
e9cf6115e4 Add support for ATA "pseudo" RAID controllers as the Promise Fasttrak
and HighPoint HPT370 controllers.

Use by defining the RAID in the BIOS and the "ar driver will pick it up
automagically...
2000-10-13 13:04:45 +00:00
Søren Schmidt
d851448bbf Add the ar ATA pseudo RAID driver 2000-10-13 13:02:17 +00:00
Søren Schmidt
8d8f318a08 Fix ISA only systems. 2000-10-13 12:09:23 +00:00
Søren Schmidt
2c483f9eb5 Get rid of the ivars entirely. 2000-10-13 11:21:27 +00:00
Søren Schmidt
b656ee68ec Only allow UDMA2 mode on SiS rev > 0xc1
Minor cosmetics
2000-10-13 10:54:47 +00:00
Andrew Gallatin
931a725809 This is the first of 3 commits that will get IBM's JDK 1.3 working
with FreeBSD (not including the MINSIGSTKSZ issue, which belongs to
Marcel).  Due to time constraints, I'm going to space them out over a
few days.

This fixes two problems with linux_sigaltstack()

o ss == 0 is perfectly valid use, so do not fail in this case.

o Fix flag handling:
 - Our SS_DISABLE is 4, linux's is 2, so we need conversion routines.
	These conversion routines will be needed by linux_rt_sendsig()
	and linux_rt_sigreturn (forthcoming), so they are not static.
 - Linux's flag 0 historically meant SS_ONSTACK according to a comment
	in their linux/kernel/signal.c file.

Among other things, this fixes a warning from Sun's JDK 1.3:
"Java HotSpot(TM) Client VM warning: cannot uninstall alt signal stack"

Reviewed by: marcel
Tested by:   sto@stat.duke.edu, many others on freebsd-java@
2000-10-13 01:57:43 +00:00
Matt Jacob
e5d4e19714 Make changes required by change in how default and usable node and port
WWNS are made and used.
2000-10-12 23:59:40 +00:00
Matt Jacob
c914d4237d Redo how default Node and Port WWNs are determined (again!). This is so
we don't stomp on the differences between ports for a Qlogic 2202.
2000-10-12 23:49:09 +00:00
Matt Jacob
9cf43b9716 Change some default macro usages/definitions/requirements. 2000-10-12 23:47:03 +00:00
Jason Evans
9722d88fba For lockmgr mutex protection, use an array of mutexes that are allocated
and initialized during boot.  This avoids bloating sizeof(struct lock).
As a side effect, it is no longer necessary to enforce the assumtion that
lockinit()/lockdestroy() calls are paired, so the LK_VALID flag has been
removed.

Idea taken from:	BSD/OS.
2000-10-12 22:37:28 +00:00
Poul-Henning Kamp
991b35adf1 Forgot these files in my kerninclude limited run.
(No core powers we abused during this commit)
2000-10-12 20:21:02 +00:00
Archie Cobbs
46aa8b9b41 Add missing option NETGRAPH_ETHER.
PR:		kern/20288
2000-10-12 17:51:24 +00:00
Doug Rabson
61e1efff8a Implement a rudimentary interrupt handling system which should be good
enough for clock interrupts in SKI.
2000-10-12 17:47:01 +00:00
Doug Rabson
d84feb93c4 Turn off a debugging printf. 2000-10-12 17:46:12 +00:00
Bruce Evans
4d448fc0ea Removed unused include of <machine/lock.h>. The locking interface stopped
being (ab)used here in rev.1.97.
2000-10-12 17:05:33 +00:00
Ruslan Ermilov
487bdb3855 Backout my wrong attempt to fix the compilation warning in ip_input.c
and instead reapply the revision 1.49 of mbuf.h, i.e.

Fixed regression of the type of the `header' member of struct pkthdr from
`void *' to caddr_t in rev.1.51.  This mainly caused an annoying warning
for compiling ip_input.c.

Requested by:	bde
2000-10-12 16:33:41 +00:00
Bruce Evans
00d8d16417 Don't depend on <machine/cpufunc.h> unnecessarily including <machine/lock.h>. 2000-10-12 16:15:24 +00:00
Hellmuth Michaelis
53cfbb7360 When T308 times out while waiting for a RELEASE COMPLETE, clean up and
send a disconnect indication to the upper layers. This lets isdnd recover
from the situation instead of hanging in some intermediate state ...
2000-10-12 16:04:58 +00:00
Doug Rabson
5596cfd09a * Fix exception handling so that it actually works. We can now handle
exceptions from both kernel and user mode.
* Fix context switching so that we can switch back to a proc which we
  switched away from (we were saving the state in the wrong place).
* Implement lazy switching of the high-fp state. This needs to be looked
  at again for SMP to cope with the case of a process migrating from one
  processor to another while it has the high-fp state.
* Make setregs() work properly. I still think this should be called
  cpu_exec() or something.
* Various other minor fixes.

With this lot, we can execve() /sbin/init and we get all the way up to its
first syscall. At that point, we stop because syscall handling is not done
yet.
2000-10-12 14:36:39 +00:00
Justin T. Gibbs
60754d0ba3 Bring back the ability to send cdbs of length 13->32 bytes. This was lost
during the qinfifo optimization.  When swapping HSCBs, we were only copying
the first 32 bytes, the amount used in the common case of a cdb <= 12 bytes.
Larger cdbs are stored in the second 32 bytes of the cdb.

Noticed by: Marc Frajola <marc@terasolutions.com>
2000-10-12 14:36:27 +00:00
Doug Rabson
8034cac98a Fix this so that it can cope with transfers to/from regions which are not
physically contiguous.
2000-10-12 14:29:24 +00:00
Doug Rabson
c332b0bc57 * Allocate kernel stacks with contigmalloc() to make exception handling
safe - we can't afford to take a TLB trap when we are writing a
  trapframe. Possibly revisit this later.
* Various fixes to pmap_enter() so that it actually works properly.
2000-10-12 14:28:05 +00:00
Doug Rabson
e571ae24fe Some minor fixes and simplifications. 2000-10-12 14:25:09 +00:00
Doug Rabson
63c47a5ca0 Add a gross hack for ia64 to allocate the backing store for a new program. 2000-10-12 14:24:03 +00:00
Bruce Evans
1676212c30 Moved the declaration of astpending to the correct place.
This shouldn't affect the alpha or ia64, since they don't have a
variable named astpending.  The alpha still has 2 declarations of
this nonexistent variable.
2000-10-12 13:02:13 +00:00
Bruce Evans
9a25c23635 Moved the definitions of AST_PENDING and AST_RESCHED to the correct place. 2000-10-12 11:13:27 +00:00
Ruslan Ermilov
e6c89c1bd2 Fix the compilation warning. 2000-10-12 10:42:32 +00:00
Poul-Henning Kamp
67b0d5b9ea Remove the #include kitchensink <netatm/kern_include.h> and add
the #includes to the respective source files.

Also un-nest includes in <dev/hfa/fore_include.h>

I have run src/tools/tools/kerninclude to remove 1239 clearly
unneeded #includes reducing the total from 3524 includes to 2285.
2000-10-12 08:14:20 +00:00
Ruslan Ermilov
bc95ac80b2 Allow for IP_FW_ADD to be used in getsockopt(2) incarnation as
well, in which case return the rule number back into userland.

PR:		bin/18351
Reviewed by:	archie, luigi
2000-10-12 07:59:14 +00:00
Poul-Henning Kamp
67467625e2 More HARP polishina:
unifdef -UFORE_SBUS -DFORE_PCI
s/ATM_KERNEL/_KERNER/g
2000-10-12 07:42:34 +00:00
Bill Fumerola
80e3ea2097 Remove 'device tx'. In wilko's testing it traps on bringing the interface
up. Even though this has recieved all the right MI treatment (newbus, miibus)
it stands for now a i386 only driver.
2000-10-12 06:10:12 +00:00
Warner Losh
5984fd1d1f Another PnP pcic card: SMC Swapbox Plug and Play
Submitted by: gallatin
2000-10-12 03:51:16 +00:00
Bosko Milekic
20f1c8364b Make if_sk stop using the "hide the softc structure in the jumbo buffer"
now that the mbuf system can handle passing it to the driver itself.

Reviewed by: wpaul
Tested by: wpaul (Bill Paul) with "jumbograms" enabled
2000-10-12 02:42:25 +00:00
Mike Smith
5f3dac9c03 Bring the 'twe' driver back now that we think it should work. 2000-10-12 01:46:43 +00:00
Mike Smith
b1e68a44b5 Reduce the number of outstanding commands we will send to the controller
to 50.  This has been reported to avoid the problems that many users have
been experiencing with crashing the card firmware during rebuilds.
2000-10-12 01:43:40 +00:00
Warner Losh
da8e360acf sync to last commit 2000-10-12 00:16:19 +00:00
Warner Losh
0ac8fcedf1 Add mii entry for tdk phy found on some cardbus cards. 2000-10-12 00:15:10 +00:00
Poul-Henning Kamp
6cb2a0952f Do some cleanups of the HARP atm codes interface into the system:
Define the NETISR just like all the other NETISRs.

unifdef -Usun -D__FreeBSD__  we will probably never support sun4c
and if we do we can't use the solaris code anyway and  I doubt
anybody will be running Fore ATM cards in then in the first place.
2000-10-12 00:03:50 +00:00
Justin T. Gibbs
70351c9a14 Store a pointer to our softc in the kernel's SCB structure. In the
past we stored this data in the CCB and attained the CCB via a pointer
in the SCB.  In ahc_timeout(), however, the timedout SCB may have already
been completed (inherent race), meaning that the CCB could have been recycled,
and the ahc pointer reset.

Clean up the logic in ahc_search_qinfifo that deals with the busy device
table.  For some reason it assumed that the only valid time to search
to see if additional lun entries should be checked was if lun 0 matched.
Now we properly itterate through the necessary luns.  The busy device
table is used to detect invalid reselections, so a device would have had
to perform an unexpected reselection for this to cause problems.  Further,
all luns are collapsed to a single entry unless we have external ram
with large SCBs (3940AU models) so the chance of this happening was
rather remote.

Clean up the logic for dealing with the untagged queues.  We now set a
flag in the SCB that indicates that it is on the untagged queue instead
of inferring this from the type and setup of the CCB pased into us by
CAM.

In ahc_timeout(), don't print the path of the SCB until the controller
is paused and we are sure that it has not completed yet.  This, in
conjunction with referencing the ahc pointer in the SCB rather than
the CCB in the SCB avoids panics in the case of a timedout scb completing
just before the timeout handler runs.  This turns out to be guaranteed
if interrupt delivery is failing, as we run our interrupt handler to
flush any "just missed events" when a timeout occurs.  Mention the
likelyhood of broken interrupts if a timedout SCB is completed by
our call to ahc_intr().
2000-10-11 23:46:34 +00:00
Mike Smith
3c3134d3a0 When testing for PCI bus overlap with another enumerator, make sure we
check for the right bus number.  This is still not quite right, but
fixes things for multi-bus machines again.

Submitted by:	tegge
2000-10-11 23:03:11 +00:00
Archie Cobbs
034d9dac34 Calling untimeout(9) leads to a race window where memory could be leaked.
Close this window by simply not calling untimeout(9).
2000-10-11 20:29:12 +00:00
Archie Cobbs
be731c30f3 Fix memory leak.
Submitted by:	Christopher N. Harrell <cnh@ivmg.net>
2000-10-11 19:04:34 +00:00
Jun Kuriyama
0a13e042b1 Add missing comma at the end of line. 2000-10-11 01:12:55 +00:00
Andrew Gallatin
9e7c752771 kmem transfers were being double-counted due to a missing continue.
This silences the dreaded "swapinfo:cannot read blmeta_t" messages at boot.
I'm really suprised there were no PRs open about this...
2000-10-11 01:01:54 +00:00
Bill Paul
00a9155349 Add support for the Kingston KNU101TX 10/100 USB ethernet adapter. We're
up to 11 of these now.
2000-10-10 23:45:17 +00:00
Bill Paul
5a68c7769a regenetate 2000-10-10 23:24:45 +00:00
Bill Paul
5ccd443674 Add vendor ID for Kingston Technology and add device ID for
KNU101TX USB ethernet adapter. (Yes, another one.)
2000-10-10 23:23:54 +00:00
Hellmuth Michaelis
81f87bbcbe fix conflicting types for ng_ing_rcvmsg() and ng_ing_rcvdata(). 2000-10-10 15:22:00 +00:00
Doug Rabson
ec502c357d * Add rudimentary DDB support (no kgdb, no backtrace, no single step).
* Track recent changes to SWI code.
* Allocate RIDs for pmaps (untested).
* Implement assembler version of cpu_switch - its cleaner that way.
2000-10-10 14:57:10 +00:00
Hellmuth Michaelis
3374f8cc7d correct "device iwic0" to "device iwic" 2000-10-10 14:23:04 +00:00
Doug Rabson
530f610f02 A quote from the ia64 compiler:
`char' is promoted to `int' when passed through `...'
	(so you should pass `int' not `char' to `va_arg')
2000-10-10 14:18:50 +00:00
Hellmuth Michaelis
8628ee392c Set i4b version number to 0.96.00.
It is (nearly) identical to i4b-00.96.00-beta-101000.tar.gz
2000-10-10 14:14:20 +00:00
Nick Hibma
e24ec98410 Add a quirk entry for the USB Sony DSC drive. 2000-10-10 13:12:11 +00:00
Nick Hibma
8e6f860ac9 Remove unneccessary includes. (phk) 2000-10-10 12:41:46 +00:00
Dag-Erling Smørgrav
e57416dc56 Mark directories as directories, not as regular files. 2000-10-10 12:32:44 +00:00
Nick Hibma
b37ba10824 Remove unneeded includes (phk) 2000-10-10 10:56:53 +00:00
Seigo Tanimura
300b36ab36 Add MAE0021 - Jetstream Int V.90 56k Voice Series 2.
PR:		i386/19920
Submitted by:	Peter Ortner <port@iname.com>
2000-10-10 10:06:26 +00:00
Atsushi Onoe
302ffdfd98 awi needs to access memory with 8bit,
but pccardd apparently maps memory with MDF_16BITS flag.
So memory mapped access is disabled and use IO port instead for now.

This fixes the problem for config index 0x01 in the pccard.conf
with the message: "awi0: failed to complete selftest (timeout)"
2000-10-10 09:50:25 +00:00
KATO Takenori
479cddfad0 Merged from sys/conf/{files.i386,options.i386} revisions 1.334 and
1.140, respectively.
2000-10-10 08:12:15 +00:00
Coleman Kane
67072510e8 Added some handling code to work with SLI configs, and removed some unused
older code that was phased out but not removed, heh.
2000-10-10 03:51:54 +00:00
Larry Lile
e658d924da o Change TX_BUFFER_LEN from 512 to 2048.
o Remove bogus "spurious interrupt" message.

o Ring buffer head and avail were incorrectly calculated.

o Fix fragment count.

o Fix ring entry for single station, default to 16Mbit.

o Don't complain about long frames.
2000-10-10 00:54:02 +00:00
Chris Costello
3157714de7 o Move from Alfred Perstein's "exclusion" technique of handling special
file types to requiring all file types to properly implement fo_stat.
  This makes any new file type additions much easier as this code no
  longer has to be modified to accomodate it.

o Instead of using curproc in fdesc_allocvp, pass a `struct proc' pointer as
  a new fifth parameter.
2000-10-09 20:06:13 +00:00
Robert Watson
d62bd6076e o Sanity check was inverted, resulting in a possible spurious panic
during unmount if extended attributes were in use.  Correct by removing
  an unneeded (and undesirable) '!'.
2000-10-09 20:04:39 +00:00
Justin T. Gibbs
b00aeda6f0 Close a race condition that doesn't really exist in -current. When
a resource shortage occurs, freeze our queue and then set the resource
shortage flag while the controller data structure is locked.  The old
code did these in the wrong order potentially allowing our interrupt
handler to release the queue and clear the flag before the freeze
ever occurred.
2000-10-09 19:54:54 +00:00
Archie Cobbs
8576ccb74b Fix broken const'ness in declaration of sha1_loop(). 2000-10-09 18:49:14 +00:00
Andrew Gallatin
acadb17f53 kernacc() only knows about mapped memory, not K0SEG addresses.
Before calling kernacc(), make sure that we're not calling it
with a K0SEG address.

This gets alphas booting with SMP_DEBUG & INVARIANTS options

approved by: jhb
2000-10-09 18:47:49 +00:00
Archie Cobbs
a89effcde1 Fix typo in NETGRAPH_INIT() macro. 2000-10-09 18:37:11 +00:00
Eivind Eklund
7eb9fca557 Blow away the v_specmountpoint define, replacing it with what it was
defined as (rdev->si_mountpoint)
2000-10-09 17:31:39 +00:00
Hellmuth Michaelis
31a539a5bd update to i4b version 0.95.04 2000-10-09 15:41:15 +00:00
Maxim Sobolev
6e3c38712b Reduce buffer size from 64K to 4K.
Approved by:	cg
2000-10-09 14:54:32 +00:00
Hellmuth Michaelis
767469d9b2 update to i4b version 0.95.04 (oops, forgot this one ..) 2000-10-09 14:30:50 +00:00
Hellmuth Michaelis
17939d43c6 remove MAINTAINER: i'll develop and maintain i4b from now on in the
FreeBSD-current tree
2000-10-09 14:29:16 +00:00
Andrew Gallatin
c199657754 fix a typo & allow softclock to run on alphas.
This gets my AS500 and UP1000 booting again.
2000-10-09 14:20:09 +00:00
Poul-Henning Kamp
6ab7b8286d Don't make_dev() in bpfopen() unless we need to. 2000-10-09 14:19:09 +00:00
Poul-Henning Kamp
8abea41d80 Don't hold an extra reference to vnodes. Devfs vnodes are sufficiently
cheap to setup that it doesn't really matter that we recycle device
vnodes at kleenex speed.

Implement first cut try at killing cloned devices when they are
not needed anymore.  For now only the bpf driver is involved in
this experiment.  Cloned devices can set the SI_CHEAPCLONE flag
which allows us to destroy_dev() it when the vcount() drops to zero
and the vnode is reclaimed.  For now it's a requirement that the
driver doesn't keep persistent state from close to (re)open.

Some whitespace changes.
2000-10-09 14:18:07 +00:00
Hellmuth Michaelis
925be47cdb update to i4b version 0.95.04 2000-10-09 13:41:07 +00:00
Hellmuth Michaelis
a86390df07 remove the tina-dd driver fragment, it is unlikely that it will get finished. 2000-10-09 13:32:02 +00:00
Hellmuth Michaelis
440c876352 update to i4b version 0.95.04 2000-10-09 13:29:00 +00:00
Hellmuth Michaelis
7b22f87786 update to i4b version 0.95.04 2000-10-09 13:18:17 +00:00
David Malone
fc39509245 Cleanup of bitstring.h:
1) Add FreeBSD: tag.
2) Add parenthesis around macro args.
3) Add parenthesis around macros which are expressions.
4) Add do { ... } while (0) around macros which are compound statements.
5) Sync bitstr_size and bit_alloc with neater versions from NetBSD.
6) Fix bit_ffs and bit_ffc so that they don't search off the end of the
	bitstirng.
7) Try to avoid rightshifting signed ints.

I didn't take NetBSD's version directly as the macros are significantly
slower for long bitstrings. Bruce reviewed a previous version of
this patch.

PR:		21204
Submitted by:	bob@immure.com
Reviewed by:	bde
2000-10-09 12:34:51 +00:00
Daniel C. Sobral
3851401454 Now I see the error of my ways.
Previous revision of this file changed the "boot" commands to take
no arguments from the stack. This is only valid in the case where
a kernel has not been loaded. In that case, load_kernel_and_modules
will be called, which takes a list of arguments from the stack.

When a kernel is presently loaded, though, the list of arguments must
be passed to the boot command, which was the behaviour before the last
revision.

Fix things for both cases.

Noticed by: S-Max and others on that chat room
2000-10-09 11:29:40 +00:00
KATO Takenori
733c8d0bf2 Fixed include files to use sys/{cons,fb,kb}io.h instead of
machine/console.h.
2000-10-09 11:07:18 +00:00
Poul-Henning Kamp
f6b5c74c35 Initiate deorbit burn sequence for <machine/mouse.h>.
Replace all in-tree uses with <sys/mouse.h> which repo-copied a few
moments ago from src/sys/i386/include/mouse.h by peter.
This is also the appropriate fix for exo-tree sources.

Put warnings in <machine/mouse.h> to discourage use.
November 15th 2000 the warnings will be converted to errors.
January 15th 2001 the <machine/mouse.h> files will be removed.
2000-10-09 08:08:36 +00:00
Poul-Henning Kamp
1b1728ad99 A couple of negative options was not commented out in NOTES/LINT. This
obscured a #include bug in syscons.
2000-10-09 07:29:41 +00:00
Bruce Evans
e4a85a9b14 Unremoved used include of <machine/ipl.h>. Removing it in rev.1.95
significantly pessimized syscalls by arranging to do null rescheduling
on return from every syscall.  (AST_RESCHED was not defined, and the
mask ~AST_RESCHED gets replaced by the useless mask ~0.  This bug has
been fixed before, in rev.1.92.)
2000-10-09 05:39:03 +00:00
Warner Losh
5f7e36d111 o Record the pccard_function in the ivar.
o Use a macro function to get the ivar for the child rather than the casting
  directly.  This should be a little safer and easier to read.
2000-10-09 03:40:15 +00:00
Justin T. Gibbs
73f1c25915 Clean up error recovery code:
aic7xxx.c:
	In target mode, reset the TQINPOS on every restart of the sequencer.
	In the past we did this only during a bus reset, but there are other
	reasons the sequencer might be reset.

	In ahc_clear_critical_section(), disable pausing chip interrupts while
	we step the sequencer out of a critical section.  This avoids the
	possibility of getting a pausing interrupt (unexpected bus free,
	bus reset, etc.) that would prevent the sequencer from stepping.

	Send the correct async notifications in the case of a BDR or bus reset.

	In ahc_loadseq(), correct the calculation of our critical sections.
	In some cases, the sections would be larger than needed.

aic7xxx.h:
	Remove an unused SCB flag.

aic7xxx.seq:
	MK_MESSAGE is cleared by the kernel, there is no need to waste
	a sequencer instruction clearing it.

aic7xxx_freebsd.c:
	Go through the host message loop instead of issuing a single
	byte message directly in the ahc_timeout() case where we
	are currently on the bus to the device.  The effect is the same,
	but this way we get a nice printf saying that an expected BDR
	was delivered instead of an unexpected bus free.

	If we are requeuing an SCB for an error recovery action, be sure
	to set the DISCONNECTED flag in the in-core version of the SCB.
	This ensures that, in the SCB-paging case, the sequencer will
	still recognize the reselection as valid even if the version
	of the SCB with this flag set was never previously paged out
	to system memory.  In the non-paging case, set the MK_MESSAGE
	flag in SCB_CONTROL directly.

aic7xxx_pci.c:
	Enable the Memeory Write and Invalidate bug workaround for
	all aic7880 chips with revs < 1.  This bug is rarely triggered
	in FreeBSD as most transfers end on cache-aligned boundaries,
	but a recheck of my references indicates that these chips
	are affected.
2000-10-09 01:46:01 +00:00
Mike Smith
03de26e0d0 Only attach "legacy" PCI busses if none have been attached via any other
method.
2000-10-09 00:44:41 +00:00
Mike Smith
0441aa9a52 Validate the PCI bus number that we fetch from our parent, since there's no
guarantee that everything attached to *it* is a PCI bus.
2000-10-09 00:43:45 +00:00
Mike Smith
e9f536a16c Change the way that eventhandler lists are processed so that an event
handler can safely remove itself from a list while being run.

(Note that it is not safe to remove anything else from the same list,
 as this may still cause corruption in the case where the removed
 item is next on the list.)
2000-10-09 00:41:29 +00:00
Mike Smith
08764b841b Resolve the inconsistency between "the number of resources of a particular
kind we can manage in a set of configurations" and "the number of resources
of a particular kind that can be programmed into an ISA PnP adapter".

Submitted by:	Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
Submitted by:	Hirokazu WATANABE <gwna@geocities.co.jp>
2000-10-09 00:40:17 +00:00
Poul-Henning Kamp
00d25f512c Initiate deorbit burn sequence for <machine/console.h>.
Replace all in-tree uses with necessary subset of <sys/{fb,kb,cons}io.h>.
This is also the appropriate fix for exo-tree sources.

Put warnings in <machine/console.h> to discourage use.
November 15th 2000 the warnings will be converted to errors.
January 15th 2001 the <machine/console.h> files will be removed.
2000-10-08 21:34:00 +00:00
Nick Hibma
3c703fcbe2 Add HP PhotoSmart C500 id.
PR:	kern/21841
Submitted by:	josh@zipperup.org
2000-10-08 21:31:39 +00:00
David E. O'Brien
23b16c61fa Don't install manpages.
They are being moved elsewhere, and they are causing problems being here.
2000-10-08 16:56:04 +00:00
Bruce Evans
376cb06d7c Unbreak detection of breakage in cy driver. 2000-10-08 14:46:04 +00:00
Bruce Evans
e3c3da9ab6 Made this file compile again after move of stuff from <machine.ipl.h>
to <sys/ipl.h>.
2000-10-08 14:41:13 +00:00
Bruce Evans
db8ec2a244 Use schedsofttty() again (SMPng casualty with intentionally wrong fix
in rev.1.101).

Made this file compile again after move of stuff from <machine.ipl.h>
to <sys/ipl.h>.
2000-10-08 14:37:39 +00:00
Bruce Evans
185fee17ad Use schedsofttty() again so that siopoll() gets scheduled as designed
(SMPng casualty in rev.1.308 with wrong fix in rev.1.310).
2000-10-08 14:13:31 +00:00
David Malone
854a6f3d1c KASSERT that mbuf external reference counts are > 0 before we remove
a reference. (Agreed to by Bosko some time ago).
2000-10-08 09:52:50 +00:00
Bosko Milekic
ec222a71d9 Cleanup comment in machine/param.h regarding mbuf-related sizes, and get rid
of MCLOFSET, which does not appear to be used anywhere anymore, and if it is,
it probably shouldn't be.
2000-10-08 03:52:27 +00:00
Justin T. Gibbs
039c6f3637 Correct corruption of the qinfifo in ahc_search_qinififo() for all
non-LVD controllers.  We only need to take special action on the qinfifo
if we have dectected the case of an SCB that has been removed from the
qinfifo but has not been fully DMAed to the controller.  A missing
conditional caused this code to be executed every time an SCB was
aborted from the queue

Don't attempt to print the path of an SCB that has been freed.

Clean up the traversal of the pending scb list in
ahc_update_pending_syncrates().  This has no functional change.

Correct ahc_timeout()'s requeing of a timedout SCB to effect a
recovery action.  We now use ahc_qinfifo_requeue() and a
new function ahc_qinfifo_count() instead of performing the
requeue inline.  The old code did not conform to the new qinfifo
method.

Clear the timedout SCB from the disconnected list.  This ensures
that the SCB_NEXT field is free to be used for queuing us to
the qinfifo.
2000-10-08 03:37:52 +00:00
Alfred Perlstein
abbfaeb87b Remove headers not needed.
Pointed out by: phk
2000-10-07 23:15:17 +00:00