Commit Graph

10022 Commits

Author SHA1 Message Date
Alan Cox
c6bf9f0455 Add pmap locking to pmap_object_init_pt(). 2004-07-31 06:42:05 +00:00
Alan Cox
a087914310 Advance the state of pmap locking on alpha, amd64, and i386.
- Enable recursion on the page queues lock.  This allows calls to
   vm_page_alloc(VM_ALLOC_NORMAL) and UMA's obj_alloc() with the page
   queues lock held.  Such calls are made to allocate page table pages
   and pv entries.
 - The previous change enables a partial reversion of vm/vm_page.c
   revision 1.216, i.e., the call to vm_page_alloc() by vm_page_cowfault()
   now specifies VM_ALLOC_NORMAL rather than VM_ALLOC_INTERRUPT.
 - Add partial locking to pmap_copy().  (As a side-effect, pmap_copy()
   should now be faster on i386 SMP because it no longer generates IPIs
   for TLB shootdown on the other processors.)
 - Complete the locking of pmap_enter() and pmap_enter_quick().  (As of now,
   all changes to a user-level pmap on alpha, amd64, and i386 are performed
   with appropriate locking.)
2004-07-29 18:56:31 +00:00
Poul-Henning Kamp
0658bb8ef8 Move a relic to its correct location(s): Put nfs diskless initialization
calls with the code they call.  (Yet another example of mindless copy&paste).
2004-07-28 21:54:57 +00:00
Alexander Kabaev
24a06d1874 Avoid casts as lvalues. While here, avoid storing 32bit quantities in
16bit locations.
2004-07-28 06:32:28 +00:00
Robert Watson
1a8cfbc450 Pass a thread argument into cpu_critical_{enter,exit}() rather than
dereference curthread.  It is called only from critical_{enter,exit}(),
which already dereferences curthread.  This doesn't seem to affect SMP
performance in my benchmarks, but improves MySQL transaction throughput
by about 1% on UP on my Xeon.

Head nodding:	jhb, bmilekic
2004-07-27 16:41:01 +00:00
Tim J. Robbins
7ee771aa57 Use file2c instead of a combination of hexdump, sed and shell script to
generate the wakecode[] array from acpi_wakecode.bin. The old method was
not safe in multibyte locales.
2004-07-27 01:33:27 +00:00
Nate Lawson
6edc660c09 Get the acpi softc via the devclass, not by caching the device. Replace
apm_softc with a single integer since the whole softc is not used.
2004-07-24 22:41:30 +00:00
Nate Lawson
be22348065 Whitespace cleanup and move static variables together. 2004-07-24 20:40:02 +00:00
Nate Lawson
b4cb140233 Remove unneeded parens and fix whitespace. 2004-07-24 20:39:25 +00:00
Scott Long
17ee0667eb Arg! Revert local changes that were accidentlly included in the previous
version.
2004-07-22 15:55:03 +00:00
Scott Long
7c06f85c31 Don't count needed bounce pages if loading a buffer that was created with
bus_dmamem_alloc()

Submitted by: harti
2004-07-22 15:46:51 +00:00
Olivier Houchard
e1021dde8b Using NULL as a malloc type when calling contigmalloc() is wrong, so introduce
a new malloc type, and use it.
2004-07-21 15:52:34 +00:00
Yoshihiro Takahashi
ee6020c993 Add the ACPI Panasonic extras driver.
Submitted by:	OGAWA Takaya <t-ogawa@triaez.kaisei.org> and nyan
2004-07-21 14:47:54 +00:00
Marcel Moolenaar
fd32d93b97 Unify db_stack_trace_cmd(). All it did was look up the thread given
the thread ID and call db_trace_thread().
Since arm has all the logic in db_stack_trace_cmd(), rename the
new DB_COMMAND function to db_stack_trace to avoid conflicts on
arm.
While here, have db_stack_trace parse its own arguments so that
we can use a more natural radix for IDs. If the ID is not a thread
ID, or more precisely when no thread exists with the ID, try if
there's a process with that ID and return the first thread in it.
This makes it easier to print stack traces from the ps output.

