ACPI AML decompiler w/ CFG recovery and structured pseudocode
29

Configure Feed

Select the types of activity you want to include in your feed.

tobi / src / ir.h
2.1 kB 97 lines
1#ifndef TOBI_IR_H 2#define TOBI_IR_H 3 4#include <stddef.h> 5#include <stdint.h> 6 7typedef enum tobi_ir_kind { 8 TOBI_IR_ROOT, 9 TOBI_IR_BLOCK, 10 TOBI_IR_SCOPE, 11 TOBI_IR_DEVICE, 12 TOBI_IR_METHOD, 13 TOBI_IR_PROCESSOR, 14 TOBI_IR_NAME, 15 TOBI_IR_ALIAS, 16 TOBI_IR_OPREGION, 17 TOBI_IR_FIELD, 18 TOBI_IR_FIELD_ELEM, 19 TOBI_IR_MUTEX, 20 TOBI_IR_EVENT, 21 TOBI_IR_RESOURCE, 22 TOBI_IR_BUFFER, 23 TOBI_IR_PACKAGE, 24 TOBI_IR_INTEGER, 25 TOBI_IR_STRING, 26 TOBI_IR_REF, 27 TOBI_IR_CALL, 28 TOBI_IR_EXPR, 29 TOBI_IR_STORE, 30 TOBI_IR_RETURN, 31 TOBI_IR_IF, 32 TOBI_IR_WHILE, 33 TOBI_IR_BREAK, 34 TOBI_IR_CONTINUE, 35 TOBI_IR_UNKNOWN, 36 TOBI_IR_DIAG 37} tobi_ir_kind; 38 39typedef struct tobi_ir { 40 tobi_ir_kind kind; 41 size_t id; 42 size_t parent_id; 43 size_t parent_index; 44 size_t off; 45 size_t len; 46 char *name; 47 char *path; 48 char *scope; 49 char *str; 50 char *target; 51 char *source; 52 uint64_t value; 53 uint64_t bit_off; 54 uint64_t bit_len; 55 uint32_t raw_op; 56 unsigned access_type; 57 unsigned lock_rule; 58 unsigned update_rule; 59 unsigned method_args; 60 unsigned method_serialized; 61 unsigned method_sync; 62 struct tobi_ir **child; 63 size_t child_len; 64 size_t child_cap; 65 size_t input_index; 66 int has_source; 67} tobi_ir; 68 69tobi_ir *tobi_ir_new(tobi_ir_kind kind, size_t off, size_t len); 70 71void tobi_ir_free(tobi_ir *node); 72 73void tobi_ir_add(tobi_ir *parent, tobi_ir *child); 74 75void tobi_ir_assign_ids(tobi_ir *root); 76 77void tobi_ir_set_name(tobi_ir *node, const char *s); 78 79void tobi_ir_set_path(tobi_ir *node, const char *s); 80 81void tobi_ir_set_scope(tobi_ir *node, const char *s); 82 83void tobi_ir_set_str(tobi_ir *node, const char *s); 84 85void tobi_ir_set_target(tobi_ir *node, const char *s); 86 87void tobi_ir_set_source(tobi_ir *node, const char *s, size_t input_index); 88 89void tobi_ir_set_source_recursive(tobi_ir *node, const char *s, size_t input_index); 90 91const char *tobi_ir_kind_name(tobi_ir_kind kind); 92 93tobi_ir *tobi_ir_find_child(tobi_ir *node, tobi_ir_kind kind); 94 95size_t tobi_ir_count_kind(const tobi_ir *node, tobi_ir_kind kind); 96 97#endif