PatchworkOS  2ca1c69
A non-POSIX operating system.
Loading...
Searching...
No Matches
eisa_id.h
Go to the documentation of this file.
1#pragma once
2
3#include <stddef.h>
4#include <stdint.h>
5
6/**
7 * @brief EISA ID to string and vice versa conversion
8 * @defgroup modules_acpi_aml_runtime_eisa_id EISA ID
9 * @ingroup modules_acpi_aml
10 *
11 * @{
12 */
13
14/**
15 * @brief Convert a string EISA ID to a numeric EISA ID.
16 *
17 * The conversion rules for EISA were derived from section 19.3.4 ASL Macros of the ACPI specification.
18 *
19 * @param str Pointer to the string EISA ID. Must be 7 characters long.
20 * @return On success, the numeric EISA ID. On failure, `ERR` and `errno` is set.
21 */
22uint64_t aml_eisa_id_from_string(const char* str);
23
24/**
25 * @brief Convert a numeric EISA ID to a string EISA ID.
26 *
27 * The conversion rules for EISA were derived from section 19.3.4 ASL Macros of the ACPI specification.
28 *
29 * @param eisaId The numeric EISA ID.
30 * @param buffer Pointer to a buffer to write the string EISA ID to. Must be at least 8 bytes long.
31 * @param bufferSize The size of the buffer in bytes.
32 * @return On success, `0`. On failure, `ERR` and `errno` is set.
33 */
34uint64_t aml_eisa_id_to_string(uint32_t eisaId, char* buffer, size_t bufferSize);
35
36/** @} */
uint64_t aml_eisa_id_to_string(uint32_t eisaId, char *buffer, size_t bufferSize)
Convert a numeric EISA ID to a string EISA ID.
Definition eisa_id.c:56
uint64_t aml_eisa_id_from_string(const char *str)
Convert a string EISA ID to a numeric EISA ID.
Definition eisa_id.c:8
EFI_PHYSICAL_ADDRESS buffer
Definition mem.c:15
__UINT32_TYPE__ uint32_t
Definition stdint.h:15
__UINT64_TYPE__ uint64_t
Definition stdint.h:17