Commit Graph

7882 Commits

Author SHA1 Message Date
Julian Elischer
589f6ed8ce Divorce the kernel binary ABI version number from the message
format version number. (userland programs should not need to be
recompiled when the netgraph kernel internal ABI is changed.

Also fix modules that don;t handle the fact that a caller may not supply
a return message pointer. (benign at the moment because the calling code
checks, but that will change)
2000-12-18 20:03:32 +00:00
Bill Paul
163369c243 Apply some contributed patches to reduce number of tx buffer allocation
failures and add some support for WEP on Prism II chip.

Submitted by: YAMAMOTO Shigeru <shigeru@iij.ad.jp>
2000-12-15 23:34:13 +00:00
Bill Paul
1b49710482 Newbus the if_el (3Com 3c501) driver. Use bus_space_X() functions.
Add detach routine and turn driver into a module so it can be loaded
and unloaded. Also take a stab at implementing multicast packet
reception so that this NIC will work with IPv6. Promiscuous mode
doesn't seem to work, but I'm not sure why. It works well enough that
I can run dhclient on it and put it on the office network though.
Also ripped out spl stuff and replaced it with mutexes.
2000-12-15 20:09:10 +00:00
Poul-Henning Kamp
48ecc0129d Add the musycc driver to NOTES.
This is a driver for the LanMedia/SBE LMC150x E1/T1 family of cards.

The driver currently support unframed E1 (2048kbit/s) and framed
E1 (nx64).

These cards will provision E1/T1 lines for about 1/4 the cost of
a cisco router...
2000-12-15 18:01:43 +00:00
John Baldwin
5f38ca907c Remove the "machine dependent" KTR trace buffer ddb commands. The code was
exactly the same on all platforms.
2000-12-14 23:57:30 +00:00
Jake Burkholder
7d8e3aa013 Use _lapic+offset to access the local apic from assembly language
files, rather than the symbols in globals.s.  The offsets are
generated by genassym.
2000-12-14 04:16:16 +00:00
Warner Losh
492510de38 o Remove the COMPAT_OLDPCI option now that Mike removed it.
o Add pmtimer device
o Shorten scsi settle time to 1 second, since that's what I use and
  I'm tired of remerging it every time.
2000-12-13 21:52:44 +00:00
John Baldwin
05f9877c15 If we fail to emulate a vm86 trap in kernel mode, then we use
vm86_trap() to return to the calling program directly.  vm86_trap()
doesn't return, thus it was never returning to trap() to release
Giant.  Thus, release Giant before calling vm86_trap().
2000-12-13 18:57:15 +00:00
Seigo Tanimura
21cd6e6232 - If swap metadata does not fit into the KVM, reduce the number of
struct swblock entries by dividing the number of the entries by 2
until the swap metadata fits.

- Reject swapon(2) upon failure of swap_zone allocation.

This is just a temporary fix. Better solutions include:
(suggested by:	dillon)

o reserving swap in SWAP_META_PAGES chunks, and
o swapping the swblock structures themselves.

Reviewed by:	alfred, dillon
2000-12-13 10:01:00 +00:00
Jake Burkholder
6d43764a10 Introduce a new potientially cleaner interface for accessing per-cpu
variables from i386 assembly language.  The syntax is PCPU(member)
where member is the capitalized name of the per-cpu variable, without
the gd_ prefix.  Example: movl %eax,PCPU(CURPROC).  The capitalization
is due to using the offsets generated by genassym rather than the symbols
provided by linking with globals.o.  asmacros.h is the wrong place for
this but it seemed as good a place as any for now.  The old implementation
in asnames.h has not been removed because it is still used to de-mangle
the symbols used by the C variables for the UP case.
2000-12-13 09:23:53 +00:00
Mike Smith
e8d5a72218 Remove the COMPAT_OLDPCI option, it's going away.
Turn 'lnc' off in GENERIC for the moment, pending its update to newbus.
2000-12-13 01:11:34 +00:00
Jake Burkholder
c0c2557090 - Change the allproc_lock to use a macro, ALLPROC_LOCK(how), instead
of explicit calls to lockmgr.  Also provides macros for the flags
  pased to specify shared, exclusive or release which map to the
  lockmgr flags.  This is so that the use of lockmgr can be easily
  replaced with optimized reader-writer locks.
- Add some locking that I missed the first time.
2000-12-13 00:17:05 +00:00
Julian Elischer
1b3335af6a Another mismatch found by Gcc:
This is what happenss when you let the patches pile up too long without
committing them.. brain rot..
2000-12-12 23:56:16 +00:00
Dag-Erling Smørgrav
c094d916c4 Remove after repo-copy to sys/compat/linprocfs. 2000-12-12 22:01:59 +00:00
Julian Elischer
859a4d166c Reviewed by: Archie@freebsd.org
This clears out my outstanding netgraph changes.
There is a netgraph change of design in the offing and this is to some
extent a superset of soem of the new functionality and some of the old
functionality that may be removed.

This code works as before, but allows some new features that I want to
work with and evaluate. It is the basis for a version of netgraph
with integral locking for SMP use.

This is running on my test machine with no new problems :-)
2000-12-12 18:52:14 +00:00
John Baldwin
5057d21069 Add in symbols needed in the WITNESS_ENTER and WITNESS_EXIT macros in
i386/include/mutex.h.
2000-12-12 16:40:20 +00:00
John Baldwin
18f619abce Fix the assembly mutex macros to call the appropriate witness functions if
the witness code is compiled in.  Without this, the witness code doesn't
notice that sched_lock is released by fork_trampoline() and thus gets all
confused about spin lock order later on.
2000-12-12 03:49:58 +00:00
Jake Burkholder
92cf772d8d - Add code to detect if a system call returns with locks other than Giant
held and panic if so (conditional on witness).
- Change witness_list to return the number of locks held so this is easier.
- Add kern/syscalls.c to the kernel build if witness is defined so that the
  panic message can contain the name of the offending system call.
- Add assertions that Giant and sched_lock are not held when returning from
  a system call, which were missing for alpha and ia64.
