PatchworkOS
Loading...
Searching...
No Matches
integer.c
Go to the documentation of this file.
2
4#include <kernel/log/log.h>
5
7
9{
11 if (dsdt == NULL)
12 {
13 LOG_ERR("failed to retrieve DSDT\n");
14 return ERR;
15 }
16 integerByteSize = dsdt->header.revision < 2 ? 4 : 8; // Section 5.2.11.1
17
18 LOG_INFO("using AML integer size %u bits\n", integerByteSize * 8);
19 return 0;
20}
21
26
28{
29 return integerByteSize * 8;
30}
31
uint8_t aml_integer_bit_size(void)
Get the bit size of an AML integer.
Definition integer.c:27
uint64_t aml_integer_t
AML Integer type.
Definition integer.h:20
uint64_t aml_integer_handling_init(void)
Initialize integer handling.
Definition integer.c:8
aml_integer_t aml_integer_ones(void)
Get a mask with all bits set for the current AML integer size.
Definition integer.c:32
uint8_t aml_integer_byte_size(void)
Get the byte size of an AML integer.
Definition integer.c:22
sdt_header_t * acpi_tables_lookup(const char *signature, uint64_t n)
Lookup the n'th table matching the signature.
Definition tables.c:281
#define DSDT_SIGNATURE
DSDT table signature.
Definition tables.h:219
#define LOG_ERR(format,...)
Definition log.h:89
#define LOG_INFO(format,...)
Definition log.h:87
#define NULL
Pointer error value.
Definition NULL.h:23
#define ERR
Integer error value.
Definition ERR.h:17
static uint8_t integerByteSize
Definition integer.c:6
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
#define UINT64_MAX
Definition stdint.h:74
__UINT8_TYPE__ uint8_t
Definition stdint.h:11
#define UINT32_MAX
Definition stdint.h:70
Differentiated System Description Table.
Definition tables.h:211
sdt_header_t header
Definition tables.h:212
uint8_t revision
Definition acpi.h:93