]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2TbltDevicePkg/Library/I2CLibPei/I2CDelayPei.c
CorebootModulePkg: Add video resolution PCD initialization
[mirror_edk2.git] / Vlv2TbltDevicePkg / Library / I2CLibPei / I2CDelayPei.c
CommitLineData
4e522096
DW
1/** @file\r
2 MicroSecondDelay implementation of ACPI Timer.\r
3 \r
4 Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
5 \r
6 This program and the accompanying materials are licensed and made available under\r
7 the terms and conditions of the BSD License that accompanies this distribution. \r
8 The full text of the license may be found at \r
9 http://opensource.org/licenses/bsd-license.php. \r
10 \r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
13 \r
14--*/\r
15\r
16#include "PiPei.h"\r
17#include "I2CAccess.h"\r
18#include "I2CDelayPei.h"\r
19#include <Library/DebugLib.h>\r
20#include <Library/PeiServicesTablePointerLib.h>\r
21#include <Ppi/Stall.h>\r
22\r
23/**\r
24 Stalls the CPU for at least the given number of microseconds.\r
25 Stalls the CPU for the number of microseconds specified by MicroSeconds.\r
26\r
27 @param MicroSeconds The minimum number of microseconds to delay.\r
28\r
29 @return EFI_STATUS\r
30\r
31**/\r
32EFI_STATUS\r
33EFIAPI\r
34MicroSecondDelay (\r
35 IN UINTN MicroSeconds\r
36 )\r
37{\r
38\r
39 EFI_PEI_STALL_PPI *StallPpi;\r
40 EFI_STATUS Status;\r
41 CONST EFI_PEI_SERVICES **PeiServices;\r
42 \r
43 PeiServices = GetPeiServicesTablePointer();\r
44\r
45\r
46 Status = (**PeiServices).LocatePpi (PeiServices, &gEfiPeiStallPpiGuid, 0, NULL, &StallPpi);\r
47 ASSERT(!EFI_ERROR(Status));\r
48\r
49 StallPpi->Stall (PeiServices, StallPpi, MicroSeconds);\r
50\r
51 return EFI_SUCCESS;\r
52}\r