History log of /netbsd-current/sys/arch/x86/acpi/acpi_machdep.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.36 16-Oct-2023 bouyer

Declare
int acpi_md_vesa_modenum;
int acpi_md_vbios_reset;
struct vcons_screen x86_genfb_console_screen;

in genfb_machdep.h instead of locally as extern in various .c files.


# 1.35 24-Jan-2023 riastradh

x86/acpi/acpi_machdep.c: Nix trailing whitespace.

No functional change intended.


Revision tags: netbsd-10-base
# 1.34 28-Oct-2022 riastradh

branches: 1.34.2;
x86/acpi: Mark acpica interrupt handlers MP-safe.

acpica has its own internal locking, and the interrupt handlers we
install with AcpiInstall*Handler (gpe, notify, &c.) also have their
own locking.


Revision tags: bouyer-sunxi-drm-base
# 1.33 20-Aug-2022 riastradh

x86: Split most of pmap.h into pmap_private.h or vmparam.h.

This way pmap.h only contains the MD definition of the MI pmap(9)
API, which loads of things in the kernel rely on, so changing x86
pmap internals no longer requires recompiling the entire kernel every
time.

Callers needing these internals must now use machine/pmap_private.h.
Note: This is not x86/pmap_private.h because it contains three parts:

1. CPU-specific (different for i386/amd64) definitions used by...

2. common definitions, including Xenisms like xpmap_ptetomach,
further used by...

3. more CPU-specific inlines for pmap_pte_* operations

So {amd64,i386}/pmap_private.h defines 1, includes x86/pmap_private.h
for 2, and then defines 3. Maybe we should split that out into a new
pmap_pte.h to reduce this trouble.

No functional change intended, other than that some .c files must
include machine/pmap_private.h when previously uvm/uvm_pmap.h
polluted the namespace with pmap internals.

Note: This migrates part of i386/pmap.h into i386/vmparam.h --
specifically the parts that are needed for several constants defined
in vmparam.h:

VM_MAXUSER_ADDRESS
VM_MAX_ADDRESS
VM_MAX_KERNEL_ADDRESS
VM_MIN_KERNEL_ADDRESS

Since i386 needs PDP_SIZE in vmparam.h, I added it there on amd64
too, just to keep things parallel.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 thorpej-i2c-spi-conf-base
# 1.32 12-May-2021 thorpej

- Define a device call for PCI bus instances to fetch a direct child's
device handle given the device's device/function #s (extracted from
a pcitag_t). Use it to associate the handle with the child device
at config_found() time.
- Implement this device call for ACPI and OpenFirmware.
- Enable the OpenFirmware variant for evbarm FDT, macppc, ofppc, sparc64.
- Obsolete acpi_device_register(); it is no longer needed.
- Obsolete setting the OpenFirmware handle in PCI devices in the
sparc64 device_register(); it is no longer needed.


Revision tags: cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.31 04-Feb-2021 thorpej

branches: 1.31.4; 1.31.6;
Call acpi_device_register() as appropriate.


# 1.30 02-May-2020 bouyer

branches: 1.30.2;
Introduce Xen PVH support in GENERIC.
This is compiled in with
options XENPVHVM
x86 changes:
- add Xen section and xen pvh entry points to locore.S. Set vm_guest
to VM_GUEST_XENPVH in this entry point.
Most of the boot procedure (especially page table setup and switch to
paged mode) is shared with native.
- change some x86_delay() to delay_func(), which points to x86_delay() for
native/HVM, and xen_delay() for PVH

Xen changes:
- remove Xen bits from init_x86_64_ksyms() and init386_ksyms()
and move to xen_init_ksyms(), used for both PV and PVH
- set ISA no-legacy-devices property for PVH
- factor out code from Xen's cpu_bootconf() to xen_bootconf()
in xen_machdep.c
- set up a specific pvh_consinit() which starts with printk()
(which uses a simple hypercall that is available early) and switch to
xencons when we can use pmap_kenter_pa().


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.29 22-Dec-2019 thorpej

Add acpi_intr_mask() and acpi_intr_unmask() which, following the pre-existing
ACPI software layering model, are wrappers around acpi_md_intr_mask() and
acpi_md_intr_unmask(), which in turn are wrappers around intr_mask() and
intr_unmask().

XXX ARM and IA64 implementations of acpi_md_intr_mask() and
acpi_md_intr_unmask() are just stubs for now.


Revision tags: phil-wifi-20191119
# 1.28 12-Sep-2019 martin

Cast physical addresses via uintptr_t to ACPI_PHYSICAL_ADDRESS to deal
with all size variants of the types used here in different builds.
Patch from manu@.


# 1.27 12-Sep-2019 manu

Attempt to obtain ACPI RSDP from the hypervisor for Xen PV

There are three possible way of obtaining the ACPI RSDP
- From Extended BIOS Data Area (EBDA) when kernel or Xen was booted from
BIOS bootstrap
- From EFI SystemTable when kernel is booted from EFI bootstrap
- When Xen is booted from EFI bootstrap, EBDA is not mapped, and EFI
SystemTable is not passed to the kernel. The only way to go is to
obtain ACPI RSDP trhough an hypercall.

Note: EFI bootstrap support for booting Xen has not yet been committed.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.26 01-May-2019 mlelstv

branches: 1.26.2;
Handle ISA/EISA interrupts like isa_machdep.c.


Revision tags: isaki-audio2-base
# 1.25 09-Mar-2019 kre

In acpi_md_OsRemoveInterruptHandler() redir and mpflags are only
relevant to the NIOAPIC > 0 case (not used without that). Rearrange
#if's slightly to make that happen (avoid "set but not used" warnings
(aka errors) when NIOAPIC == 0 (or undefined)).


# 1.24 09-Mar-2019 maxv

Start replacing the x86 PTE bits.


# 1.23 03-Mar-2019 maxv

Fix bug, PG_W is 'wired', not 'writable'.


# 1.22 11-Feb-2019 cherry

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.21 22-Nov-2018 jmcneill

Apply MADT interrupt source overrides to interrupts established via
acpi_md_intr_establish.


# 1.20 16-Nov-2018 jmcneill

Add MD functions for establishing and disestablishing interrupt handlers.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.19 20-Mar-2018 bouyer

