Author: cgutman
Date: Sat Mar 13 20:19:24 2010
New Revision: 46181
URL:
http://svn.reactos.org/svn/reactos?rev=46181&view=rev
Log:
- Handle ACPI_RESOURCE_TYPE_EXTENDED_IRQ and ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64
Modified:
trunk/reactos/drivers/bus/acpi/buspdo.c
Modified: trunk/reactos/drivers/bus/acpi/buspdo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/buspdo.c?…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/buspdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/buspdo.c [iso-8859-1] Sat Mar 13 20:19:24 2010
@@ -623,6 +623,12 @@
{
switch (resource->Type)
{
+ case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+ {
+ ACPI_RESOURCE_EXTENDED_IRQ *irq_data = (ACPI_RESOURCE_EXTENDED_IRQ*)
&resource->Data;
+ NumberOfResources += irq_data->InterruptCount;
+ break;
+ }
case ACPI_RESOURCE_TYPE_IRQ:
{
ACPI_RESOURCE_IRQ *irq_data = (ACPI_RESOURCE_IRQ*) &resource->Data;
@@ -638,6 +644,7 @@
case ACPI_RESOURCE_TYPE_ADDRESS16:
case ACPI_RESOURCE_TYPE_ADDRESS32:
case ACPI_RESOURCE_TYPE_ADDRESS64:
+ case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
case ACPI_RESOURCE_TYPE_MEMORY24:
case ACPI_RESOURCE_TYPE_MEMORY32:
case ACPI_RESOURCE_TYPE_IO:
@@ -676,6 +683,25 @@
{
switch (resource->Type)
{
+ case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+ {
+ ACPI_RESOURCE_EXTENDED_IRQ *irq_data = (ACPI_RESOURCE_EXTENDED_IRQ*)
&resource->Data;
+ for (i = 0; i < irq_data->InterruptCount; i++)
+ {
+ ResourceDescriptor->Type = CmResourceTypeInterrupt;
+
+ ResourceDescriptor->ShareDisposition =
+ (irq_data->Sharable == ACPI_SHARED ? CmResourceShareShared :
CmResourceShareDeviceExclusive);
+ ResourceDescriptor->Flags =
+ (irq_data->Triggering == ACPI_LEVEL_SENSITIVE ?
CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE : CM_RESOURCE_INTERRUPT_LATCHED);
+ ResourceDescriptor->u.Interrupt.Level = irq_data->Interrupts[i];
+ ResourceDescriptor->u.Interrupt.Vector = 0;
+ ResourceDescriptor->u.Interrupt.Affinity = (KAFFINITY)(-1);
+
+ ResourceDescriptor++;
+ }
+ break;
+ }
case ACPI_RESOURCE_TYPE_IRQ:
{
ACPI_RESOURCE_IRQ *irq_data = (ACPI_RESOURCE_IRQ*) &resource->Data;
@@ -825,6 +851,49 @@
case ACPI_RESOURCE_TYPE_ADDRESS64:
{
ACPI_RESOURCE_ADDRESS64 *addr64_data = (ACPI_RESOURCE_ADDRESS64*)
&resource->Data;
+ if (addr64_data->ResourceType == ACPI_BUS_NUMBER_RANGE)
+ {
+ DPRINT1("64-bit bus address is not supported!\n");
+ ResourceDescriptor->Type = CmResourceTypeBusNumber;
+ ResourceDescriptor->ShareDisposition = CmResourceShareShared;
+ ResourceDescriptor->Flags = 0;
+ ResourceDescriptor->u.BusNumber.Start = (ULONG)addr64_data->Minimum;
+ ResourceDescriptor->u.BusNumber.Length = addr64_data->AddressLength;
+ }
+ else if (addr64_data->ResourceType == ACPI_IO_RANGE)
+ {
+ ResourceDescriptor->Type = CmResourceTypePort;
+ ResourceDescriptor->ShareDisposition = CmResourceShareDeviceExclusive;
+ ResourceDescriptor->Flags = CM_RESOURCE_PORT_IO;
+ if (addr64_data->Decode == ACPI_POS_DECODE)
+ ResourceDescriptor->Flags |= CM_RESOURCE_PORT_POSITIVE_DECODE;
+ ResourceDescriptor->u.Port.Start.QuadPart = addr64_data->Minimum;
+ ResourceDescriptor->u.Port.Length = addr64_data->AddressLength;
+ }
+ else
+ {
+ ResourceDescriptor->Type = CmResourceTypeMemory;
+ ResourceDescriptor->ShareDisposition = CmResourceShareDeviceExclusive;
+ ResourceDescriptor->Flags = 0;
+ if (addr64_data->Info.Mem.WriteProtect == ACPI_READ_ONLY_MEMORY)
+ ResourceDescriptor->Flags |= CM_RESOURCE_MEMORY_READ_ONLY;
+ else
+ ResourceDescriptor->Flags |= CM_RESOURCE_MEMORY_READ_WRITE;
+ switch (addr64_data->Info.Mem.Caching)
+ {
+ case ACPI_CACHABLE_MEMORY: ResourceDescriptor->Flags |=
CM_RESOURCE_MEMORY_CACHEABLE; break;
+ case ACPI_WRITE_COMBINING_MEMORY: ResourceDescriptor->Flags |=
CM_RESOURCE_MEMORY_COMBINEDWRITE; break;
+ case ACPI_PREFETCHABLE_MEMORY: ResourceDescriptor->Flags |=
CM_RESOURCE_MEMORY_PREFETCHABLE; break;
+ }
+ ResourceDescriptor->u.Memory.Start.QuadPart = addr64_data->Minimum;
+ ResourceDescriptor->u.Memory.Length = addr64_data->AddressLength;
+ }
+ ResourceDescriptor++;
+ break;
+ }
+ case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
+ {
+ ACPI_RESOURCE_EXTENDED_ADDRESS64 *addr64_data = (ACPI_RESOURCE_EXTENDED_ADDRESS64*)
&resource->Data;
if (addr64_data->ResourceType == ACPI_BUS_NUMBER_RANGE)
{
DPRINT1("64-bit bus address is not supported!\n");
@@ -968,6 +1037,12 @@
{
switch (resource->Type)
{
+ case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+ {
+ ACPI_RESOURCE_EXTENDED_IRQ *irq_data = (ACPI_RESOURCE_EXTENDED_IRQ*)
&resource->Data;
+ NumberOfResources += irq_data->InterruptCount;
+ break;
+ }
case ACPI_RESOURCE_TYPE_IRQ:
{
ACPI_RESOURCE_IRQ *irq_data = (ACPI_RESOURCE_IRQ*) &resource->Data;
@@ -983,6 +1058,7 @@
case ACPI_RESOURCE_TYPE_ADDRESS16:
case ACPI_RESOURCE_TYPE_ADDRESS32:
case ACPI_RESOURCE_TYPE_ADDRESS64:
+ case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
case ACPI_RESOURCE_TYPE_MEMORY24:
case ACPI_RESOURCE_TYPE_MEMORY32:
case ACPI_RESOURCE_TYPE_IO:
@@ -1021,6 +1097,22 @@
{
switch (resource->Type)
{
+ case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+ {
+ ACPI_RESOURCE_EXTENDED_IRQ *irq_data = (ACPI_RESOURCE_EXTENDED_IRQ*)
&resource->Data;
+ for (i = 0; i < irq_data->InterruptCount; i++)
+ {
+ RequirementDescriptor->Option = CurrentRes ? 0 : IO_RESOURCE_PREFERRED;
+ RequirementDescriptor->Type = CmResourceTypeInterrupt;
+ RequirementDescriptor->ShareDisposition = (irq_data->Sharable == ACPI_SHARED ?
CmResourceShareShared : CmResourceShareDeviceExclusive);
+ RequirementDescriptor->Flags =(irq_data->Triggering == ACPI_LEVEL_SENSITIVE ?
CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE : CM_RESOURCE_INTERRUPT_LATCHED);
+ RequirementDescriptor->u.Interrupt.MinimumVector =
+ RequirementDescriptor->u.Interrupt.MaximumVector = irq_data->Interrupts[i];
+
+ RequirementDescriptor++;
+ }
+ break;
+ }
case ACPI_RESOURCE_TYPE_IRQ:
{
ACPI_RESOURCE_IRQ *irq_data = (ACPI_RESOURCE_IRQ*) &resource->Data;
@@ -1225,6 +1317,53 @@
RequirementDescriptor++;
break;
}
+ case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
+ {
+ ACPI_RESOURCE_EXTENDED_ADDRESS64 *addr64_data = (ACPI_RESOURCE_EXTENDED_ADDRESS64*)
&resource->Data;
+ RequirementDescriptor->Option = CurrentRes ? 0 : IO_RESOURCE_PREFERRED;
+ if (addr64_data->ResourceType == ACPI_BUS_NUMBER_RANGE)
+ {
+ DPRINT1("64-bit bus address is not supported!\n");
+ RequirementDescriptor->Type = CmResourceTypeBusNumber;
+ RequirementDescriptor->ShareDisposition = CmResourceShareShared;
+ RequirementDescriptor->Flags = 0;
+ RequirementDescriptor->u.BusNumber.MinBusNumber =
(ULONG)addr64_data->Minimum;
+ RequirementDescriptor->u.BusNumber.MaxBusNumber =
(ULONG)addr64_data->Maximum;
+ RequirementDescriptor->u.BusNumber.Length = addr64_data->AddressLength;
+ }
+ else if (addr64_data->ResourceType == ACPI_IO_RANGE)
+ {
+ RequirementDescriptor->Type = CmResourceTypePort;
+ RequirementDescriptor->ShareDisposition = CmResourceShareDeviceExclusive;
+ RequirementDescriptor->Flags = CM_RESOURCE_PORT_IO;
+ if (addr64_data->Decode == ACPI_POS_DECODE)
+ RequirementDescriptor->Flags |= CM_RESOURCE_PORT_POSITIVE_DECODE;
+ RequirementDescriptor->u.Port.MinimumAddress.QuadPart = addr64_data->Minimum;
+ RequirementDescriptor->u.Port.MaximumAddress.QuadPart = addr64_data->Maximum;
+ RequirementDescriptor->u.Port.Length = addr64_data->AddressLength;
+ }
+ else
+ {
+ RequirementDescriptor->Type = CmResourceTypeMemory;
+ RequirementDescriptor->ShareDisposition = CmResourceShareDeviceExclusive;
+ RequirementDescriptor->Flags = 0;
+ if (addr64_data->Info.Mem.WriteProtect == ACPI_READ_ONLY_MEMORY)
+ RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_READ_ONLY;
+ else
+ RequirementDescriptor->Flags |= CM_RESOURCE_MEMORY_READ_WRITE;
+ switch (addr64_data->Info.Mem.Caching)
+ {
+ case ACPI_CACHABLE_MEMORY: RequirementDescriptor->Flags |=
CM_RESOURCE_MEMORY_CACHEABLE; break;
+ case ACPI_WRITE_COMBINING_MEMORY: RequirementDescriptor->Flags |=
CM_RESOURCE_MEMORY_COMBINEDWRITE; break;
+ case ACPI_PREFETCHABLE_MEMORY: RequirementDescriptor->Flags |=
CM_RESOURCE_MEMORY_PREFETCHABLE; break;
+ }
+ RequirementDescriptor->u.Memory.MinimumAddress.QuadPart =
addr64_data->Minimum;
+ RequirementDescriptor->u.Memory.MaximumAddress.QuadPart =
addr64_data->Maximum;
+ RequirementDescriptor->u.Memory.Length = addr64_data->AddressLength;
+ }
+ RequirementDescriptor++;
+ break;
+ }
case ACPI_RESOURCE_TYPE_MEMORY24:
{
ACPI_RESOURCE_MEMORY24 *mem24_data = (ACPI_RESOURCE_MEMORY24*)
&resource->Data;