Commit Graph

1366 Commits

Author SHA1 Message Date
dyoung
35fd1a8bbe Replace some anonymous constants with PCI_ constants.
Print debugging information using aprint_debug(9) not aprint_verbose(9)
and be consistent about that.  Get rid of the pciaddrverbose switch for
debugging printfs.

Make 'static' several functions that are private to this module.

Don't test truth of arbitrary integers but compare with 0.  Change
'return (x)' to 'return x'.
2011-08-28 05:32:41 +00:00
dyoung
aa14fb96d7 Make the override implementation more concise. Saves about three lines
of code per routine, makes it more explicit what's going on, and avoids
recursion, though the compiler probably optimized the tail recursion in
the old code.
2011-08-28 04:59:37 +00:00
dyoung
bd41bd0d2c Use __strict_weak_alias(). 2011-08-28 00:51:21 +00:00
christos
93e326680f use c99 struct initializers 2011-08-27 09:32:11 +00:00
dyoung
f05aa184df Initialize bst_exists in bus_space_tag_create(9). Use it to avoid
walking the chain of ancestor tags to see if a bus_space(9) routine was
overridden.
2011-08-25 15:08:49 +00:00
dyoung
73b6a5effa Add to x86 bus_space_tag_t a member, bst_exists, that tells whether a
routine is overridden by this tag or by any ancestral tag.
2011-08-25 15:06:10 +00:00
jakllsch
08fb9c512d Add rescan support for 'amdtempbus' to x86 pchb(4).
Maybe finally fixes PR#45268.
2011-08-20 20:01:08 +00:00
jakllsch
a99113c4a1 pchb_get_bus_number() is actually public 2011-08-20 19:56:31 +00:00
jakllsch
08c7a716a6 staticification 2011-08-20 19:49:55 +00:00
jakllsch
90aab468c3 We no longer need to #include "rnd.h". 2011-08-20 19:43:47 +00:00
jakllsch
5cf40ee467 We need to initialize the PCI chipset and device tags in the softc for
the suspend and resume handlers.
2011-08-20 19:06:57 +00:00
jakllsch
844442797e Attach amdtemp(4) at pchb(4) instead of in place of pchb(4).
Should fix PR#45268.
2011-08-18 20:55:20 +00:00
dyoung
8062831546 In pci_msi_establish(), replace several anonymous constants with IOAPIC_
symbols.  No change in the generated assembly.
2011-08-17 14:56:55 +00:00
dyoung
6b47091b3b Add definitions from [1] for the I/O APIC's MSI Message Address & Data
registers.

[1] Intel Corporation, Intel 64 and IA-32 Architectures Software
    Developer's Manual, Volume 3A: System Programming Guide, Part 1,
    http://www.intel.com/Assets/PDF/manual/253668.pdf, Chapter 10,
    January, 2011.
2011-08-17 14:55:11 +00:00
dyoung
70183e515a Redefine PCI_MSI_* and PCI_PCIE_* constants in terms of bits(3).
Use named constants and more conventional variable names in
pci_msi_establish() and pci_msi_disestablish().  Fix a couple of bugs:
pci_msi_establish() returned a pointer to the struct intrhand instead of
to the struct msi_hdl as it was intended to, and pci_msi_disestablish()
did not free(9) the msi_hdl.
2011-08-17 00:59:47 +00:00
msaitoh
abdd14be5f Add some LPC entries for Intel 6 series and C20x. 2011-08-14 12:42:19 +00:00
rmind
8ff531f87f Convert few panic() uses to asserts, reduce the scope of variable use.
No functional changes.
2011-08-14 02:31:08 +00:00
christos
ec97828f5a Always provide a meaningful short name for the kobj in the error message,
as well as the function name and the linenumber, without extra line feeds.
2011-08-13 21:04:05 +00:00
cherry
7bd1f7e3fe MP probing and startup code 2011-08-13 12:37:30 +00:00
cherry
92ccc4ea78 Add locking around ops to the hypervisor MMU "queue". 2011-08-13 12:09:38 +00:00
cherry
5d5c189898 Unbreak the build. (conflicting types in function declaration and definition)
Thanks riz@
2011-08-11 20:33:20 +00:00
cherry
3c3a6a3a8e Hide the MD details of specific IPIs behind semantically pleasing functions. This cleans up a couple of #ifdef XEN/#endif pairs 2011-08-11 18:11:17 +00:00
cherry
d7b11fa417 xen ipi infrastructure 2011-08-10 11:39:44 +00:00
cherry
e0e9175da4 Add Xen specific members to struct cpu_info, Add proper per-cpu curcpu() functionality 2011-08-10 06:40:35 +00:00
jmcneill
beb12362eb revert previous 2011-08-08 17:00:23 +00:00
jmcneill
698af758ce If the USE_PLATFORM_CLOCK flag is set in the FADT, it indicates that OSPM
should use a platform provided timer (either HPET or the PM timer). A
platform may set this flag if internal processor clock(s) cannot provide
consistent monotonically non-decreasing counters. Set TSC quality to -100
if this flag is set.
2011-08-08 11:18:34 +00:00
jmcneill
bd79b21e79 x86_reset: use acpi_reset instead of AcpiReset 2011-08-01 11:26:31 +00:00
drochner
f54d17f2c0 add an experimental implementation of PCI MSIs (Message Signaled
Interrupts). Successfully tested with hdaudio and "wpi" wireless
ethernet.
notes:
-There seem to be buggy chips around which announce MSI support
 but don't correctly implement it. Thus the final word whether MSIs
 can be used should be by the driver.