branches: 1.19.2;
Allow registering ACPI interrupt handlers with a xname.
AcpiOsInstallInterruptHandler(), part of ACPICA API, doesn't allow passing
the xname. I extend the API with AcpiOsInstallInterruptHandler_xname()
for this purpose, and change acpi_md_OsInstallInterruptHandler() to
accept and use the xname (ia64 doens't use it).
The xname was hardcoded to "acpi SCI" in the
x86 acpi_md_OsInstallInterruptHandler(), so I make
AcpiOsInstallInterruptHandler() call
AcpiOsInstallInterruptHandler_xname with xname = "acpi SCI".

Now 'vmstat -i' shows the device's name instead of "acpi SCI" for for i2c HID
interrupts.

Proposed on tech-kern@ on Dec 29.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.18 14-Feb-2017 nonaka

branches: 1.18.6; 1.18.12;
Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

branches: 1.14.2;
provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


# 1.35 24-Jan-2023 riastradh

x86/acpi/acpi_machdep.c: Nix trailing whitespace.

No functional change intended.


Revision tags: netbsd-10-base
# 1.34 28-Oct-2022 riastradh

x86/acpi: Mark acpica interrupt handlers MP-safe.

acpica has its own internal locking, and the interrupt handlers we
install with AcpiInstall*Handler (gpe, notify, &c.) also have their
own locking.


Revision tags: bouyer-sunxi-drm-base
# 1.33 20-Aug-2022 riastradh

x86: Split most of pmap.h into pmap_private.h or vmparam.h.

This way pmap.h only contains the MD definition of the MI pmap(9)
API, which loads of things in the kernel rely on, so changing x86
pmap internals no longer requires recompiling the entire kernel every
time.

Callers needing these internals must now use machine/pmap_private.h.
Note: This is not x86/pmap_private.h because it contains three parts:

1. CPU-specific (different for i386/amd64) definitions used by...

2. common definitions, including Xenisms like xpmap_ptetomach,
further used by...

3. more CPU-specific inlines for pmap_pte_* operations

So {amd64,i386}/pmap_private.h defines 1, includes x86/pmap_private.h
for 2, and then defines 3. Maybe we should split that out into a new
pmap_pte.h to reduce this trouble.

No functional change intended, other than that some .c files must
include machine/pmap_private.h when previously uvm/uvm_pmap.h
polluted the namespace with pmap internals.

Note: This migrates part of i386/pmap.h into i386/vmparam.h --
specifically the parts that are needed for several constants defined
in vmparam.h:

VM_MAXUSER_ADDRESS
VM_MAX_ADDRESS
VM_MAX_KERNEL_ADDRESS
VM_MIN_KERNEL_ADDRESS

Since i386 needs PDP_SIZE in vmparam.h, I added it there on amd64
too, just to keep things parallel.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 thorpej-i2c-spi-conf-base
# 1.32 12-May-2021 thorpej

- Define a device call for PCI bus instances to fetch a direct child's
device handle given the device's device/function #s (extracted from
a pcitag_t). Use it to associate the handle with the child device
at config_found() time.
- Implement this device call for ACPI and OpenFirmware.
- Enable the OpenFirmware variant for evbarm FDT, macppc, ofppc, sparc64.
- Obsolete acpi_device_register(); it is no longer needed.
- Obsolete setting the OpenFirmware handle in PCI devices in the
sparc64 device_register(); it is no longer needed.


Revision tags: cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.31 04-Feb-2021 thorpej

branches: 1.31.4; 1.31.6;
Call acpi_device_register() as appropriate.


# 1.30 02-May-2020 bouyer

branches: 1.30.2;
Introduce Xen PVH support in GENERIC.
This is compiled in with
options XENPVHVM
x86 changes:
- add Xen section and xen pvh entry points to locore.S. Set vm_guest
to VM_GUEST_XENPVH in this entry point.
Most of the boot procedure (especially page table setup and switch to
paged mode) is shared with native.
- change some x86_delay() to delay_func(), which points to x86_delay() for
native/HVM, and xen_delay() for PVH

Xen changes:
- remove Xen bits from init_x86_64_ksyms() and init386_ksyms()
and move to xen_init_ksyms(), used for both PV and PVH
- set ISA no-legacy-devices property for PVH
- factor out code from Xen's cpu_bootconf() to xen_bootconf()
in xen_machdep.c
- set up a specific pvh_consinit() which starts with printk()
(which uses a simple hypercall that is available early) and switch to
xencons when we can use pmap_kenter_pa().


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.29 22-Dec-2019 thorpej

Add acpi_intr_mask() and acpi_intr_unmask() which, following the pre-existing
ACPI software layering model, are wrappers around acpi_md_intr_mask() and
acpi_md_intr_unmask(), which in turn are wrappers around intr_mask() and
intr_unmask().

XXX ARM and IA64 implementations of acpi_md_intr_mask() and
acpi_md_intr_unmask() are just stubs for now.


Revision tags: phil-wifi-20191119
# 1.28 12-Sep-2019 martin

Cast physical addresses via uintptr_t to ACPI_PHYSICAL_ADDRESS to deal
with all size variants of the types used here in different builds.
Patch from manu@.


# 1.27 12-Sep-2019 manu

Attempt to obtain ACPI RSDP from the hypervisor for Xen PV

There are three possible way of obtaining the ACPI RSDP
- From Extended BIOS Data Area (EBDA) when kernel or Xen was booted from
BIOS bootstrap
- From EFI SystemTable when kernel is booted from EFI bootstrap
- When Xen is booted from EFI bootstrap, EBDA is not mapped, and EFI
SystemTable is not passed to the kernel. The only way to go is to
obtain ACPI RSDP trhough an hypercall.

Note: EFI bootstrap support for booting Xen has not yet been committed.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.26 01-May-2019 mlelstv

branches: 1.26.2;
Handle ISA/EISA interrupts like isa_machdep.c.


Revision tags: isaki-audio2-base
# 1.25 09-Mar-2019 kre

In acpi_md_OsRemoveInterruptHandler() redir and mpflags are only
relevant to the NIOAPIC > 0 case (not used without that). Rearrange
#if's slightly to make that happen (avoid "set but not used" warnings
(aka errors) when NIOAPIC == 0 (or undefined)).


# 1.24 09-Mar-2019 maxv

Start replacing the x86 PTE bits.


# 1.23 03-Mar-2019 maxv

Fix bug, PG_W is 'wired', not 'writable'.


# 1.22 11-Feb-2019 cherry

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.21 22-Nov-2018 jmcneill

Apply MADT interrupt source overrides to interrupts established via
acpi_md_intr_establish.


# 1.20 16-Nov-2018 jmcneill

Add MD functions for establishing and disestablishing interrupt handlers.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.19 20-Mar-2018 bouyer

