mirror of https://github.com/acidanthera/audk.git
Fix the IsaIo driver to not create ISA resource item when the ACPI resource returned from EFI_SIO_PROTOCOL::GetResources() is 0.
This could avoid creating the ISA resource item with StartRange = 0 and EndRange = 0xffffffff when the ACPI resource Base and Len both are 0 because we set StartRange = Base and EndRange = Base + End - 1. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11164 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
204df563fe
commit
3a0e054598
|
@ -327,24 +327,28 @@ AcpiResourceToIsaResource (
|
||||||
|
|
||||||
case ACPI_IO_PORT_DESCRIPTOR:
|
case ACPI_IO_PORT_DESCRIPTOR:
|
||||||
Io = (EFI_ACPI_IO_PORT_DESCRIPTOR *) AcpiResource.SmallHeader;
|
Io = (EFI_ACPI_IO_PORT_DESCRIPTOR *) AcpiResource.SmallHeader;
|
||||||
if (IsaResource != NULL) {
|
if (Io->Length != 0) {
|
||||||
IsaResource[Count].Type = EfiIsaAcpiResourceIo;
|
if (IsaResource != NULL) {
|
||||||
IsaResource[Count].Attribute = IsaIoAttribute (Io->Information);
|
IsaResource[Count].Type = EfiIsaAcpiResourceIo;
|
||||||
IsaResource[Count].StartRange = Io->BaseAddressMin;
|
IsaResource[Count].Attribute = IsaIoAttribute (Io->Information);
|
||||||
IsaResource[Count].EndRange = Io->BaseAddressMin + Io->Length - 1;
|
IsaResource[Count].StartRange = Io->BaseAddressMin;
|
||||||
|
IsaResource[Count].EndRange = Io->BaseAddressMin + Io->Length - 1;
|
||||||
|
}
|
||||||
|
Count ++;
|
||||||
}
|
}
|
||||||
Count ++;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR:
|
case ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR:
|
||||||
FixedIo = (EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR *) AcpiResource.SmallHeader;
|
FixedIo = (EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR *) AcpiResource.SmallHeader;
|
||||||
if (IsaResource != NULL) {
|
if (FixedIo->Length != 0) {
|
||||||
IsaResource[Count].Type = EfiIsaAcpiResourceIo;
|
if (IsaResource != NULL) {
|
||||||
IsaResource[Count].Attribute = EFI_ISA_ACPI_IO_DECODE_10_BITS;
|
IsaResource[Count].Type = EfiIsaAcpiResourceIo;
|
||||||
IsaResource[Count].StartRange = FixedIo->BaseAddress;
|
IsaResource[Count].Attribute = EFI_ISA_ACPI_IO_DECODE_10_BITS;
|
||||||
IsaResource[Count].EndRange = FixedIo->BaseAddress + FixedIo->Length - 1;
|
IsaResource[Count].StartRange = FixedIo->BaseAddress;
|
||||||
|
IsaResource[Count].EndRange = FixedIo->BaseAddress + FixedIo->Length - 1;
|
||||||
|
}
|
||||||
|
Count ++;
|
||||||
}
|
}
|
||||||
Count ++;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACPI_IRQ_DESCRIPTOR:
|
case ACPI_IRQ_DESCRIPTOR:
|
||||||
|
@ -377,24 +381,28 @@ AcpiResourceToIsaResource (
|
||||||
|
|
||||||
case ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR:
|
case ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR:
|
||||||
Memory = (EFI_ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR *) AcpiResource.LargeHeader;
|
Memory = (EFI_ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR *) AcpiResource.LargeHeader;
|
||||||
if (IsaResource != NULL) {
|
if (Memory->Length != 0) {
|
||||||
IsaResource[Count].Type = EfiIsaAcpiResourceMemory;
|
if (IsaResource != NULL) {
|
||||||
IsaResource[Count].Attribute = IsaMemoryAttribute (Memory->Information);
|
IsaResource[Count].Type = EfiIsaAcpiResourceMemory;
|
||||||
IsaResource[Count].StartRange = Memory->BaseAddressMin;
|
IsaResource[Count].Attribute = IsaMemoryAttribute (Memory->Information);
|
||||||
IsaResource[Count].EndRange = Memory->BaseAddressMin + Memory->Length - 1;
|
IsaResource[Count].StartRange = Memory->BaseAddressMin;
|
||||||
|
IsaResource[Count].EndRange = Memory->BaseAddressMin + Memory->Length - 1;
|
||||||
|
}
|
||||||
|
Count ++;
|
||||||
}
|
}
|
||||||
Count ++;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR:
|
case ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR:
|
||||||
FixedMemory = (EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR *) AcpiResource.LargeHeader;
|
FixedMemory = (EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR *) AcpiResource.LargeHeader;
|
||||||
if (IsaResource != NULL) {
|
if (FixedMemory->Length != 0) {
|
||||||
IsaResource[Count].Type = EfiIsaAcpiResourceMemory;
|
if (IsaResource != NULL) {
|
||||||
IsaResource[Count].Attribute = IsaMemoryAttribute (FixedMemory->Information);
|
IsaResource[Count].Type = EfiIsaAcpiResourceMemory;
|
||||||
IsaResource[Count].StartRange = FixedMemory->BaseAddress;
|
IsaResource[Count].Attribute = IsaMemoryAttribute (FixedMemory->Information);
|
||||||
IsaResource[Count].EndRange = FixedMemory->BaseAddress + FixedMemory->Length - 1;
|
IsaResource[Count].StartRange = FixedMemory->BaseAddress;
|
||||||
|
IsaResource[Count].EndRange = FixedMemory->BaseAddress + FixedMemory->Length - 1;
|
||||||
|
}
|
||||||
|
Count ++;
|
||||||
}
|
}
|
||||||
Count ++;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACPI_END_TAG_DESCRIPTOR:
|
case ACPI_END_TAG_DESCRIPTOR:
|
||||||
|
|
Loading…
Reference in New Issue