2000-12-12 01:14:32 +00:00
Matt Jacob
ac918c8460 add comment about ispfw 2000-12-11 23:31:32 +00:00
Nick Sayer
4323578d73 Add the spic driver, which is a simple first attempt at providing access
to the jog dial device.
2000-12-11 19:41:48 +00:00
Poul-Henning Kamp
9b67714311 Remove DDB, it leaked in here with another commit.
Submitted by:	bde
2000-12-11 14:02:00 +00:00
Dag-Erling Smørgrav
b51a26edb2 Add proc/<pid>/cmdline. 2000-12-09 16:20:48 +00:00
Dag-Erling Smørgrav
8b5a844af9 Add a dependency on procfs. 2000-12-09 16:20:35 +00:00
Dag-Erling Smørgrav
f786d43aac A bunch of fixes that have been rotting in my tree for a month or two
waiting for procfs to get fixed:

  - Use fill_eproc() to obtain correct VM stats. Attempt to compute VmLib.

  - Fill some more fields in proc/<pid>/stat, and add four (unimplemented)
    fields after studying a recent Linux kernel.

  - Compute CPU frequency only once instead of twice.

  - Fix some comments that were OBE.

  - Fix indentation except where it makes the code less readable.
2000-12-09 13:25:54 +00:00
Mike Smith
bb0d0a8efc Next phase in the PCI subsystem cleanup.
- Move PCI core code to dev/pci.
 - Split bridge code out into separate modules.
 - Remove the descriptive strings from the bridge drivers.  If you
   want to know what a device is, use pciconf.  Add support for
   broadly identifying devices based on class/subclass, and for
   parsing a preloaded device identification database so that if
   you want to waste the memory, you can identify *anything* we know
   about.
 - Remove machine-dependant code from the core PCI code.  APIC interrupt
   mapping is performed by shadowing the intline register in machine-
   dependant code.
 - Bring interrupt routing support to the Alpha
   (although many platforms don't yet support routing or mapping
   interrupts entirely correctly).  This resulted in spamming
   <sys/bus.h> into more places than it really should have gone.
 - Put sys/dev on the kernel/modules include path.  This avoids
   having to change *all* the pci*.h includes.
2000-12-08 22:11:23 +00:00
David Malone
7cc0979fd6 Convert more malloc+bzero to malloc+M_ZERO.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
2000-12-08 21:51:06 +00:00
Jake Burkholder
1b00f92039 Revert the previous change I made to cpu_switch. It doesn't help as
much as I thought it would and according to bde was a pessimization.
2000-12-08 21:31:52 +00:00
Poul-Henning Kamp
959b7375ed Staticize some malloc M_ instances. 2000-12-08 20:09:00 +00:00
Jake Burkholder
cc3f51b537 Fix a jump to the wrong label, <sigh>. Put a period at the end of a
sentence in a comment.

Submitted by:	bde
2000-12-08 19:53:37 +00:00
John Baldwin
31ae9b450a Argh, revert the clobber changes. Since %ecx and %edx aren't call safe,
calling the C functions mtx_enter_hard() and mtx_exit_hard() clobbers them.
Note that %eax is also not call safe, but it is already clobbered due to
cmpxchg.  However, now we are back to not compiling again, so these macros
are still left disabled for now.
2000-12-08 18:21:06 +00:00
Jake Burkholder
96d57f35b2 Change the calling conventions of the MTX_ENTER macro to match
that of MTX_EXIT.  Don't assume that the reg parameter to MTX_ENTER
holds curproc, load it explicitly.  Put semi-colons at the end of
the macros to be more consistent and so its harder to forget them
when these change.
2000-12-08 08:49:36 +00:00
John Baldwin
5e028585be Well, the previous commit wasn't entirely correct either. For now, just
disable the optimized mutex micro-operations for the non-I386_CPU case
and fall back to the C stubs that call the atomic_foo() inlines.
2000-12-08 05:03:34 +00:00
Poul-Henning Kamp
45b031c5e4 Move extern tsc_present outside function to quelch a warning. 2000-12-07 22:30:11 +00:00
Mitsuru IWASAKI
b52617dc0e Create a pmtimer device instance for GENERIC and NEWCARD kernels by default.
Submitted by:	Masayuki FUKUI <fukui@sonic.nm.fujitsu.co.jp>
2000-12-07 14:27:02 +00:00
John Baldwin
a423d0122b Fix broken register restraints that needlessly clobbered registers %ecx
and %edx resulting in gcc not having enough registers left to work with.
2000-12-07 02:23:16 +00:00
Peter Wemm
4366ac52ad This is kind of a nasty hack, but it appears to solve the Compaq DL360
SMP problem.  Compaq, in their infinite wisdom, forgot to put the IO apic
intpin #0 connection to the 8259 PIC into the mptable.  This hack is to
look and see if intpin #0 has *no* table entry and adds a fake ExtInt
entry for the remap routines to use.  isa/clock.c will still test the
interrupts.  This entry is only ever used on an already broken system.
2000-12-06 03:47:14 +00:00
Peter Wemm
a263238c86 Move io_apic_{read,write} from apic_ipl.s (where they do not belong) into
mpapic.c.  This gives us the benefit of C type checking.  These functions
are not called in any critical paths and are not used by the interrupt
routines.
2000-12-06 01:04:02 +00:00
Peter Wemm
9a18987b73 GC unused assembler function apic_eoi() 2000-12-06 00:38:04 +00:00
Jake Burkholder
1eb44f0270 Remove the last of the MD netisr code. It is now all MI. Remove
spending, which was unused now that all software interrupts have
their own thread.  Make the legacy schednetisr use an atomic op
for setting bits in the netisr mask.

Reviewed by:	jhb
2000-12-05 00:36:00 +00:00
Peter Wemm
5ee171d264 Cleanup some leftover lint from the old interrupt system.
Also, while here, run up to 32 interrupt sources on APIC systems.
Normalize INTREN/INTRDIS so they are the same on both UP and SMP systems
rather than sometimes a macro, and sometimes a function.

Reviewed by:  jhb, jakeb
2000-12-04 21:15:14 +00:00
Jake Burkholder
f315dbdbd4 (1) Allow a stray lock prefix to be compiled out with the
MPLOCKED macro
(2)	Use decimal 12 rather than hex 0xc in an addl
(3)	Implement MTX_ENTER for the I386_CPU case
(4)	Use semi-colons between instructions to allow MTX_ENTER
	and MTX_ENTER_WITH_RECURSION to be assembled
(5)	Use incl instead of incw to increment the recusion count
(6)	10 is not a valid label, use 7, 8 and 9 rather than 8, 9 and 10
(7)	Sort numeric labels