branches: 1.19.2;
Allow registering ACPI interrupt handlers with a xname.
AcpiOsInstallInterruptHandler(), part of ACPICA API, doesn't allow passing
the xname. I extend the API with AcpiOsInstallInterruptHandler_xname()
for this purpose, and change acpi_md_OsInstallInterruptHandler() to
accept and use the xname (ia64 doens't use it).
The xname was hardcoded to "acpi SCI" in the
x86 acpi_md_OsInstallInterruptHandler(), so I make
AcpiOsInstallInterruptHandler() call
AcpiOsInstallInterruptHandler_xname with xname = "acpi SCI".

Now 'vmstat -i' shows the device's name instead of "acpi SCI" for for i2c HID
interrupts.

Proposed on tech-kern@ on Dec 29.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.18 14-Feb-2017 nonaka

branches: 1.18.6; 1.18.12;
Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

branches: 1.14.2;
provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


# 1.34 28-Oct-2022 riastradh

x86/acpi: Mark acpica interrupt handlers MP-safe.

acpica has its own internal locking, and the interrupt handlers we
install with AcpiInstall*Handler (gpe, notify, &c.) also have their
own locking.


Revision tags: bouyer-sunxi-drm-base
# 1.33 20-Aug-2022 riastradh

x86: Split most of pmap.h into pmap_private.h or vmparam.h.

This way pmap.h only contains the MD definition of the MI pmap(9)
API, which loads of things in the kernel rely on, so changing x86
pmap internals no longer requires recompiling the entire kernel every
time.

Callers needing these internals must now use machine/pmap_private.h.
Note: This is not x86/pmap_private.h because it contains three parts:

1. CPU-specific (different for i386/amd64) definitions used by...

2. common definitions, including Xenisms like xpmap_ptetomach,
further used by...

3. more CPU-specific inlines for pmap_pte_* operations

So {amd64,i386}/pmap_private.h defines 1, includes x86/pmap_private.h
for 2, and then defines 3. Maybe we should split that out into a new
pmap_pte.h to reduce this trouble.

No functional change intended, other than that some .c files must
include machine/pmap_private.h when previously uvm/uvm_pmap.h
polluted the namespace with pmap internals.

Note: This migrates part of i386/pmap.h into i386/vmparam.h --
specifically the parts that are needed for several constants defined
in vmparam.h:

VM_MAXUSER_ADDRESS
VM_MAX_ADDRESS
VM_MAX_KERNEL_ADDRESS
VM_MIN_KERNEL_ADDRESS

Since i386 needs PDP_SIZE in vmparam.h, I added it there on amd64
too, just to keep things parallel.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 thorpej-i2c-spi-conf-base
# 1.32 12-May-2021 thorpej

- Define a device call for PCI bus instances to fetch a direct child's
device handle given the device's device/function #s (extracted from
a pcitag_t). Use it to associate the handle with the child device
at config_found() time.
- Implement this device call for ACPI and OpenFirmware.
- Enable the OpenFirmware variant for evbarm FDT, macppc, ofppc, sparc64.
- Obsolete acpi_device_register(); it is no longer needed.
- Obsolete setting the OpenFirmware handle in PCI devices in the
sparc64 device_register(); it is no longer needed.


Revision tags: cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.31 04-Feb-2021 thorpej

branches: 1.31.4; 1.31.6;
Call acpi_device_register() as appropriate.


# 1.30 02-May-2020 bouyer

branches: 1.30.2;
Introduce Xen PVH support in GENERIC.
This is compiled in with
options XENPVHVM
x86 changes:
- add Xen section and xen pvh entry points to locore.S. Set vm_guest
to VM_GUEST_XENPVH in this entry point.
Most of the boot procedure (especially page table setup and switch to
paged mode) is shared with native.
- change some x86_delay() to delay_func(), which points to x86_delay() for
native/HVM, and xen_delay() for PVH

Xen changes:
- remove Xen bits from init_x86_64_ksyms() and init386_ksyms()
and move to xen_init_ksyms(), used for both PV and PVH
- set ISA no-legacy-devices property for PVH
- factor out code from Xen's cpu_bootconf() to xen_bootconf()
in xen_machdep.c
- set up a specific pvh_consinit() which starts with printk()
(which uses a simple hypercall that is available early) and switch to
xencons when we can use pmap_kenter_pa().


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.29 22-Dec-2019 thorpej

Add acpi_intr_mask() and acpi_intr_unmask() which, following the pre-existing
ACPI software layering model, are wrappers around acpi_md_intr_mask() and
acpi_md_intr_unmask(), which in turn are wrappers around intr_mask() and
intr_unmask().

XXX ARM and IA64 implementations of acpi_md_intr_mask() and
acpi_md_intr_unmask() are just stubs for now.


Revision tags: phil-wifi-20191119
# 1.28 12-Sep-2019 martin

Cast physical addresses via uintptr_t to ACPI_PHYSICAL_ADDRESS to deal
with all size variants of the types used here in different builds.
Patch from manu@.


# 1.27 12-Sep-2019 manu

Attempt to obtain ACPI RSDP from the hypervisor for Xen PV

There are three possible way of obtaining the ACPI RSDP
- From Extended BIOS Data Area (EBDA) when kernel or Xen was booted from
BIOS bootstrap
- From EFI SystemTable when kernel is booted from EFI bootstrap
- When Xen is booted from EFI bootstrap, EBDA is not mapped, and EFI
SystemTable is not passed to the kernel. The only way to go is to
obtain ACPI RSDP trhough an hypercall.

Note: EFI bootstrap support for booting Xen has not yet been committed.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.26 01-May-2019 mlelstv

branches: 1.26.2;
Handle ISA/EISA interrupts like isa_machdep.c.


Revision tags: isaki-audio2-base
# 1.25 09-Mar-2019 kre

In acpi_md_OsRemoveInterruptHandler() redir and mpflags are only
relevant to the NIOAPIC > 0 case (not used without that). Rearrange
#if's slightly to make that happen (avoid "set but not used" warnings
(aka errors) when NIOAPIC == 0 (or undefined)).


# 1.24 09-Mar-2019 maxv

Start replacing the x86 PTE bits.


# 1.23 03-Mar-2019 maxv

Fix bug, PG_W is 'wired', not 'writable'.


# 1.22 11-Feb-2019 cherry

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.21 22-Nov-2018 jmcneill

Apply MADT interrupt source overrides to interrupts established via
acpi_md_intr_establish.


# 1.20 16-Nov-2018 jmcneill

Add MD functions for establishing and disestablishing interrupt handlers.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.19 20-Mar-2018 bouyer

