]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/Dxe/Misc/Stall.c
3 UEFI Miscellaneous boot Services Stall service implementation
5 Copyright (c) 2006 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
32 Introduces a fine-grained stall.
36 Microseconds The number of microseconds to stall execution
40 EFI_SUCCESS - Execution was stalled for at least the requested amount
43 EFI_NOT_AVAILABLE_YET - gMetronome is not available yet
50 if (gMetronome
== NULL
) {
51 return EFI_NOT_AVAILABLE_YET
;
55 // Calculate the number of ticks by dividing the number of microseconds by
57 // Calcullation is based on 100ns unit.
59 Counter
= (UINT32
) DivU64x32Remainder (
61 gMetronome
->TickPeriod
,
66 // Call WaitForTick for Counter + 1 ticks to try to guarantee Counter tick
67 // periods, thus attempting to ensure Microseconds of stall time.
73 gMetronome
->WaitForTick (gMetronome
, Counter
);