Commit Graph

10149 Commits

Author SHA1 Message Date
John Baldwin
e367f46738 Add some constants for the local APIC timer. 2004-12-23 20:35:07 +00:00
John Baldwin
21bc8faa44 Add a simple 'intrcnt_add' function that other MD code can use to add a
single named counter to the interrupt counts without having to fake up an
entire interrupt source.
2004-12-23 20:34:18 +00:00
Alan Cox
1f70d62298 Modify pmap_enter_quick() so that it expects the page queues to be locked
on entry and it assumes the responsibility for releasing the page queues
lock if it must sleep.

Remove a bogus comment from pmap_enter_quick().

Using the first change, modify vm_map_pmap_enter() so that the page queues
lock is acquired and released once, rather than each time that a page
is mapped.
2004-12-23 20:16:11 +00:00
John Baldwin
dfa7bc486b - Add a function to set the Task Priority Register (TPR) of the local APIC.
Currently this is only used to initiailize the TPR to 0 during initial
  setup.
- Reallocate vectors for the local APIC timer, error, and thermal LVT
  entries.  The timer entry is allocated from the top of the I/O interrupt
  range reducing the number of vectors available for hardware interrupts
  to 191.  Linux happens to use the same exact vector for its timer
  interrupt as well.  If the timer vector shared the same priority queue
  as the IPI handlers, then the frequency that the timer vector will
  eventually be firing at can interact badly with the IPIs resulting in
  the queue filling and the dreaded IPI stuck panics, hence it being located
  at the top of the previous priority queue instead.
- Fixup various minor nits in comments.
2004-12-23 19:47:59 +00:00
Alan Cox
85f5b24573 In the common case, pmap_enter_quick() completes without sleeping.
In such cases, the busying of the page and the unlocking of the
containing object by vm_map_pmap_enter() and vm_fault_prefault() is
unnecessary overhead.  To eliminate this overhead, this change
modifies pmap_enter_quick() so that it expects the object to be locked
on entry and it assumes the responsibility for busying the page and
unlocking the object if it must sleep.  Note: alpha, amd64, i386 and
ia64 are the only implementations optimized by this change; arm,
powerpc, and sparc64 still conservatively busy the page and unlock the
object within every pmap_enter_quick() call.

Additionally, this change is the first case where we synchronize
access to the page's PG_BUSY flag and busy field using the containing
object's lock rather than the global page queues lock.  (Modifications
to the page's PG_BUSY flag and busy field have asserted both locks for
several weeks, enabling an incremental transition.)
2004-12-15 19:55:05 +00:00
Scott Long
5662cf3c92 Remove a stray critical_exit().
Submitted by: johan
2004-12-13 07:08:44 +00:00
Warner Losh
6c5c0a5ac1 Separate mse driver into a core driver and a bus attachments. Separate out
the ISA and CBUS (called isa on pc98) attachments.  Eliminate all PC98
ifdefs in the process (the driver in pc98/pc98/mse.c was a copy of the one
in i386/isa/mse.c with PC98 ifdefs).  Create a module for this driver.

I've tested this my PC-9821RaS40 with moused.  I've not tested this on i386
because I have no InPort cards, or similar such things.  NEC standardized
on bus mice very early, long before ps/2 mice ports apeared, so all PC-98
machines supported by FreeBSD/pc98 have bus mice, I believe.

Reviewed by: nyan-san
2004-12-12 20:05:50 +00:00
Nate Lawson
bff417fcd3 Only export defined symbols. Note that I couldn't find any difference
between object code generated without the flag but it makes sense and might
make a difference in the future.