branches: 1.19.2;
Allow registering ACPI interrupt handlers with a xname.
AcpiOsInstallInterruptHandler(), part of ACPICA API, doesn't allow passing
the xname. I extend the API with AcpiOsInstallInterruptHandler_xname()
for this purpose, and change acpi_md_OsInstallInterruptHandler() to
accept and use the xname (ia64 doens't use it).
The xname was hardcoded to "acpi SCI" in the
x86 acpi_md_OsInstallInterruptHandler(), so I make
AcpiOsInstallInterruptHandler() call
AcpiOsInstallInterruptHandler_xname with xname = "acpi SCI".

Now 'vmstat -i' shows the device's name instead of "acpi SCI" for for i2c HID
interrupts.

Proposed on tech-kern@ on Dec 29.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.18 14-Feb-2017 nonaka

branches: 1.18.6; 1.18.12;
Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

branches: 1.14.2;
provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


# 1.33 20-Aug-2022 riastradh

x86: Split most of pmap.h into pmap_private.h or vmparam.h.

This way pmap.h only contains the MD definition of the MI pmap(9)
API, which loads of things in the kernel rely on, so changing x86
pmap internals no longer requires recompiling the entire kernel every
time.

Callers needing these internals must now use machine/pmap_private.h.
Note: This is not x86/pmap_private.h because it contains three parts:

1. CPU-specific (different for i386/amd64) definitions used by...

2. common definitions, including Xenisms like xpmap_ptetomach,
further used by...

3. more CPU-specific inlines for pmap_pte_* operations

So {amd64,i386}/pmap_private.h defines 1, includes x86/pmap_private.h
for 2, and then defines 3. Maybe we should split that out into a new
pmap_pte.h to reduce this trouble.

No functional change intended, other than that some .c files must
include machine/pmap_private.h when previously uvm/uvm_pmap.h
polluted the namespace with pmap internals.

Note: This migrates part of i386/pmap.h into i386/vmparam.h --
specifically the parts that are needed for several constants defined
in vmparam.h:

VM_MAXUSER_ADDRESS
VM_MAX_ADDRESS
VM_MAX_KERNEL_ADDRESS
VM_MIN_KERNEL_ADDRESS

Since i386 needs PDP_SIZE in vmparam.h, I added it there on amd64
too, just to keep things parallel.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 thorpej-i2c-spi-conf-base
# 1.32 12-May-2021 thorpej

- Define a device call for PCI bus instances to fetch a direct child's
device handle given the device's device/function #s (extracted from
a pcitag_t). Use it to associate the handle with the child device
at config_found() time.
- Implement this device call for ACPI and OpenFirmware.
- Enable the OpenFirmware variant for evbarm FDT, macppc, ofppc, sparc64.
- Obsolete acpi_device_register(); it is no longer needed.
- Obsolete setting the OpenFirmware handle in PCI devices in the
sparc64 device_register(); it is no longer needed.


Revision tags: cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.31 04-Feb-2021 thorpej

branches: 1.31.4; 1.31.6;
Call acpi_device_register() as appropriate.


# 1.30 02-May-2020 bouyer

branches: 1.30.2;
Introduce Xen PVH support in GENERIC.
This is compiled in with
options XENPVHVM
x86 changes:
- add Xen section and xen pvh entry points to locore.S. Set vm_guest
to VM_GUEST_XENPVH in this entry point.
Most of the boot procedure (especially page table setup and switch to
paged mode) is shared with native.
- change some x86_delay() to delay_func(), which points to x86_delay() for
native/HVM, and xen_delay() for PVH

Xen changes:
- remove Xen bits from init_x86_64_ksyms() and init386_ksyms()
and move to xen_init_ksyms(), used for both PV and PVH
- set ISA no-legacy-devices property for PVH
- factor out code from Xen's cpu_bootconf() to xen_bootconf()
in xen_machdep.c
- set up a specific pvh_consinit() which starts with printk()
(which uses a simple hypercall that is available early) and switch to
xencons when we can use pmap_kenter_pa().


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.29 22-Dec-2019 thorpej

Add acpi_intr_mask() and acpi_intr_unmask() which, following the pre-existing
ACPI software layering model, are wrappers around acpi_md_intr_mask() and
acpi_md_intr_unmask(), which in turn are wrappers around intr_mask() and
intr_unmask().

XXX ARM and IA64 implementations of acpi_md_intr_mask() and
acpi_md_intr_unmask() are just stubs for now.


Revision tags: phil-wifi-20191119
# 1.28 12-Sep-2019 martin

Cast physical addresses via uintptr_t to ACPI_PHYSICAL_ADDRESS to deal
with all size variants of the types used here in different builds.
Patch from manu@.


# 1.27 12-Sep-2019 manu

Attempt to obtain ACPI RSDP from the hypervisor for Xen PV

There are three possible way of obtaining the ACPI RSDP
- From Extended BIOS Data Area (EBDA) when kernel or Xen was booted from
BIOS bootstrap
- From EFI SystemTable when kernel is booted from EFI bootstrap
- When Xen is booted from EFI bootstrap, EBDA is not mapped, and EFI
SystemTable is not passed to the kernel. The only way to go is to
obtain ACPI RSDP trhough an hypercall.

Note: EFI bootstrap support for booting Xen has not yet been committed.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.26 01-May-2019 mlelstv

branches: 1.26.2;
Handle ISA/EISA interrupts like isa_machdep.c.


Revision tags: isaki-audio2-base
# 1.25 09-Mar-2019 kre

In acpi_md_OsRemoveInterruptHandler() redir and mpflags are only
relevant to the NIOAPIC > 0 case (not used without that). Rearrange
#if's slightly to make that happen (avoid "set but not used" warnings
(aka errors) when NIOAPIC == 0 (or undefined)).


# 1.24 09-Mar-2019 maxv

Start replacing the x86 PTE bits.


# 1.23 03-Mar-2019 maxv

Fix bug, PG_W is 'wired', not 'writable'.


# 1.22 11-Feb-2019 cherry

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.21 22-Nov-2018 jmcneill

Apply MADT interrupt source overrides to interrupts established via
acpi_md_intr_establish.


# 1.20 16-Nov-2018 jmcneill

Add MD functions for establishing and disestablishing interrupt handlers.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.19 20-Mar-2018 bouyer

branches: 1.19.2;
Allow registering ACPI interrupt handlers with a xname.
AcpiOsInstallInterruptHandler(), part of ACPICA API, doesn't allow passing
the xname. I extend the API with AcpiOsInstallInterruptHandler_xname()
for this purpose, and change acpi_md_OsInstallInterruptHandler() to
accept and use the xname (ia64 doens't use it).
The xname was hardcoded to "acpi SCI" in the
x86 acpi_md_OsInstallInterruptHandler(), so I make
AcpiOsInstallInterruptHandler() call
AcpiOsInstallInterruptHandler_xname with xname = "acpi SCI".

Now 'vmstat -i' shows the device's name instead of "acpi SCI" for for i2c HID
interrupts.

Proposed on tech-kern@ on Dec 29.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.18 14-Feb-2017 nonaka

branches: 1.18.6; 1.18.12;
Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

branches: 1.14.2;
provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


Revision tags: thorpej-i2c-spi-conf-base
# 1.32 12-May-2021 thorpej

- Define a device call for PCI bus instances to fetch a direct child's
device handle given the device's device/function #s (extracted from
a pcitag_t). Use it to associate the handle with the child device
at config_found() time.
- Implement this device call for ACPI and OpenFirmware.
- Enable the OpenFirmware variant for evbarm FDT, macppc, ofppc, sparc64.
- Obsolete acpi_device_register(); it is no longer needed.
- Obsolete setting the OpenFirmware handle in PCI devices in the
sparc64 device_register(); it is no longer needed.


Revision tags: cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.31 04-Feb-2021 thorpej

branches: 1.31.4;
Call acpi_device_register() as appropriate.


# 1.30 02-May-2020 bouyer

branches: 1.30.2;
Introduce Xen PVH support in GENERIC.
This is compiled in with
options XENPVHVM
x86 changes:
- add Xen section and xen pvh entry points to locore.S. Set vm_guest
to VM_GUEST_XENPVH in this entry point.
Most of the boot procedure (especially page table setup and switch to
paged mode) is shared with native.
- change some x86_delay() to delay_func(), which points to x86_delay() for
native/HVM, and xen_delay() for PVH

