]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseS3StallLib/S3StallLib.c
MdePkg: Replace BSD License with BSD+Patent License
[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
19\r
20/**\r
21 Stalls the CPU for at least the given number of microseconds and and saves\r
22 the value in the S3 script to be replayed on S3 resume.\r
23\r
24 Stalls the CPU for the number of microseconds specified by MicroSeconds.\r
25\r
26 @param MicroSeconds The minimum number of microseconds to delay.\r
27\r
28 @return MicroSeconds\r
29\r
30**/\r
31UINTN\r
32EFIAPI\r
33S3Stall (\r
34 IN UINTN MicroSeconds\r
35 )\r
36{\r
37 RETURN_STATUS Status;\r
9095d37b 38\r
fe69ac84 39 Status = S3BootScriptSaveStall (MicroSecondDelay (MicroSeconds));\r
40 ASSERT (Status == RETURN_SUCCESS);\r
9095d37b 41\r
fe69ac84 42 return MicroSeconds;\r
43}\r
44\r
45\r