]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseS3StallLib/S3StallLib.c
MdePkg/BaseLib: Support IA32 processors without CLFLUSH
[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
4 of the Timer class. \r
5\r
6 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
7\r
8 This program and the accompanying materials\r
9 are licensed and made available under the terms and conditions\r
10 of the BSD License which accompanies this distribution. The\r
11 full text of the license may be found at\r
12 http://opensource.org/licenses/bsd-license.php\r
13\r
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16\r
17**/\r
18\r
19#include <Base.h>\r
20\r
21#include <Library/TimerLib.h>\r
22#include <Library/DebugLib.h>\r
23#include <Library/S3BootScriptLib.h>\r
24#include <Library/S3StallLib.h>\r
25\r
26\r
27/**\r
28 Stalls the CPU for at least the given number of microseconds and and saves\r
29 the value in the S3 script to be replayed on S3 resume.\r
30\r
31 Stalls the CPU for the number of microseconds specified by MicroSeconds.\r
32\r
33 @param MicroSeconds The minimum number of microseconds to delay.\r
34\r
35 @return MicroSeconds\r
36\r
37**/\r
38UINTN\r
39EFIAPI\r
40S3Stall (\r
41 IN UINTN MicroSeconds\r
42 )\r
43{\r
44 RETURN_STATUS Status;\r
45 \r
46 Status = S3BootScriptSaveStall (MicroSecondDelay (MicroSeconds));\r
47 ASSERT (Status == RETURN_SUCCESS);\r
48 \r
49 return MicroSeconds;\r
50}\r
51\r
52\r