Hi Payton,
Thanks for responding. I understand the idea of the patch, Gua described my 
idea better. I was thinking that there would be two library instances, 
BaseSerialPortLibHob.inf and DxeSerialPortLibHob.inf. BASE compiles only 
BaseSerialPortLibHob.c, and DXE compiles the BaseSerialPortLibHob.c and a small 
DxeSerialPortLibHob.c with the constructor and event for DXE. The idea is to 
have this improved behaviour with less code added.

I can implement and test the deduplication if you prefer.

Best regards,
Benjamin

On April 27, 2023 10:33:09 p.m. EDT, "Hsieh, PaytonX" <paytonx.hs...@intel.com> 
wrote:
>Hi Benjamin,
>
>Due to some platform will disable the MMIO access of UART in ExitBootServices 
>event.
>
>So we register an ExitBootServices event to avoid access the invalid MMIO 
>space, it will cause the system hang when boot to windows OS.
>
>And the serial port library is also used in SEC and PEI phase, we will need 
>another DXE library to avoid build error or possible system hang while the 
>Boot Service is not available in PEI or SEC phase.
>
>From: Benjamin Doron <benjamin.doro...@gmail.com>
>Sent: Friday, April 28, 2023 1:36 AM
>To: Hsieh, PaytonX <paytonx.hs...@intel.com>; devel@edk2.groups.io
>Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix issues when 
>MULTIPLE_DEBUG_PORT_SUPPORT is true
>
>Hi,
>Can you deduplicate this code by moving the functions into a common, or "base" 
>file, and DXE's constructor and event into a separate file? As I see it, it 
>should be alright to reuse DXE's functions for other phases, the 
>`mBaseSerialPortLibHobAtRuntime` variable will never be changed in this case.
>
>Regards,
>Benjamin


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103779): https://edk2.groups.io/g/devel/message/103779
Mute This Topic: https://groups.io/mt/98531776/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to