Submitted by:	bde (2, 4, and 5)
2000-12-04 12:38:03 +00:00
Alexander Langer
b2ca55728b Add the NS DP83815 to the list of supported chips by the sis driver.
Inspired by:	Oliver Fromme
2000-12-03 18:43:41 +00:00
David Malone
0863e00340 Check return value of malloc correctly and use M_ZERO. 2000-12-03 13:18:49 +00:00
Jake Burkholder
1306962a43 Change cpu_switch to explicitly popl the callers program counter and
pushl that of the new process, rather than doing a movl (%esp) and
assuming that the stack has been setup right.  This make the initial
stack setup slightly more sane, and will make it easier to stick
an interrupted process onto the run queue without its knowing.
2000-12-03 01:09:59 +00:00
Mark Murray
4a3a2f0704 Namespace cleanup. Remove some #includes in favour of an explicit
declaration.

Asked for by:	bde
2000-12-02 17:59:41 +00:00
John Baldwin
0de7d1da20 Protect access to p_stat with sched_lock. 2000-12-01 06:34:19 +00:00
John Baldwin
1bcb20def1 Fix this slightly better by using NON_GPROF_RET instead of duplicating
hard-coded asm.

Suggested by:	bde
2000-12-01 05:29:21 +00:00
Jake Burkholder
21ad98bca8 Change doreti to take a trapframe instead of an intrframe.
Remove associated pushes of dummy units to convert frame.

Reviewed by:	jhb
2000-12-01 02:09:45 +00:00
John Baldwin
e60877b3ae Revert the previous change to this file. We have to hardcode in the opcode
for return because we do Evil Things(tm) with a 'ret' macro in
asmacros.h.

Noticed by:	markm
2000-11-30 20:07:49 +00:00
Alfred Perlstein
82625cf321 remove unneded sys/ucred.h includes 2000-11-30 18:52:32 +00:00
Marcel Moolenaar
d034d459da Don't use p->p_sigstk.ss_flags to keep state of whether the
process is on the alternate stack or not. For compatibility
with sigstack(2) state is being updated if such is needed.

We now determine whether the process is on the alternate
stack by looking at its stack pointer. This allows a process
to siglongjmp from a signal handler on the alternate stack
to the place of the sigsetjmp on the normal stack. When
maintaining state, this would have invalidated the state
information and causing a subsequent signal to be delivered
on the normal stack instead of the alternate stack.

PR: 22286
2000-11-30 05:23:49 +00:00
Peter Wemm
083e9ed543 Increase NKPT from 17 to 30. This fixes the 4GB ram boot panic on both
-current and RELENG_4 with GENERIC.

NKPT is the number of initial bootstrap page table pages we create for
the kernel during startup. Once VM is up, we resize it as needed, but
with 4G ram, the size of the vm_page_t structures was pushing it over
the limit.  The fact that trimmed down kernels boot on 4G ram machines
suggests that we were pretty close to the edge.

