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