Home | History | Annotate | Download | only in TimerDxe
      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 This program and the accompanying materials
      9 are licensed and made available under the terms and conditions of the BSD License
     10 which accompanies this distribution.  The full text of the license may be found at
     11 http://opensource.org/licenses/bsd-license.php
     12 
     13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     15 
     16 
     17 **/
     18 
     19 #ifndef _TIMER_H_
     20 #define _TIMER_H_
     21 
     22 
     23 
     24 
     25 //
     26 // Legal timer value range in 100 ns units
     27 //
     28 #define TIMER_MINIMUM_VALUE 0
     29 #define TIMER_MAXIMUM_VALUE (0x100000000ULL - 1)
     30 
     31 //
     32 // Default timer value in 100 ns units (50 ms)
     33 //
     34 #define DEFAULT_TIMER_TICK_DURATION 500000
     35 
     36 //
     37 // Function Prototypes
     38 //
     39 EFI_STATUS
     40 EFIAPI
     41 EmuTimerDriverInitialize (
     42   IN EFI_HANDLE        ImageHandle,
     43   IN EFI_SYSTEM_TABLE  *SystemTable
     44   );
     45 
     46 EFI_STATUS
     47 EFIAPI
     48 EmuTimerDriverRegisterHandler (
     49   IN EFI_TIMER_ARCH_PROTOCOL  *This,
     50   IN EFI_TIMER_NOTIFY         NotifyFunction
     51   );
     52 
     53 EFI_STATUS
     54 EFIAPI
     55 EmuTimerDriverSetTimerPeriod (
     56   IN EFI_TIMER_ARCH_PROTOCOL  *This,
     57   IN UINT64                   TimerPeriod
     58   );
     59 
     60 EFI_STATUS
     61 EFIAPI
     62 EmuTimerDriverGetTimerPeriod (
     63   IN EFI_TIMER_ARCH_PROTOCOL   *This,
     64   OUT UINT64                   *TimerPeriod
     65   );
     66 
     67 EFI_STATUS
     68 EFIAPI
     69 EmuTimerDriverGenerateSoftInterrupt (
     70   IN EFI_TIMER_ARCH_PROTOCOL  *This
     71   );
     72 
     73 #endif
     74