]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseS3StallLib/S3StallLib.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / BaseS3StallLib / S3StallLib.c
CommitLineData
fe69ac84 1/** @file\r
2 Stall Services that do stall and also enable the Stall operatation\r
3 to be replayed during an S3 resume. This library class maps directly on top\r
9095d37b 4 of the Timer class.\r
fe69ac84 5\r
9095d37b 6 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
fe69ac84 7\r
9344f092 8 SPDX-License-Identifier: BSD-2-Clause-Patent\r
fe69ac84 9\r
10**/\r
11\r
12#include <Base.h>\r
13\r
14#include <Library/TimerLib.h>\r
15#include <Library/DebugLib.h>\r
16#include <Library/S3BootScriptLib.h>\r
17#include <Library/S3StallLib.h>\r
18\r
fe69ac84 19/**\r
20 Stalls the CPU for at least the given number of microseconds and and saves\r
21 the value in the S3 script to be replayed on S3 resume.\r
22\r
23 Stalls the CPU for the number of microseconds specified by MicroSeconds.\r
24\r
25 @param MicroSeconds The minimum number of microseconds to delay.\r
26\r
27 @return MicroSeconds\r
28\r
29**/\r
30UINTN\r
31EFIAPI\r
32S3Stall (\r
2f88bd3a 33 IN UINTN MicroSeconds\r
fe69ac84 34 )\r
35{\r
2f88bd3a 36 RETURN_STATUS Status;\r
9095d37b 37\r
fe69ac84 38 Status = S3BootScriptSaveStall (MicroSecondDelay (MicroSeconds));\r
39 ASSERT (Status == RETURN_SUCCESS);\r
9095d37b 40\r
fe69ac84 41 return MicroSeconds;\r
42}\r