X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFrameworkModulePkg%2FCsm%2FLegacyBiosDxe%2FLegacySio.c;h=a27a477eaa0eea20dd3ae66a1fde792ff997610d;hp=9844d64fd62516c1c009d1319889081000b04f5c;hb=faef695239ece2a24a0e7065ef447b97a27a53ef;hpb=aa7f11db4dfbc3b18c09940865dd01d5c3bc2c51 diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacySio.c b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacySio.c index 9844d64fd6..a27a477eaa 100644 --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacySio.c +++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacySio.c @@ -49,8 +49,7 @@ LegacyBiosBuildSioDataFromIsaIo ( UINTN EntryCount; EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer; EFI_BLOCK_IO_PROTOCOL *BlockIo; - - + EFI_SERIAL_IO_PROTOCOL *SerialIo; // // Get the list of ISA controllers in the system @@ -137,10 +136,16 @@ LegacyBiosBuildSioDataFromIsaIo ( // We want resource for legacy even if no 32-bit driver installed // for (ChildIndex = 0; ChildIndex < EntryCount; ChildIndex++) { - SioSerial = &SioPtr->Serial[ResourceList->Device.UID]; - SioSerial->Address = (UINT16) IoResource->StartRange; - SioSerial->Irq = (UINT8) InterruptResource->StartRange; - SioSerial->Mode = DEVICE_SERIAL_MODE_NORMAL | DEVICE_SERIAL_MODE_DUPLEX_HALF; + if ((OpenInfoBuffer[ChildIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) { + Status = gBS->HandleProtocol (OpenInfoBuffer[ChildIndex].AgentHandle, &gEfiSerialIoProtocolGuid, (VOID **) &SerialIo); + if (!EFI_ERROR (Status)) { + SioSerial = &SioPtr->Serial[ResourceList->Device.UID]; + SioSerial->Address = (UINT16) IoResource->StartRange; + SioSerial->Irq = (UINT8) InterruptResource->StartRange; + SioSerial->Mode = DEVICE_SERIAL_MODE_NORMAL | DEVICE_SERIAL_MODE_DUPLEX_HALF; + break; + } + } } FreePool (OpenInfoBuffer);