ACPI AML decompiler w/ CFG recovery and structured pseudocode
1#ifndef TOBI_P_H
2#define TOBI_P_H
3
4#include "dg.h"
5#include "ir.h"
6
7#include <stddef.h>
8#include <stdint.h>
9
10typedef struct tobi_input_meta {
11 int is_table;
12 char signature[5];
13 size_t table_len;
14 size_t aml_off;
15 size_t aml_len;
16 uint8_t checksum_sum;
17 int checksum_valid;
18} tobi_input_meta;
19
20typedef struct tobi_parse_result {
21 tobi_ir *root;
22 tobi_diag_list diag;
23 tobi_input_meta meta;
24} tobi_parse_result;
25
26typedef struct tobi_parse_input {
27 const uint8_t *data;
28 size_t len;
29 const char *name;
30} tobi_parse_input;
31
32/** Parse a raw AML blob or DSDT/SSDT table into IR and diagnostics. */
33int tobi_parse(const uint8_t *data, size_t len, int strict, tobi_parse_result *out);
34
35/** Parse several AML blobs/tables into one IR with a shared method namespace pre-pass. */
36int tobi_parse_multi(const tobi_parse_input *inputs, size_t count, int strict, tobi_parse_result *out);
37
38/** Free all allocations owned by a parse result. */
39void tobi_parse_result_free(tobi_parse_result *res);
40
41#endif