ReactOS 0.4.16-dev-1946-g52006dd
tables.h
Go to the documentation of this file.
1#pragma once
2
3#include <uacpi/types.h>
4#include <uacpi/status.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10// Forward-declared to avoid including the entire acpi.h here
11struct acpi_fadt;
12
15
16 // if oemid[0] == 0 this field is ignored
17 char oemid[6];
18
19 // if oem_table_id[0] == 0 this field is ignored
20 char oem_table_id[8];
22
23typedef struct uacpi_table {
24 union {
26 void *ptr;
27 struct acpi_sdt_hdr *hdr;
28 };
29
30 // Index number used to identify this table internally
33
34/*
35 * Install a table from either a virtual or a physical address.
36 * The table is simply stored in the internal table array, and not loaded by
37 * the interpreter (see uacpi_table_load).
38 *
39 * The table is optionally returned via 'out_table'.
40 *
41 * Manual calls to uacpi_table_install are not subject to filtering via the
42 * table installation callback (if any).
43 */
45 void*, uacpi_table *out_table
46);
49);
50
51#ifndef UACPI_BAREBONES_MODE
52/*
53 * Load a previously installed table by feeding it to the interpreter.
54 */
56#endif // !UACPI_BAREBONES_MODE
57
58/*
59 * Helpers for finding tables.
60 *
61 * NOTE:
62 * The returned table's reference count is incremented by 1, which keeps its
63 * mapping alive forever unless uacpi_table_unref() is called for this table
64 * later on. Calling uacpi_table_find_next_with_same_signature() on a table also
65 * drops its reference count by 1, so if you want to keep it mapped you must
66 * manually call uacpi_table_ref() beforehand.
67 */
69 const uacpi_char *signature, uacpi_table *out_table
70);
72 uacpi_table *in_out_table
73);
75 const uacpi_table_identifiers *id, uacpi_table *out_table
76);
77
78/*
79 * Increment/decrement a table's reference count.
80 * The table is unmapped when the reference count drops to 0.
81 */
84
85/*
86 * Returns the pointer to a sanitized internal version of FADT.
87 *
88 * The revision is guaranteed to be correct. All of the registers are converted
89 * to GAS format. Fields that might contain garbage are cleared.
90 */
91uacpi_status uacpi_table_fadt(struct acpi_fadt**);
92
94 // Allow the table to be installed as-is
96
97 /*
98 * Deny the table from being installed completely. This is useful for
99 * debugging various problems, e.g. AML loading bad SSDTs that cause the
100 * system to hang or enter an undesired state.
101 */
103
104 /*
105 * Override the table being installed with the table at the virtual address
106 * returned in 'out_override_address'.
107 */
109
110 /*
111 * Override the table being installed with the table at the physical address
112 * returned in 'out_override_address'.
113 */
116
118 (struct acpi_sdt_hdr *hdr, uacpi_u64 *out_override_address);
119
120/*
121 * Set a handler that is invoked for each table before it gets installed.
122 *
123 * Depending on the return value, the table is either allowed to be installed
124 * as-is, denied, or overriden with a new one.
125 */
128);
129
130#ifdef __cplusplus
131}
132#endif
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
size_t uacpi_size
Definition: types.h:37
uint64_t uacpi_u64
Definition: types.h:22
char uacpi_char
Definition: types.h:44
uacpi_uintptr uacpi_virt_addr
Definition: types.h:36
uacpi_status
Definition: status.h:10
uacpi_u64 uacpi_phys_addr
Definition: types.h:17
GLuint index
Definition: glext.h:6031
char hdr[14]
Definition: iptest.cpp:33
uacpi_object_name signature
Definition: tables.h:14
char oem_table_id[8]
Definition: tables.h:20
void * ptr
Definition: tables.h:26
struct acpi_sdt_hdr * hdr
Definition: tables.h:27
uacpi_virt_addr virt_addr
Definition: tables.h:25
uacpi_size index
Definition: tables.h:31
uacpi_status uacpi_table_find(const uacpi_table_identifiers *id, uacpi_table *out_table)
Definition: tables.c:1013
uacpi_status uacpi_table_ref(uacpi_table *)
Definition: tables.c:1151
uacpi_status uacpi_table_load(uacpi_size index)
Definition: tables.c:1138
uacpi_status uacpi_table_find_next_with_same_signature(uacpi_table *in_out_table)
Definition: tables.c:995
uacpi_table_installation_disposition
Definition: tables.h:93
@ UACPI_TABLE_INSTALLATION_DISPOSITON_DENY
Definition: tables.h:102
@ UACPI_TABLE_INSTALLATION_DISPOSITON_PHYSICAL_OVERRIDE
Definition: tables.h:114
@ UACPI_TABLE_INSTALLATION_DISPOSITON_VIRTUAL_OVERRIDE
Definition: tables.h:108
@ UACPI_TABLE_INSTALLATION_DISPOSITON_ALLOW
Definition: tables.h:95
uacpi_status uacpi_table_install(void *, uacpi_table *out_table)
Definition: tables.c:812
uacpi_status uacpi_table_unref(uacpi_table *)
Definition: tables.c:1158
uacpi_status uacpi_table_find_by_signature(const uacpi_char *signature, uacpi_table *out_table)
Definition: tables.c:975
uacpi_table_installation_disposition(* uacpi_table_installation_handler)(struct acpi_sdt_hdr *hdr, uacpi_u64 *out_override_address)
Definition: tables.h:118
uacpi_status uacpi_table_install_physical(uacpi_phys_addr, uacpi_table *out_table)
Definition: tables.c:821
uacpi_status uacpi_table_fadt(struct acpi_fadt **)
Definition: tables.c:1391
uacpi_status uacpi_set_table_installation_handler(uacpi_table_installation_handler handler)
Definition: tables.c:356