1 /*++ @file 2 Emu Emulation Architectural Protocol Driver as defined in UEFI/PI. 3 This Timer module uses an UNIX Thread to simulate the timer-tick driven 4 timer service. 5 6 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> 7 Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved. 8 SPDX-License-Identifier: BSD-2-Clause-Patent 9 10 11 **/ 12 13 #ifndef _TIMER_H_ 14 #define _TIMER_H_ 15 16 17 18 19 // 20 // Legal timer value range in 100 ns units 21 // 22 #define TIMER_MINIMUM_VALUE 0 23 #define TIMER_MAXIMUM_VALUE (0x100000000ULL - 1) 24 25 // 26 // Default timer value in 100 ns units (50 ms) 27 // 28 #define DEFAULT_TIMER_TICK_DURATION 500000 29 30 // 31 // Function Prototypes 32 // 33 EFI_STATUS 34 EFIAPI 35 EmuTimerDriverInitialize ( 36 IN EFI_HANDLE ImageHandle, 37 IN EFI_SYSTEM_TABLE *SystemTable 38 ); 39 40 EFI_STATUS 41 EFIAPI 42 EmuTimerDriverRegisterHandler ( 43 IN EFI_TIMER_ARCH_PROTOCOL *This, 44 IN EFI_TIMER_NOTIFY NotifyFunction 45 ); 46 47 EFI_STATUS 48 EFIAPI 49 EmuTimerDriverSetTimerPeriod ( 50 IN EFI_TIMER_ARCH_PROTOCOL *This, 51 IN UINT64 TimerPeriod 52 ); 53 54 EFI_STATUS 55 EFIAPI 56 EmuTimerDriverGetTimerPeriod ( 57 IN EFI_TIMER_ARCH_PROTOCOL *This, 58 OUT UINT64 *TimerPeriod 59 ); 60 61 EFI_STATUS 62 EFIAPI 63 EmuTimerDriverGenerateSoftInterrupt ( 64 IN EFI_TIMER_ARCH_PROTOCOL *This 65 ); 66 67 #endif 68