Xen changes:
- remove Xen bits from init_x86_64_ksyms() and init386_ksyms()
and move to xen_init_ksyms(), used for both PV and PVH
- set ISA no-legacy-devices property for PVH
- factor out code from Xen's cpu_bootconf() to xen_bootconf()
in xen_machdep.c
- set up a specific pvh_consinit() which starts with printk()
(which uses a simple hypercall that is available early) and switch to
xencons when we can use pmap_kenter_pa().


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.29 22-Dec-2019 thorpej

Add acpi_intr_mask() and acpi_intr_unmask() which, following the pre-existing
ACPI software layering model, are wrappers around acpi_md_intr_mask() and
acpi_md_intr_unmask(), which in turn are wrappers around intr_mask() and
intr_unmask().

XXX ARM and IA64 implementations of acpi_md_intr_mask() and
acpi_md_intr_unmask() are just stubs for now.


Revision tags: phil-wifi-20191119
# 1.28 12-Sep-2019 martin

Cast physical addresses via uintptr_t to ACPI_PHYSICAL_ADDRESS to deal
with all size variants of the types used here in different builds.
Patch from manu@.


# 1.27 12-Sep-2019 manu

Attempt to obtain ACPI RSDP from the hypervisor for Xen PV

There are three possible way of obtaining the ACPI RSDP
- From Extended BIOS Data Area (EBDA) when kernel or Xen was booted from
BIOS bootstrap
- From EFI SystemTable when kernel is booted from EFI bootstrap
- When Xen is booted from EFI bootstrap, EBDA is not mapped, and EFI
SystemTable is not passed to the kernel. The only way to go is to
obtain ACPI RSDP trhough an hypercall.

Note: EFI bootstrap support for booting Xen has not yet been committed.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.26 01-May-2019 mlelstv

branches: 1.26.2;
Handle ISA/EISA interrupts like isa_machdep.c.


Revision tags: isaki-audio2-base
# 1.25 09-Mar-2019 kre

In acpi_md_OsRemoveInterruptHandler() redir and mpflags are only
relevant to the NIOAPIC > 0 case (not used without that). Rearrange
#if's slightly to make that happen (avoid "set but not used" warnings
(aka errors) when NIOAPIC == 0 (or undefined)).


# 1.24 09-Mar-2019 maxv

Start replacing the x86 PTE bits.


# 1.23 03-Mar-2019 maxv

Fix bug, PG_W is 'wired', not 'writable'.


# 1.22 11-Feb-2019 cherry

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.21 22-Nov-2018 jmcneill

Apply MADT interrupt source overrides to interrupts established via
acpi_md_intr_establish.


# 1.20 16-Nov-2018 jmcneill

Add MD functions for establishing and disestablishing interrupt handlers.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.19 20-Mar-2018 bouyer

branches: 1.19.2;
Allow registering ACPI interrupt handlers with a xname.
AcpiOsInstallInterruptHandler(), part of ACPICA API, doesn't allow passing
the xname. I extend the API with AcpiOsInstallInterruptHandler_xname()
for this purpose, and change acpi_md_OsInstallInterruptHandler() to
accept and use the xname (ia64 doens't use it).
The xname was hardcoded to "acpi SCI" in the
x86 acpi_md_OsInstallInterruptHandler(), so I make
AcpiOsInstallInterruptHandler() call
AcpiOsInstallInterruptHandler_xname with xname = "acpi SCI".

Now 'vmstat -i' shows the device's name instead of "acpi SCI" for for i2c HID
interrupts.

Proposed on tech-kern@ on Dec 29.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.18 14-Feb-2017 nonaka

branches: 1.18.6; 1.18.12;
Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

branches: 1.14.2;
provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


# 1.31 04-Feb-2021 thorpej

Call acpi_device_register() as appropriate.


Revision tags: thorpej-futex-base
# 1.30 02-May-2020 bouyer

Introduce Xen PVH support in GENERIC.
This is compiled in with
options XENPVHVM
x86 changes:
- add Xen section and xen pvh entry points to locore.S. Set vm_guest
to VM_GUEST_XENPVH in this entry point.
Most of the boot procedure (especially page table setup and switch to
paged mode) is shared with native.
- change some x86_delay() to delay_func(), which points to x86_delay() for
native/HVM, and xen_delay() for PVH

Xen changes:
- remove Xen bits from init_x86_64_ksyms() and init386_ksyms()
and move to xen_init_ksyms(), used for both PV and PVH
- set ISA no-legacy-devices property for PVH
- factor out code from Xen's cpu_bootconf() to xen_bootconf()
in xen_machdep.c
- set up a specific pvh_consinit() which starts with printk()
(which uses a simple hypercall that is available early) and switch to
xencons when we can use pmap_kenter_pa().


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.29 22-Dec-2019 thorpej

Add acpi_intr_mask() and acpi_intr_unmask() which, following the pre-existing
ACPI software layering model, are wrappers around acpi_md_intr_mask() and
acpi_md_intr_unmask(), which in turn are wrappers around intr_mask() and
intr_unmask().

XXX ARM and IA64 implementations of acpi_md_intr_mask() and
acpi_md_intr_unmask() are just stubs for now.


Revision tags: phil-wifi-20191119
# 1.28 12-Sep-2019 martin

Cast physical addresses via uintptr_t to ACPI_PHYSICAL_ADDRESS to deal
with all size variants of the types used here in different builds.
Patch from manu@.


# 1.27 12-Sep-2019 manu

Attempt to obtain ACPI RSDP from the hypervisor for Xen PV

There are three possible way of obtaining the ACPI RSDP
- From Extended BIOS Data Area (EBDA) when kernel or Xen was booted from
BIOS bootstrap
- From EFI SystemTable when kernel is booted from EFI bootstrap
- When Xen is booted from EFI bootstrap, EBDA is not mapped, and EFI
SystemTable is not passed to the kernel. The only way to go is to
obtain ACPI RSDP trhough an hypercall.

Note: EFI bootstrap support for booting Xen has not yet been committed.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.26 01-May-2019 mlelstv

branches: 1.26.2;
Handle ISA/EISA interrupts like isa_machdep.c.


Revision tags: isaki-audio2-base
# 1.25 09-Mar-2019 kre

In acpi_md_OsRemoveInterruptHandler() redir and mpflags are only
relevant to the NIOAPIC > 0 case (not used without that). Rearrange
#if's slightly to make that happen (avoid "set but not used" warnings
(aka errors) when NIOAPIC == 0 (or undefined)).


# 1.24 09-Mar-2019 maxv

Start replacing the x86 PTE bits.


# 1.23 03-Mar-2019 maxv

Fix bug, PG_W is 'wired', not 'writable'.


# 1.22 11-Feb-2019 cherry

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.21 22-Nov-2018 jmcneill

Apply MADT interrupt source overrides to interrupts established via
acpi_md_intr_establish.


