[edk2-devel] [PATCH v2 10/10] MdePkg: use CpuPause() in CpuDeadLoop()
Michael D Kinney
michael.d.kinney at intel.com
Thu Jan 7 22:30:39 UTC 2021
Looks like a good improvement. One minor comment is that the loop
should have {} to follow coding style:
for (Index = 0; Index == 0;) {
CpuPause();
}
With that change:
Reviewed-by: Michael D Kinney <michael.d.kinney at intel.com>
Mike
> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Ankur Arora
> Sent: Thursday, January 7, 2021 11:55 AM
> To: devel at edk2.groups.io
> Cc: lersek at redhat.com; imammedo at redhat.com; boris.ostrovsky at oracle.com; Ankur Arora <ankur.a.arora at oracle.com>; Kinney,
> Michael D <michael.d.kinney at intel.com>; Liming Gao <gaoliming at byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu at intel.com>;
> Aaron Young <aaron.young at oracle.com>
> Subject: [edk2-devel] [PATCH v2 10/10] MdePkg: use CpuPause() in CpuDeadLoop()
>
> Use CpuPause() to allow the CPU to go into a lower power state
> state while we spin wait.
>
> Cc: Michael D Kinney <michael.d.kinney at intel.com>
> Cc: Liming Gao <gaoliming at byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu at intel.com>
> Cc: Laszlo Ersek <lersek at redhat.com>
> Cc: Igor Mammedov <imammedo at redhat.com>
> Cc: Boris Ostrovsky <boris.ostrovsky at oracle.com>
> Cc: Aaron Young <aaron.young at oracle.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3132
> Signed-off-by: Ankur Arora <ankur.a.arora at oracle.com>
> ---
> MdePkg/Library/BaseLib/CpuDeadLoop.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/MdePkg/Library/BaseLib/CpuDeadLoop.c b/MdePkg/Library/BaseLib/CpuDeadLoop.c
> index 9e110cacbc96..e76312de7b4e 100644
> --- a/MdePkg/Library/BaseLib/CpuDeadLoop.c
> +++ b/MdePkg/Library/BaseLib/CpuDeadLoop.c
> @@ -28,5 +28,6 @@ CpuDeadLoop (
> {
>
> volatile UINTN Index;
>
>
>
> - for (Index = 0; Index == 0;);
>
> + for (Index = 0; Index == 0;)
>
> + CpuPause();>
> }
>
> --
> 2.9.3
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#69980): https://edk2.groups.io/g/devel/message/69980
> Mute This Topic: https://groups.io/mt/79507581/1643496
> Group Owner: devel+owner at edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [michael.d.kinney at intel.com]
> -=-=-=-=-=-=
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69990): https://edk2.groups.io/g/devel/message/69990
Mute This Topic: https://groups.io/mt/79507581/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list