TianoCore EDK2 master
Loading...
Searching...
No Matches
Timer.h
Go to the documentation of this file.
1
8#ifndef _TIMER_H_
9#define _TIMER_H_
10
11#include <PiDxe.h>
12
13#include <Protocol/Cpu.h>
14#include <Protocol/Legacy8259.h>
15#include <Protocol/Timer.h>
16
18#include <Library/BaseLib.h>
19#include <Library/DebugLib.h>
20#include <Library/IoLib.h>
21
22//
23// The PCAT 8253/8254 has an input clock at 1.193182 MHz and Timer 0 is
24// initialized as a 16 bit free running counter that generates an interrupt(IRQ0)
25// each time the counter rolls over.
26//
27// 65536 counts
28// ---------------- * 1,000,000 uS/S = 54925.4 uS = 549254 * 100 ns
29// 1,193,182 Hz
30//
31
32//
33// The maximum tick duration for 8254 timer
34//
35#define MAX_TIMER_TICK_DURATION 549254
36//
37// The default timer tick duration is set to 10 ms = 100000 100 ns units
38//
39#define DEFAULT_TIMER_TICK_DURATION 100000
40#define TIMER_CONTROL_PORT 0x43
41#define TIMER0_COUNT_PORT 0x40
42
43//
44// Function Prototypes
45//
46
59EFIAPI
61 IN EFI_HANDLE ImageHandle,
62 IN EFI_SYSTEM_TABLE *SystemTable
63 )
64;
65
95EFIAPI
99 )
100;
101
131EFIAPI
134 IN UINT64 TimerPeriod
135 )
136;
137
155EFIAPI
158 OUT UINT64 *TimerPeriod
159 )
160;
161
180EFIAPI
183 )
184;
185
186#endif
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
VOID(EFIAPI * EFI_TIMER_NOTIFY)(IN UINT64 Time)
Definition: Timer.h:41
EFI_STATUS EFIAPI TimerDriverInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: Timer.c:339
EFI_STATUS EFIAPI TimerDriverRegisterHandler(IN EFI_TIMER_ARCH_PROTOCOL *This, IN EFI_TIMER_NOTIFY NotifyFunction)
Definition: TimerDxe.c:69
EFI_STATUS EFIAPI TimerDriverGetTimerPeriod(IN EFI_TIMER_ARCH_PROTOCOL *This, OUT UINT64 *TimerPeriod)
Definition: TimerDxe.c:193
EFI_STATUS EFIAPI TimerDriverSetTimerPeriod(IN EFI_TIMER_ARCH_PROTOCOL *This, IN UINT64 TimerPeriod)
Definition: TimerDxe.c:130
EFI_STATUS EFIAPI TimerDriverGenerateSoftInterrupt(IN EFI_TIMER_ARCH_PROTOCOL *This)
Definition: TimerDxe.c:223
VOID EFIAPI NotifyFunction(IN EFI_EVENT Event, IN VOID *Context)
Definition: ScsiBus.c:1492
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33