PR:		kern/53008
Submitted by:	Jens Rehsack rehsack at liwing de
2004-12-12 06:59:14 +00:00
Nate Lawson
74cce6ca80 Move the author's copyright notice to match the initial LongRun import
now that we have split out this support into longrun.c
2004-12-12 05:53:57 +00:00
Scott Long
245e410ba7 Expand the scope of the critical section in the PCIe read and write methods
on the advice of Alan Cox.
2004-12-10 15:44:12 +00:00
Kelly Yancey
5ad5504c14 If the parent process has the trap bit set (i.e. a debugger had single
stepped the process to the system call), we need to clear the trap flag
from the new frame unless the debugger had set PF_FORK on the parent.
Otherwise, the child will receive a (likely unexpected) SIGTRAP when it
executes the first instruction after returning to userland.

Reviewed by:	bde
MFC after:	3 days
2004-12-08 19:03:55 +00:00
Sam Leffler
e25fd1370f add ath rate control module(s) 2004-12-08 17:40:55 +00:00
Stephan Uphoff
f30a4a1ced Avoid more than two pending IPI interrupt vectors per local APIC
as this may cause deadlocks.

This should fix kern/72123.

Discussed with: jhb
Tested by: Nik Azim Azam, Andy Farkas, Flack Man, Aykut KARA
           Izzet BESKARDES, Jens Binnewies, Karl Keusgen
Approved by:    sam (mentor)
2004-12-07 20:15:01 +00:00
Warner Losh
ff34173f05 NEC PC-98 machines do not have and cannot have an EISA bus. They have
only C-Bus and PCI busses.  Therefore, don't create an eisa0 node on
the legacy bus that can never attach.

PC-98 info verified by: nyan-san
2004-12-07 15:36:19 +00:00
Warner Losh
993fd0c509 PNP BIOS devices are fundamentally different than ISA PNP devices.
These devices should be probed first because they are at fixed
locations and cannot be turned off.  ISA PNP devices, on the other
hand, can be turned off and often can be flexible in the resources
they use.  Probe them last, as always.
2004-12-07 05:30:02 +00:00
Stephan Uphoff
8b902508c8 Move reading the current CPU mask in pmap_lazyfix() to where the thread
is protected from migrating to another CPU.

Approved by:    sam (mentor)
MFC after:      4 weeks
2004-12-07 02:56:14 +00:00
Stephan Uphoff
98399a1760 Allow fast interrupts to cause preemption.
Reviewed by:    jhb, scottl
Approved by:    sam (mentor)
2004-12-06 22:25:01 +00:00
Scott Long
568b7ee1b2 Due to a significant addition of code, add my copyright to this file. Also
note that the PCIe work was made possible due to hardware donations from
the FreeBSD Foundation and Intel.  Thanks!
2004-12-06 18:19:32 +00:00
Scott Long
aa2ea23220 Add support for the memory-mapped PCI Express configuration mechanism. This
actually is a property of the northbridge and applies to all PCI/PCI-X/PCIe
devices in the system, though only PCIe devices will respond to registers
higher than 256.  This uses per-CPU pools of temporary mappings so that
the whole 256MB of configuration space doesn't have to be mapped all at
once.  While the sf_buf API was considered for this, the fact that it
requires sleep locks and can return failure made it unsuitable for this use.

For now only the Intel Grantsdale and Lindenhurst (925 and 752x) chipsets are
supported.  Since there doesn't appear to be a compatible way to determine
northbridge support, new chipsets will have to be explicitely added in the
future.
2004-12-06 08:27:10 +00:00
David E. O'Brien
d512059d0c Enable amr(4) - scottl fixed when used with >4GB RAM. 2004-12-06 02:50:31 +00:00
Alan Cox
4878c3cdba For efficiency move the call to pmap_pte_quick() out of pmap_protect()'s
and pmap_remove()'s inner loop.

Reviewed by: peter@, tegge@
2004-12-02 03:29:17 +00:00
Marcel Moolenaar
bcc5241c43 Change gdb_cpu_setreg() to not take the value to which to set the
specified register, but a pointer to the in-memory representation of
that value. The reason for this is twofold:
1. Not all registers can be represented by a register_t. In particular
   FP registers fall in that category. Passing the new register value
   by reference instead of by value makes this point moot.
