PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
integer.h
Go to the documentation of this file.
1#pragma once
2
3#include <kernel/defs.h>
4#include <stdint.h>
5
6/**
7 * @brief Integer revision handling
8 * @defgroup modules_acpi_aml_integer Integer
9 * @ingroup modules_acpi_aml
10 *
11 * This module handles the varying size of integers in AML, which can be either 32 or 64 bits depending on the ACPI
12 * revision.
13 *
14 * @{
15 */
16
17/**
18 * @brief AML Integer type.
19 */
21
22/**
23 * @brief AML Boolean true value.
24 */
25#define AML_TRUE aml_integer_ones()
26
27/**
28 * @brief AML Boolean false value.
29 */
30#define AML_FALSE 0
31
32/**
33 * @brief Initialize integer handling.
34 *
35 * @return On success, `0`. On failure, `ERR` and `errno` is set.
36 */
38
39/**
40 * @brief Get the byte size of an AML integer.
41 *
42 * @return The byte size of an AML integer (4 or 8).
43 */
45
46/**
47 * @brief Get the bit size of an AML integer.
48 *
49 * @return The bit size of an AML integer (32 or 64).
50 */
52
53/**
54 * @brief Get a mask with all bits set for the current AML integer size.
55 *
56 * @return A mask with all bits set for the current AML integer size.
57 */
59
60/** @} */
#define PURE
GCC.
Definition defs.h:65
uint64_t aml_integer_handling_init(void)
Initialize integer handling.
Definition integer.c:8
uint8_t aml_integer_bit_size(void) PURE
Get the bit size of an AML integer.
Definition integer.c:27
aml_uint_t aml_integer_ones(void) PURE
Get a mask with all bits set for the current AML integer size.
Definition integer.c:32
uint64_t aml_uint_t
AML Integer type.
Definition integer.h:20
uint8_t aml_integer_byte_size(void) PURE
Get the byte size of an AML integer.
Definition integer.c:22
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
__UINT8_TYPE__ uint8_t
Definition stdint.h:11