The "30" is arbitary, but smaller than the 'nkpt' variable on all
machines that I checked.
2000-11-30 01:53:02 +00:00
John Baldwin
8d9888d37a Don't wait forever for CPUs to stop or restart. Instead, give up after a
timeout.  If DIAGNOSTIC is turned on, then display a message to the console
with a map of which CPUs failed to stop or restart.  This gives an SMP box
at least a fighting chance of getting into DDB if one of the other CPUs has
interrupts disabled.
2000-11-28 23:52:36 +00:00
John Baldwin
bf8bfade99 Use atomic ops to close a race condition on the in_Debugger variable used
to only allow 1 CPU at a time to (non-recursively) enter the debugger.
2000-11-28 23:15:44 +00:00
Dag-Erling Smørgrav
fbbd9aebdd Add bogomips to cpuinfo (set it equal to the CPU frequency, which is bogus
but not more so than Linux' definition).
This should get the IBM JDK 1.3 working again.

Prompted by:	sobomax
2000-11-27 11:10:03 +00:00
David Malone
373134cc60 Don't scroll of the end of the help pages when using the visual
option in for "boot -c".

PR:		17539
Submitted by:	Edwin.Groothuis@cgmd76206.chello.nl
2000-11-26 23:39:46 +00:00
Jonathan Lemon
df5e198723 Lock down the network interface queues. The queue mutex must be obtained
before adding/removing packets from the queue.  Also, the if_obytes and
if_omcasts fields should only be manipulated under protection of the mutex.

IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on
the queue.  An IF_LOCK macro is provided, as well as the old (mutex-less)
versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which
needs them, but their use is discouraged.

Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF,
which takes care of locking/enqueue, and also statistics updating/start
if necessary.
2000-11-25 07:35:38 +00:00
Jonathan Lemon
14db7f978b Correct a misnamed argument hidden behind a #ifdef DEBUG
Found by:  LINT
2000-11-25 07:04:43 +00:00
Jonathan Lemon
e82ac18e52 Revert the last commit to the callout interface, and add a flag to
callout_init() indicating whether the callout is safe or not.  Update
the callers of callout_init() to reflect the new interface.

Okayed by: Jake
2000-11-25 06:22:16 +00:00
Alfred Perlstein
d28632c097 These files are mpsafe. 2000-11-25 03:01:05 +00:00
Marcel Moolenaar
cc6ca9b35c o Change the argument of linux_sigreturn to be a pointer to a
struct sigframe. We need more than only the signal context.

o  Properly convert the signal mask when setting up the signal
   frame in linux_sendsig and properly convert it back in
   linux_sigreturn.

Do some cleanups and improve style while here.
2000-11-23 08:55:30 +00:00
Marcel Moolenaar
e26cc4467b Change the argument of linux_sigreturn to be a pointer to a
struct sigframe.
2000-11-23 08:53:19 +00:00
Marcel Moolenaar
466b14d758 Don't unregister the ioctl handlers before we verified we
can unload. Doing so leaves the linuxulator in a crippled
state (no ioctl support) when Linux binaries are run at
unload time.

While here, consistently spell ELF in capitals and perform
some minor style improvements.

ELF spelling submitted by: asmodai
2000-11-23 03:21:58 +00:00
Jake Burkholder
553629ebc9 Protect the following with a lockmgr lock:
allproc
	zombproc
	pidhashtbl
	proc.p_list
	proc.p_hash
	nextpid

Reviewed by:	jhb
Obtained from:	BSD/OS and netbsd
2000-11-22 07:42:04 +00:00
Mark Murray
39413503a4 Assembler fixes.
Fix opcodes that were typed as ".byte 0xNN, 0xMM" when an older
assembler could not recognise the newer Pentium instructions.
Reviewed by:	jhb
2000-11-21 20:16:49 +00:00
Mark Murray
5855006767 Add a consistent API to a feature that most modern CPUs have; a fast
counter register in-CPU.

This is to be used as a fast "timer", where linearity is more important
than time, and multiple lines in the linearity caused by multiple CPUs
in an SMP machine is not a problem.

This adds no code whatsoever to the FreeBSD kernel until it is actually
used, and then as a single-instruction inline routine (except for the
80386 and 80486 where it is some more inline code around nanotime(9).

Reviewed by:	bde, kris, jhb
2000-11-21 19:55:21 +00:00
John Baldwin
0fb3a41200 Stop handcoding a couple of instructions since gas 2.10 can properly
assemble 16-bit code.

Noticed by:	markm
2000-11-21 18:36:10 +00:00
Poul-Henning Kamp
d7450ce6d5 Make programs which still #include <machine/{mouse,console}.h> fail
at compiletime, with an explanatory error message.  Previously they
would only get a warning.

These files will be finally removed 2001-01-15
2000-11-20 22:00:25 +00:00
Julian Elischer
06525b98f2 Duh. These have been sitting in my tree since I committed this stuff.
Thes are identical to what I committed except that they had the correct
copyright headers. This is what I was SUPPOSED to have checked in..
2000-11-20 13:43:40 +00:00
Jake Burkholder
fa2fbc3dac - Protect the callout wheel with a separate spin mutex, callout_lock.
- Use the mutex in hardclock to ensure no races between it and
  softclock.
- Make softclock be INTR_MPSAFE and provide a flag,
  CALLOUT_MPSAFE, which specifies that a callout handler does not
  need giant.  There is still no way to set this flag when
  regstering a callout.

Reviewed by:	-smp@, jlemon
2000-11-19 06:02:32 +00:00
Jake Burkholder
7da6f97772 - Split the run queue and sleep queue linkage, so that a process
may block on a mutex while on the sleep queue without corrupting
it.
- Move dropping of Giant to after the acquire of sched_lock.

Tested by:	John Hay <jhay@icomtek.csir.co.za>
		jhb
2000-11-17 18:09:18 +00:00
John Baldwin
835a748f30 - Change extra sanity checks in cpu_switch() to be conditional on INVARIANTS
instead of DIAGNOSTIC.
- Remove the p_wchan check as it no longer applies since a process may be
  switched out during CURSIG() within msleep() or mawait().
- Remove an extra sanity check only needed during the early SMPng work.
2000-11-17 17:37:43 +00:00
Archie Cobbs
7d7a5b89a7 Add kernel option NETGRAPH_ONE2MANY. 2000-11-16 16:59:26 +00:00
John Baldwin
20cdcc5b73 Don't release and acquire Giant in mi_switch(). Instead, release and
acquire Giant as needed in functions that call mi_switch().  The releases
need to be done outside of the sched_lock to avoid potential deadlocks
from trying to acquire Giant while interrupts are disabled.

Submitted by:	witness
2000-11-16 02:16:44 +00:00
Andrew Gallatin
088638dae4 remove redundant declaration of bsd_to_linux_sigset()
reviewed by: marcel
2000-11-16 02:08:40 +00:00
Andrew Gallatin
b595ab370b fix glaring bugs in rt signals -- copyout the right signal mask in
linux_rt_sendsig() and restore the same signal mask linux does
in rt_sigreturn().  This gets us saving/restoring all 64-bits of the
linux sigset_t in rt signals.

Reviewed by: marcel
2000-11-16 02:07:05 +00:00
John Baldwin
7c06c69188 Assert that Giant is not owned during the main loop of ithd_loop(). 2000-11-15 22:03:26 +00:00
John Baldwin
59f857e4ea Declare the 'witness_spin_check' properly as a per-CPU variable in the
non-SMP case.
2000-11-15 22:02:05 +00:00
Warner Losh
c7ba419499 vx no longer uses pci compat shims and this doesn't need a count 2000-11-15 18:43:41 +00:00
Warner Losh
5c75885e24 MFGENERIC: 1.291 2000-11-15 18:42:44 +00:00
Warner Losh
e655ea71de Add pmtimer device, necessary for proper time keeping when apm or
other power management devices are enabled.
2000-11-15 18:36:24 +00:00
John Baldwin
4ae465d099 Always enable interrupts during fork_trampoline() after releasing the
sched_lock.  This is needed for kernel threads that are created before
interrupts are enabled.  kthreads created by kld's that are created at
SI_SUB_KLD such as the random kthread.

Tested by:	phk
2000-11-14 23:01:24 +00:00
Jordan K. Hubbard
4dc665b8bf Proper capitalization of PCMCIA (and avoid matching pcm) 2000-11-14 01:13:57 +00:00
Jordan K. Hubbard
68ce54fbde In the year 2000, I think it's perfectly reasonable to include audio
support by default in GENERIC.
2000-11-14 01:11:13 +00:00
Andrew Gallatin
2c4ab9ddfa Make linux_sendsig and linux_sigreturn use all 64 bits of a
linux_sigset_t by updating the linux_sigframe struct so as to include
linux's "extramask" field.  This field contains the upper 32-bits of
the sigset.  extramask sits behind a linux_fpstate struct, which I've
defined primarily for padding purposes.

While we're here, define LINUX_NSIG in terms of LINUX_NBPW (32) and
LINUX_NSIG_WORDS (2).

This fixes problems where threaded apps would accumulate a large
number of zombies.  This was happening because the exit signal resides
in the upper 32-bits of the sigset and was never getting unmasked by
the manager thread after the first child exited.

PR: 		misc/18530  (may be related, originator not yet contacted)
Reviewed by:	marcel
2000-11-13 20:44:05 +00:00
John Baldwin
af80d322a6 Fix a bug with handling of the saved interrupt state for spin mutexes in
the MTX_EXIT_WITH_RECURSION() assembly macro (currently unused).

Submitted by:	bde
2000-11-13 18:39:18 +00:00
Yoshihiro Takahashi
8965720482 Initialize bus_space_handle_t with zero (for PC-98). 2000-11-13 11:48:38 +00:00
Marcel Moolenaar
ebea866055 Revert auto-generation. The Alpha port is broken.
Syncing with it is wrong.
2000-11-10 21:30:19 +00:00
Marcel Moolenaar
806d7daafe Make MINSIGSTKSZ machine dependent, and have the sigaltstack
syscall compare against a variable sv_minsigstksz in struct
sysentvec as to properly take the size of the machine- and
ABI dependent struct sigframe into account.

The SVR4 and iBCS2 modules continue to have a minsigstksz of
8192 to preserve behavior. The real values (if different) are
not known at this time. Other ABI modules use the real
values.

The native MINSIGSTKSZ is now defined as follows:

Arch		MINSIGSTKSZ
----		-----------
alpha		    4096
i386		    2048
ia64		   12288

Reviewed by: mjacob
Suggested by: bde
2000-11-09 08:25:48 +00:00
Marcel Moolenaar
2da829a0c8 Sync with Alpha:
Do not use sysent.c, proto.h and syscall.h in source tree;
use auto-generated versions.
2000-11-09 07:27:55 +00:00
Takanori Watanabe
c69ab48d38 Farewell our code. We will switch acpica code from Intel.
This code has help us comprehence ACPI spec .

Contributors of this code is as follows(except for FreeBSD commiter):
Yasuo Yokoyama,
Munehiro Matsuda,
and ALL acpi-jp@jp.freebsd.org people.

Thanks.

R.I.P.
2000-11-09 05:09:52 +00:00
Jeroen Ruigrok van der Werven
6b1d8ceabe Fix CMSG and ALIGN macro usage.
Previously we had to include <machine/param.h> or <sys/param.h> bogusly
due to the fact that <sys/socket.h> CMSG macros needed the ALIGN macro,
which was defined in param.h.  However, including param.h was a disaster
for namespace pollution.
This solution, as contributed by shin a while ago, fixes it elegantly
by wrapping the definitions around some namespace pollution preventer
definitions.
This patch was long overdue.
This should allow any network programmer to use <sys/socket.h> as
before.

PR:		19971, 20530
Submitted by:	Martin Kaeske <MartinKaeske@lausitz.net>
		Mark Andrews <Mark.Andrews@nominum.com>
Patch submitted by:	shin
Reviewed by:	bde
2000-11-08 16:59:25 +00:00
Jeroen Ruigrok van der Werven
a88d714c23 Document DISABLE_PSE. 2000-11-08 15:53:49 +00:00
Jeroen Ruigrok van der Werven
28d7984f3d Document CLUSTERDEBUG, CPU_UPGRADE_HW_CACHE and LOCKF_DEBUG. 2000-11-08 12:14:06 +00:00
Jeroen Ruigrok van der Werven
5b488b3443 Fix some further english grammar and typo's. 2000-11-08 12:00:05 +00:00
Jeroen Ruigrok van der Werven
a47ea7b90e Fix typo's: UPGRADE_CPU_HW_CACHE -> CPU_UPGRADE_HW_CACHE 2000-11-08 11:58:07 +00:00
Jeroen Ruigrok van der Werven
edd5302d4d Document the following options:
FB_DEBUG,
	FB_INSTALL_CDEV,
	FE_8BIT_SUPPORT,
	IBCS2,
	KEY,
	LOUTB,
	SPX_HACK
2000-11-08 11:34:09 +00:00
Mike Smith
e9ca98b28f Hack to work around a probe which will lock up at least some i450GX-based
systems.

From the PR:

 When 'probe.slot' is PCI_SLOTMAX (== 31) and 'probe.func' is 7,
 call to 'pci_cfgread()' here and machine suddenly hangs up.
 I don't know why...  (or 450GX chipset's bug?)

PR:		i386/20379
Submitted by:	Masayuki FUKUI <fukui@sonic.nm.fujitsu.co.jp>
2000-11-08 11:25:15 +00:00
Jeroen Ruigrok van der Werven
f57fc21c46 Document XBONEHACK option. 2000-11-08 10:09:01 +00:00
Jeroen Ruigrok van der Werven
fac70739ff Document some AHC_* options. 2000-11-08 10:01:45 +00:00
Warner Losh
cd594d0ec4 Merge from GENERIC 1.288 2000-11-07 21:26:34 +00:00
Warner Losh
30cb2a0dfb Make the ISA nic section look like the other device sections with
comments on the same line like so:
	device		foo		# FooInc Brand NetEther cards

Also, move the wireless NIC cards to their own section.

Add commented out wl driver in wireless section.

Remove obsolete or redundant comments about some of the wireless cards
that used to apply but don't since we've removed 'at foobus'.

There should be no functional changes in this change.
2000-11-07 21:20:52 +00:00
Warner Losh
7a90c33a8a Synchronize NEWCARD kernel to GENERIC kernel. It is still experimental,
but it doesn't hurt to keep these things in sync.
2000-11-07 21:07:35 +00:00
Warner Losh
5350155530 Minor ordering changes to make more sections strictly alphabetical. 2000-11-07 21:06:57 +00:00
Semen Ustimenko
600ae3dd25 Synced tx(4) driver descriptions + ``device tx'' line moved to the
list of drivers using miibus.

PR:		kern/22556
2000-11-07 20:22:19 +00:00
Alfred Perlstein
b5d335ad6d Protect against an infinite loop when prefaulting pages. This can
happen when the vm system maps past the end of an object or tries
to map a zero length object, the pmap layer misses the fact that
offsets wrap into negative numbers and we get stuck.

Found by: Joost Pol aka Nohican <nohican@marcella.niets.org>
Submitted by: tegge
2000-11-07 18:31:16 +00:00
Kenjiro Cho
44b5247d95 newbusify the en atm driver. 2000-11-07 09:31:28 +00:00
John Baldwin
d902baa4ba Document the KTR_VERBOSE option. 2000-11-07 01:50:10 +00:00
Bill Paul
f425f328cd The vx driver no longer needs the PCI compat shims. Also should now
work on the alpha (at least the PCI part should).
2000-11-07 00:58:35 +00:00
Mike Smith
90aa4fc1ee Quieten some warnings about correct usage of assignments as truth values. 2000-11-06 21:32:13 +00:00
Dag-Erling Smørgrav
fd9f324055 Check that p->p_pptr is not NULL - kernel processes have no parents! 2000-11-06 03:23:56 +00:00
Yoshihiro Takahashi
5c84db5258 Switched from i386/isa/scsi_dvcfg.h to cam/scsi/scsi_dvcfg.h 2000-11-05 14:34:35 +00:00
David E. O'Brien
86d42bbdbe Our SHRT_MIN definition was actually 4 bits too big.
Submitted by:	Bradley T. Hughes <bhughes@trolltech.com>
2000-11-04 21:01:44 +00:00
Mike Smith
099d058b54 Improve the PCI interrupt routing code. Now the process is as follows:
- Look for a hardwired interrupt in the routing table for this
   bus/device/pin (we already did this).
 - Look for another device with the same link byte which has a hardwired
   interrupt.
 - Look for a PCI device matching an entry with the same link byte
   which has already been assigned an interrupt, and use that.
 - Look for a routable interrupt listed in the "PCI only" interrupts
   field and use that.
 - Pick the first interrupt that's marked as routable and use that.
2000-11-02 00:37:45 +00:00
David E. O'Brien
83d2913008 Make the target a little bit more generic. 2000-11-01 08:47:34 +00:00
Roger Hardiman
def1ddf3a8 Fix typo in comments 2000-10-31 14:30:29 +00:00
Poul-Henning Kamp
a16d0eb2d7 Deprecate devsw->d_bmaj entirely.
This removes support for booting current kernels with very old bootblocks.

Device driver writers: Please remove initializations for the d_bmaj
field in your cdevsw{}.
2000-10-31 10:58:14 +00:00
Andrew Gallatin
84aa58ab03 fix the sigaltstack hack by lowering the stack size to the original value
if the request was for less than MINSIGSTKSZ (in which case we "round up").
discussed with: marcel
2000-10-31 03:10:41 +00:00
Poul-Henning Kamp
54dfbb1460 Comment out the (old) acpi stuff, it breaks LINT. 2000-10-30 20:35:31 +00:00
Poul-Henning Kamp
da936bf80a Remove unneeded <stddef.h> #includes. 2000-10-29 16:57:42 +00:00
Poul-Henning Kamp
cf9fa8e725 Move suser() and suser_xxx() prototypes and a related #define from
<sys/proc.h> to <sys/systm.h>.

Correctly document the #includes needed in the manpage.

Add one now needed #include of <sys/systm.h>.
Remove the consequent 48 unused #includes of <sys/proc.h>.
2000-10-29 16:06:56 +00:00
Poul-Henning Kamp
53ce36d17a Remove unneeded #include <sys/proc.h> lines. 2000-10-29 13:57:19 +00:00
Noriaki Mitsunaga
918dbed337 Add hints for ISA cards (such as TMC1610M) which use stg driver.
The values has been given by Arai Mikio <m-arai@sco.bekkoame.ne.jp>.
2000-10-29 05:51:46 +00:00
John Baldwin
a76e4179b4 Don't ignore VESA modes that have the NON-VGA bit set. All of the SVGA
graphical modes on some systems have this bit set causing our VESA code
to ignore them.
2000-10-28 22:35:57 +00:00
Nik Clayton
f94a808c35 Add a brief comment telling people to retain 'device miibus' as necessary.
PR:		docs/21981
Submitted by:	Matthew Emmerton <matt@gsicomp.on.ca>
2000-10-28 22:32:17 +00:00
Bruce Evans
27c6358927 Quick fix for namespace problems which broke many ports. Spell
uint16_t as "unsigned short" like it used to be and uint32_t as
"unsigned int" not like it used to be (was: "unsigned long").
2000-10-28 08:20:33 +00:00
Mike Smith
0da9b7818e Add some verbiage about the new ACPICA code. Note that this probably
breaks building this config, as the old ACPI code will conflict.  The
old code will be going away shortly, so this should not be an issue.
2000-10-28 07:07:02 +00:00
Mike Smith
fd660059d9 FreeBSD-specific OSD (operating system dependant) modules for the Intel
ACPICA code.
2000-10-28 06:56:15 +00:00
Poul-Henning Kamp
54b1161b73 Revert two experimental changes which escaped from my devel machine. 2000-10-28 06:55:12 +00:00
John Baldwin
55d79ad0db The x86 atomic operations are already locked, so they do not need an
additional locked instruction to guarantee a write barrier for the acquire
variants.

Approved by:	dfr
Pointy hat to:	jhb
2000-10-28 00:28:15 +00:00
John Baldwin
7c0cb49a64 Fix a couple of whitespace nits. 2000-10-27 21:45:50 +00:00
Poul-Henning Kamp
46aa3347cb Convert all users of fldoff() to offsetof(). fldoff() is bad
because it only takes a struct tag which makes it impossible to
use unions, typedefs etc.

Define __offsetof() in <machine/ansi.h>

Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h>

Remove myriad of local offsetof() definitions.

Remove includes of <stddef.h> in kernel code.

NB: Kernelcode should *never* include from /usr/include !

Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API.

Deprecate <struct.h> with a warning.  The warning turns into an error on
01-12-2000 and the file gets removed entirely on 01-01-2001.

Paritials reviews by:   various.
Significant brucifications by:  bde
2000-10-27 11:45:49 +00:00
Doug Barton
c9e6ddc6af Expand on the reasons for and against defining NO_F00F_HACK. This is one of
those options that is frequently misunderstood, and ends up on -questions.

PR:		21852
2000-10-27 10:57:33 +00:00
Bruce Evans
4a3bb59944 Declare or #define per-cpu globals in <machine/globals.h> in all cases.
The i386 UP case was messily different.
2000-10-27 08:30:59 +00:00
Mark Murray
5f3431b5ad As the blocking model has seems to be troublesome for many, disable
it for now with an option.

This option is already deprecated, and will be removed when the
entropy-harvesting code is fast enough to warrant it.
2000-10-27 06:06:04 +00:00
John Baldwin
660d1e3a9d Add and document the WITNESS_SKIPSPIN and WITNESS_DDB kernel options. 2000-10-27 03:00:28 +00:00
Roger Hardiman
870b024f5d Add new ioctls for userland access to the MSP device 2000-10-26 16:41:48 +00:00
Hellmuth Michaelis
d1dad62933 Add infrastructure for Cologne Chip HFC-S PCI driver.
Increment isdn4bsd step.
2000-10-26 06:58:43 +00:00
Dag-Erling Smørgrav
f8c05e5019 Bring cpuinfo closer to what it looks like in Linux 2.2.
Submitted by:	R Bradford Jones <brad@kazrak.com>
2000-10-25 22:38:23 +00:00
Dag-Erling Smørgrav
886a6f6fca Add /proc/<pid>/status and /proc/<pid>/stat (the latter being mostly
zeroes for the time being).

Prompted by:	Nathan Boeger <nathan@khmere.com>
2000-10-25 22:12:59 +00:00
John Baldwin
ee8f2f372c - Add atomic_cmpset_{acq_,rel_,}_long
- Add in atomic operations for 8-bit, 16-bit, and 32-bit integers
2000-10-25 21:56:16 +00:00
John Baldwin
fbc9c4f042 Catch up to the new software interrupt code.
Noticed by:	phk
2000-10-25 21:24:08 +00:00
John Baldwin
49e0078b0f - Catch up to new software interrupt code.
- Add a missing curly brace.

Noticed by:	phk
2000-10-25 21:13:42 +00:00
John Baldwin
62a010fecf - Remove unneeded machine/ipl.h #include.
- Change the softintr() macro to do nothing on FreeBSD.  Previously,
  this macro would set a bit in spending and schedule the softinterrupt
  thread to run.  However, the bs driver never actually registers a
  a software interrupt handler, so all this work achieved nothing.  From
  the code it is not clear what exactly the softintr() macro is actually
  supposed to be doing.  It looks like it is supposed to be possibly
  running the hardware interrupt handler maybe?  This handler is only
  present in the #ifdef __NetBSD__ code however.  I have no idea how this
  driver handles interrupts at all, but at least it compiles now.
2000-10-25 20:38:08 +00:00
Paul Saab
fbdfe15620 Fast interrupts have no associated process, therefore do not try
and schedule it.  This fixes booting machines with broken MP tables.
2000-10-25 10:40:20 +00:00
Nick Hibma
2fd84f56d5 The USB scanner driver. To be used together with SANE. 2000-10-25 10:34:38 +00:00
John Baldwin
8088699f79 - Overhaul the software interrupt code to use interrupt threads for each
type of software interrupt.  Roughly, what used to be a bit in spending
  now maps to a swi thread.  Each thread can have multiple handlers, just
  like a hardware interrupt thread.
- Instead of using a bitmask of pending interrupts, we schedule the specific
  software interrupt thread to run, so spending, NSWI, and the shandlers
  array are no longer needed.  We can now have an arbitrary number of
  software interrupt threads.  When you register a software interrupt
  thread via sinthand_add(), you get back a struct intrhand that you pass
  to sched_swi() when you wish to schedule your swi thread to run.
- Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit
  more intuitive.  Also, prefix all the members of struct intrhand with
  'ih_'.
- Make swi_net() a MI function since there is now no point in it being
  MD.

Submitted by:	cp
2000-10-25 05:19:40 +00:00
David E. O'Brien
780ba1bcc0 * Update comments
* convert decimal constants to hex
Submitted by:	bde

* Add ISO-C99 long long limits
2000-10-24 10:48:50 +00:00
Sergey Babkin
821c54a1eb Added lines for the wds driver.
Approved by:	gibbs
2000-10-24 03:38:28 +00:00
John Baldwin
a555b1468d Don't dink with interrupts in vm_page_zero_idle(). This code assumed it
was being called with interrupts disabled, when it was actually being called
with them enabled.

Pointed out by:	tegge
2000-10-23 23:32:36 +00:00
Matt Jacob
eb661345a9 Move bogus proc reference stuff into <machine/globals.h>. There is no
more include file including <sys/proc.h>, but there still is this wonky
and (causes warnings on i386) reference in globals.h.

CURTHD is now defined in <machine/globals.h> as well. The correct thing
to do is provide a platform function for this.
2000-10-23 18:36:03 +00:00
Noriaki Mitsunaga
ae94720d12 Add PC-Card/ISA SCSI host adpater drivers from NetBSD/pc98
(a NetBSD port for NEC PC-98x1 machines). They are ncv for NCR 53C500,
nsp for Workbit Ninja SCSI-3, and stg for TMC 18C30 and 18C50.

I thank NetBSD/pc98 and bsd-nomads people.

Obtained from:	NetBSD/pc98
2000-10-23 12:55:51 +00:00
Poul-Henning Kamp
416282b562 Get rid of the last traces of ACTUALLY_LKM_NOT_KERNEL 2000-10-23 08:35:41 +00:00
Yoshihiro Takahashi
97ae0fe84c Moved prototypes of isa_alloc_resourcev() and isa_load_resourcev() to
isa/isavar.h, and added needed includes.
2000-10-22 16:48:08 +00:00
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
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
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
Hellmuth Michaelis
8ccc600fa4 Add ifpnp driver to list of i4b hardware drivers. 2000-10-18 09:16:30 +00:00
Hellmuth Michaelis
5682901b52 Add a debug flag bit for a new driver. 2000-10-18 08:39:24 +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
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
29f0d43398 Add types and prototypes.
Submitted by: msmith
2000-10-16 19:49:30 +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
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
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
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
Yoshihiro Takahashi
6bf6c91f5d Fixed warnings. 2000-10-15 04:54:17 +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
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
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
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
9fa3f7b0f2 Update the wi driver to use mutexes instead of spls. 2000-10-13 20:33:24 +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
Archie Cobbs
46aa8b9b41 Add missing option NETGRAPH_ETHER.
PR:		kern/20288
2000-10-12 17:51:24 +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
00d8d16417 Don't depend on <machine/cpufunc.h> unnecessarily including <machine/lock.h>. 2000-10-12 16:15:24 +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
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
Hellmuth Michaelis
3374f8cc7d correct "device iwic0" to "device iwic" 2000-10-10 14:23:04 +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
Dag-Erling Smørgrav
e57416dc56 Mark directories as directories, not as regular files. 2000-10-10 12:32:44 +00:00
Hellmuth Michaelis
31a539a5bd update to i4b version 0.95.04 2000-10-09 15:41:15 +00:00
Hellmuth Michaelis
7b22f87786 update to i4b version 0.95.04 2000-10-09 13:18:17 +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
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
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
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
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
Poul-Henning Kamp
4bcd76bdd9 Cy driver doesn't compile and nobody seems to care. 2000-10-07 10:07:36 +00:00
KATO Takenori
f16d554272 Caught up with the changes in interruption stuff. 2000-10-07 06:01:38 +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
3ed78c6696 - Include opt_vesa.h in vesa.c so that the VESA_DEBUG option is actually
propagated from the kernel config file to the source.
- Add some more debug messages to list each mode that is rejected or found.
2000-10-06 01:43:59 +00:00
Archie Cobbs
3c5656bf03 Driver for the Intel 82801AA (ICH) SMBus controller and compatibles.
Obtained from:	Whistle source tree
2000-10-06 00:09:46 +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
John Baldwin
1219828400 - Remove somewhat bogus handling of the Giant mutex in the vm86 code.
- Add a vm86pcb_lock mutex that is used to lock the vm86pcb used when
  making a vm86 call.
2000-10-05 20:27:45 +00:00
Jason Evans
645b8b81f0 Reduce userland namespace polution. 2000-10-04 01:21:58 +00:00
Jason Evans
d389654761 Fix spelling error ("exits" should be "exists"). 2000-10-04 01:20:49 +00:00
Bill Paul
41f7d2d51b Add the pcn device to NEWCARD and NOTES. 2000-10-03 18:30:15 +00:00
Søren Schmidt
a9763f0a52 Add ATA_ENABLE_TAGS options description 2000-10-03 15:00:11 +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
Mitsuru IWASAKI
6a8954b084 Fix StallOp implementaion. I've noticed that StallOp corresponds to
OsdSleepUsec(), SleepOp corresponds to OsdSleep() by reading ACPICA
source code.
 - Add OsdSleepUsec() which uses DELAY() simply.
 - Change unit of acpi_sleep() argument; microseconds to milliseconds.
2000-10-02 08:58:50 +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
2da5dbec3e Put on my nuclear-grade asbestos suit and cvs rm the old, broken, sound
drivers (again).  These drivers have not compiled for 5-6 months.
Now that the new sound code supports MIDI, the major reason we had for
reviving it is gone.  It is a far better investment polishing the new
midi code than trying to keep this on life support.  Come 5.0-REL, if
there are major shortcomings in the pcm sound driver then maybe we can
rethink this, but until then we should focus on pcm.

Remember, these have not been compilable since ~April-May this year.
2000-10-02 03:13:50 +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
Mitsuru IWASAKI
3ffcacc9d8 Remove ACPI_NO_OSDFUNC_INLINE option from kernel configuration. Now
that it's enabled in acpireg.h only if DIAGNOSTIC option is specified.
ACPICA OSD functions will be compiled in machine/acpi_machdep.c again
tentatively (if DIAGNOSTIC option is specified).
# Should we have acpica_osd.c ?
2000-10-01 08:17:47 +00:00
Mitsuru IWASAKI
240474e6a9 One more update against header file name changing. 2000-10-01 06:55:17 +00:00
Mitsuru IWASAKI
3ea2027588 - Add acpi_disable_events() and set it with EVENTHANDLER_REGISTER in order to
avoid power on again problem after acpi_soft_off() calling.
 - Implement SleepOp/StallOp in AML interpreter.  Also provide ACPICA
   compatibility.
 - Minor changes on __inline function declaration in acpica_osd.h
   (obtained from NetBSD porting).
2000-09-30 22:37:24 +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
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
Mitsuru IWASAKI
ff3f2f5ca4 Document the pmtimer driver.
Pointed-out by:	esu@yk.rim.or.jp (Shinya Esu)
2000-09-26 11:27:30 +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
Mitsuru IWASAKI
1653e9c321 Formatting fix on ACPI options. Sort them, comment out negative options.
Suggested by:	bde
2000-09-25 02:43:51 +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
Mitsuru IWASAKI
fe44e2ea94 Fix LINT breakage by options ACPI_NO_OSDFUNC_INLINE.
Also space/tab-fix in NOTE.
Grrr, my bad.

Pointed-out by:	eivind
2000-09-21 13:01:19 +00:00
John Baldwin
1fe4c660db Add in and document two new debugging options used in the mutex code:
SMP_DEBUG and WITNESS.
2000-09-21 06:56:11 +00:00
John Baldwin
c508c1b632 Add in documentation and examples of the KTR kernel config options.
Prompted by:	phk's kernel include script
2000-09-21 06:50:02 +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
Mike Smith
ead270f1e3 Mention the AAC_COMPAT_LINUX option 2000-09-19 23:56:27 +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
Eivind Eklund
c16dc61bd2 Document ENABLE_VFS_IOOPT 2000-09-19 10:36:19 +00:00
Jonathan Lemon
8343765bcb Allow the user to make direct BIOS intcalls (via vm86 system) if they
successfully authenticate as root via the suser() call.
2000-09-19 03:27:31 +00:00
Dag-Erling Smørgrav
cd595ef506 Fix cut'n'paste bogon.
Submitted by:	Jim Pirzyk <Jim.Pirzyk@disney.com>
2000-09-18 17:46:01 +00:00
Bruce Evans
21144e2fde Brought back schedsofttty() (SMPng casualty). Didn't bring back the
other schedsoft*() functions since they have never been used.

Removed confused comment about not needing these functions.  The
functions delay scheduling of SWIs until the next hardclock tick.
For devices that only deliver a few characters per interrupt, this
reduces the number of calls to the scheduler by a large factor (about
115 for each sio port at 115200 bps).
2000-09-17 16:37:30 +00:00
Poul-Henning Kamp
2404c3f99d Make LINT link.
cy driver is broken post SMPng.
2000-09-16 19:04:24 +00:00
Poul-Henning Kamp
c866ec47e3 Make LINT compile. 2000-09-16 18:55:05 +00:00
Poul-Henning Kamp
3045b21279 Make LINT compile. 2000-09-16 18:48:11 +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
Mitsuru IWASAKI
215e338b51 Add pmtimer instance. 2000-09-14 22:39:14 +00:00
Mitsuru IWASAKI
2bfb7205bf Add Timer device driver for power management events.
The code for suspend/resume is derived from APM device driver.

Some people suggested the original code is somewhat buggy, but I'd
like to just move it from apm.c without any major changes for the
initial version.  This code should be refined later.

To use pmtimer to adjust time at resume time, add
	device	pmtimer
in your kernel config file, and add
	hint.pmtimer.0.at="isa"
in your device.hints

Reviewed by:	-current, bde
2000-09-14 22:34: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
Yoshihiro Takahashi
b14d7dac8a - Newbus'ify and bus_space'ify.
- Separate bus dependent part and independent part.
- Moved source files to sys/dev/fe (repo copied).
- Fixed some comments by chi@bd.mbn.or.jp (Chiharu Shibata)

Tested by:	bsd-nomads@clave.gr.jp and
		FreeBSD98-testers@jp.freebsd.org
2000-09-14 12:02:07 +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
553427fc01 Take out some unneeded debugging code and re-enable panic()'ing if we spin
on a spin lock for more then 5 seconds.
2000-09-13 00:41:34 +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
Semen Ustimenko
eed59f52da Sign tx driver as using miibus code. 2000-09-11 20:10:16 +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
Mark Murray
452d07c1ce Provide keyboard entropy harvesting for PCVT users. 2000-09-10 14:31:40 +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
Alexander Langer
5d4850e720 Add a comment, that a LINT file can be produced from NOTES via
``make LINT''.

Reviewed by:	nbm via IRC
2000-09-09 16:33:48 +00:00
Dag-Erling Smørgrav
fecfecfbd0 Remove unused variables. 2000-09-09 14:35:35 +00:00
Dag-Erling Smørgrav
ddc0b9925d Add stat, uptime and version.
Note that version currently returns the first line of the version string
from vers.c, which is not quite what a Linux system would return.
2000-09-09 11:44:58 +00:00