aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/acresrc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/acpi/acresrc.h')
-rw-r--r--include/acpi/acresrc.h390
1 files changed, 229 insertions, 161 deletions
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index 38e798b05d08..fa02e8083381 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -44,216 +44,284 @@
44#ifndef __ACRESRC_H__ 44#ifndef __ACRESRC_H__
45#define __ACRESRC_H__ 45#define __ACRESRC_H__
46 46
47/* 47/* Need the AML resource descriptor structs */
48 * Function prototypes called from Acpi* APIs
49 */
50acpi_status
51acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
52 48
53acpi_status 49#include "amlresrc.h"
54acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
55 50
56#ifdef ACPI_FUTURE_USAGE 51/*
57acpi_status 52 * If possible, pack the following structures to byte alignment, since we
58acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); 53 * don't care about performance for debug output
59#endif /* ACPI_FUTURE_USAGE */ 54 */
60 55#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
61acpi_status 56#pragma pack(1)
62acpi_rs_get_method_data(acpi_handle handle, 57#endif
63 char *path, struct acpi_buffer *ret_buffer);
64 58
65acpi_status 59/*
66acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); 60 * Individual entry for the resource conversion tables
61 */
62typedef const struct acpi_rsconvert_info {
63 u8 opcode;
64 u8 resource_offset;
65 u8 aml_offset;
66 u8 value;
67
68} acpi_rsconvert_info;
69
70/* Resource conversion opcodes */
71
72#define ACPI_RSC_INITGET 0
73#define ACPI_RSC_INITSET 1
74#define ACPI_RSC_FLAGINIT 2
75#define ACPI_RSC_1BITFLAG 3
76#define ACPI_RSC_2BITFLAG 4
77#define ACPI_RSC_COUNT 5
78#define ACPI_RSC_COUNT16 6
79#define ACPI_RSC_LENGTH 7
80#define ACPI_RSC_MOVE8 8
81#define ACPI_RSC_MOVE16 9
82#define ACPI_RSC_MOVE32 10
83#define ACPI_RSC_MOVE64 11
84#define ACPI_RSC_SET8 12
85#define ACPI_RSC_DATA8 13
86#define ACPI_RSC_ADDRESS 14
87#define ACPI_RSC_SOURCE 15
88#define ACPI_RSC_SOURCEX 16
89#define ACPI_RSC_BITMASK 17
90#define ACPI_RSC_BITMASK16 18
91#define ACPI_RSC_EXIT_NE 19
92#define ACPI_RSC_EXIT_LE 20
93
94/* Resource Conversion sub-opcodes */
95
96#define ACPI_RSC_COMPARE_AML_LENGTH 0
97#define ACPI_RSC_COMPARE_VALUE 1
98
99#define ACPI_RSC_TABLE_SIZE(d) (sizeof (d) / sizeof (struct acpi_rsconvert_info))
100
101#define ACPI_RS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_resource,f)
102#define AML_OFFSET(f) (u8) ACPI_OFFSET (union aml_resource,f)
103
104typedef const struct acpi_rsdump_info {
105 u8 opcode;
106 u8 offset;
107 char *name;
108 const char **pointer;
109
110} acpi_rsdump_info;
111
112/* Values for the Opcode field above */
113
114#define ACPI_RSD_TITLE 0
115#define ACPI_RSD_LITERAL 1
116#define ACPI_RSD_STRING 2
117#define ACPI_RSD_UINT8 3
118#define ACPI_RSD_UINT16 4
119#define ACPI_RSD_UINT32 5
120#define ACPI_RSD_UINT64 6
121#define ACPI_RSD_1BITFLAG 7
122#define ACPI_RSD_2BITFLAG 8
123#define ACPI_RSD_SHORTLIST 9
124#define ACPI_RSD_LONGLIST 10
125#define ACPI_RSD_DWORDLIST 11
126#define ACPI_RSD_ADDRESS 12
127#define ACPI_RSD_SOURCE 13
128
129/* restore default alignment */
130
131#pragma pack()
132
133/* Resource tables indexed by internal resource type */
134
135extern const u8 acpi_gbl_aml_resource_sizes[];
136extern struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[];
137
138/* Resource tables indexed by raw AML resource descriptor type */
139
140extern const u8 acpi_gbl_resource_struct_sizes[];
141extern struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[];
142
143struct acpi_vendor_walk_info {
144 struct acpi_vendor_uuid *uuid;
145 struct acpi_buffer *buffer;
146 acpi_status status;
147};
67 148
149/*
150 * rscreate
151 */
68acpi_status 152acpi_status
69acpi_rs_create_resource_list(union acpi_operand_object *byte_stream_buffer, 153acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
70 struct acpi_buffer *output_buffer); 154 struct acpi_buffer *output_buffer);
71 155
72acpi_status 156acpi_status
73acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer, 157acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
74 struct acpi_buffer *output_buffer); 158 struct acpi_buffer *output_buffer);
75 159
76acpi_status 160acpi_status
77acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, 161acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
78 struct acpi_buffer *output_buffer); 162 struct acpi_buffer *output_buffer);
79 163
80/* 164/*
81 * rsdump 165 * rsutils
82 */ 166 */
83#ifdef ACPI_FUTURE_USAGE
84void acpi_rs_dump_resource_list(struct acpi_resource *resource);
85
86void acpi_rs_dump_irq_list(u8 * route_table);
87#endif /* ACPI_FUTURE_USAGE */
88
89/*
90 * rscalc
91 */
92acpi_status
93acpi_rs_get_byte_stream_start(u8 * byte_stream_buffer,
94 u8 ** byte_stream_start, u32 * size);
95
96acpi_status
97acpi_rs_get_list_length(u8 * byte_stream_buffer,
98 u32 byte_stream_buffer_length, acpi_size * size_needed);
99
100acpi_status
101acpi_rs_get_byte_stream_length(struct acpi_resource *linked_list_buffer,
102 acpi_size * size_needed);
103
104acpi_status
105acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
106 acpi_size * buffer_size_needed);
107
108acpi_status
109acpi_rs_byte_stream_to_list(u8 * byte_stream_buffer,
110 u32 byte_stream_buffer_length, u8 * output_buffer);
111
112acpi_status
113acpi_rs_list_to_byte_stream(struct acpi_resource *linked_list,
114 acpi_size byte_stream_size_needed,
115 u8 * output_buffer);
116
117acpi_status
118acpi_rs_io_resource(u8 * byte_stream_buffer,
119 acpi_size * bytes_consumed,
120 u8 ** output_buffer, acpi_size * structure_size);
121
122acpi_status
123acpi_rs_fixed_io_resource(u8 * byte_stream_buffer,
124 acpi_size * bytes_consumed,
125 u8 ** output_buffer, acpi_size * structure_size);
126
127acpi_status 167acpi_status
128acpi_rs_io_stream(struct acpi_resource *linked_list, 168acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
129 u8 ** output_buffer, acpi_size * bytes_consumed);
130
131acpi_status
132acpi_rs_fixed_io_stream(struct acpi_resource *linked_list,
133 u8 ** output_buffer, acpi_size * bytes_consumed);
134
135acpi_status
136acpi_rs_irq_resource(u8 * byte_stream_buffer,
137 acpi_size * bytes_consumed,
138 u8 ** output_buffer, acpi_size * structure_size);
139
140acpi_status
141acpi_rs_irq_stream(struct acpi_resource *linked_list,
142 u8 ** output_buffer, acpi_size * bytes_consumed);
143
144acpi_status
145acpi_rs_dma_resource(u8 * byte_stream_buffer,
146 acpi_size * bytes_consumed,
147 u8 ** output_buffer, acpi_size * structure_size);
148 169
149acpi_status 170acpi_status
150acpi_rs_dma_stream(struct acpi_resource *linked_list, 171acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
151 u8 ** output_buffer, acpi_size * bytes_consumed);
152 172
173#ifdef ACPI_FUTURE_USAGE
153acpi_status 174acpi_status
154acpi_rs_address16_resource(u8 * byte_stream_buffer, 175acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
155 acpi_size * bytes_consumed, 176#endif /* ACPI_FUTURE_USAGE */
156 u8 ** output_buffer, acpi_size * structure_size);
157 177
158acpi_status 178acpi_status
159acpi_rs_address16_stream(struct acpi_resource *linked_list, 179acpi_rs_get_method_data(acpi_handle handle,
160 u8 ** output_buffer, acpi_size * bytes_consumed); 180 char *path, struct acpi_buffer *ret_buffer);
161 181
162acpi_status 182acpi_status
163acpi_rs_address32_resource(u8 * byte_stream_buffer, 183acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
164 acpi_size * bytes_consumed,
165 u8 ** output_buffer, acpi_size * structure_size);
166 184
185/*
186 * rscalc
187 */
167acpi_status 188acpi_status
168acpi_rs_address32_stream(struct acpi_resource *linked_list, 189acpi_rs_get_list_length(u8 * aml_buffer,
169 u8 ** output_buffer, acpi_size * bytes_consumed); 190 u32 aml_buffer_length, acpi_size * size_needed);
170 191
171acpi_status 192acpi_status
172acpi_rs_address64_resource(u8 * byte_stream_buffer, 193acpi_rs_get_aml_length(struct acpi_resource *linked_list_buffer,
173 acpi_size * bytes_consumed, 194 acpi_size * size_needed);
174 u8 ** output_buffer, acpi_size * structure_size);
175 195
176acpi_status 196acpi_status
177acpi_rs_address64_stream(struct acpi_resource *linked_list, 197acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
178 u8 ** output_buffer, acpi_size * bytes_consumed); 198 acpi_size * buffer_size_needed);
179 199
180acpi_status 200acpi_status
181acpi_rs_start_depend_fns_resource(u8 * byte_stream_buffer, 201acpi_rs_convert_aml_to_resources(u8 * aml_buffer,
182 acpi_size * bytes_consumed, 202 u32 aml_buffer_length, u8 * output_buffer);
183 u8 ** output_buffer,
184 acpi_size * structure_size);
185 203
186acpi_status 204acpi_status
187acpi_rs_end_depend_fns_resource(u8 * byte_stream_buffer, 205acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
188 acpi_size * bytes_consumed, 206 acpi_size aml_size_needed, u8 * output_buffer);
189 u8 ** output_buffer,
190 acpi_size * structure_size);
191 207
192acpi_status 208/*
193acpi_rs_start_depend_fns_stream(struct acpi_resource *linked_list, 209 * rsaddr
194 u8 ** output_buffer, 210 */
195 acpi_size * bytes_consumed); 211void
212acpi_rs_set_address_common(union aml_resource *aml,
213 struct acpi_resource *resource);
196 214
197acpi_status 215u8
198acpi_rs_end_depend_fns_stream(struct acpi_resource *linked_list, 216acpi_rs_get_address_common(struct acpi_resource *resource,
199 u8 ** output_buffer, acpi_size * bytes_consumed); 217 union aml_resource *aml);
200 218
219/*
220 * rsmisc
221 */
201acpi_status 222acpi_status
202acpi_rs_memory24_resource(u8 * byte_stream_buffer, 223acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
203 acpi_size * bytes_consumed, 224 union aml_resource *aml,
204 u8 ** output_buffer, acpi_size * structure_size); 225 struct acpi_rsconvert_info *info);
205 226
206acpi_status 227acpi_status
207acpi_rs_memory24_stream(struct acpi_resource *linked_list, 228acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
208 u8 ** output_buffer, acpi_size * bytes_consumed); 229 union aml_resource *aml,
230 struct acpi_rsconvert_info *info);
209 231
210acpi_status 232/*
211acpi_rs_memory32_range_resource(u8 * byte_stream_buffer, 233 * rsutils
212 acpi_size * bytes_consumed, 234 */
213 u8 ** output_buffer, 235void
214 acpi_size * structure_size); 236acpi_rs_move_data(void *destination,
237 void *source, u16 item_count, u8 move_type);
215 238
216acpi_status 239u8 acpi_rs_decode_bitmask(u16 mask, u8 * list);
217acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer,
218 acpi_size * bytes_consumed,
219 u8 ** output_buffer,
220 acpi_size * structure_size);
221 240
222acpi_status 241u16 acpi_rs_encode_bitmask(u8 * list, u8 count);
223acpi_rs_memory32_range_stream(struct acpi_resource *linked_list,
224 u8 ** output_buffer, acpi_size * bytes_consumed);
225 242
226acpi_status 243acpi_rs_length
227acpi_rs_fixed_memory32_stream(struct acpi_resource *linked_list, 244acpi_rs_get_resource_source(acpi_rs_length resource_length,
228 u8 ** output_buffer, acpi_size * bytes_consumed); 245 acpi_rs_length minimum_length,
246 struct acpi_resource_source *resource_source,
247 union aml_resource *aml, char *string_ptr);
229 248
230acpi_status 249acpi_rsdesc_size
231acpi_rs_extended_irq_resource(u8 * byte_stream_buffer, 250acpi_rs_set_resource_source(union aml_resource *aml,
232 acpi_size * bytes_consumed, 251 acpi_rs_length minimum_length,
233 u8 ** output_buffer, acpi_size * structure_size); 252 struct acpi_resource_source *resource_source);
234 253
235acpi_status 254void
236acpi_rs_extended_irq_stream(struct acpi_resource *linked_list, 255acpi_rs_set_resource_header(u8 descriptor_type,
237 u8 ** output_buffer, acpi_size * bytes_consumed); 256 acpi_rsdesc_size total_length,
257 union aml_resource *aml);
238 258
239acpi_status 259void
240acpi_rs_end_tag_resource(u8 * byte_stream_buffer, 260acpi_rs_set_resource_length(acpi_rsdesc_size total_length,
241 acpi_size * bytes_consumed, 261 union aml_resource *aml);
242 u8 ** output_buffer, acpi_size * structure_size);
243 262
244acpi_status 263/*
245acpi_rs_end_tag_stream(struct acpi_resource *linked_list, 264 * rsdump
246 u8 ** output_buffer, acpi_size * bytes_consumed); 265 */
266void acpi_rs_dump_resource_list(struct acpi_resource *resource);
247 267
248acpi_status 268void acpi_rs_dump_irq_list(u8 * route_table);
249acpi_rs_vendor_resource(u8 * byte_stream_buffer,
250 acpi_size * bytes_consumed,
251 u8 ** output_buffer, acpi_size * structure_size);
252 269
253acpi_status 270/*
254acpi_rs_vendor_stream(struct acpi_resource *linked_list, 271 * Resource conversion tables
255 u8 ** output_buffer, acpi_size * bytes_consumed); 272 */
273extern struct acpi_rsconvert_info acpi_rs_convert_dma[];
274extern struct acpi_rsconvert_info acpi_rs_convert_end_dpf[];
275extern struct acpi_rsconvert_info acpi_rs_convert_io[];
276extern struct acpi_rsconvert_info acpi_rs_convert_fixed_io[];
277extern struct acpi_rsconvert_info acpi_rs_convert_end_tag[];
278extern struct acpi_rsconvert_info acpi_rs_convert_memory24[];
279extern struct acpi_rsconvert_info acpi_rs_convert_generic_reg[];
280extern struct acpi_rsconvert_info acpi_rs_convert_memory32[];
281extern struct acpi_rsconvert_info acpi_rs_convert_fixed_memory32[];
282extern struct acpi_rsconvert_info acpi_rs_convert_address32[];
283extern struct acpi_rsconvert_info acpi_rs_convert_address16[];
284extern struct acpi_rsconvert_info acpi_rs_convert_ext_irq[];
285extern struct acpi_rsconvert_info acpi_rs_convert_address64[];
286extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[];
287
288/* These resources require separate get/set tables */
289
290extern struct acpi_rsconvert_info acpi_rs_get_irq[];
291extern struct acpi_rsconvert_info acpi_rs_get_start_dpf[];
292extern struct acpi_rsconvert_info acpi_rs_get_vendor_small[];
293extern struct acpi_rsconvert_info acpi_rs_get_vendor_large[];
294
295extern struct acpi_rsconvert_info acpi_rs_set_irq[];
296extern struct acpi_rsconvert_info acpi_rs_set_start_dpf[];
297extern struct acpi_rsconvert_info acpi_rs_set_vendor[];
298
299#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
300/*
301 * rsinfo
302 */
303extern struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[];
256 304
257u8 acpi_rs_get_resource_type(u8 resource_start_byte); 305/*
306 * rsdump
307 */
308extern struct acpi_rsdump_info acpi_rs_dump_irq[];
309extern struct acpi_rsdump_info acpi_rs_dump_dma[];
310extern struct acpi_rsdump_info acpi_rs_dump_start_dpf[];
311extern struct acpi_rsdump_info acpi_rs_dump_end_dpf[];
312extern struct acpi_rsdump_info acpi_rs_dump_io[];
313extern struct acpi_rsdump_info acpi_rs_dump_fixed_io[];
314extern struct acpi_rsdump_info acpi_rs_dump_vendor[];
315extern struct acpi_rsdump_info acpi_rs_dump_end_tag[];
316extern struct acpi_rsdump_info acpi_rs_dump_memory24[];
317extern struct acpi_rsdump_info acpi_rs_dump_memory32[];
318extern struct acpi_rsdump_info acpi_rs_dump_fixed_memory32[];
319extern struct acpi_rsdump_info acpi_rs_dump_address16[];
320extern struct acpi_rsdump_info acpi_rs_dump_address32[];
321extern struct acpi_rsdump_info acpi_rs_dump_address64[];
322extern struct acpi_rsdump_info acpi_rs_dump_ext_address64[];
323extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[];
324extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[];
325#endif
258 326
259#endif /* __ACRESRC_H__ */ 327#endif /* __ACRESRC_H__ */