2. When we receive a G or P packet, both are for writing a register,
   the packet will have the register value in target-byte order and
   in the memory representation (modulo the fact that bytes are sent
   as 2 printable hexadecimal numbers of course). We only need to
   decode the packet to have a pointer to the register value.

This change fixes the bug of extracting the register value of the P
packet as a hexadecimal number instead of as a bit array. The quick
(and dirty) fix to bswap the register value in gdb_cpu_setreg() as
it has been added on i386 and amd64 can therefore be removed and has
in fact been that.

Tested on: alpha, amd64, i386, ia64, sparc64
2004-12-01 06:40:35 +00:00
Nate Lawson
29fe88d256 Remove now unused variable.
Pointy hat:	njl from nskyline_r35 at yahoo com
2004-11-30 20:07:40 +00:00
Nate Lawson
63a6daf68b MFamd64: Remove the cpu_reset_proxy cruft now that we run boot() on
cpu 0.  Also, restructure cpu_reset to be cleaner (no functional change.)
2004-11-30 06:18:46 +00:00
Scott Long
ee8d8ca5c1 Don't flag alignment constraints as a reason for bouncing. This fixes the
trigger for other misbehaviour in the sym driver that was causing freezes at
boot.  Thanks to phk@ for reporting and testing this.
2004-11-29 14:49:27 +00:00
David Schultz
6004362e66 Don't include sys/user.h merely for its side-effect of recursively
including other headers.
2004-11-27 06:51:39 +00:00
David Schultz
d3adf76902 Axe the semblance of support for PECOFF and Linux a.out core dumps. 2004-11-27 06:46:45 +00:00
Scott Long
4c10e55d26 Remove an extra #include 2004-11-21 06:28:35 +00:00
Scott Long
938eaf8e6b MFC amd64:
Consolidate all of the bounce tests into the BUS_DMA_COULD_BOUNCE flag.
  Allocate the bounce zone at either tag creation or map creation to help
  avoid null-pointer derefs later on.  Track total pages per zone so that
  each zone can get a minimum allocation at tag creation time instead of
  being defeated by mis-behaving tags that suck up the max amount.
2004-11-21 04:43:28 +00:00
David Schultz
0ef5c36ff1 Maintain the broken state of backwards compatibilty for a.out (and
PECOFF!) core dumps.  None of the old versions of gdb I tried were
able to read a.out core dumps before or after this change.

Reviewed by:	arch@
2004-11-20 02:32:04 +00:00
David Schultz
6484fde022 Remove references to U area and garbage collect includes.
Reviewed by:	arch@
2004-11-20 02:30:59 +00:00
David Schultz
ab44ebf537 Remove UAREA_PAGES.
Reviewed by:	arch@
2004-11-20 02:29:50 +00:00
David Schultz
11111b709f U areas are going away, so don't allocate one for process 0.
Reviewed by:	arch@
2004-11-20 02:29:25 +00:00
Scott Long
5932596e0d Revert part of rev 1.57. The tag boundary is honored by splitting the
segment, not by bouncing.
2004-11-19 17:56:22 +00:00
John Baldwin
2d68e3fb92 Initiate deorbit burn sequence for 80386 support in FreeBSD: Remove
80386 (I386_CPU) support from the kernel.
2004-11-16 20:42:32 +00:00
Warner Losh
2adc126b6c Add acpi_sony to the list of drivers that are built. 2004-11-15 19:46:22 +00:00
Warner Losh
c2aed5122b After discussions with Nate, repo copy the acpi assist drivers from
i386 to dev/acpi_support.  In theory, these devices could be found
other than in i386 machines only as amd64 becomes more popular.  These
drivers don't appear to do anything i386 specific, so move them to
dev/acpi_support.  Move config lines to files so that those
architectures that don't support kernel modules can build them into
the kernel.  At the same time, rename acpi_snc to acpi_sony to follow
the lead of all the other specialty devices.
2004-11-15 05:54:15 +00:00
Philip Paeps
078080c965 o Change the strcmp() to a strncmp() to allow us to attach to 'E'
models of laptops, which are essentially the same as the normal
   ones, as far as acpi_asus is concerned[1]

 o Use the above as an excuse to reshuffle the mess I made of the
   probe function when I originally wrote it.