-Only a single vector is supported. For multiple vectors, the IDT
 allocation code would have to be changed. (And we would possibly
 run into problems due to the limited number of vectors supported
 by the current code.)
-The code is "#if NIOAPIC > 0" because it uses the ioapic_edge
 interrupt stubs. These actually don't touch any ioapic, so this
 is somewhat a misnomer.
-MSIs can't be identified by a "pin" but only by a cpu/vector
 pair. Common intr code soesn't deal well with this yet.
-Drivers need to take care of saving/restoring MSI data in the device's
 config space on suspend/resume.
2011-08-01 11:08:03 +00:00
drochner
0ce8c54d89 if checking whether an interrupt is shared, don't compare pin numbers
if it is "-1" -- this is a hack to allow MSIs which don't have a concept
of pin numbers, and are generally not shared
(This doesn't give us sensible event names for statistics display. The
whole abstraction has more exceptions than regular cases, it should
be redesigned imho.)
2011-08-01 10:42:23 +00:00
jmcneill
7e89c84d93 x86_reset: If the FADT defines a reset register and ACPI was active, try
to use it to reset the system before attempting any other methods
2011-07-31 22:43:01 +00:00
jmcneill
2e5784d8be add Family14h (AMD Fusion) support 2011-07-31 22:04:07 +00:00
dyoung
1b847f1e51 Don't shutdown the boostrap processor (BSP) because we may have to run
BIOS methods on it.  For example, ACPI requires that we execute the code
for changing sleep state on the BSP.

This may help the problem where folks' machines would hang instead of
powering off when they entered ACPI sleep state 5.

XXX If the BSP is already shut down, we should start it back up.
2011-07-29 21:21:43 +00:00
yamt
44feae8dc4 - add PCID
- comment
2011-07-26 12:59:41 +00:00
dyoung
9396015d90 Constify bus_space_reserve_subregion() implementation. 2011-07-25 20:34:07 +00:00
dyoung
6f92bd37d6 In _bus_dmamap_load_busaddr(), just return 0 instead of assigning an
intermediate variable (int error = 0;) and returning that (return
error;).
2011-07-25 20:33:20 +00:00
dyoung
f9a358cfdb Good-bye bus.h. Don't install <machine/bus.h>. 2011-07-17 23:38:32 +00:00
jruoho
57c7846186 Do not disable interrupts at machine-level in the MI idle-loop entry. 2011-07-13 07:34:55 +00:00
dyoung
5b0b4c98b3 Bring bus_space_tag_create(9) up-to-date with doco.
Fix overrides of bus_space_unmap(9) et cetera.
2011-07-08 03:23:14 +00:00
dyoung
24e681f5cd Implement bus_space_tag_create() and _destroy().
Factor bus_space_reserve(), bus_space_release(), et cetera out of
bus_space_alloc(), bus_space_map(), bus_space_free(), bus_space_unmap(),
et cetera.

For i386 and amd64, activate the use of <machine/bus_defs.h> and
<machine/bus_funcs.h> by #defining __HAVE_NEW_STYLE_BUS_H in
their respective types.h.  While I'm here, remove unnecessary
__HAVE_DEVICE_REGISTER #defines.
2011-07-06 18:46:04 +00:00
yamt
03e0d01e97 unrelax an assertion 2011-07-05 14:07:12 +00:00
mrg
899d666939 insert some (uintptr_t) between some casts involving pointer to int.
(they already had casts for the pointer.)
2011-07-02 13:09:31 +00:00
dyoung
391925c74f #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 18:21:31 +00:00
dyoung
59adf08e17 Per discussion at
<http://mail-index.netbsd.org/tech-kern/2010/04/02/msg007941.html>,
divide each machine's bus.h into bus_defs.h (constants & data types)
and bus_funcs.h (macro implementations of bus_space(9) routines and MD
prototypes).

Note that some bus_space(9) routines' implementation will move to .c
files from inline subroutines or macros in .h files.

I've only made the split for machine architectures where there is PCI.
All of the non-PCI-having architectures will require a similar split.

These #include files are not referenced by any (committed) Makefiles or
header files, yet.  Changes to Makefiles, to <sys/bus.h>, and to some
more machine-dependent files will dribble in before I throw the switch.
2011-07-01 17:09:58 +00:00
yamt
90a297503a pmap_map_ptes: fix a bug introduced by rmind-uvmplock merge 2011-06-24 01:39:41 +00:00
rmind
aade7fc010 pmap_map_ptes: use cpu_load_pmap() to handle i386 PAE case.
Spotted by cherry@
2011-06-23 16:25:09 +00:00
jruoho
849fd36f5e Fix bug pointed out by njoly@. 2011-06-23 08:10:35 +00:00
jruoho
1adfb1b50e Add small comment. 2011-06-22 09:28:08 +00:00
jruoho
4fb79b4e25 Get rid of RUN_ONCE(9). Should fix PR # kern/44043. 2011-06-22 08:49:54 +00:00
pgoyette
ee17befd6c Initialize sensor state before registering. 2011-06-20 17:07:21 +00:00
jruoho
0301c37913 Use acpi_match_cpu_handle() from acpi_util.c and only evaluate
the _PDC control method for CPUs that are enabled in the MADT.
2011-06-20 15:39:54 +00:00