summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-09-10 22:06:41 +0000
committermarcel <marcel@FreeBSD.org>2003-09-10 22:06:41 +0000
commitfbb81ecab576baf4e1235b79d589220011627583 (patch)
tree5f7276c78cc0ce17f8907fcc2214a59cf950c048 /sys/dev/acpica
parenta77d2b18b17c2cf45ea9e65f62501845f5ebf231 (diff)
downloadFreeBSD-src-fbb81ecab576baf4e1235b79d589220011627583.zip
FreeBSD-src-fbb81ecab576baf4e1235b79d589220011627583.tar.gz
Extend the ACPI resource handling to make use of the BUS_CONFIG_INTR()
method. This is necessary on ia64 where it's known that serial interfaces described in the ACPI namespace may not have the well-known IRQs assigned to them. This confuses us in thinking they are PCI based interrupts and wrongly program the APIC.
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/acpi_resource.c17
-rw-r--r--sys/dev/acpica/acpivar.h2
2 files changed, 13 insertions, 6 deletions
diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c
index 7a428ca..e91d577 100644
--- a/sys/dev/acpica/acpi_resource.c
+++ b/sys/dev/acpica/acpi_resource.c
@@ -197,7 +197,8 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle,
* required"
*/
set->set_irq(dev, context, res->Data.Irq.Interrupts,
- res->Data.Irq.NumberOfInterrupts);
+ res->Data.Irq.NumberOfInterrupts, res->Data.Irq.EdgeLevel,
+ res->Data.Irq.ActiveHighLow);
break;
case ACPI_RSTYPE_DMA:
/*
@@ -350,7 +351,9 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle,
case ACPI_RSTYPE_EXT_IRQ:
/* XXX special handling? */
set->set_irq(dev, context,res->Data.ExtendedIrq.Interrupts,
- res->Data.ExtendedIrq.NumberOfInterrupts);
+ res->Data.ExtendedIrq.NumberOfInterrupts,
+ res->Data.ExtendedIrq.EdgeLevel,
+ res->Data.ExtendedIrq.ActiveHighLow);
break;
case ACPI_RSTYPE_VENDOR:
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
@@ -383,7 +386,7 @@ static void acpi_res_set_memoryrange(device_t dev, void *context,
u_int32_t low, u_int32_t high,
u_int32_t length, u_int32_t align);
static void acpi_res_set_irq(device_t dev, void *context, u_int32_t *irq,
- int count);
+ int count, int trig, int pol);
static void acpi_res_set_drq(device_t dev, void *context, u_int32_t *drq,
int count);
static void acpi_res_set_start_dependant(device_t dev, void *context,
@@ -477,10 +480,11 @@ acpi_res_set_memoryrange(device_t dev, void *context, u_int32_t low,
}
static void
-acpi_res_set_irq(device_t dev, void *context, u_int32_t *irq, int count)
+acpi_res_set_irq(device_t dev, void *context, u_int32_t *irq, int count,
+ int trig, int pol)
{
struct acpi_res_context *cp = (struct acpi_res_context *)context;
-
+
if (cp == NULL || irq == NULL)
return;
@@ -489,6 +493,9 @@ acpi_res_set_irq(device_t dev, void *context, u_int32_t *irq, int count)
return;
bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, *irq, 1);
+ BUS_CONFIG_INTR(dev, *irq, (trig == ACPI_EDGE_SENSITIVE) ?
+ INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, (pol == ACPI_ACTIVE_HIGH) ?
+ INTR_POLARITY_HIGH : INTR_POLARITY_LOW);
}
static void
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
index e79fa97..578a6c0 100644
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -203,7 +203,7 @@ struct acpi_parse_resource_set {
u_int32_t high, u_int32_t length,
u_int32_t align);
void (*set_irq)(device_t dev, void *context, u_int32_t *irq,
- int cout);
+ int count, int trig, int pol);
void (*set_drq)(device_t dev, void *context, u_int32_t *drq,
int count);
void (*set_start_dependant)(device_t dev, void *context,
OpenPOWER on IntegriCloud