3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Tiano Miscellaneous Services Stall service implementation
38 Introduces a fine-grained stall.
42 Microseconds The number of microseconds to stall execution
46 EFI_SUCCESS - Execution was stalled for at least the requested amount
49 EFI_NOT_AVAILABLE_YET - gMetronome is not available yet
56 if (gMetronome
== NULL
) {
57 return EFI_NOT_AVAILABLE_YET
;
61 // Calculate the number of ticks by dividing the number of microseconds by
63 // Calcullation is based on 100ns unit.
65 Counter
= (UINT32
) DivU64x32Remainder (
67 gMetronome
->TickPeriod
,
72 // Call WaitForTick for Counter + 1 ticks to try to guarantee Counter tick
73 // periods, thus attempting to ensure Microseconds of stall time.
79 gMetronome
->WaitForTick (gMetronome
, Counter
);