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#include "nm.h"
7
8#include <stddef.h>
9#include <stdint.h>
10
11typedef struct tobi_input_meta {
12 int is_table;
13 char signature[5];
14 char *source;
15 char oem_id[7];
16 char oem_table_id[9];
17 char creator_id[5];
18 size_t table_len;
19 size_t aml_off;
20 size_t aml_len;
21 uint32_t oem_revision;
22 uint32_t creator_revision;
23 uint32_t header_hash;
24 uint32_t aml_hash;
25 uint8_t revision;
26 uint8_t checksum_byte;
27 uint8_t checksum_sum;
28 int checksum_valid;
29} tobi_input_meta;
30
31typedef struct tobi_parse_result {
32 tobi_ir *root;
33 tobi_diag_list diag;
34 tobi_ns ns;
35 tobi_input_meta meta;
36 tobi_input_meta *inputs;
37 size_t input_len;
38} tobi_parse_result;
39
40typedef struct tobi_parse_input {
41 const uint8_t *data;
42 size_t len;
43 const char *name;
44} tobi_parse_input;
45
46int tobi_parse(const uint8_t *data, size_t len, int strict, tobi_parse_result *out);
47
48int tobi_parse_multi(const tobi_parse_input *inputs, size_t count, int strict, tobi_parse_result *out);
49
50void tobi_parse_result_free(tobi_parse_result *res);
51
52#endif