# 1.20 16-Nov-2018 jmcneill

Add MD functions for establishing and disestablishing interrupt handlers.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.19 20-Mar-2018 bouyer

branches: 1.19.2;
Allow registering ACPI interrupt handlers with a xname.
AcpiOsInstallInterruptHandler(), part of ACPICA API, doesn't allow passing
the xname. I extend the API with AcpiOsInstallInterruptHandler_xname()
for this purpose, and change acpi_md_OsInstallInterruptHandler() to
accept and use the xname (ia64 doens't use it).
The xname was hardcoded to "acpi SCI" in the
x86 acpi_md_OsInstallInterruptHandler(), so I make
AcpiOsInstallInterruptHandler() call
AcpiOsInstallInterruptHandler_xname with xname = "acpi SCI".

Now 'vmstat -i' shows the device's name instead of "acpi SCI" for for i2c HID
interrupts.

Proposed on tech-kern@ on Dec 29.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.18 14-Feb-2017 nonaka

branches: 1.18.6; 1.18.12;
Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

branches: 1.14.2;
provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


# 1.30 02-May-2020 bouyer

Introduce Xen PVH support in GENERIC.
This is compiled in with
options XENPVHVM
x86 changes:
- add Xen section and xen pvh entry points to locore.S. Set vm_guest
to VM_GUEST_XENPVH in this entry point.
Most of the boot procedure (especially page table setup and switch to
paged mode) is shared with native.
- change some x86_delay() to delay_func(), which points to x86_delay() for
native/HVM, and xen_delay() for PVH

Xen changes:
- remove Xen bits from init_x86_64_ksyms() and init386_ksyms()
and move to xen_init_ksyms(), used for both PV and PVH
- set ISA no-legacy-devices property for PVH
- factor out code from Xen's cpu_bootconf() to xen_bootconf()
in xen_machdep.c
- set up a specific pvh_consinit() which starts with printk()
(which uses a simple hypercall that is available early) and switch to
xencons when we can use pmap_kenter_pa().


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.29 22-Dec-2019 thorpej

Add acpi_intr_mask() and acpi_intr_unmask() which, following the pre-existing
ACPI software layering model, are wrappers around acpi_md_intr_mask() and
acpi_md_intr_unmask(), which in turn are wrappers around intr_mask() and
intr_unmask().

XXX ARM and IA64 implementations of acpi_md_intr_mask() and
acpi_md_intr_unmask() are just stubs for now.


Revision tags: phil-wifi-20191119
# 1.28 12-Sep-2019 martin

Cast physical addresses via uintptr_t to ACPI_PHYSICAL_ADDRESS to deal
with all size variants of the types used here in different builds.
Patch from manu@.


# 1.27 12-Sep-2019 manu

Attempt to obtain ACPI RSDP from the hypervisor for Xen PV

There are three possible way of obtaining the ACPI RSDP
- From Extended BIOS Data Area (EBDA) when kernel or Xen was booted from
BIOS bootstrap
- From EFI SystemTable when kernel is booted from EFI bootstrap
- When Xen is booted from EFI bootstrap, EBDA is not mapped, and EFI
SystemTable is not passed to the kernel. The only way to go is to
obtain ACPI RSDP trhough an hypercall.

Note: EFI bootstrap support for booting Xen has not yet been committed.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.26 01-May-2019 mlelstv

branches: 1.26.2;
Handle ISA/EISA interrupts like isa_machdep.c.


Revision tags: isaki-audio2-base
# 1.25 09-Mar-2019 kre

In acpi_md_OsRemoveInterruptHandler() redir and mpflags are only
relevant to the NIOAPIC > 0 case (not used without that). Rearrange
#if's slightly to make that happen (avoid "set but not used" warnings
(aka errors) when NIOAPIC == 0 (or undefined)).


# 1.24 09-Mar-2019 maxv

Start replacing the x86 PTE bits.


# 1.23 03-Mar-2019 maxv

Fix bug, PG_W is 'wired', not 'writable'.


# 1.22 11-Feb-2019 cherry

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.21 22-Nov-2018 jmcneill

Apply MADT interrupt source overrides to interrupts established via
acpi_md_intr_establish.


# 1.20 16-Nov-2018 jmcneill

Add MD functions for establishing and disestablishing interrupt handlers.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.19 20-Mar-2018 bouyer

branches: 1.19.2;
Allow registering ACPI interrupt handlers with a xname.
AcpiOsInstallInterruptHandler(), part of ACPICA API, doesn't allow passing
the xname. I extend the API with AcpiOsInstallInterruptHandler_xname()
for this purpose, and change acpi_md_OsInstallInterruptHandler() to
accept and use the xname (ia64 doens't use it).
The xname was hardcoded to "acpi SCI" in the
x86 acpi_md_OsInstallInterruptHandler(), so I make
AcpiOsInstallInterruptHandler() call
AcpiOsInstallInterruptHandler_xname with xname = "acpi SCI".

Now 'vmstat -i' shows the device's name instead of "acpi SCI" for for i2c HID
interrupts.

Proposed on tech-kern@ on Dec 29.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.18 14-Feb-2017 nonaka

branches: 1.18.6; 1.18.12;
Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

branches: 1.14.2;
provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


# 1.29 22-Dec-2019 thorpej

Add acpi_intr_mask() and acpi_intr_unmask() which, following the pre-existing
ACPI software layering model, are wrappers around acpi_md_intr_mask() and
acpi_md_intr_unmask(), which in turn are wrappers around intr_mask() and
intr_unmask().

XXX ARM and IA64 implementations of acpi_md_intr_mask() and
acpi_md_intr_unmask() are just stubs for now.


Revision tags: phil-wifi-20191119
# 1.28 12-Sep-2019 martin

Cast physical addresses via uintptr_t to ACPI_PHYSICAL_ADDRESS to deal
with all size variants of the types used here in different builds.
Patch from manu@.


# 1.27 12-Sep-2019 manu

Attempt to obtain ACPI RSDP from the hypervisor for Xen PV

There are three possible way of obtaining the ACPI RSDP
- From Extended BIOS Data Area (EBDA) when kernel or Xen was booted from
BIOS bootstrap
- From EFI SystemTable when kernel is booted from EFI bootstrap
- When Xen is booted from EFI bootstrap, EBDA is not mapped, and EFI
SystemTable is not passed to the kernel. The only way to go is to
obtain ACPI RSDP trhough an hypercall.

Note: EFI bootstrap support for booting Xen has not yet been committed.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.26 01-May-2019 mlelstv

branches: 1.26.2;
Handle ISA/EISA interrupts like isa_machdep.c.


Revision tags: isaki-audio2-base
# 1.25 09-Mar-2019 kre

In acpi_md_OsRemoveInterruptHandler() redir and mpflags are only
relevant to the NIOAPIC > 0 case (not used without that). Rearrange
#if's slightly to make that happen (avoid "set but not used" warnings
(aka errors) when NIOAPIC == 0 (or undefined)).


# 1.24 09-Mar-2019 maxv

