On 03/16/21 23:59, Ankur Arora wrote: > Use CpuPause() to allow the CPU to go into a lower power state > state while we spin wait. > > Cc: Liming Gao <[email protected]> > Signed-off-by: Ankur Arora <[email protected]> > Reviewed-by: Michael D Kinney <[email protected]> > --- > MdePkg/Library/BaseLib/CpuDeadLoop.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/MdePkg/Library/BaseLib/CpuDeadLoop.c > b/MdePkg/Library/BaseLib/CpuDeadLoop.c > index 9e110cacbc96..3cd304351a65 100644 > --- a/MdePkg/Library/BaseLib/CpuDeadLoop.c > +++ b/MdePkg/Library/BaseLib/CpuDeadLoop.c > @@ -28,5 +28,7 @@ CpuDeadLoop ( > { > volatile UINTN Index; > > - for (Index = 0; Index == 0;); > + for (Index = 0; Index == 0;) { > + CpuPause(); > + } > } >
Reviewed-by: Laszlo Ersek <[email protected]> (for RISC-V and ARM64, the implementations seem to be "nop" instructions) Thanks Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72977): https://edk2.groups.io/g/devel/message/72977 Mute This Topic: https://groups.io/mt/81390478/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
