PatchworkOS
da8a090
A non-POSIX operating system.
Theme:
Default
Round
Robot
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
*/
22
typedef
enum
23
{
24
APIC_TIMER_MASKED
= 0x10000,
///< Timer is masked (disabled)
25
APIC_TIMER_PERIODIC
= 0x20000,
26
APIC_TIMER_ONE_SHOT
= 0x00000
27
}
apic_timer_mode_t
;
28
29
/**
30
* @brief APIC Timer Divider Values.
31
* @enum apic_timer_divider_t
32
*/
33
typedef
enum
34
{
35
APIC_TIMER_DIV_16
= 0x3,
36
APIC_TIMER_DIV_32
= 0x4,
37
APIC_TIMER_DIV_64
= 0x5,
38
APIC_TIMER_DIV_128
= 0x6,
39
APIC_TIMER_DIV_DEFAULT
=
APIC_TIMER_DIV_16
40
}
apic_timer_divider_t
;
41
42
/**
43
* @brief Initialize the APIC timer subsystem.
44
*
45
* @return On success, `0`. On failure, `ERR`.
46
*/
47
uint64_t
apic_timer_init
(
void
);
48
49
/** @} */
apic_timer_mode_t
apic_timer_mode_t
APIC Timer Modes.
Definition
apic_timer.h:23
apic_timer_divider_t
apic_timer_divider_t
APIC Timer Divider Values.
Definition
apic_timer.h:34
apic_timer_init
uint64_t apic_timer_init(void)
Initialize the APIC timer subsystem.
Definition
apic_timer.c:86
APIC_TIMER_ONE_SHOT
@ APIC_TIMER_ONE_SHOT
Definition
apic_timer.h:26
APIC_TIMER_PERIODIC
@ APIC_TIMER_PERIODIC
Definition
apic_timer.h:25
APIC_TIMER_MASKED
@ APIC_TIMER_MASKED
Timer is masked (disabled)
Definition
apic_timer.h:24
APIC_TIMER_DIV_64
@ APIC_TIMER_DIV_64
Definition
apic_timer.h:37
APIC_TIMER_DIV_128
@ APIC_TIMER_DIV_128
Definition
apic_timer.h:38
APIC_TIMER_DIV_16
@ APIC_TIMER_DIV_16
Definition
apic_timer.h:35
APIC_TIMER_DIV_DEFAULT
@ APIC_TIMER_DIV_DEFAULT
Definition
apic_timer.h:39
APIC_TIMER_DIV_32
@ APIC_TIMER_DIV_32
Definition
apic_timer.h:36
stdint.h
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
include
modules
drivers
apic
apic_timer.h
Generated on Fri Dec 12 2025 00:22:10 for PatchworkOS by
1.9.8