requested by: rwatson@
tested on: amd64, i386, ia64
2004-07-21 05:07:09 +00:00
David Xu
2396628bb4 Make end of frames for KSE thread, for system scope thread, without this
change, debugger will dump a weird stack backtrace.
2004-07-20 01:38:59 +00:00
John Baldwin
788195c186 As a temporary hack, turn off deferred preemptions that are the result of
a fast interrupt handler doing an swi_sched().  This fixed the lockups I
saw on my laptop when using xmms in KDE and on rwatson's MySQL benchmarks
on SMP.  This will eventually be removed and/or modified when I figure out
what the root cause is and fix that.
2004-07-19 16:37:47 +00:00
David Schultz
479f8d2214 Make FLT_ROUNDS correctly reflect the dynamic rounding mode. 2004-07-19 08:17:25 +00:00
Mike Silbersack
4ca037c6c8 Add a #error requiring KDB if DDB is specified. (This can probably be
relocated to a better place, if one exists.)
2004-07-19 02:46:34 +00:00
Alan Cox
aec86de47b Utilize pmap_pte_quick() rather than pmap_pte() in pmap_protect(). The
reason being that pmap_pte_quick() requires the page queues lock, which is
already held, rather than Giant.
2004-07-18 21:19:10 +00:00
Maxim Konovalov
aa355a2679 In -CURRENT pseudo devices are not statically assigned at compile time,
remove a stale comment.

PR:		kern/62285
2004-07-18 09:03:12 +00:00
Alan Cox
b73cfbb3e4 Remedy my omission of one change in the prevision revision: pmap_remove()
must pin the current thread in order to call pmap_pte_quick().
2004-07-17 23:44:59 +00:00
Alan Cox
c9829537f4 - Utilize pmap_pte_quick() rather than pmap_pte() in pmap_remove() and
pmap_remove_page().  The reason being that pmap_pte_quick() requires
   the page queues lock, which is already held, rather than Giant.
 - Assert that the page queues lock is held in pmap_remove_page() and
   pmap_remove_pte().
2004-07-17 22:20:53 +00:00
Poul-Henning Kamp
672c05d49c Preparation commit for the tty cleanups that will follow in the near
future:

rename ttyopen() -> tty_open() and ttyclose() -> tty_close().

We need the ttyopen() and ttyclose() for the new generic cdevsw
functions for tty devices in order to have consistent naming.
2004-07-15 20:47:41 +00:00
Alan Cox
3d2e54c317 Push down the acquisition and release of the page queues lock into
pmap_protect() and pmap_remove().  In general, they require the lock in
order to modify a page's pv list or flags.  In some cases, however,
pmap_protect() can avoid acquiring the lock.
2004-07-15 18:00:43 +00:00
John Baldwin
fe96955252 Fix a typo in a comment. 2004-07-15 16:37:48 +00:00
Poul-Henning Kamp
3e019deaed Do a pass over all modules in the kernel and make them return EOPNOTSUPP
for unknown events.

A number of modules return EINVAL in this instance, and I have left
those alone for now and instead taught MOD_QUIESCE to accept this
as "didn't do anything".
2004-07-15 08:26:07 +00:00
John Baldwin
0c9cb34441 Correct bounds check in lapic_create().
Submitted by:	"Ted Unangst" tedu at coverity.com
2004-07-14 18:12:15 +00:00
Poul-Henning Kamp
ec712659ef Desupport M-Systems DiskOnChip driver "fla" 2004-07-13 17:43:03 +00:00
Warner Losh
4b5239229c oldcard's card device no longer requires a count 2004-07-13 16:11:34 +00:00
David Xu
53dbf30349 Add ptrace_clear_single_step(), alpha already has it for years, the function
will be used by ptrace to clear a thread's single step state.
2004-07-13 07:22:56 +00:00
Alan Cox
ce8da3091f Push down the acquisition and release of the page queues lock into
pmap_remove_pages().  (The implementation of pmap_remove_pages() is
optional.  If pmap_remove_pages() is unimplemented, the acquisition and
release of the page queues lock is unnecessary.)

Remove spl calls from the alpha, arm, and ia64 pmap_remove_pages().
2004-07-13 02:49:22 +00:00
Marcel Moolenaar
45cfc0a914 Partially revert previous commit. Calling getit() unconditionally fixed
a problem that could also be fixed differently without reverting previous
attempts to fix DELAY while the debugger is active (rev 1.204). The bug
was that the i8254 implements a countdown timer, while for (k)db_active
a countup timer was implemented. This resulted in premature termination
and consequently the breakage of DELAY. The fix (relative to rev 1.211)
is to implement a countdown timer for the kdb_active case. As such the
ability to step clock initialization is preserved and DELAY does what is
expected of it.

