Commit Graph

2501 Commits

Author SHA1 Message Date
John Baldwin
bd4635599d Define the mtx_legal2block() macro used in the witness code that managed
to get lost during the MI mutex conversion.

Reported by:    Steve Kargl <sgk@troutmask.apl.washington.edu>
2000-10-20 22:44:06 +00:00
Andrey A. Chernov
c07f6a2dd1 Return -10000 in pci_hostb_probe to allow agp driver (disabled otherwise) 2000-10-20 15:40:05 +00:00
Andrey A. Chernov
da0f52e1ea Add i815 Host to Hub 2000-10-20 15:14:51 +00:00
John Baldwin
35e0e5b311 Catch up to moving headers:
- machine/ipl.h -> sys/ipl.h
- machine/mutex.h -> sys/mutex.h
2000-10-20 07:58:15 +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
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
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
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
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
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
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
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
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
Warner Losh
29f0d43398 Add types and prototypes.
Submitted by: msmith
2000-10-16 19:49:30 +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
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Poul-Henning Kamp
398bc678aa Move DELAY() from <machine/clock.h> to <sys/systm.h> 2000-10-15 09:51:49 +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
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
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
Bruce Evans
9a25c23635 Moved the definitions of AST_PENDING and AST_RESCHED to the correct place. 2000-10-12 11:13:27 +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
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
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
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
Bruce Evans
cc46dff67f Work around a bug by adding struct tags. gcc-2.95 apparently gets the
check in the [basic.link] section of the C++ standard wrong.  gcc-2.7.2.3
apparently doesn't do the check, so the bug doesn't affect RELENG_3.

PR:		16170, 21427
Submitted by:	Max Khon <fjoe@lark.websci.ru> (i386 version)
Discussed with:	jdp
2000-10-06 11:53:32 +00:00
John Baldwin
6c56727456 - Change fast interrupts on x86 to push a full interrupt frame and to
return through doreti to handle ast's.  This is necessary for the
  clock interrupts to work properly.
- Change the clock interrupts on the x86 to be fast instead of threaded.
  This is needed because both hardclock() and statclock() need to run in
  the context of the current process, not in a separate thread context.
- Kill the prevproc hack as it is no longer needed.
- We really need Giant when we call psignal(), but we don't want to block
  during the clock interrupt.  Instead, use two p_flag's in the proc struct
  to mark the current process as having a pending SIGVTALRM or a SIGPROF
  and let them be delivered during ast() when hardclock() has finished
  running.
- Remove CLKF_BASEPRI, which was #ifdef'd out on the x86 anyways.  It was
  broken on the x86 if it was turned on since cpl is gone.  It's only use
  was to bogusly run softclock() directly during hardclock() rather than
  scheduling an SWI.
- Remove the COM_LOCK simplelock and replace it with a clock_lock spin
  mutex.  Since the spin mutex already handles disabling/restoring
  interrupts appropriately, this also lets us axe all the *_intr() fu.
- Back out the hacks in the APIC_IO x86 cpu_initclocks() code to use
  temporary fast interrupts for the APIC trial.
- Add two new process flags P_ALRMPEND and P_PROFPEND to mark the pending
  signals in hardclock() that are to be delivered in ast().

