Home | History | Annotate | Download | only in HpetTimerDxe

Lines Matching refs:Timer

2   Timer Architectural Protocol module using High Precesion Event Timer (HPET)

18 #include <Protocol/Timer.h>
33 /// Define value for an invalid HPET Timer index.
38 /// Timer Architectural Protocol function prototypes.
43 the timer interrupt fires. It also passes the amount of time since the last
46 returned. If the CPU does not support registering a timer interrupt handler,
51 register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR
55 @param NotifyFunction The function to call when a timer interrupt fires.
57 Core will register a handler for the timer interrupt,
59 information is used to signal timer based events.
62 @retval EFI_SUCCESS The timer handler was registered.
63 @retval EFI_UNSUPPORTED The platform does not support timer interrupts.
68 @retval EFI_DEVICE_ERROR The timer handler could not be registered.
79 This function adjusts the period of timer interrupts to the value specified
80 by TimerPeriod. If the timer period is updated, then the selected timer
82 the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.
83 If an error occurs while attempting to update the timer period, then the
84 timer hardware will be put back in its state prior to this call, and
85 EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt
87 Instead, it must either turn off the timer hardware, or it must adjust the
88 interrupt controller so that a CPU interrupt is not generated when the timer
92 @param TimerPeriod The rate to program the timer interrupt in 100 nS units.
93 If the timer hardware is not programmable, then
94 EFI_UNSUPPORTED is returned. If the timer is programmable,
95 then the timer period will be rounded up to the nearest
96 timer period that is supported by the timer hardware.
97 If TimerPeriod is set to 0, then the timer interrupts
100 @retval EFI_SUCCESS The timer period was changed.
101 @retval EFI_UNSUPPORTED The platform cannot change the period of the timer interrupt.
102 @retval EFI_DEVICE_ERROR The timer period could not be changed due to a device error.
113 This function retrieves the period of timer interrupts in 100 ns units,
116 returned, then the timer is currently disabled.
119 @param TimerPeriod A pointer to the timer period to retrieve in 100 ns units.
120 If 0 is returned, then the timer is currently disabled.
122 @retval EFI_SUCCESS The timer period was returned in TimerPeriod.
134 This function generates a soft timer interrupt. If the platform does not support soft
135 timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned.
137 service, then a soft timer interrupt will be generated. If the timer interrupt is
139 registered handler should not be able to distinguish a hardware-generated timer
140 interrupt from a software-generated timer interrupt.
144 @retval EFI_SUCCESS The soft timer interrupt was generated.
146 timer interrupts.
156 /// The handle onto which the Timer Architectural Protocol will be installed.
161 /// The Timer Architectural Protocol that this driver produces.
176 /// The notification function to call on every timer interrupt.
181 /// The current period of the HPET timer interrupt in 100 ns units.
186 /// The number of HPET timer ticks required for the current HPET rate specified by mTimerPeriod.
196 /// The HPET main counter value from the most recent HPET timer interrupt.
203 /// The index of the HPET timer being managed by this driver.
208 /// The I/O APIC IRQ that the HPET Timer is mapped if I/O APIC mode is used.
225 /// Cached state of the Configuration register for the HPET Timer managed by
232 /// Counts the number of HPET Timer interrupts processed by this driver.
270 Enable or disable the main counter in the HPET Timer.
272 @param Enable If TRUE, then enable the main counter in the HPET Timer.
273 If FALSE, then disable the main counter in the HPET Timer.
285 The interrupt handler for the HPET timer. This handler clears the HPET interrupt
286 and computes the amount of time that has passed since the last HPET timer interrupt.
312 // Clear HPET timer interrupt status
322 // Disable HPET timer when adjusting the COMPARATOR value to prevent a missed interrupt
337 // Set HPET COMPARATOR to the value required for the next timer tick
408 the timer interrupt fires. It also passes the amount of time since the last
411 returned. If the CPU does not support registering a timer interrupt handler,
416 register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR
420 @param NotifyFunction The function to call when a timer interrupt fires.
422 Core will register a handler for the timer interrupt,
424 information is used to signal timer based events.
427 @retval EFI_SUCCESS The timer handler was registered.
428 @retval EFI_UNSUPPORTED The platform does not support timer interrupts.
433 @retval EFI_DEVICE_ERROR The timer handler could not be registered.
462 This function adjusts the period of timer interrupts to the value specified
463 by TimerPeriod. If the timer period is updated, then the selected timer
465 the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.
466 If an error occurs while attempting to update the timer period, then the
467 timer hardware will be put back in its state prior to this call, and
468 EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt
470 Instead, it must either turn off the timer hardware, or it must adjust the
471 interrupt controller so that a CPU interrupt is not generated when the timer
475 @param TimerPeriod The rate to program the timer interrupt in 100 nS units.
476 If the timer hardware is not programmable, then
477 EFI_UNSUPPORTED is returned. If the timer is programmable,
478 then the timer period will be rounded up to the nearest
479 timer period that is supported by the timer hardware.
480 If TimerPeriod is set to 0, then the timer interrupts
483 @retval EFI_SUCCESS The timer period was changed.
484 @retval EFI_UNSUPPORTED The platform cannot change the period of the timer interrupt.
485 @retval EFI_DEVICE_ERROR The timer period could not be changed due to a device error.
507 // Disable HPET timer when adjusting the timer period
536 // If TimerPeriod is 0, then mask HPET Timer interrupts
552 // Disable HPET timer interrupt
583 // Enable HPET Timer interrupt generation
587 // Program MSI Address and MSI Data values in the selected HPET Timer
599 // Enable timer interrupt through I/O APIC
614 // Save the new timer period
619 // Enable the HPET counter once new timer period has been established
620 // The HPET counter should run even if the HPET Timer interrupts are
635 This function retrieves the period of timer interrupts in 100 ns units,
638 returned, then the timer is currently disabled.
641 @param TimerPeriod A pointer to the timer period to retrieve in 100 ns units.
642 If 0 is returned, then the timer is currently disabled.
644 @retval EFI_SUCCESS The timer period was returned in TimerPeriod.
665 This function generates a soft timer interrupt. If the platform does not support soft
666 timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned.
668 service, then a soft timer interrupt will be generated. If the timer interrupt is
670 registered handler should not be able to distinguish a hardware-generated timer
671 interrupt from a software-generated timer interrupt.
675 @retval EFI_SUCCESS The soft timer interrupt was generated.
677 timer interrupts.
749 Initialize the Timer Architectural Protocol driver
754 @retval EFI_SUCCESS Timer Architectural Protocol created
771 DEBUG ((DEBUG_INFO, "Init HPET Timer Driver\n"));
774 // Make sure the Timer Architectural Protocol is not already installed in the system
802 // Force the HPET timer to be disabled while setting everything up
829 // Determine the interrupt mode to use for the HPET Timer.
836 // Read the HPET Timer Capabilities and Configuration register
841 // Check to see if this HPET Timer supports MSI
845 // Save the index of the first HPET Timer that supports MSI interrupts
853 // Check to see if this HPET Timer supports I/O APIC interrupts
857 // Save the index of the first HPET Timer that supports I/O APIC interrupts
873 // Program MSI Address and MSI Data values in the selected HPET Timer
880 // Read the HPET Timer Capabilities and Configuration register and initialize for MSI mode
896 // Initialize I/O APIC entry for HPET Timer Interrupt
902 // Read the HPET Timer
913 // Configure the selected HPET Timer with settings common to both MSI mode and I/O APIC mode
924 // Read the HPET Timer Capabilities and Configuration register back again.
925 // CounterSizeEnable will be read back as a 0 if it is a 32-bit only timer
929 DEBUG ((DEBUG_INFO, "Choose 64-bit HPET timer.\n"));
931 // 64-bit BIOS can use 64-bit HPET timer
935 // Set timer back to 64-bit
940 DEBUG ((DEBUG_INFO, "Choose 32-bit HPET timer.\n"));
945 // Install interrupt handler for selected HPET Timer
955 // Force the HPET Timer to be enabled at its default period
960 DEBUG ((DEBUG_ERROR, "Unable to set HPET default timer rate. Unload HPET driver.\n"));
965 // Show state of enabled HPET timer
976 DEBUG ((DEBUG_INFO, "HPET Timer Period = %d\n", mTimerPeriod));
977 DEBUG ((DEBUG_INFO, "HPET Timer Count = 0x%016lx\n", mTimerCount));
983 // Wait for a few timer interrupts to fire before continuing
989 // Install the Timer Architectural Protocol onto a new handle