PatchworkOS  da8a090
A non-POSIX operating system.
Loading...
Searching...
No Matches
apic_timer.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4
5/**
6 * @brief Advanced Programmable Interrupt Controller Timer.
7 * @defgroup modules_drivers_apic_timer APIC Timer
8 * @ingroup modules_drivers_apic
9 *
10 * Each local APIC is associated with a timer which can be used to generate interrupts at specific intervals, or as we
11 * use it, to generate a single interrupt after a specified time.
12 *
13 * @see [ACPI Specification Version 6.6](https://uefi.org/sites/default/files/resources/ACPI_Spec_6.6.pdf)
14 *
15 * @{
16 */
17
18/**
19 * @brief APIC Timer Modes.
20 * @enum apic_timer_mode_t
21 */
22typedef enum
23{
24 APIC_TIMER_MASKED = 0x10000, ///< Timer is masked (disabled)
26 APIC_TIMER_ONE_SHOT = 0x00000
28
29/**
30 * @brief APIC Timer Divider Values.
31 * @enum apic_timer_divider_t
32 */
41
42/**
43 * @brief Initialize the APIC timer subsystem.
44 *
45 * @return On success, `0`. On failure, `ERR`.
46 */
48
49/** @} */
apic_timer_mode_t
APIC Timer Modes.
Definition apic_timer.h:23
apic_timer_divider_t
APIC Timer Divider Values.
Definition apic_timer.h:34
uint64_t apic_timer_init(void)
Initialize the APIC timer subsystem.
Definition apic_timer.c:86
@ APIC_TIMER_ONE_SHOT
Definition apic_timer.h:26
@ APIC_TIMER_PERIODIC
Definition apic_timer.h:25
@ APIC_TIMER_MASKED
Timer is masked (disabled)
Definition apic_timer.h:24
@ APIC_TIMER_DIV_64
Definition apic_timer.h:37
@ APIC_TIMER_DIV_128
Definition apic_timer.h:38
@ APIC_TIMER_DIV_16
Definition apic_timer.h:35
@ APIC_TIMER_DIV_DEFAULT
Definition apic_timer.h:39
@ APIC_TIMER_DIV_32
Definition apic_timer.h:36
__UINT64_TYPE__ uint64_t
Definition stdint.h:17