Start replacing the x86 PTE bits.


# 1.23 03-Mar-2019 maxv

Fix bug, PG_W is 'wired', not 'writable'.


# 1.22 11-Feb-2019 cherry

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.21 22-Nov-2018 jmcneill

Apply MADT interrupt source overrides to interrupts established via
acpi_md_intr_establish.


# 1.20 16-Nov-2018 jmcneill

Add MD functions for establishing and disestablishing interrupt handlers.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.19 20-Mar-2018 bouyer

branches: 1.19.2;
Allow registering ACPI interrupt handlers with a xname.
AcpiOsInstallInterruptHandler(), part of ACPICA API, doesn't allow passing
the xname. I extend the API with AcpiOsInstallInterruptHandler_xname()
for this purpose, and change acpi_md_OsInstallInterruptHandler() to
accept and use the xname (ia64 doens't use it).
The xname was hardcoded to "acpi SCI" in the
x86 acpi_md_OsInstallInterruptHandler(), so I make
AcpiOsInstallInterruptHandler() call
AcpiOsInstallInterruptHandler_xname with xname = "acpi SCI".

Now 'vmstat -i' shows the device's name instead of "acpi SCI" for for i2c HID
interrupts.

Proposed on tech-kern@ on Dec 29.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.18 14-Feb-2017 nonaka

branches: 1.18.6; 1.18.12;
Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

branches: 1.14.2;
provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


# 1.28 12-Sep-2019 martin

Cast physical addresses via uintptr_t to ACPI_PHYSICAL_ADDRESS to deal
with all size variants of the types used here in different builds.
Patch from manu@.


# 1.27 12-Sep-2019 manu

Attempt to obtain ACPI RSDP from the hypervisor for Xen PV

There are three possible way of obtaining the ACPI RSDP
- From Extended BIOS Data Area (EBDA) when kernel or Xen was booted from
BIOS bootstrap
- From EFI SystemTable when kernel is booted from EFI bootstrap
- When Xen is booted from EFI bootstrap, EBDA is not mapped, and EFI
SystemTable is not passed to the kernel. The only way to go is to
obtain ACPI RSDP trhough an hypercall.

Note: EFI bootstrap support for booting Xen has not yet been committed.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.26 01-May-2019 mlelstv

Handle ISA/EISA interrupts like isa_machdep.c.


Revision tags: isaki-audio2-base
# 1.25 09-Mar-2019 kre

In acpi_md_OsRemoveInterruptHandler() redir and mpflags are only
relevant to the NIOAPIC > 0 case (not used without that). Rearrange
#if's slightly to make that happen (avoid "set but not used" warnings
(aka errors) when NIOAPIC == 0 (or undefined)).


# 1.24 09-Mar-2019 maxv

Start replacing the x86 PTE bits.


# 1.23 03-Mar-2019 maxv

Fix bug, PG_W is 'wired', not 'writable'.


# 1.22 11-Feb-2019 cherry

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.21 22-Nov-2018 jmcneill

Apply MADT interrupt source overrides to interrupts established via
acpi_md_intr_establish.


# 1.20 16-Nov-2018 jmcneill

Add MD functions for establishing and disestablishing interrupt handlers.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.19 20-Mar-2018 bouyer

branches: 1.19.2;
Allow registering ACPI interrupt handlers with a xname.
AcpiOsInstallInterruptHandler(), part of ACPICA API, doesn't allow passing
the xname. I extend the API with AcpiOsInstallInterruptHandler_xname()
for this purpose, and change acpi_md_OsInstallInterruptHandler() to
accept and use the xname (ia64 doens't use it).
The xname was hardcoded to "acpi SCI" in the
x86 acpi_md_OsInstallInterruptHandler(), so I make
AcpiOsInstallInterruptHandler() call
AcpiOsInstallInterruptHandler_xname with xname = "acpi SCI".

Now 'vmstat -i' shows the device's name instead of "acpi SCI" for for i2c HID
interrupts.

Proposed on tech-kern@ on Dec 29.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.18 14-Feb-2017 nonaka

branches: 1.18.12;
Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

branches: 1.14.2;
provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


# 1.27 12-Sep-2019 manu

Attempt to obtain ACPI RSDP from the hypervisor for Xen PV

There are three possible way of obtaining the ACPI RSDP
- From Extended BIOS Data Area (EBDA) when kernel or Xen was booted from
BIOS bootstrap
- From EFI SystemTable when kernel is booted from EFI bootstrap
- When Xen is booted from EFI bootstrap, EBDA is not mapped, and EFI
SystemTable is not passed to the kernel. The only way to go is to
obtain ACPI RSDP trhough an hypercall.

Note: EFI bootstrap support for booting Xen has not yet been committed.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.26 01-May-2019 mlelstv

Handle ISA/EISA interrupts like isa_machdep.c.


Revision tags: isaki-audio2-base
# 1.25 09-Mar-2019 kre

In acpi_md_OsRemoveInterruptHandler() redir and mpflags are only
relevant to the NIOAPIC > 0 case (not used without that). Rearrange
#if's slightly to make that happen (avoid "set but not used" warnings
(aka errors) when NIOAPIC == 0 (or undefined)).


# 1.24 09-Mar-2019 maxv

Start replacing the x86 PTE bits.


# 1.23 03-Mar-2019 maxv

Fix bug, PG_W is 'wired', not 'writable'.


# 1.22 11-Feb-2019 cherry

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.21 22-Nov-2018 jmcneill

Apply MADT interrupt source overrides to interrupts established via
acpi_md_intr_establish.


# 1.20 16-Nov-2018 jmcneill

Add MD functions for establishing and disestablishing interrupt handlers.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.19 20-Mar-2018 bouyer

branches: 1.19.2;
Allow registering ACPI interrupt handlers with a xname.
AcpiOsInstallInterruptHandler(), part of ACPICA API, doesn't allow passing
the xname. I extend the API with AcpiOsInstallInterruptHandler_xname()
for this purpose, and change acpi_md_OsInstallInterruptHandler() to
accept and use the xname (ia64 doens't use it).
The xname was hardcoded to "acpi SCI" in the
x86 acpi_md_OsInstallInterruptHandler(), so I make
AcpiOsInstallInterruptHandler() call
AcpiOsInstallInterruptHandler_xname with xname = "acpi SCI".

Now 'vmstat -i' shows the device's name instead of "acpi SCI" for for i2c HID
interrupts.

Proposed on tech-kern@ on Dec 29.


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.18 14-Feb-2017 nonaka

branches: 1.18.12;
Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

branches: 1.14.2;
provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


# 1.26 01-May-2019 mlelstv

Handle ISA/EISA interrupts like isa_machdep.c.


Revision tags: isaki-audio2-base
# 1.25 09-Mar-2019 kre

In acpi_md_OsRemoveInterruptHandler() redir and mpflags are only
relevant to the NIOAPIC > 0 case (not used without that). Rearrange
#if's slightly to make that happen (avoid "set but not used" warnings
(aka errors) when NIOAPIC == 0 (or undefined)).


