On Mon, Dec 11, 2017 at 12:22:56AM +0100, JaromÃr Dole?ek wrote:
[in response to acpi_intr_establish() introduction]
> Can we have acpi_intr_establish() accept the xname? It's very useful to
> have the driver name registered for "intrctl list".
The attached patch does it.
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".
On my laptop I had before the change:
>intrctl list
interrupt idCPU0 CPU1 CPU2 CPU3 device name(s)
ioapic0 pin 9 29928*0 0 0 acpi SCI
msi0 vec 0 3388*0 0 0 xhci0
ioapic0 pin 16 0*0 0 0 unknown, ahcisata0, ichsmb0
ioapic0 pin 17 0*0 0 0 unknown
ioapic0 pin 51 0*0 0 0 acpi SCI
msi1 vec 0 394*0 0 0 iwm0
msix2 vec 00*0 0 0 nvme0 adminq
msix2 vec 1 1652*0 0 0 nvme0 ioq1
msix2 vec 20 1915*0 0 nvme0 ioq2
msix2 vec 30 0 104*0 nvme0 ioq3
msix2 vec 40 0 0 426* nvme0 ioq4
msi3 vec 0 0*0 0 0 hdaudio0
ioapic0 pin 1 0*0 0 0 unknown
ioapic0 pin 12 0*0 0 0 unknown
and after:
>intrctl list
interrupt id CPU0 CPU1 CPU2 CPU3 device name(s)
ioapic0 pin 9 7130*0 0 0 acpi SCI
msi0 vec 0 920*0 0 0 xhci0
ioapic0 pin 160*0 0 0 unknown, ahcisata0, ichsmb0
ioapic0 pin 170*0 0 0 unknown
ioapic0 pin 510*0 0 0 ihidev0
msi1 vec 0 617*0 0 0 iwm0
msix2 vec 0 0*0 0 0 nvme0 adminq
msix2 vec 12531*0 0 0 nvme0 ioq1
msix2 vec 2 0 911*0 0 nvme0 ioq2
msix2 vec 3 0 095*0 nvme0 ioq3
msix2 vec 4 0 0 0 407* nvme0 ioq4
msi3 vec 00*0 0 0 hdaudio0
ioapic0 pin 1 0*0 0 0 unknown
ioapic0 pin 120*0 0 0 unknown
any objection to this change ?
--
Manuel Bouyer
NetBSD: 26 ans d'experience feront toujours la difference
--
Index: sys/arch/ia64/acpi/acpi_machdep.c
===
RCS file: /cvsroot/src/sys/arch/ia64/acpi/acpi_machdep.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 acpi_machdep.c
--- sys/arch/ia64/acpi/acpi_machdep.c 23 Sep 2012 00:31:05 - 1.6
+++ sys/arch/ia64/acpi/acpi_machdep.c 28 Dec 2017 14:32:18 -
@@ -77,7 +77,8 @@ acpi_md_OsGetRootPointer(void)
ACPI_STATUS
acpi_md_OsInstallInterruptHandler(UINT32 InterruptNumber,
ACPI_OSD_HANDLER ServiceRoutine,
- void *Context, void **cookiep)
+ void *Context, void **cookiep,
+ const char *xname)
{
static int isa_irq_to_vector_map[16] = {
/* i8259 IRQ translation, first 16 entries */
Index: sys/arch/ia64/include/acpi_machdep.h
===
RCS file: /cvsroot/src/sys/arch/ia64/include/acpi_machdep.h,v
retrieving revision 1.6
diff -u -p -u -r1.6 acpi_machdep.h
--- sys/arch/ia64/include/acpi_machdep.h23 Sep 2012 00:31:05 -
1.6
+++ sys/arch/ia64/include/acpi_machdep.h28 Dec 2017 14:32:18 -
@@ -12,7 +12,7 @@ ACPI_PHYSICAL_ADDRESS acpi_md_OsGetRootP
#define acpi_md_OsOut32(x, v) outl((x), (v))
ACPI_STATUS acpi_md_OsInstallInterruptHandler(UINT32, ACPI_OSD_HANDLER,
- void *, void **);
+ void *, void **, const char *);
void acpi_md_OsRemoveInterruptHandler(void *);
ACPI_STATUS acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS, UINT32, void **);
Index: sys/arch/x86/acpi/acpi_machdep.c
===
RCS file: /cvsroot/src/sys/arch/x86/acpi/acpi_machdep.c,v
retrieving revision 1.18
diff -u -p -u -r1.18 acpi_machdep.c
--- sys/arch/x86/acpi/acpi_machdep.c14 Feb 2017 13:29:09 - 1.18
+++ sys/arch/x86/acpi/acpi_machdep.c28 Dec 2017 14:32:19 -
@@ -147,7 +147,8 @@ acpi_md_findoverride(ACPI_SUBTABLE_HEADE
ACPI_STATUS
acpi_md_OsInstallInterruptHandler(uint32_t InterruptNumber,
-ACPI_OSD_HANDLER ServiceRoutine, void *Context, void **cookiep)
+ACPI_OSD_HANDLER ServiceRoutine, void *Context, void **cookiep,
+const char *xname)
{
void *ih;
struct pic *pic;
@@ -242,7 +243,7 @@ acpi_md_OsInstallInterruptHandler(uint32
* XXX probably, IPL_BIO is enough.
*/
ih