]>
Commit | Line | Data |
---|---|---|
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 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
7 | \r | |
8 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
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 | 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 | |
30 | UINTN\r | |
31 | EFIAPI\r | |
32 | S3Stall (\r | |
33 | IN UINTN MicroSeconds\r | |
34 | )\r | |
35 | {\r | |
36 | RETURN_STATUS Status;\r | |
37 | \r | |
38 | Status = S3BootScriptSaveStall (MicroSecondDelay (MicroSeconds));\r | |
39 | ASSERT (Status == RETURN_SUCCESS);\r | |
40 | \r | |
41 | return MicroSeconds;\r | |
42 | }\r |