Reported by:	    Soeren Larsen <soeren@whiteswan.dk>
2004-11-12 23:21:19 +00:00
Philip Paeps
03cbfbc51a Minor whitespace nitpicking to reduce my diffs of Real Changes[tm] 2004-11-12 23:06:13 +00:00
John Baldwin
90baa95fad Spell _KERNEL correctly so that UP kernels are actually optimized again.
Submitted by:	pjd
2004-11-12 19:18:46 +00:00
John Baldwin
bd2ed154a1 - Use the SMP style ops for atomic_load/store() in userland so that
libraries and binaries will work on both UP and SMP machines.
- Remove unnecessary gcc memory barrier from the UP atomic_store() op.

Submitted by:	bde
2004-11-12 18:40:22 +00:00
John Baldwin
57621b8b35 - Place the gcc memory barrier hint in the right place in the 80386 version
of atomic_store_rel().
- Use the 80386 versions of atomic_load_acq() and atomic_store_rel() that
  do not use serializing instructions on all UP kernels since a UP machine
  does need to synchronize with other CPUs.  This trims lots of cycles from
  spin locks on UP kernels among other things.

Benchmarked by:	rwatson
2004-11-11 22:42:25 +00:00
Warner Losh
c8c8f27a5d pbio has moved to dev/pbio
Prodded by: peter
2004-11-11 04:53:46 +00:00
Yoshihiro Takahashi
79961ebfcb cosmetic changes. 2004-11-10 12:28:06 +00:00
Scott Long
4ab5ff2747 Zero the tag when it's allocated. Also fix a printf format problem. This
should fix the problems introduced several hours ago.
2004-11-09 16:03:27 +00:00
Scott Long
2162eb2e7c First pass at replacing the single global bounce pool with sub-pools that are
appropriate for different tag requirements.  With the former global pool,
bounce pages might get allocated that are appropriate for one tag, but not
appropriate for another, but the system had no way to distinguish between them.
Now zones with distinct attributes are created to hold pages, and each tag
that requires bouncing is associated with a zone.  New zones are created as
needed if no existing zones can meet the requirements of the tag.  Stats for
each zone are tracked via the hw.busdma sysctl node.

This should help drivers that are failing with mysterious data corruption.

MFC After: 1 week
2004-11-09 07:07:54 +00:00
Philip Paeps
9923cf221b Add support for gadgets on Asus L4R and M6R notebooks. 2004-11-08 16:54:26 +00:00
Alan Cox
d3cb0d99e0 Introduce two new options, "CPU private" and "no wait", to sf_buf_alloc().
Change the spelling of the "catch" option to be consistent with the new
options.  Implement the "no wait" option.  An implementation of the "CPU
private" for i386 will be committed at a later date.
2004-11-08 00:43:46 +00:00
Nate Lawson
f3118682aa Add power profile support so that the LCD changes brightness levels based
on the AC line state.

Submitted by:	OGAWA Takaya <t-ogawa@triaez.kaisei.org>
MFC after:	1 week
2004-11-07 23:18:23 +00:00
Peter Wemm
ffcb357bd1 Begin an invasion of i386-land by amd64.
Expose some of the amd64-specific sysarch functions to allow alternative
implementations of the %fs/%gs code for TLS, threads, etc.  USER_LDT does
not exist on the amd64 kernel, so we have to implement things other ways.
2004-11-06 03:23:36 +00:00