# 1.24 09-Mar-2019 maxv

Start replacing the x86 PTE bits.


# 1.23 03-Mar-2019 maxv

Fix bug, PG_W is 'wired', not 'writable'.


# 1.22 11-Feb-2019 cherry

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.21 22-Nov-2018 jmcneill

Apply MADT interrupt source overrides to interrupts established via
acpi_md_intr_establish.


# 1.20 16-Nov-2018 jmcneill

Add MD functions for establishing and disestablishing interrupt handlers.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.19 20-Mar-2018 bouyer

Allow registering ACPI interrupt handlers with a xname.
AcpiOsInstallInterruptHandler(), part of ACPICA API, doesn't allow passing
the xname. I extend the API with AcpiOsInstallInterruptHandler_xname()
for this purpose, and change acpi_md_OsInstallInterruptHandler() to
accept and use the xname (ia64 doens't use it).
The xname was hardcoded to "acpi SCI" in the
x86 acpi_md_OsInstallInterruptHandler(), so I make
AcpiOsInstallInterruptHandler() call
AcpiOsInstallInterruptHandler_xname with xname = "acpi SCI".

Now 'vmstat -i' shows the device's name instead of "acpi SCI" for for i2c HID
interrupts.

Proposed on tech-kern@ on Dec 29.


Revision tags: netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.18 14-Feb-2017 nonaka

branches: 1.18.12;
Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

branches: 1.14.2;
provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


Revision tags: isaki-audio2-base
# 1.25 09-Mar-2019 kre

In acpi_md_OsRemoveInterruptHandler() redir and mpflags are only
relevant to the NIOAPIC > 0 case (not used without that). Rearrange
#if's slightly to make that happen (avoid "set but not used" warnings
(aka errors) when NIOAPIC == 0 (or undefined)).


# 1.24 09-Mar-2019 maxv

Start replacing the x86 PTE bits.


# 1.23 03-Mar-2019 maxv

Fix bug, PG_W is 'wired', not 'writable'.


# 1.22 11-Feb-2019 cherry

We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.21 22-Nov-2018 jmcneill

Apply MADT interrupt source overrides to interrupts established via
acpi_md_intr_establish.


# 1.20 16-Nov-2018 jmcneill

Add MD functions for establishing and disestablishing interrupt handlers.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.19 20-Mar-2018 bouyer

Allow registering ACPI interrupt handlers with a xname.
AcpiOsInstallInterruptHandler(), part of ACPICA API, doesn't allow passing
the xname. I extend the API with AcpiOsInstallInterruptHandler_xname()
for this purpose, and change acpi_md_OsInstallInterruptHandler() to
accept and use the xname (ia64 doens't use it).
The xname was hardcoded to "acpi SCI" in the
x86 acpi_md_OsInstallInterruptHandler(), so I make
AcpiOsInstallInterruptHandler() call
AcpiOsInstallInterruptHandler_xname with xname = "acpi SCI".

Now 'vmstat -i' shows the device's name instead of "acpi SCI" for for i2c HID
interrupts.

Proposed on tech-kern@ on Dec 29.


Revision tags: netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.18 14-Feb-2017 nonaka

branches: 1.18.12;
Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

branches: 1.14.2;
provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


# 1.18 14-Feb-2017 nonaka

Handle persistent memory. Currently only debug output.


# 1.17 14-Feb-2017 nonaka

x86: make btinfo_memmap from btinfo_efimemmap for to reduce mem_cluster_cnt.

should fix PR/51953.


# 1.16 09-Feb-2017 nonaka

efi_md::md_virt always uses uint64_t.


Revision tags: nick-nhusb-base-20170204
# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


# 1.15 24-Jan-2017 nonaka

Initial commit of native amd64 EFI boot loader.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104
# 1.14 15-Oct-2016 jdolecek

provide intr xname


Revision tags: nick-nhusb-base-20161004
# 1.13 21-Sep-2016 jmcneill

Set hw.acpi.sleep.vbios when a non-HW accelerated VGA driver attaches.
If the VGA_POST option is present in the kernel the default value is 2,
otherwise 1. PR kern/50781

Reviewed by: agc, mrg


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.12 28-Jan-2016 htodd

branches: 1.12.2;
Fix build break.


# 1.11 28-Jan-2016 christos

Add support for grub to find the ACPI root table pointer via a bootinfo entry
from grub.
From: https://mail-index.netbsd.org/tech-kern/2014/05/22/msg017119.html


Revision tags: nick-nhusb-base-20151226
# 1.10 06-Oct-2015 christos

CID/1325751: Avoid possible 32 bit overflow.


# 1.9 02-Oct-2015 msaitoh

PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
Currently the following extended capabilities are decoded:
- Advanced Error Reporting
- Virtual Channel
- Device Serial Number
- Power Budgeting
- Root Complex Link Declaration
- Root Complex Event Collector Association
- Access Control Services
- Alternative Routing-ID Interpretation
- Address Translation Services
- Single Root IO Virtualization
- Page Request
- TPH Requester
- Latency Tolerance Reporting
- Secondary PCI Express
- Process Address Space ID
- LN Requester
- L1 PM Substates
The following extended capabilities are not decoded yet:
- Root Complex Internal Link Control
- Multi-Function Virtual Channel
- RCRB Header
- Vendor Unique
- Configuration Access Correction
- Multiple Root IO Virtualization
- Multicast
- Resizable BAR
- Dynamic Power Allocation
- Protocol Multiplexing
- Downstream Port Containment
- Precision Time Management
- M-PCIe
- Function Reading Status Queueing
- Readiness Time Reporting
- Designated Vendor-Specific


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.8 12-May-2014 joerg

branches: 1.8.4;
acpi_md_findoverride is only used when NIOAPIC > 0, so don't provide it
otherwise.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.7 06-Oct-2013 jakllsch

branches: 1.7.2;
Correct acpi_md_OsWritable() logic so that it can return TRUE.
From Masanori Kanaoka in PR 47571.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.6 31-Mar-2013 chs

branches: 1.6.4;
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the "flags" field
as well as "redir" since apic_set_redir() uses both. fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


# 1.5 25-Mar-2013 chs

redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.4 23-Sep-2012 chs

locate PCI buses and determine their bus numbers using the info
previously extracted from ACPICA rather than trying to figure it out again.
allow PCI buses that don't have a _PRT method.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.3 30-Jan-2012 rmind

branches: 1.3.2; 1.3.6;
acpi_md_ncpus: use kcpuset_attached instead.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base jym-xensuspend-base jym-xensuspend-nbase
# 1.2 01-Jul-2011 dyoung

branches: 1.2.2; 1.2.4; 1.2.8;
#include <sys/bus.h> instead of <machine/bus.h>.


# 1.1 12-Jun-2011 jruoho

branches: 1.1.2;
Follow IA-64 with the x86-specific ACPI MD functions and move these where
they belong to. Remove an unused function. Minor KNF. No functional change.