aml-build.h (0403b0f539f40a21da60409b825b4653b273ab39) aml-build.h (ff80dc7fa8045e2b2531888d965424d2b0e1d1b6)
1#ifndef HW_ACPI_GEN_UTILS_H
2#define HW_ACPI_GEN_UTILS_H
3
4#include <stdint.h>
5#include <glib.h>
6#include "qemu/compiler.h"
7#include "hw/acpi/acpi-defs.h"
8

--- 22 unchanged lines hidden (view full) ---

31
32 /*< private >*/
33 uint8_t op;
34 AmlBlockFlags block_flags;
35};
36typedef struct Aml Aml;
37
38typedef enum {
1#ifndef HW_ACPI_GEN_UTILS_H
2#define HW_ACPI_GEN_UTILS_H
3
4#include <stdint.h>
5#include <glib.h>
6#include "qemu/compiler.h"
7#include "hw/acpi/acpi-defs.h"
8

--- 22 unchanged lines hidden (view full) ---

31
32 /*< private >*/
33 uint8_t op;
34 AmlBlockFlags block_flags;
35};
36typedef struct Aml Aml;
37
38typedef enum {
39 aml_decode10 = 0,
40 aml_decode16 = 1,
39 AML_DECODE10 = 0,
40 AML_DECODE16 = 1,
41} AmlIODecode;
42
43typedef enum {
41} AmlIODecode;
42
43typedef enum {
44 aml_any_acc = 0,
45 aml_byte_acc = 1,
46 aml_word_acc = 2,
47 aml_dword_acc = 3,
48 aml_qword_acc = 4,
49 aml_buffer_acc = 5,
44 AML_ANY_ACC = 0,
45 AML_BYTE_ACC = 1,
46 AML_WORD_ACC = 2,
47 AML_DWORD_ACC = 3,
48 AML_QWORD_ACC = 4,
49 AML_BUFFER_ACC = 5,
50} AmlAccessType;
51
52typedef enum {
50} AmlAccessType;
51
52typedef enum {
53 aml_preserve = 0,
54 aml_write_as_ones = 1,
55 aml_write_as_zeros = 2,
53 AML_PRESERVE = 0,
54 AML_WRITE_AS_ONES = 1,
55 AML_WRITE_AS_ZEROS = 2,
56} AmlUpdateRule;
57
58typedef enum {
56} AmlUpdateRule;
57
58typedef enum {
59 aml_system_memory = 0x00,
60 aml_system_io = 0x01,
59 AML_SYSTEM_MEMORY = 0X00,
60 AML_SYSTEM_IO = 0X01,
61} AmlRegionSpace;
62
63typedef enum {
61} AmlRegionSpace;
62
63typedef enum {
64 aml_memory_range = 0,
65 aml_io_range = 1,
66 aml_bus_number_range = 2,
64 AML_MEMORY_RANGE = 0,
65 AML_IO_RANGE = 1,
66 AML_BUS_NUMBER_RANGE = 2,
67} AmlResourceType;
68
69typedef enum {
67} AmlResourceType;
68
69typedef enum {
70 aml_sub_decode = 1 << 1,
71 aml_pos_decode = 0
70 AML_SUB_DECODE = 1 << 1,
71 AML_POS_DECODE = 0
72} AmlDecode;
73
74typedef enum {
72} AmlDecode;
73
74typedef enum {
75 aml_max_fixed = 1 << 3,
76 aml_max_not_fixed = 0,
75 AML_MAX_FIXED = 1 << 3,
76 AML_MAX_NOT_FIXED = 0,
77} AmlMaxFixed;
78
79typedef enum {
77} AmlMaxFixed;
78
79typedef enum {
80 aml_min_fixed = 1 << 2,
81 aml_min_not_fixed = 0
80 AML_MIN_FIXED = 1 << 2,
81 AML_MIN_NOT_FIXED = 0
82} AmlMinFixed;
83
84/*
85 * ACPI 1.0b: Table 6-26 I/O Resource Flag (Resource Type = 1) Definitions
86 * _RNG field definition
87 */
88typedef enum {
82} AmlMinFixed;
83
84/*
85 * ACPI 1.0b: Table 6-26 I/O Resource Flag (Resource Type = 1) Definitions
86 * _RNG field definition
87 */
88typedef enum {
89 aml_isa_only = 1,
90 aml_non_isa_only = 2,
91 aml_entire_range = 3,
89 AML_ISA_ONLY = 1,
90 AML_NON_ISA_ONLY = 2,
91 AML_ENTIRE_RANGE = 3,
92} AmlISARanges;
93
94/*
95 * ACPI 1.0b: Table 6-25 Memory Resource Flag (Resource Type = 0) Definitions
96 * _MEM field definition
97 */
98typedef enum {
92} AmlISARanges;
93
94/*
95 * ACPI 1.0b: Table 6-25 Memory Resource Flag (Resource Type = 0) Definitions
96 * _MEM field definition
97 */
98typedef enum {
99 aml_non_cacheable = 0,
100 aml_cacheable = 1,
101 aml_write_combining = 2,
102 aml_prefetchable = 3,
103} AmlCacheble;
99 AML_NON_CACHEABLE = 0,
100 AML_CACHEABLE = 1,
101 AML_WRITE_COMBINING = 2,
102 AML_PREFETCHABLE = 3,
103} AmlCacheable;
104
105/*
106 * ACPI 1.0b: Table 6-25 Memory Resource Flag (Resource Type = 0) Definitions
107 * _RW field definition
108 */
109typedef enum {
104
105/*
106 * ACPI 1.0b: Table 6-25 Memory Resource Flag (Resource Type = 0) Definitions
107 * _RW field definition
108 */
109typedef enum {
110 aml_ReadOnly = 0,
111 aml_ReadWrite = 1,
110 AML_READ_ONLY = 0,
111 AML_READ_WRITE = 1,
112} AmlReadAndWrite;
113
114typedef
115struct AcpiBuildTables {
116 GArray *table_data;
117 GArray *rsdp;
118 GArray *tcpalog;
119 GArray *linker;

--- 66 unchanged lines hidden (view full) ---

186 uint16_t addr_min, uint16_t addr_max,
187 uint16_t addr_trans, uint16_t len);
188Aml *aml_word_io(AmlMinFixed min_fixed, AmlMaxFixed max_fixed,
189 AmlDecode dec, AmlISARanges isa_ranges,
190 uint16_t addr_gran, uint16_t addr_min,
191 uint16_t addr_max, uint16_t addr_trans,
192 uint16_t len);
193Aml *aml_dword_memory(AmlDecode dec, AmlMinFixed min_fixed,
112} AmlReadAndWrite;
113
114typedef
115struct AcpiBuildTables {
116 GArray *table_data;
117 GArray *rsdp;
118 GArray *tcpalog;
119 GArray *linker;

--- 66 unchanged lines hidden (view full) ---

186 uint16_t addr_min, uint16_t addr_max,
187 uint16_t addr_trans, uint16_t len);
188Aml *aml_word_io(AmlMinFixed min_fixed, AmlMaxFixed max_fixed,
189 AmlDecode dec, AmlISARanges isa_ranges,
190 uint16_t addr_gran, uint16_t addr_min,
191 uint16_t addr_max, uint16_t addr_trans,
192 uint16_t len);
193Aml *aml_dword_memory(AmlDecode dec, AmlMinFixed min_fixed,
194 AmlMaxFixed max_fixed, AmlCacheble cacheable,
194 AmlMaxFixed max_fixed, AmlCacheable cacheable,
195 AmlReadAndWrite read_and_write,
196 uint32_t addr_gran, uint32_t addr_min,
197 uint32_t addr_max, uint32_t addr_trans,
198 uint32_t len);
199Aml *aml_qword_memory(AmlDecode dec, AmlMinFixed min_fixed,
195 AmlReadAndWrite read_and_write,
196 uint32_t addr_gran, uint32_t addr_min,
197 uint32_t addr_max, uint32_t addr_trans,
198 uint32_t len);
199Aml *aml_qword_memory(AmlDecode dec, AmlMinFixed min_fixed,
200 AmlMaxFixed max_fixed, AmlCacheble cacheable,
200 AmlMaxFixed max_fixed, AmlCacheable cacheable,
201 AmlReadAndWrite read_and_write,
202 uint64_t addr_gran, uint64_t addr_min,
203 uint64_t addr_max, uint64_t addr_trans,
204 uint64_t len);
205
206/* Block AML object primitives */
207Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
208Aml *aml_device(const char *name_format, ...) GCC_FMT_ATTR(1, 2);

--- 18 unchanged lines hidden ---
201 AmlReadAndWrite read_and_write,
202 uint64_t addr_gran, uint64_t addr_min,
203 uint64_t addr_max, uint64_t addr_trans,
204 uint64_t len);
205
206/* Block AML object primitives */
207Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
208Aml *aml_device(const char *name_format, ...) GCC_FMT_ATTR(1, 2);

--- 18 unchanged lines hidden ---