Blushed: bde :-)
Submitted by: bde
2004-07-11 17:50:59 +00:00
Marcel Moolenaar
8bcb1e9e84 Add options KDB and GDB. KDB takes on the function of what DDB used
to be. Both DDB and GDB specify which KDB backends to include.
2004-07-11 03:20:09 +00:00
Marcel Moolenaar
1ca618fcaa Remove the now unused GDB stubs. See src/sys/gdb/* for the new KDB
backend.
2004-07-11 01:47:26 +00:00
Marcel Moolenaar
37224cd3fc Mega update for the KDB framework: turn DDB into a KDB backend.
Most of the changes are a direct result of adding thread awareness.
Typically, DDB_REGS is gone. All registers are taken from the
trapframe and backtraces use the PCB based contexts. DDB_REGS was
defined to be a trapframe on all platforms anyway.
Thread awareness introduces the following new commands:
	thread X	switch to thread X (where X is the TID),
	show threads	list all threads.

The backtrace code has been made more flexible so that one can
create backtraces for any thread by giving the thread ID as an
argument to trace.

With this change, ia64 has support for breakpoints.
2004-07-10 23:47:20 +00:00
Marcel Moolenaar
3875c9304a Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
o  Declare ksym_start and ksym_end as extern and initialize them.
   This was previously and bogusly handled by DDB itself.
o  Call kdb_enter() instead of Debugger().
o  Remove implementation of Debugger().
2004-07-10 22:47:06 +00:00
Marcel Moolenaar
7f46949fdf Call getit() unconditionally and only grab clock_lock when the
debugger is not active. The fixes breakages of DELAY() when
running in the debugger, because not calling getit() when the
debugger is active yields a DELAY that doesn't.
2004-07-10 22:16:18 +00:00
Marcel Moolenaar
6c29a22f1f Update for the KDB framework:
o  s/ddb_on_nmi/kdb_on_nmi/g
o  Rename sysctl machdep.ddb_on_nmi to machdep.kdb_on_nmi
o  Make debugging support conditional upon KDB instead of DDB.
o  Call kdb_reenter() when kdb_active is non-zero.
o  Call kdb_trap() to enter the debugger when not already active.
o  Update comments accordingly.
o  Remove misplaced prototype of kdb_trap().
2004-07-10 22:11:14 +00:00
Marcel Moolenaar
89cf7c254d Update for the KDB framework:
o  Make debugging code conditional upon KDB instead of DDB.
o  Call kdb_enter() instead of Debugger().
o  Remove local (static) variable in_debugger. Use kdb_active instead.
2004-07-10 21:24:36 +00:00
Marcel Moolenaar
5a39cbaf69 Implement makectx(). The makectx() function is used by KDB to create
a PCB from a trapframe for purposes of unwinding the stack. The PCB
is used as the thread context and all but the thread that entered the
debugger has a valid PCB.
This function can also be used to create a context for the threads
running on the CPUs that have been stopped when the debugger got
entered. This however is not done at the time of this commit.
2004-07-10 19:56:00 +00:00
Marcel Moolenaar
cbc174356c Introduce the KDB debugger frontend. The frontend provides a framework
in which multiple (presumably different) debugger backends can be
configured and which provides basic services to those backends.
Besides providing services to backends, it also serves as the single
point of contact for any and all code that wants to make use of the
debugger functions, such as entering the debugger or handling of the
alternate break sequence. For this purpose, the frontend has been
made non-optional.
All debugger requests are forwarded or handed over to the current
backend, if applicable. Selection of the current backend is done by
the debug.kdb.current sysctl. A list of configured backends can be
obtained with the debug.kdb.available sysctl. One can enter the
debugger by writing to the debug.kdb.enter sysctl.
2004-07-10 18:40:12 +00:00
Marcel Moolenaar
72d44f31a6 Introduce the GDB debugger backend for the new KDB framework. The
backend improves over the old GDB support in the following ways:
o  Unified implementation with minimal MD code.
o  A simple interface for devices to register themselves as debug
   ports, ala consoles.
o  Compression by using run-length encoding.
o  Implements GDB threading support.
2004-07-10 17:47:22 +00:00
Brian Somers
0ac4013324 Change the following environment variables to kernel options:
bootp -> BOOTP
    bootp.nfsroot -> BOOTP_NFSROOT
    bootp.nfsv3 -> BOOTP_NFSV3
    bootp.compat -> BOOTP_COMPAT
    bootp.wired_to -> BOOTP_WIRED_TO

- i.e. back out the previous commit.  It's already possible to
pxeboot(8) with a GENERIC kernel.

Pointed out by: dwmalone
2004-07-08 22:35:36 +00:00
Brian Somers
59e1ebc9b5 Change the following kernel options to environment variables:
BOOTP -> bootp
    BOOTP_NFSROOT -> bootp.nfsroot
    BOOTP_NFSV3 -> bootp.nfsv3
    BOOTP_COMPAT -> bootp.compat
    BOOTP_WIRED_TO -> bootp.wired_to

This lets you PXE boot with a GENERIC kernel by putting this sort of thing
in loader.conf:

    bootp="YES"
    bootp.nfsroot="YES"
    bootp.nfsv3="YES"
    bootp.wired_to="bge1"

or even setting the variables manually from the OK prompt.
2004-07-08 13:40:33 +00:00
Poul-Henning Kamp
ddb81ab1c6 Fix an oversight in r1.26: remove #ifdef around necessary variable.
Spotted by:	philip
2004-07-07 20:02:30 +00:00
Alan Cox
26a965568d Simplify the control flow in pmap_extract(), enabling the elimination of a
PMAP_UNLOCK() call.
2004-07-07 16:47:58 +00:00
Alan Cox
03c0ca74ee White space and style changes only. 2004-07-07 02:23:46 +00:00
Nate Lawson
52702e98d2 Use the proper type and then cast on assignment. This fixes warning when
building with -O2.
2004-07-06 04:56:31 +00:00
Alan Cox
c9a217d2ed Style changes to pmap_extract(). 2004-07-06 02:33:11 +00:00
Poul-Henning Kamp
91ea86d7e8 Something funny happened on the way to the floppy driver today...
When two drivers share an ISA DMA channel, they both call isa_dmainit()
and the second call fails if DIAGNOSTIC is on.

If isa_dmainit() was already called successfully, just return silently.

This only works if both drivers agree on the bounce buffer size,
but since sharing DMA is usually only possible on very special
hardware and then typically only for devices of the same type (which
would have multiple instances of the same device driver), this is
not a problem in practice.
2004-07-05 20:37:42 +00:00
Warner Losh
c928d0b956 Remove now obsolete port assignments and sizes. These more properly
belong in the respective drivers.  I've not removed ALL of them, as a
few still haven't moved.  I've just removed the ones that aren't used.

# these can be removed from amd64, but I'm having issues getting to
# sledge at the moment for a build.
2004-07-05 18:39:30 +00:00
Stefan Farfeleder
5908d366fb Consistently use __inline instead of __inline__ as the former is an empty macro
in <sys/cdefs.h> for compilers without support for inline.
2004-07-04 16:11:03 +00:00
Warner Losh
8b68b82381 Don't define __RMAN_RESOURCE_VISISBLE. They aren't needed here after
I've converted the direct accessing of struct resource members to the
preferred interface.
2004-07-03 20:11:49 +00:00
Scott Long
b524342941 Commit the first of half of changes that allow busdma to transparently
honor the alignment and boundary constraints in the dma tag when loading
buffers.  Previously, these constraints were only honored when allocating
memory via bus_dmamem_alloc().  Now, bus_dmamap_load() will automatically
use bounce buffers when needed.

Also add a set of sysctls to monitor the global busdma stats.  These are:

hw.busdma.free_bpages
hw.busdma.reserved_bpages
hw.busdma.active_bpages
hw.busdma.total_bpages
hw.busdma.total_bounced
hw.busdma.total_deferred
2004-07-03 18:18:36 +00:00
John Baldwin
0c0b25ae91 Implement preemption of kernel threads natively in the scheduler rather
than as one-off hacks in various other parts of the kernel:
- Add a function maybe_preempt() that is called from sched_add() to
  determine if a thread about to be added to a run queue should be
  preempted to directly.  If it is not safe to preempt or if the new
  thread does not have a high enough priority, then the function returns
  false and sched_add() adds the thread to the run queue.  If the thread
  should be preempted to but the current thread is in a nested critical
  section, then the flag TDF_OWEPREEMPT is set and the thread is added
  to the run queue.  Otherwise, mi_switch() is called immediately and the
  thread is never added to the run queue since it is switch to directly.
  When exiting an outermost critical section, if TDF_OWEPREEMPT is set,
  then clear it and call mi_switch() to perform the deferred preemption.
- Remove explicit preemption from ithread_schedule() as calling
  setrunqueue() now does all the correct work.  This also removes the
  do_switch argument from ithread_schedule().
- Do not use the manual preemption code in mtx_unlock if the architecture
  supports native preemption.
- Don't call mi_switch() in a loop during shutdown to give ithreads a
  chance to run if the architecture supports native preemption since
  the ithreads will just preempt DELAY().
- Don't call mi_switch() from the page zeroing idle thread for
  architectures that support native preemption as it is unnecessary.
- Native preemption is enabled on the same archs that supported ithread
  preemption, namely alpha, i386, and amd64.

This change should largely be a NOP for the default case as committed
except that we will do fewer context switches in a few cases and will
avoid the run queues completely when preempting.

Approved by:	scottl (with his re@ hat)
2004-07-02 20:21:44 +00:00
Scott Long
c0daeb2592 Remove stray i386 math emulator references. 2004-07-01 22:18:06 +00:00
Yoshihiro Takahashi
7f1fb91a0a This needs __RMAN_RESOURCE_VISIBLE if PC98 is defined. 2004-07-01 09:36:31 +00:00
John Baldwin
39981fed82 Trim a few things from the dmesg output and stick them under bootverbose to
cut down on the clutter including PCI interrupt routing, MTRR, pcibios,
etc.

Discussed with:	USENIX Cabal
2004-07-01 07:46:29 +00:00
John Baldwin
0d7f466944 As per discussion at today's developer summit, add a comment to NOTES
indicating that 80386 support is deprecated and will be removed in
6.0-RELEASE.

Ok'd by:	rwatson, scottl
2004-07-01 06:02:32 +00:00
Warner Losh
0363a12688 Hide struct resource and struct rman. You must define
__RMAN_RESOURCE_VISIBLE to see inside these now.

Reviewed by: dfr, njl (not njr)
2004-06-30 16:54:10 +00:00
Nate Lawson
1a26ea7f2c Add machdep quirks functions. On i386, this disables acpi on systems with
BIOS dates earlier than Jan 1, 1999.  Add prototypes and quirks flags.
2004-06-30 04:42:29 +00:00
Peter Wemm
1b74731b83 Fix leftover argument to pmap_unuse_pt(). I committed the wrong diff.
Submmitted by:  Jon Noack <noackjr@alumni.rice.edu>
2004-06-30 01:43:23 +00:00
Nate Lawson
3ed1dfa11d Update for acpi_id_probe() 2004-06-29 19:05:20 +00:00
Peter Wemm
654bd0e802 Reduce the size of pv entries by 15%. This saves 1MB of KVA for mapping
pv entries per 1GB of user virtual memory.  (eg: if we had 1GB file was
mmaped into 30 processes, that would theoretically reduce the KVA demand by
30MB for pv entries.  In reality though, we limit pv entries so we don't
have that many at once.)

We used to store the vm_page_t for the page table page.  But we recently
had the pa of the ptp, or can calculate it fairly quickly.  If we wanted
to avoid the shift/mask operation in pmap_pde(), we could recover the
pa but that means we have to store it for a while.

This does not measurably change performance.

Suggested by:  alc
Tested by:  alc
2004-06-29 15:57:05 +00:00
Warner Losh
dc7949f45f bde points out that this can't do anything useful. The full patch has
other parts that I can't locat at the moment, so back it out until I can.
2004-06-28 05:37:22 +00:00
Warner Losh
f465e257e2 When opening /dev/io, preserve iopl properly. Otherwise, if you open
/dev/io multiple times, the first close remove the privs.
2004-06-28 03:16:32 +00:00
Warner Losh
cb490814b9 remove needless blankline 2004-06-28 03:08:17 +00:00
Warner Losh
15442f461b Use APM_UNKNOWN instead of 0xff. Use ~0U instead 0 for the number of
batteries.  This should be -1 to match other code, but since the api
is unsigned ~0U is the same thing.
2004-06-28 02:38:20 +00:00
Alan Cox
df68e345c5 In case pmap_extract_and_hold() is ever performed on a different pmap than
the current one, we need to pin the current thread to its CPU.

Submitted by:	tegge@
2004-06-26 19:10:12 +00:00
David E. O'Brien
13a0a973c6 Add casts so all these quantities are a constant type. 2004-06-24 02:24:39 +00:00
John Baldwin
2fc3727323 Finally implement bus_config_intr() support for I/O APIC interrupt sources.
This should fix problems with older SMP systems that only have ISA/EISA
IRQs when routing virgin PCI interrupts as well as on other boxes whose
MADT does not have any interrupt override entries for ISA IRQs that are
used to route PCI interrupts even in APIC mode.
2004-06-23 18:11:33 +00:00
John Baldwin
a7cd01df0e Fetch the actual acpi0 device_t and use device_is_attached() to see if
it's alive rather than trying to fetch its softc pointer via its devclass.

Glanced at by:	imp, njl
2004-06-23 17:59:01 +00:00
Brooks Davis
14b3b2933d el(4) stopped needing to me a count device in December 2000. 2004-06-23 17:33:25 +00:00
John Baldwin
96d3b93753 Various cleanups in support of a future ioapic_config_intr() function:
- Allow ioapic_set_{nmi,smi,extint}() to be called multiple times on the
  same pin so long as the pin's mode is the same as the mode being
  requested.
- Add a notion of bus type for the interrupt associated with interrupt pin.
  This is needed so that we can force all EISA interrupts to be active high
  in the forthcoming ioapic_config_intr().
- Fix a bug for EISA systems that didn't remap IRQs.  This would have broken
  EISA systems that tried to disable mixed mode for IRQ 0.
2004-06-23 15:29:20 +00:00
Bruce M Simpson
8a32d6f08e MFamd64: Document the machdep.hlt_cpus sysctl MIB variable.
PR:		i386/65729
Submitted by:	Craig Rodrigues
2004-06-23 07:12:34 +00:00
Alan Cox
9eb31321cf Implement the protection check required by the pmap_extract_and_hold()
specification.  This enables the elimination of Giant from that function.

Reviewed by:	tegge@
2004-06-22 19:35:43 +00:00
Poul-Henning Kamp
ec66f15d14 Put the pre FreeBSD-2.x tty compat code under BURN_BRIDGES. 2004-06-21 22:57:16 +00:00
Alan Cox
dc8beb5358 - Simplify pmap_remove_pages(), eliminating unnecessary indirection.
- Simplify the locking of pmap_is_modified() by converting control flow to
   data flow.
2004-06-20 20:57:06 +00:00
Alan Cox
1ec4b75936 Add pmap locking to pmap_is_prefaultable(). 2004-06-20 06:11:00 +00:00
Bruce Evans
4c5f10a672 Backed out previous commit. Blind substitution of dev_t by `struct cdev *'
was just wrong here because the dev_t's are user dev_t's.
2004-06-20 03:52:50 +00:00
Bruce Evans
4df7435a78 Include <sys/_lock.h>'s prerequisite <sys/queue.h> before including the
former, not after.
2004-06-20 00:33:14 +00:00
Bruce Evans
6ed979574f Clear any pending exceptions before using frstor (in the non-FXSR case)
in npxsetregs() too.  npxsetregs() must overwrite the previous state, and
it is never paired with an npxgetregs() that would defuse the previous
state (since npxgetregs() would have fninit'ed the state, leaving nothing
to do).

PR:		68058 (this should complete the fix)
Tested by:	Simon Barner <barner@in.tum.de>
2004-06-19 22:24:16 +00:00
Alan Cox
785f2cdf57 Remove unused pt_entry_ts. Remove an unneeded semicolon. 2004-06-19 19:09:08 +00:00
Bruce Evans
83cca9682f Removed foot-shooting setting of CR0_TS in exec_setregs(). It is
unnecessary because cpu_setregs() and/or npxinit() always sets CR0_TS
during system initialization, and CR0_TS is set in the next statement
(fpstate_drop()) if necessary after system initialization.  Setting
it unnecessarily was less than a pessimization since it broke the
invariant that the npx can be used without an npxdna() trap if
fpucurthread is non-null.  The broken invariant became harmful when I
added an fnclex to npxdrop().

Removed setting of CR0_MP in exec_setregs().  This was similarly
unnecessary but was harmless.

Updated comments (mainly by removing them).  Things are simpler now
that we have cpu_setregs() and don't support a math emulator or pretend
to support not having either a math emulator or an npx.

Removed the ifdef for avoiding setting CR0_NE in the !SMP case in
cpu_setregs().  npx_probe() should reverse the setting if it wants to
force IRQ13 exception handling for testing.
2004-06-19 12:28:48 +00:00
Bruce Evans
bd1a3f1a7e Fixed a panic caused by over-optimizing npxdrop() in the non-FXSR case.
frstor can trap despite it being a control instruction, since it bogusly
checks for pending exceptions in the state that it is overwriting.
This used to be a non-problem because frstor was always paired with a
previous fnsave, and fnsave does an implicit fninit so any pending
exceptions only remain live in the saved state.  Now frstor is sometimes
paired with npxdrop() and we must do a little more than just forget
that the npx was used in npxdrop() to avoid a trap later.  This is a
non-problem in the FXSR case because fxrstor doesn't do the bogus check.

FXSR is part of SSE, and npxdrop() is only in FreeBSD-5.x, so this bug
only affected old machines running FreeBSD-5.x.

PR:		68058
2004-06-18 02:10:55 +00:00
Nate Lawson
37c55a039a Revert last change. If acpi is loaded or compiled into the kernel, its
devclass will be present even if the driver was disabled by a hint.  Using
device_get_softc() provides the right info even if it's overkill.

Explained by:	jhb
2004-06-17 17:27:37 +00:00
Alan Cox
d45f21f31a Do not preset PG_BUSY on VM_ALLOC_NOOBJ pages. Such pages are not
accessible through an object.  Thus, PG_BUSY serves no purpose.
2004-06-17 06:16:58 +00:00
Warner Losh
e04ed822be o Return ai_batteries as 0xffffffff instead of -1. This is a nop change, but
placates gcc which seems to like to complain about -1 being assigned to
  an unsigned value.  It is well defined and intended, but since signess bugs
  are being hunted just change to 0xffffffff.
o Mask the lower 8 bits, not the lower 4 bits for the ai_capabilities word.
  All 8 bits are defined and the 0xf was almost certainly a typo.
o Define APM_UNKNOWN to 0xff for emulation layer.
2004-06-16 20:27:50 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Alan Cox
4d831945a7 MFamd64
Introduce pmap locking to many of the pmap functions.
2004-06-16 07:03:15 +00:00
Alan Cox
1e82a3d1f0 MFamd64
Remove dead or unneeded code, e.g., spl calls.
2004-06-16 05:42:44 +00:00
Julian Elischer
fa88511615 Nice, is a property of a process as a whole..
I mistakenly moved it to the ksegroup when breaking up the process
structure. Put it back in the proc structure.
2004-06-16 00:26:31 +00:00
Alan Cox
7b9d474460 Remove a stale comment. 2004-06-15 19:28:40 +00:00
Nate Lawson
591b993b83 s/device_get_handle/acpi_get_handle
Submitted by:	Hiroyuki Aizu
2004-06-15 16:49:20 +00:00
Nate Lawson
f6c8318b0f Catch one more use of acpi_MatchHid and update for new API. 2004-06-15 02:17:23 +00:00
Nate Lawson
345281bc43 We only need the devclass_find() result, not the softc. 2004-06-15 02:12:12 +00:00
John Baldwin
3b7f737e69 Fix a couple of typos.
PR:		doc/67894
Submitted by:	Chris Pepper pepper at reppep dot com
2004-06-14 18:37:23 +00:00
Nate Lawson
7a15653c9c Use the new API for acpi_MatchHid(). The difference between ACPI_HANDLE
and device_t isn't caught by the compiler.
2004-06-14 03:40:56 +00:00
Alan Cox
7881f95056 Prevent the loss of a PG_M bit through an SMP race in pmap_ts_referenced(). 2004-06-13 21:59:42 +00:00
Alan Cox
8559e0a291 - Remove an unused declaration.
- Move a definition inside the scope of a #ifdef _KERNEL.
2004-06-13 03:44:11 +00:00