Submitted by:	jakeb (making statclock safe in a fast interrupt)
Submitted by:	cp (concept of delaying signals until ast())
2000-10-06 02:20:21 +00:00
John Baldwin
a384bdbfc9 currentldt is now a "special" global-data variable, and as such, there
is no actual currentldt integer variable directly.  Thus, don't claim that
there is.
2000-10-06 01:59:07 +00:00
John Baldwin
6ccfbaa53d Interrupt frames don't include the saved cpl anymore since cpl is dead. 2000-10-06 01:57:28 +00:00
John Baldwin
a91b7dc11b Various whitespace cleanups after the SMPng commit, which jumbled things
around a bit in the trap handling code.
2000-10-06 01:55:07 +00:00
John Baldwin
0e2aab1237 Don't treat a kernel stack fault the same as a general protect fault or
a segment not present fault in the non-vm86 case.
2000-10-06 01:50:43 +00:00
John Baldwin
03cea59caf Remove an unnecessary sti and spl0() in fork_trampoline. Interrupts
should be enabled by MTX_EXIT() now when it releases the sched_lock.
2000-10-06 01:47:24 +00:00
John Baldwin
1931cf940a - Heavyweight interrupt threads on the alpha for device I/O interrupts.
- Make softinterrupts (SWI's) almost completely MI, and divorce them
  completely from the x86 hardware interrupt code.
  - The ihandlers array is now gone.  Instead, there is a MI shandlers array
    that just contains SWI handlers.
  - Most of the former machine/ipl.h files have moved to a new sys/ipl.h.
- Stub out all the spl*() functions on all architectures.

Submitted by:	dfr
2000-10-05 23:09:57 +00:00
John Baldwin
12e8a79ce1 Replace loadandclear() with atomic_readandclear_int(). 2000-10-05 22:22:31 +00:00
John Baldwin
b4645202b5 Add atomic_readandclear_int and atomic_readandclear_long. 2000-10-05 22:19:50 +00:00
John Baldwin
d238b83315 Make the gd_currentldt member in struct globaldata unconditional so
that this header doesn't depend on USER_LDT.  This fixes the USER_LDT
breakage with SMP kernels.
2000-10-05 20:30:36 +00:00
Jason Evans
645b8b81f0 Reduce userland namespace polution. 2000-10-04 01:21:58 +00:00
Peter Wemm
3a3d38ef8d Fix a cosmetic sign problem on machines with 4G of ram.
0x00312000 - 0xe5fe7fff, 3855441920 bytes (4294859990 pages)
.. becomes
0x00314000 - 0xe5fe7fff, 3855433728 bytes (941268 pages)
2000-10-02 20:13:03 +00:00
Mike Smith
12a02d6efd Move the i386 PCI attachment code out of i386/isa back into i386/pci.
Split out the configuration space access primitives, as these are needed
elsewhere as well.
2000-10-02 07:11:13 +00:00
Peter Wemm
2cf3496166 Fix the no-pci case of attaching isa, eisa and mca devices.
device_add_child() is meant to be called by the bus add_child method, not
to replace the bus add_child method.  We could have called nexus_add_device
directly too, that would have also worked.

PR:		21657
Tested by:	markm
2000-10-01 09:34:55 +00:00
Mike Smith
96f5284585 More updates to the ACPI code:
- Move all register I/O into acpi_io.c
 - Move event handling into acpi_event.c
 - Reorganise headers into acpivar/acpireg/acpiio
 - Move find-RSDT and find-ACPI-owned-memory into acpi_machdep
 - Allocate all resources (except those detailed only by AML)
   as real resources.  Add infrastructure that will make adding
   resource support to AML code easy.
 - Remove all ACPI #ifdefs in non-ACPI code
 - Removed unnecessary includes
 - Minor style and commenting fixes

Reviewed by:	iwasaki
2000-09-30 20:12:27 +00:00
Bosko Milekic
7d03271452 Big mbuf subsystem diff #1: incorporate mutexes and fix things up somewhat
to accomodate the changes.

 Here's a list of things that have changed (I may have left out a few); for a
 relatively complete list, see http://people.freebsd.org/~bmilekic/mtx_journal

   * Remove old (once useful) mcluster code for MCLBYTES > PAGE_SIZE which
     nobody uses anymore. It was great while it lasted, but now we're moving
     onto bigger and better things (Approved by: wollman).

   * Practically re-wrote the allocation macros in sys/sys/mbuf.h to accomodate
     new allocations which grab the necessary lock.

   * Make sure that necessary mbstat variables are manipulated with
     corresponding atomic() routines.

   * Changed the "wait" routines, cleaned it up, made one routine that does
     the job.

   * Generalized MWAKEUP() macro. Got rid of m_retry and m_retryhdr, as they
     are now included in the generalized "wait" routines.

   * Sleep routines now use msleep().

   * Free lists have locks.

   * etc... probably other stuff I'm missing...

  Things to look out for and work on later:

   * find a better way to (dynamically) adjust EXT_COUNTERS

   * move necessity to recurse on a lock from drain routines by providing
     lock-free lower-level version of MFREE() (and possibly m_free()?).

   * checkout include of mutex.h in sys/sys/mbuf.h - probably violating
     general philosophy here.

   The code has been reviewed quite a bit, but problems may arise... please,
   don't panic! Send me Emails: bmilekic@freebsd.org

Reviewed by: jlemon, cp, alfred, others?
2000-09-30 06:30:39 +00:00
Doug Rabson
8fb26af111 Ansify and fix warnings. 2000-09-29 16:53:39 +00:00
Doug Rabson
1ebcad5720 This is the first snapshot of the FreeBSD/ia64 kernel. This kernel will
not work on any real hardware (or fully work on any simulator). Much more
needs to happen before this is actually functional but its nice to see
the FreeBSD copyright message appear in the ia64 simulator.
2000-09-29 13:46:07 +00:00
Peter Wemm
5e5678bea0 Fill in some more missing bits from cpu_features according to the Intel
Pentium4 cpuid docs.
2000-09-29 04:53:00 +00:00
Peter Wemm
d694b7728c First shot at identifying the Pentum 4 acording to our reading of the
the cpu_id extensions in the Intel docs.  There is more info available.
See the following URL for more details.
http://developer.intel.com/design/processor/future/manuals/CPUID_Supplement.htm

Requested by:	Intel
2000-09-29 04:38:35 +00:00
Peter Wemm
b6c8407840 Get out the roto-rooter and clean up the abuse of nexus ivars by the
i386/isa/pcibus.c.  This gets -current running again on multiple host->pci
machines after the most recent nexus commits.  I had discussed this with
Mike Smith, but ended up doing it slightly differently to what we
discussed as it turned out cleaner this way.  Mike was suggesting creating
a new resource (SYS_RES_PCIBUS) or something and using *_[gs]et_resource(),
but IMHO that wasn't ideal as SYS_RES_* is meant to be a global platform
property, not a quirk of a given implementation.  This does use the ivar
methods but does so properly.  It also now prints the physical pci bus that
a host->pci bridge (pcib) corresponds to.
2000-09-28 00:37:32 +00:00
Jeroen Ruigrok van der Werven
5da1361025 Fix spelling of Katmai [Katami]. 2000-09-27 11:33:31 +00:00
Mike Smith
b16c630a6a Since the nexus is responsible for creating the I/O resources (ports, memory)
it ought to be able to deal with devices directly attached to it having
allocations of such resources.  Make it so.
2000-09-27 00:51:42 +00:00
KATO Takenori
0506e3e8c0 Recognize new Pentium III Xeon (stepping A0).
PR:		21233
Submitted by:	ade
2000-09-26 08:59:55 +00:00
John Baldwin
65e893c9b9 Fix the assmebly mutex macros to handle saving/restoring interrupt state
properly.  Fix the recursive mutex macros to actually compile.  At the
moment we only use MTX_EXIT anyways.
2000-09-24 23:34:21 +00:00
Paul Saab
92b123a002 Move MAXCPU from machine/smp.h to machine/param.h to fix breakage
with !SMP kernels.  Also, replace NCPUS with MAXCPU since they are
redundant.
2000-09-23 12:18:06 +00:00
Jason Evans
c6d1d1cf5d #include <sys/proc.h> in order to get curproc. This seems to be the lesser
of two evils; the greater evil is requiring sys/proc.h to be included
before including machine/mutex.h.
2000-09-23 00:00:50 +00:00
Paul Saab
7321545f26 Remove the NCPU, NAPIC, NBUS, NINTR config options. Make NAPIC,
NBUS, NINTR dynamic and set NCPU to a maximum of 16 under SMP.

Reviewed by:	peter
2000-09-22 23:40:10 +00:00
John Baldwin
c60db3e23a Teach MTX_EXIT_RECURSE that the recursion count is a 32-bit integer,
not a 16-bit one.
2000-09-22 04:30:33 +00:00
Mike Smith
72b535ef45 Implement halt-on-idle in the !SMP case, which should significantly
reduce power consumption on most systems.
2000-09-22 03:18:20 +00:00
Brian S. Dean
9d90941a83 Add a couple of debug register helper functions to assist in setting
and clearing watchpoints.

Reviewed by:	jwd@FreeBSD.org, -hackers@
2000-09-21 17:07:27 +00:00
Bill Paul
73334a4329 Add a new driver for the AMD PCnet/FAST, FAST+ and Home PCI adapters.
Previously, these cards were supported by the lnc driver (and they
still are, but the pcn driver will claim them first), which is fine
except the lnc driver runs them in 16-bit LANCE compatibility mode.
The pcn driver runs these chips in 32-bit mode and uses the RX alignment
feature to achieve zero-copy receive. (Which puts it in the same
class as the xl, fxp and tl chipsets.) This driver is also MI, so it
will work on the x86 and alpha platforms. (The lnc driver is still
needed to support non-PCI cards. At some point, I'll need to newbusify
it so that it too will me MI.)

The Am79c978 HomePNA adapter is also supported.
2000-09-20 17:30:22 +00:00
Eivind Eklund
300019c450 Better error message when booting an SMP kernel on an UP system. 2000-09-19 10:40:52 +00:00
Poul-Henning Kamp
c866ec47e3 Make LINT compile. 2000-09-16 18:55:05 +00:00
John Baldwin
7ab37af1ed - Add a new process flag P_NOLOAD that marks a process that should be
ignored during load average calcuations.
- Set this flag for the idle processes and the softinterrupt process.
2000-09-15 22:00:23 +00:00
Yoshihiro Takahashi
5d7e2cbea6 Moved the fe driver from the compat section to the correct section.
Submitted by:	sanpei
2000-09-15 02:25:41 +00:00
John Baldwin
518afc0f11 Check to see if we actually have an interrupt descriptor and an interrupt
thread for each interrupt that comes in.  If we don't, log the event and
return immediately for a hardware interrupt.  For a softinterrupt, panic
instead.

Submitted by:	ben
2000-09-15 00:27:57 +00:00
John Baldwin
606f8eb27a Remove the mtx_t, witness_t, and witness_blessed_t types. Instead, just
use struct mtx, struct witness, and struct witness_blessed.

Requested by:	bde
2000-09-14 20:15:16 +00:00
John Baldwin
9a94c9c5c3 - Remove the inthand2_t type and use the equivalent driver_intr_t type from
newbus for referencing device interrupt handlers.
- Move the 'struct intrec' type which describes interrupt sources into
  sys/interrupt.h instead of making it just be a x86 structure.
- Don't create 'ithd' and 'intrec' typedefs, instead, just use 'struct ithd'
  and 'struct intrec'
- Move the code to translate new-bus interrupt flags into an interrupt thread
  priority out of the x86 nexus code and into a MI ithread_priority()
  function in sys/kern/kern_intr.c.
- Remove now-uneeded x86-specific headers from sys/dev/ata/ata-all.c and
  sys/pci/pci_compat.c.
2000-09-13 18:33:25 +00:00
Bruce Evans
d3f209631e Be more careful about cleaning up the stack after function calls early
in the boot.  The cleanup must be done in one of the few ways that
db_numargs() understands, so that early backtraces in ddb don't underrun
the stack.  The underruns caused reboots a few years ago when there
was an unmapped page above the stack (trapping to abort the command
doesn't work early).

Cleaned up some nearby code.
2000-09-13 14:08:50 +00:00
Bruce Evans
9c15b3c143 Fixed hang on booting with -d. mtx_enter() was called on an uninitialized
lock.  The quick fix in trap.c was not quite the version tested and had no
effect; back it out.
2000-09-13 12:40:43 +00:00
Mike Smith
358637397e A new driver for PCI:SCSI RAID controllers based on the Adaptec FSA
design.  This includes integrated Dell RAID controllers, the Dell
PERC 2/QC and the HP NetRAID-4M.
2000-09-13 03:20:35 +00:00
John Baldwin
77044cb6d9 Clean up process accounting some more. Unfortunately, it is still not
quite right on i386 as the CPU who runs statclock() doesn't have a valid
clockframe to calculate statistics with.
2000-09-12 18:57:59 +00:00
Bruce Evans
bbbb2579b4 Quick fix for hang on booting with -d. mtx_enter() was called before
curproc was initialized.  curproc == NULL was interpreted as matching
the process holding Giant...  Just skip mtx_enter() and mtx_exit() in
trap() if (curproc == NULL && cold) (&& cold for safety).
2000-09-12 18:41:56 +00:00
Bruce Evans
d511196c02 Don't panic for delivery of a multiplexed SWI. Most SWI handlers
don't take an arg, but swi_generic() is special in order to avoid one
whole conditional branch in the old SWI dispatch code.  The new SWI
dispatch code passed it a garbage arg.  Bypass swi_generic() and call
swi_dispatcher() directly, like the corresponding alpha code has always
done.

The panic was rare because because it only occurred if more than one
of the {sio,cy,rc} drivers was configured and one was active, and the
cy driver doesn't even compile.
2000-09-12 16:02:43 +00:00
Mark Murray
ac519db05b Turn the /dev/random device into a (pseudo-)device, not an option.
(I didn't realise that it was this easy!)
Submitted by:	jhb
2000-09-12 13:21:40 +00:00
Bill Fumerola
eaeac22d2c Move tx to the list of drivers that now require miibus. 2000-09-11 21:20:39 +00:00
John Baldwin
b162b45509 When doing statistics for statclock on other CPU's, use the other CPUs'
idleproc pointers instead of our own for comparisons.

Submitted by:	tegge
2000-09-11 04:10:29 +00:00
Jason Evans
5340642a2e Style cleanups. No functional changes. 2000-09-09 23:18:48 +00:00
Jason Evans
46bf3fe5a6 Add file and line arguments to WITNESS_ENTER() and WITNESS_EXIT, since
__FILE__ and __LINE__ don't get expanded usefully in inline functions.

Add const to all witness*() arguments that are filenames.
2000-09-09 22:43:22 +00:00
Jason Evans
12473b76dc Rename mtx_enter(), mtx_try_enter(), and mtx_exit() and wrap them with cpp
macros that expand to pass filename and line number information.  This is
necessary since we're using inline functions instead of macros now.

Add const to the filename pointers passed througout the mtx and witness
code.
2000-09-08 21:48:06 +00:00
John Baldwin
1baab78f9e Remove an unneeded extern declaration of cp_time. 2000-09-08 20:18:29 +00:00
Jake Burkholder
4ef34f39ec Really fix USER_LDT. (Don't use currentldt as an L-value.) 2000-09-08 03:36:09 +00:00
Jake Burkholder
88f4c2a1d6 Don't use currentldt as an L-value.
This should fix options USER_LDT.

Reported-by:	John Hay <jhay@zibbi.mikom.csir.co.za>
		Nickolay Dudorov <nnd@mail.nsk.ru>
2000-09-07 20:12:12 +00:00
John Baldwin
746a935474 Test for both SMP and I386_CPU being set before generating an error. 2000-09-07 16:10:02 +00:00
Yoshihiro Takahashi
f69dfaede1 Don't assume that address of I/O address table increase (PC-98 only).
Pointed out by:	Tomokazu HARADA <tkhara@osk4.3web.ne.jp>
2000-09-07 14:43:00 +00:00
Jason Evans
0384fff8c5 Major update to the way synchronization is done in the kernel. Highlights
include:

* Mutual exclusion is used instead of spl*().  See mutex(9).  (Note: The
  alpha port is still in transition and currently uses both.)

* Per-CPU idle processes.

* Interrupts are run in their own separate kernel threads and can be
  preempted (i386 only).

Partially contributed by:	BSDi (BSD/OS)
Submissions by (at least):	cp, dfr, dillon, grog, jake, jhb, sheldonh
2000-09-07 01:33:02 +00:00
Jason Evans
62ae6c89ad Add KTR, a facility that logs kernel events in order to to facilitate
debugging.

Acquired from:	BSDi (BSD/OS)
Submitted by:	dfr, grog, jake, jhb
2000-09-07 01:29:44 +00:00
Poul-Henning Kamp
819e370c3b Introduce atomic_cmpset_int() and atomic_cmpset_long() from SMPng a
few hours earlier than the rest.

The next DEVFS commit needs these functions.

Alpha versions by: dfr
i386 versions by: jakeb

Approved by:    SMPng
2000-09-06 11:21:14 +00:00
Mike Smith
877aa18bbf Teach the NFS && NFS_ROOT case how to pick up information left by the
PXE loader, and use this to build the nfs_diskless structure.
2000-09-05 22:34:11 +00:00
Peter Wemm
4d8ea19f7c Catch a few more bogosities in certain chipsets before they mess us up.
Some have dual host->PCI bridges for the same logical pci bus (!), eg:
some of the RCC chipsets.  This is a 32/64 bit 33/66MHz and dual pci
voltage motherboard so persumably there are electical or signalling
differences but they are otherwise the same logical bus.
The new PCI probe code however was getting somewhat upset about it and
ended up creating two pci bridges to the same logical bus, which caused
devices on that logical bus to appear and be probed twice.

The ACPI data on this box correctly identifies this stuff, so bring on
ACPI! :-)
2000-09-05 00:53:34 +00:00
Peter Wemm
da65de1dee Complain if we cannot find loader(8) metadata. 2000-09-03 04:13:03 +00:00
Mike Smith
ef137fd32f Add the 'asr' driver, supplied by Mark Salyzyn of Adaptec (nee DPT).
This provides support for the Adaptec SCSI RAID controller family,
as well as the DPT SmartRAID V and VI families.

The driver will be maintained by Mark and Adaptec, and any changes
should be referred to the MAINTAINER.
2000-09-01 07:51:25 +00:00
Peter Wemm
280b4748af Take a shot at fixing multiple pci busses on i386.
pcib_set_bus() cannot be used on the new child because it is
meant to be used on the *pci* device (it looks at the parent internally)
not the pcib being added.  Bite the bullet and use ivars for the bus
number to avoid any doubts about whether the softc is consistant between
probe and attach.  This should not break the Alpha code.
2000-08-31 23:11:35 +00:00
Takanori Watanabe
b1f12b6157 Merge rest piece of ACPI driver.To activate acpi driver ,add
device acpi

line. Merge finished. But still experimental phase.Need more hack!

Obtained from:ACPI for FreeBSD project
2000-08-31 15:34:54 +00:00
KATO Takenori
1cfd836f65 Improved Cyrix 486DX supports for NEC PC-98.
- Enable WB cache via CCR2 and CR0.
  - Set the need_pre_dma_flush when the CPU_I486_ON_386 option is
    defined.

Submitted by:	Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
2000-08-31 10:33:06 +00:00