aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acconfig.h22
-rw-r--r--include/acpi/acdebug.h2
-rw-r--r--include/acpi/acdisasm.h81
-rw-r--r--include/acpi/acdispat.h5
-rw-r--r--include/acpi/acevents.h8
-rw-r--r--include/acpi/acexcep.h2
-rw-r--r--include/acpi/acglobal.h23
-rw-r--r--include/acpi/achware.h2
-rw-r--r--include/acpi/acinterp.h48
-rw-r--r--include/acpi/aclocal.h103
-rw-r--r--include/acpi/acmacros.h190
-rw-r--r--include/acpi/acnames.h2
-rw-r--r--include/acpi/acnamesp.h4
-rw-r--r--include/acpi/acobject.h2
-rw-r--r--include/acpi/acopcode.h2
-rw-r--r--include/acpi/acoutput.h12
-rw-r--r--include/acpi/acparser.h2
-rw-r--r--include/acpi/acpi.h2
-rw-r--r--include/acpi/acpi_drivers.h4
-rw-r--r--include/acpi/acpiosxf.h6
-rw-r--r--include/acpi/acpixf.h13
-rw-r--r--include/acpi/acresrc.h390
-rw-r--r--include/acpi/acstruct.h2
-rw-r--r--include/acpi/actables.h2
-rw-r--r--include/acpi/actbl.h8
-rw-r--r--include/acpi/actbl1.h2
-rw-r--r--include/acpi/actbl2.h2
-rw-r--r--include/acpi/actypes.h590
-rw-r--r--include/acpi/acutils.h57
-rw-r--r--include/acpi/amlcode.h2
-rw-r--r--include/acpi/amlresrc.h271
-rw-r--r--include/acpi/pdc_intel.h4
-rw-r--r--include/acpi/platform/acenv.h14
-rw-r--r--include/acpi/platform/acgcc.h2
-rw-r--r--include/acpi/platform/aclinux.h6
-rw-r--r--include/acpi/processor.h22
36 files changed, 1146 insertions, 763 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 427cff1a3f83..675a32f78329 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.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
@@ -61,9 +61,9 @@
61 * 61 *
62 */ 62 */
63 63
64/* Version string */ 64/* Current ACPICA subsystem version in YYYYMMDD format */
65 65
66#define ACPI_CA_VERSION 0x20050902 66#define ACPI_CA_VERSION 0x20060113
67 67
68/* 68/*
69 * OS name, used for the _OS object. The _OS object is essentially obsolete, 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -98,11 +98,6 @@
98 98
99#define ACPI_CA_SUPPORT_LEVEL 3 99#define ACPI_CA_SUPPORT_LEVEL 3
100 100
101/* String size constants */
102
103#define ACPI_MAX_STRING_LENGTH 512
104#define ACPI_PATHNAME_MAX 256 /* A full namespace pathname */
105
106/* Maximum count for a semaphore object */ 101/* Maximum count for a semaphore object */
107 102
108#define ACPI_MAX_SEMAPHORE_COUNT 256 103#define ACPI_MAX_SEMAPHORE_COUNT 256
@@ -115,6 +110,10 @@
115 110
116#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 111#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096
117 112
113/* owner_id tracking. 8 entries allows for 255 owner_ids */
114
115#define ACPI_NUM_OWNERID_MASKS 8
116
118/****************************************************************************** 117/******************************************************************************
119 * 118 *
120 * ACPI Specification constants (Do not change unless the specification changes) 119 * ACPI Specification constants (Do not change unless the specification changes)
@@ -134,14 +133,11 @@
134#define ACPI_METHOD_NUM_ARGS 7 133#define ACPI_METHOD_NUM_ARGS 7
135#define ACPI_METHOD_MAX_ARG 6 134#define ACPI_METHOD_MAX_ARG 6
136 135
137/* Maximum length of resulting string when converting from a buffer */ 136/* Length of _HID, _UID, _CID, and UUID values */
138
139#define ACPI_MAX_STRING_CONVERSION 200
140
141/* Length of _HID, _UID, and _CID values */
142 137
143#define ACPI_DEVICE_ID_LENGTH 0x09 138#define ACPI_DEVICE_ID_LENGTH 0x09
144#define ACPI_MAX_CID_LENGTH 48 139#define ACPI_MAX_CID_LENGTH 48
140#define ACPI_UUID_LENGTH 16
145 141
146/* 142/*
147 * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG 143 * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h
index 70ce3b4d006e..d8167095caf3 100644
--- a/include/acpi/acdebug.h
+++ b/include/acpi/acdebug.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
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 3d96dcb1bb4b..11a8fe39cb04 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.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
@@ -57,26 +57,11 @@ struct acpi_external_list {
57}; 57};
58 58
59extern struct acpi_external_list *acpi_gbl_external_list; 59extern struct acpi_external_list *acpi_gbl_external_list;
60extern const char *acpi_gbl_io_decode[2]; 60
61/* Strings used for decoding flags to ASL keywords */
62
61extern const char *acpi_gbl_word_decode[4]; 63extern const char *acpi_gbl_word_decode[4];
62extern const char *acpi_gbl_consume_decode[2];
63extern const char *acpi_gbl_min_decode[2];
64extern const char *acpi_gbl_max_decode[2];
65extern const char *acpi_gbl_DECdecode[2];
66extern const char *acpi_gbl_RNGdecode[4];
67extern const char *acpi_gbl_MEMdecode[4];
68extern const char *acpi_gbl_RWdecode[2];
69extern const char *acpi_gbl_irq_decode[2]; 64extern const char *acpi_gbl_irq_decode[2];
70extern const char *acpi_gbl_HEdecode[2];
71extern const char *acpi_gbl_LLdecode[2];
72extern const char *acpi_gbl_SHRdecode[2];
73extern const char *acpi_gbl_TYPdecode[4];
74extern const char *acpi_gbl_BMdecode[2];
75extern const char *acpi_gbl_SIZdecode[4];
76extern const char *acpi_gbl_TTPdecode[2];
77extern const char *acpi_gbl_MTPdecode[4];
78extern const char *acpi_gbl_TRSdecode[2];
79
80extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; 65extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES];
81extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; 66extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES];
82extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; 67extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES];
@@ -171,11 +156,19 @@ u8 acpi_dm_is_string_buffer(union acpi_parse_object *op);
171/* 156/*
172 * dmresrc 157 * dmresrc
173 */ 158 */
159void acpi_dm_dump_integer8(u8 value, char *name);
160
161void acpi_dm_dump_integer16(u16 value, char *name);
162
163void acpi_dm_dump_integer32(u32 value, char *name);
164
165void acpi_dm_dump_integer64(u64 value, char *name);
166
174void 167void
175acpi_dm_resource_descriptor(struct acpi_op_walk_info *info, 168acpi_dm_resource_template(struct acpi_op_walk_info *info,
176 u8 * byte_data, u32 byte_count); 169 u8 * byte_data, u32 byte_count);
177 170
178u8 acpi_dm_is_resource_descriptor(union acpi_parse_object *op); 171u8 acpi_dm_is_resource_template(union acpi_parse_object *op);
179 172
180void acpi_dm_indent(u32 level); 173void acpi_dm_indent(u32 level);
181 174
@@ -187,73 +180,69 @@ void acpi_dm_decode_attribute(u8 attribute);
187 * dmresrcl 180 * dmresrcl
188 */ 181 */
189void 182void
190acpi_dm_word_descriptor(struct asl_word_address_desc *resource, 183acpi_dm_word_descriptor(union aml_resource *resource, u32 length, u32 level);
191 u32 length, u32 level);
192 184
193void 185void
194acpi_dm_dword_descriptor(struct asl_dword_address_desc *resource, 186acpi_dm_dword_descriptor(union aml_resource *resource, u32 length, u32 level);
195 u32 length, u32 level);
196 187
197void 188void
198acpi_dm_extended_descriptor(struct asl_extended_address_desc *resource, 189acpi_dm_extended_descriptor(union aml_resource *resource,
199 u32 length, u32 level); 190 u32 length, u32 level);
200 191
201void 192void
202acpi_dm_qword_descriptor(struct asl_qword_address_desc *resource, 193acpi_dm_qword_descriptor(union aml_resource *resource, u32 length, u32 level);
203 u32 length, u32 level);
204 194
205void 195void
206acpi_dm_memory24_descriptor(struct asl_memory_24_desc *resource, 196acpi_dm_memory24_descriptor(union aml_resource *resource,
207 u32 length, u32 level); 197 u32 length, u32 level);
208 198
209void 199void
210acpi_dm_memory32_descriptor(struct asl_memory_32_desc *resource, 200acpi_dm_memory32_descriptor(union aml_resource *resource,
211 u32 length, u32 level); 201 u32 length, u32 level);
212 202
213void 203void
214acpi_dm_fixed_mem32_descriptor(struct asl_fixed_memory_32_desc *resource, 204acpi_dm_fixed_memory32_descriptor(union aml_resource *resource,
215 u32 length, u32 level); 205 u32 length, u32 level);
216 206
217void 207void
218acpi_dm_generic_register_descriptor(struct asl_general_register_desc *resource, 208acpi_dm_generic_register_descriptor(union aml_resource *resource,
219 u32 length, u32 level); 209 u32 length, u32 level);
220 210
221void 211void
222acpi_dm_interrupt_descriptor(struct asl_extended_xrupt_desc *resource, 212acpi_dm_interrupt_descriptor(union aml_resource *resource,
223 u32 length, u32 level); 213 u32 length, u32 level);
224 214
225void 215void
226acpi_dm_vendor_large_descriptor(struct asl_large_vendor_desc *resource, 216acpi_dm_vendor_large_descriptor(union aml_resource *resource,
227 u32 length, u32 level); 217 u32 length, u32 level);
228 218
219void acpi_dm_vendor_common(char *name, u8 * byte_data, u32 length, u32 level);
220
229/* 221/*
230 * dmresrcs 222 * dmresrcs
231 */ 223 */
232void 224void
233acpi_dm_irq_descriptor(struct asl_irq_format_desc *resource, 225acpi_dm_irq_descriptor(union aml_resource *resource, u32 length, u32 level);
234 u32 length, u32 level);
235 226
236void 227void
237acpi_dm_dma_descriptor(struct asl_dma_format_desc *resource, 228acpi_dm_dma_descriptor(union aml_resource *resource, u32 length, u32 level);
238 u32 length, u32 level);
239 229
240void 230void acpi_dm_io_descriptor(union aml_resource *resource, u32 length, u32 level);
241acpi_dm_io_descriptor(struct asl_io_port_desc *resource, u32 length, u32 level);
242 231
243void 232void
244acpi_dm_fixed_io_descriptor(struct asl_fixed_io_port_desc *resource, 233acpi_dm_fixed_io_descriptor(union aml_resource *resource,
245 u32 length, u32 level); 234 u32 length, u32 level);
246 235
247void 236void
248acpi_dm_start_dependent_descriptor(struct asl_start_dependent_desc *resource, 237acpi_dm_start_dependent_descriptor(union aml_resource *resource,
249 u32 length, u32 level); 238 u32 length, u32 level);
250 239
251void 240void
252acpi_dm_end_dependent_descriptor(struct asl_start_dependent_desc *resource, 241acpi_dm_end_dependent_descriptor(union aml_resource *resource,
253 u32 length, u32 level); 242 u32 length, u32 level);
254 243
255void 244void
256acpi_dm_vendor_small_descriptor(struct asl_small_vendor_desc *resource, 245acpi_dm_vendor_small_descriptor(union aml_resource *resource,
257 u32 length, u32 level); 246 u32 length, u32 level);
258 247
259/* 248/*
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 065f24a77cfc..c41a926ff317 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.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
@@ -201,6 +201,9 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
201 union acpi_operand_object *obj_desc, 201 union acpi_operand_object *obj_desc,
202 struct acpi_namespace_node *calling_method_node); 202 struct acpi_namespace_node *calling_method_node);
203 203
204acpi_status
205acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state);
206
204/* 207/*
205 * dsinit 208 * dsinit
206 */ 209 */
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h
index bfa54600ecd9..f2717be4fe0d 100644
--- a/include/acpi/acevents.h
+++ b/include/acpi/acevents.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
@@ -51,6 +51,8 @@ acpi_status acpi_ev_initialize_events(void);
51 51
52acpi_status acpi_ev_install_xrupt_handlers(void); 52acpi_status acpi_ev_install_xrupt_handlers(void);
53 53
54acpi_status acpi_ev_install_fadt_gpes(void);
55
54u32 acpi_ev_fixed_event_detect(void); 56u32 acpi_ev_fixed_event_detect(void);
55 57
56/* 58/*
@@ -105,6 +107,10 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
105 u32 interrupt_number, 107 u32 interrupt_number,
106 struct acpi_gpe_block_info **return_gpe_block); 108 struct acpi_gpe_block_info **return_gpe_block);
107 109
110acpi_status
111acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
112 struct acpi_gpe_block_info *gpe_block);
113
108acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block); 114acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block);
109 115
110u32 116u32
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 4f005eb65928..dc768aa580e4 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.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
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 4ab2ca18b8df..734cc77bf2c7 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.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
@@ -80,6 +80,15 @@ extern u32 acpi_dbg_layer;
80 80
81extern u32 acpi_gbl_nesting_level; 81extern u32 acpi_gbl_nesting_level;
82 82
83/* Support for dynamic control method tracing mechanism */
84
85ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
86ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
87ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
88ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
89ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
90ACPI_EXTERN u32 acpi_gbl_trace_flags;
91
83/***************************************************************************** 92/*****************************************************************************
84 * 93 *
85 * Runtime configuration (static defaults that can be overriden at runtime) 94 * Runtime configuration (static defaults that can be overriden at runtime)
@@ -89,11 +98,15 @@ extern u32 acpi_gbl_nesting_level;
89/* 98/*
90 * Enable "slack" in the AML interpreter? Default is FALSE, and the 99 * Enable "slack" in the AML interpreter? Default is FALSE, and the
91 * interpreter strictly follows the ACPI specification. Setting to TRUE 100 * interpreter strictly follows the ACPI specification. Setting to TRUE
92 * allows the interpreter to forgive certain bad AML constructs. Currently: 101 * allows the interpreter to ignore certain errors and/or bad AML constructs.
102 *
103 * Currently, these features are enabled by this flag:
104 *
93 * 1) Allow "implicit return" of last value in a control method 105 * 1) Allow "implicit return" of last value in a control method
94 * 2) Allow access beyond end of operation region 106 * 2) Allow access beyond the end of an operation region
95 * 3) Allow access to uninitialized locals/args (auto-init to integer 0) 107 * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
96 * 4) Allow ANY object type to be a source operand for the Store() operator 108 * 4) Allow ANY object type to be a source operand for the Store() operator
109 * 5) Allow unresolved references (invalid target name) in package objects
97 */ 110 */
98ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); 111ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE);
99 112
@@ -211,9 +224,11 @@ ACPI_EXTERN u32 acpi_gbl_original_mode;
211ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; 224ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
212ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; 225ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
213ACPI_EXTERN u32 acpi_gbl_ps_find_count; 226ACPI_EXTERN u32 acpi_gbl_ps_find_count;
214ACPI_EXTERN u64 acpi_gbl_owner_id_mask; 227ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS];
215ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; 228ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save;
216ACPI_EXTERN u16 acpi_gbl_global_lock_handle; 229ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
230ACPI_EXTERN u8 acpi_gbl_last_owner_id_index;
231ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset;
217ACPI_EXTERN u8 acpi_gbl_debugger_configuration; 232ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
218ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; 233ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
219ACPI_EXTERN u8 acpi_gbl_step_to_next_call; 234ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index 3644d7248e7e..29b60a8c0593 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.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
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index 2c9c1a1d1b7f..9f22cfcb624b 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.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,7 +44,49 @@
44#ifndef __ACINTERP_H__ 44#ifndef __ACINTERP_H__
45#define __ACINTERP_H__ 45#define __ACINTERP_H__
46 46
47#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1])) 47#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1]))
48
49/* Macros for tables used for debug output */
50
51#define ACPI_EXD_OFFSET(f) (u8) ACPI_OFFSET (union acpi_operand_object,f)
52#define ACPI_EXD_NSOFFSET(f) (u8) ACPI_OFFSET (struct acpi_namespace_node,f)
53#define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_exdump_info))
54
55/*
56 * If possible, pack the following structure to byte alignment, since we
57 * don't care about performance for debug output
58 */
59#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
60#pragma pack(1)
61#endif
62
63typedef const struct acpi_exdump_info {
64 u8 opcode;
65 u8 offset;
66 char *name;
67
68} acpi_exdump_info;
69
70/* Values for the Opcode field above */
71
72#define ACPI_EXD_INIT 0
73#define ACPI_EXD_TYPE 1
74#define ACPI_EXD_UINT8 2
75#define ACPI_EXD_UINT16 3
76#define ACPI_EXD_UINT32 4
77#define ACPI_EXD_UINT64 5
78#define ACPI_EXD_LITERAL 6
79#define ACPI_EXD_POINTER 7
80#define ACPI_EXD_ADDRESS 8
81#define ACPI_EXD_STRING 9
82#define ACPI_EXD_BUFFER 10
83#define ACPI_EXD_PACKAGE 11
84#define ACPI_EXD_FIELD 12
85#define ACPI_EXD_REFERENCE 13
86
87/* restore default alignment */
88
89#pragma pack()
48 90
49/* 91/*
50 * exconvrt - object conversion 92 * exconvrt - object conversion
@@ -327,7 +369,7 @@ acpi_ex_dump_operands(union acpi_operand_object **operands,
327void 369void
328acpi_ex_dump_object_descriptor(union acpi_operand_object *object, u32 flags); 370acpi_ex_dump_object_descriptor(union acpi_operand_object *object, u32 flags);
329 371
330void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags); 372void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags);
331#endif /* ACPI_FUTURE_USAGE */ 373#endif /* ACPI_FUTURE_USAGE */
332 374
333/* 375/*
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 9fba0fddda90..97f8e4185e4f 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.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
@@ -276,6 +276,37 @@ struct acpi_create_field_info {
276 u8 field_type; 276 u8 field_type;
277}; 277};
278 278
279/*
280 * Bitmapped ACPI types. Used internally only
281 */
282#define ACPI_BTYPE_ANY 0x00000000
283#define ACPI_BTYPE_INTEGER 0x00000001
284#define ACPI_BTYPE_STRING 0x00000002
285#define ACPI_BTYPE_BUFFER 0x00000004
286#define ACPI_BTYPE_PACKAGE 0x00000008
287#define ACPI_BTYPE_FIELD_UNIT 0x00000010
288#define ACPI_BTYPE_DEVICE 0x00000020
289#define ACPI_BTYPE_EVENT 0x00000040
290#define ACPI_BTYPE_METHOD 0x00000080
291#define ACPI_BTYPE_MUTEX 0x00000100
292#define ACPI_BTYPE_REGION 0x00000200
293#define ACPI_BTYPE_POWER 0x00000400
294#define ACPI_BTYPE_PROCESSOR 0x00000800
295#define ACPI_BTYPE_THERMAL 0x00001000
296#define ACPI_BTYPE_BUFFER_FIELD 0x00002000
297#define ACPI_BTYPE_DDB_HANDLE 0x00004000
298#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000
299#define ACPI_BTYPE_REFERENCE 0x00010000
300#define ACPI_BTYPE_RESOURCE 0x00020000
301
302#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
303
304#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
305#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
306#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
307#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
308#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
309
279/***************************************************************************** 310/*****************************************************************************
280 * 311 *
281 * Event typedefs and structs 312 * Event typedefs and structs
@@ -573,6 +604,8 @@ struct acpi_parse_obj_named {
573 604
574/* The parse node is the fundamental element of the parse tree */ 605/* The parse node is the fundamental element of the parse tree */
575 606
607#define ACPI_MAX_PARSEOP_NAME 20
608
576struct acpi_parse_obj_asl { 609struct acpi_parse_obj_asl {
577 ACPI_PARSE_COMMON union acpi_parse_object *child; 610 ACPI_PARSE_COMMON union acpi_parse_object *child;
578 union acpi_parse_object *parent_method; 611 union acpi_parse_object *parent_method;
@@ -597,7 +630,7 @@ struct acpi_parse_obj_asl {
597 u8 aml_opcode_length; 630 u8 aml_opcode_length;
598 u8 aml_pkg_len_bytes; 631 u8 aml_pkg_len_bytes;
599 u8 extra; 632 u8 extra;
600 char parse_op_name[12]; 633 char parse_op_name[ACPI_MAX_PARSEOP_NAME];
601}; 634};
602 635
603union acpi_parse_object { 636union acpi_parse_object {
@@ -735,44 +768,52 @@ struct acpi_bit_register_info {
735 768
736/* resource_type values */ 769/* resource_type values */
737 770
738#define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0 771#define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0
739#define ACPI_RESOURCE_TYPE_IO_RANGE 1 772#define ACPI_ADDRESS_TYPE_IO_RANGE 1
740#define ACPI_RESOURCE_TYPE_BUS_NUMBER_RANGE 2 773#define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2
741 774
742/* Resource descriptor types and masks */ 775/* Resource descriptor types and masks */
743 776
744#define ACPI_RDESC_TYPE_LARGE 0x80 777#define ACPI_RESOURCE_NAME_LARGE 0x80
745#define ACPI_RDESC_TYPE_SMALL 0x00 778#define ACPI_RESOURCE_NAME_SMALL 0x00
746 779
747#define ACPI_RDESC_TYPE_MASK 0x80 780#define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */
748#define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */ 781#define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */
782#define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */
749 783
750/* 784/*
751 * Small resource descriptor types 785 * Small resource descriptor "names" as defined by the ACPI specification.
752 * Note: The 3 length bits (2:0) must be zero 786 * Note: Bits 2:0 are used for the descriptor length
753 */ 787 */
754#define ACPI_RDESC_TYPE_IRQ_FORMAT 0x20 788#define ACPI_RESOURCE_NAME_IRQ 0x20
755#define ACPI_RDESC_TYPE_DMA_FORMAT 0x28 789#define ACPI_RESOURCE_NAME_DMA 0x28
756#define ACPI_RDESC_TYPE_START_DEPENDENT 0x30 790#define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30
757#define ACPI_RDESC_TYPE_END_DEPENDENT 0x38 791#define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38
758#define ACPI_RDESC_TYPE_IO_PORT 0x40 792#define ACPI_RESOURCE_NAME_IO 0x40
759#define ACPI_RDESC_TYPE_FIXED_IO_PORT 0x48 793#define ACPI_RESOURCE_NAME_FIXED_IO 0x48
760#define ACPI_RDESC_TYPE_SMALL_VENDOR 0x70 794#define ACPI_RESOURCE_NAME_RESERVED_S1 0x50
761#define ACPI_RDESC_TYPE_END_TAG 0x78 795#define ACPI_RESOURCE_NAME_RESERVED_S2 0x58
796#define ACPI_RESOURCE_NAME_RESERVED_S3 0x60
797#define ACPI_RESOURCE_NAME_RESERVED_S4 0x68
798#define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70
799#define ACPI_RESOURCE_NAME_END_TAG 0x78
762 800
763/* 801/*
764 * Large resource descriptor types 802 * Large resource descriptor "names" as defined by the ACPI specification.
803 * Note: includes the Large Descriptor bit in bit[7]
765 */ 804 */
766#define ACPI_RDESC_TYPE_MEMORY_24 0x81 805#define ACPI_RESOURCE_NAME_MEMORY24 0x81
767#define ACPI_RDESC_TYPE_GENERAL_REGISTER 0x82 806#define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82
768#define ACPI_RDESC_TYPE_LARGE_VENDOR 0x84 807#define ACPI_RESOURCE_NAME_RESERVED_L1 0x83
769#define ACPI_RDESC_TYPE_MEMORY_32 0x85 808#define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84
770#define ACPI_RDESC_TYPE_FIXED_MEMORY_32 0x86 809#define ACPI_RESOURCE_NAME_MEMORY32 0x85
771#define ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE 0x87 810#define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86
772#define ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE 0x88 811#define ACPI_RESOURCE_NAME_ADDRESS32 0x87
773#define ACPI_RDESC_TYPE_EXTENDED_XRUPT 0x89 812#define ACPI_RESOURCE_NAME_ADDRESS16 0x88
774#define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A 813#define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89
775#define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B 814#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
815#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
816#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B
776 817
777/***************************************************************************** 818/*****************************************************************************
778 * 819 *
@@ -780,7 +821,7 @@ struct acpi_bit_register_info {
780 * 821 *
781 ****************************************************************************/ 822 ****************************************************************************/
782 823
783#define ACPI_ASCII_ZERO 0x30 824#define ACPI_ASCII_ZERO 0x30
784 825
785/***************************************************************************** 826/*****************************************************************************
786 * 827 *
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 702cc4e57f5f..49ba151766de 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.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
@@ -60,7 +60,7 @@
60 60
61/* 61/*
62 * For 16-bit addresses, we have to assume that the upper 32 bits 62 * For 16-bit addresses, we have to assume that the upper 32 bits
63 * are zero. 63 * (out of 64) are zero.
64 */ 64 */
65#define ACPI_LODWORD(l) ((u32)(l)) 65#define ACPI_LODWORD(l) ((u32)(l))
66#define ACPI_HIDWORD(l) ((u32)(0)) 66#define ACPI_HIDWORD(l) ((u32)(0))
@@ -104,30 +104,38 @@
104#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) 104#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i)
105 105
106/* 106/*
107 * Extract a byte of data using a pointer. Any more than a byte and we 107 * Extract data using a pointer. Any more than a byte and we
108 * get into potential aligment issues -- see the STORE macros below 108 * get into potential aligment issues -- see the STORE macros below.
109 * Use with care.
109 */ 110 */
110#define ACPI_GET8(addr) (*(u8*)(addr)) 111#define ACPI_GET8(ptr) *ACPI_CAST_PTR (u8, ptr)
112#define ACPI_GET16(ptr) *ACPI_CAST_PTR (u16, ptr)
113#define ACPI_GET32(ptr) *ACPI_CAST_PTR (u32, ptr)
114#define ACPI_GET64(ptr) *ACPI_CAST_PTR (u64, ptr)
115#define ACPI_SET8(ptr) *ACPI_CAST_PTR (u8, ptr)
116#define ACPI_SET16(ptr) *ACPI_CAST_PTR (u16, ptr)
117#define ACPI_SET32(ptr) *ACPI_CAST_PTR (u32, ptr)
118#define ACPI_SET64(ptr) *ACPI_CAST_PTR (u64, ptr)
111 119
112/* Pointer arithmetic */ 120/*
113 121 * Pointer manipulation
114#define ACPI_PTR_ADD(t,a,b) (t *) (void *)((char *)(a) + (acpi_native_uint)(b)) 122 */
115#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) ((char *)(a) - (char *)(b)) 123#define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p))
124#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p))
125#define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_native_uint)(b)))
126#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b)))
116 127
117/* Pointer/Integer type conversions */ 128/* Pointer/Integer type conversions */
118 129
119#define ACPI_TO_POINTER(i) ACPI_PTR_ADD (void, (void *) NULL,(acpi_native_uint)i) 130#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i)
120#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) 131#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL)
121#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) 132#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
122#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f) 133#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f)
123 134
124#define ACPI_CAST_PTR(t, p) ((t *)(void *)(p))
125#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **)(void *)(p))
126
127#if ACPI_MACHINE_WIDTH == 16 135#if ACPI_MACHINE_WIDTH == 16
128#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) 136#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s)
129#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i) 137#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i)
130#define ACPI_PTR_TO_PHYSADDR(i) (u32) (char *)(i) 138#define ACPI_PTR_TO_PHYSADDR(i) (u32) ACPI_CAST_PTR (u8,(i))
131#else 139#else
132#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) 140#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
133#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) 141#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
@@ -202,7 +210,7 @@
202 210
203#define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset) 211#define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset)
204 212
205#ifdef ACPI_MISALIGNED_TRANSFERS 213#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
206 214
207/* The hardware supports unaligned transfers, just do the little-endian move */ 215/* The hardware supports unaligned transfers, just do the little-endian move */
208 216
@@ -326,6 +334,10 @@
326#define ACPI_MUL_16(a) _ACPI_MUL(a,4) 334#define ACPI_MUL_16(a) _ACPI_MUL(a,4)
327#define ACPI_MOD_16(a) _ACPI_MOD(a,16) 335#define ACPI_MOD_16(a) _ACPI_MOD(a,16)
328 336
337#define ACPI_DIV_32(a) _ACPI_DIV(a,5)
338#define ACPI_MUL_32(a) _ACPI_MUL(a,5)
339#define ACPI_MOD_32(a) _ACPI_MOD(a,32)
340
329/* 341/*
330 * Rounding macros (Power of two boundaries only) 342 * Rounding macros (Power of two boundaries only)
331 */ 343 */
@@ -365,6 +377,13 @@
365#define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) 377#define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask)
366#define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask) 378#define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask)
367 379
380/* Generate a UUID */
381
382#define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) (a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \
383 (b) & 0xFF, ((b) >> 8) & 0xFF, \
384 (c) & 0xFF, ((c) >> 8) & 0xFF, \
385 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)
386
368/* 387/*
369 * An struct acpi_namespace_node * can appear in some contexts, 388 * An struct acpi_namespace_node * can appear in some contexts,
370 * where a pointer to an union acpi_operand_object can also 389 * where a pointer to an union acpi_operand_object can also
@@ -424,56 +443,66 @@
424#define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) 443#define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH))
425 444
426/* 445/*
427 * Reporting macros that are never compiled out 446 * Module name is include in both debug and non-debug versions primarily for
447 * error messages. The __FILE__ macro is not very useful for this, because it
448 * often includes the entire pathname to the module
428 */ 449 */
429#define ACPI_PARAM_LIST(pl) pl 450#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
451
452#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name;
453#else
454#define ACPI_MODULE_NAME(name)
455#endif
430 456
431/* 457/*
432 * Error reporting. These versions add callers module and line#. 458 * Ascii error messages can be configured out
433 *
434 * Since _acpi_module_name gets compiled out when ACPI_DEBUG_OUTPUT
435 * isn't defined, only use it in debug mode.
436 */ 459 */
437#ifdef ACPI_DEBUG_OUTPUT 460#ifndef ACPI_NO_ERROR_MESSAGES
438 461
439#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_acpi_module_name,__LINE__,_COMPONENT); \ 462#define ACPI_PARAM_LIST(pl) pl
440 acpi_os_printf ACPI_PARAM_LIST(fp);} 463#define ACPI_LOCATION_INFO _acpi_module_name, __LINE__
441#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_acpi_module_name,__LINE__,_COMPONENT); \
442 acpi_os_printf ACPI_PARAM_LIST(fp);}
443#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_acpi_module_name,__LINE__,_COMPONENT); \
444 acpi_os_printf ACPI_PARAM_LIST(fp);}
445#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_acpi_module_name,__LINE__,_COMPONENT, s, e);
446
447#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_acpi_module_name,__LINE__,_COMPONENT, s, n, p, e);
448 464
465/*
466 * Error reporting. Callers module and line number are inserted automatically
467 * These macros are used for both the debug and non-debug versions of the code
468 */
469#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info (ACPI_LOCATION_INFO); \
470 acpi_os_printf ACPI_PARAM_LIST (fp);}
471#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error (ACPI_LOCATION_INFO); \
472 acpi_os_printf ACPI_PARAM_LIST (fp);}
473#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning (ACPI_LOCATION_INFO); \
474 acpi_os_printf ACPI_PARAM_LIST (fp);}
475#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error (ACPI_LOCATION_INFO, \
476 s, e);
477#define ACPI_REPORT_MTERROR(s,n,p,e) acpi_ns_report_method_error (ACPI_LOCATION_INFO, \
478 s, n, p, e);
479
480/* Error reporting. These versions pass thru the module and lineno */
481
482#define _ACPI_REPORT_INFO(a,b,fp) {acpi_ut_report_info (a,b); \
483 acpi_os_printf ACPI_PARAM_LIST (fp);}
484#define _ACPI_REPORT_ERROR(a,b,fp) {acpi_ut_report_error (a,b); \
485 acpi_os_printf ACPI_PARAM_LIST (fp);}
486#define _ACPI_REPORT_WARNING(a,b,fp) {acpi_ut_report_warning (a,b); \
487 acpi_os_printf ACPI_PARAM_LIST (fp);}
449#else 488#else
450 489
451#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info("ACPI",__LINE__,_COMPONENT); \ 490/* No error messages */
452 acpi_os_printf ACPI_PARAM_LIST(fp);}
453#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error("ACPI",__LINE__,_COMPONENT); \
454 acpi_os_printf ACPI_PARAM_LIST(fp);}
455#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning("ACPI",__LINE__,_COMPONENT); \
456 acpi_os_printf ACPI_PARAM_LIST(fp);}
457#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error("ACPI",__LINE__,_COMPONENT, s, e);
458
459#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error("ACPI",__LINE__,_COMPONENT, s, n, p, e);
460 491
492#define ACPI_REPORT_INFO(fp)
493#define ACPI_REPORT_ERROR(fp)
494#define ACPI_REPORT_WARNING(fp)
495#define ACPI_REPORT_NSERROR(s,e)
496#define ACPI_REPORT_MTERROR(s,n,p,e)
497#define _ACPI_REPORT_INFO(a,b,c,fp)
498#define _ACPI_REPORT_ERROR(a,b,c,fp)
499#define _ACPI_REPORT_WARNING(a,b,c,fp)
461#endif 500#endif
462 501
463/* Error reporting. These versions pass thru the module and line# */
464
465#define _ACPI_REPORT_INFO(a,b,c,fp) {acpi_ut_report_info(a,b,c); \
466 acpi_os_printf ACPI_PARAM_LIST(fp);}
467#define _ACPI_REPORT_ERROR(a,b,c,fp) {acpi_ut_report_error(a,b,c); \
468 acpi_os_printf ACPI_PARAM_LIST(fp);}
469#define _ACPI_REPORT_WARNING(a,b,c,fp) {acpi_ut_report_warning(a,b,c); \
470 acpi_os_printf ACPI_PARAM_LIST(fp);}
471
472/* 502/*
473 * Debug macros that are conditionally compiled 503 * Debug macros that are conditionally compiled
474 */ 504 */
475#ifdef ACPI_DEBUG_OUTPUT 505#ifdef ACPI_DEBUG_OUTPUT
476#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name;
477 506
478/* 507/*
479 * Common parameters used for debug output functions: 508 * Common parameters used for debug output functions:
@@ -525,6 +554,9 @@
525 * bad form, but having a separate exit macro is very ugly and difficult to maintain. 554 * bad form, but having a separate exit macro is very ugly and difficult to maintain.
526 * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros 555 * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
527 * so that "_acpi_function_name" is defined. 556 * so that "_acpi_function_name" is defined.
557 *
558 * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining
559 * about these constructs.
528 */ 560 */
529#ifdef ACPI_USE_DO_WHILE_0 561#ifdef ACPI_USE_DO_WHILE_0
530#define ACPI_DO_WHILE0(a) do a while(0) 562#define ACPI_DO_WHILE0(a) do a while(0)
@@ -532,10 +564,55 @@
532#define ACPI_DO_WHILE0(a) a 564#define ACPI_DO_WHILE0(a) a
533#endif 565#endif
534 566
535#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(ACPI_DEBUG_PARAMETERS);return;}) 567#define return_VOID ACPI_DO_WHILE0 ({ \
536#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(ACPI_DEBUG_PARAMETERS,(s));return((s));}) 568 acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
537#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(ACPI_DEBUG_PARAMETERS,(acpi_integer)(s));return((s));}) 569 return;})
538#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(ACPI_DEBUG_PARAMETERS,(u8 *)(s));return((s));}) 570/*
571 * There are two versions of most of the return macros. The default version is
572 * safer, since it avoids side-effects by guaranteeing that the argument will
573 * not be evaluated twice.
574 *
575 * A less-safe version of the macros is provided for optional use if the
576 * compiler uses excessive CPU stack (for example, this may happen in the
577 * debug case if code optimzation is disabled.)
578 */
579#ifndef ACPI_SIMPLE_RETURN_MACROS
580
581#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
582 register acpi_status _s = (s); \
583 acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, _s); \
584 return (_s); })
585#define return_PTR(s) ACPI_DO_WHILE0 ({ \
586 register void *_s = (void *) (s); \
587 acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) _s); \
588 return (_s); })
589#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
590 register acpi_integer _s = (s); \
591 acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \
592 return (_s); })
593#define return_UINT8(s) ACPI_DO_WHILE0 ({ \
594 register u8 _s = (u8) (s); \
595 acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \
596 return (_s); })
597#define return_UINT32(s) ACPI_DO_WHILE0 ({ \
598 register u32 _s = (u32) (s); \
599 acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \
600 return (_s); })
601#else /* Use original less-safe macros */
602
603#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
604 acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, (s)); \
605 return((s)); })
606#define return_PTR(s) ACPI_DO_WHILE0 ({ \
607 acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) (s)); \
608 return((s)); })
609#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
610 acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) (s)); \
611 return((s)); })
612#define return_UINT8(s) return_VALUE(s)
613#define return_UINT32(s) return_VALUE(s)
614
615#endif /* ACPI_SIMPLE_RETURN_MACROS */
539 616
540/* Conditional execution */ 617/* Conditional execution */
541 618
@@ -582,9 +659,6 @@
582 * This is the non-debug case -- make everything go away, 659 * This is the non-debug case -- make everything go away,
583 * leaving no executable debug code! 660 * leaving no executable debug code!
584 */ 661 */
585#define ACPI_MODULE_NAME(name)
586#define _acpi_module_name ""
587
588#define ACPI_DEBUG_EXEC(a) 662#define ACPI_DEBUG_EXEC(a)
589#define ACPI_NORMAL_EXEC(a) a; 663#define ACPI_NORMAL_EXEC(a) a;
590 664
@@ -612,6 +686,8 @@
612#define return_VOID return 686#define return_VOID return
613#define return_ACPI_STATUS(s) return(s) 687#define return_ACPI_STATUS(s) return(s)
614#define return_VALUE(s) return(s) 688#define return_VALUE(s) return(s)
689#define return_UINT8(s) return(s)
690#define return_UINT32(s) return(s)
615#define return_PTR(s) return(s) 691#define return_PTR(s) return(s)
616 692
617#endif 693#endif
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index 4f9063f3e951..b67da3636899 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.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
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index dd3501f7e5d6..b667a804fc8a 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.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
@@ -263,13 +263,11 @@ u32 acpi_ns_local(acpi_object_type type);
263void 263void
264acpi_ns_report_error(char *module_name, 264acpi_ns_report_error(char *module_name,
265 u32 line_number, 265 u32 line_number,
266 u32 component_id,
267 char *internal_name, acpi_status lookup_status); 266 char *internal_name, acpi_status lookup_status);
268 267
269void 268void
270acpi_ns_report_method_error(char *module_name, 269acpi_ns_report_method_error(char *module_name,
271 u32 line_number, 270 u32 line_number,
272 u32 component_id,
273 char *message, 271 char *message,
274 struct acpi_namespace_node *node, 272 struct acpi_namespace_node *node,
275 char *path, acpi_status lookup_status); 273 char *path, acpi_status lookup_status);
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 4a326ba6d482..1bd411962c77 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2005, R. Byron Moore 9 * Copyright (C) 2000 - 2006, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h
index 64da42992199..e6d78bd9e90a 100644
--- a/include/acpi/acopcode.h
+++ b/include/acpi/acopcode.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
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 68d7edf0f697..7785d481dc3e 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.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
@@ -137,13 +137,19 @@
137 137
138/* Exception level -- used in the global "debug_level" */ 138/* Exception level -- used in the global "debug_level" */
139 139
140#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR)
141#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN)
142#define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) 140#define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT)
143#define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) 141#define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT)
144#define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) 142#define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
145#define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) 143#define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS)
146 144
145/*
146 * These two levels are essentially obsolete, all instances in the
147 * ACPICA core code have been replaced by REPORT_ERROR and REPORT_WARNING
148 * (Kept here because some drivers may still use them)
149 */
150#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR)
151#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN)
152
147/* Trace level -- also used in the global "debug_level" */ 153/* Trace level -- also used in the global "debug_level" */
148 154
149#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) 155#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES)
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index d352d40de1f3..5a1ff484af33 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.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
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h
index ccf34f9dac64..b9a39d1009bd 100644
--- a/include/acpi/acpi.h
+++ b/include/acpi/acpi.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
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index c1b4e1f882e4..b425f9bb6d43 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -52,8 +52,8 @@
52/* ACPI PCI Interrupt Link (pci_link.c) */ 52/* ACPI PCI Interrupt Link (pci_link.c) */
53 53
54int acpi_irq_penalty_init(void); 54int acpi_irq_penalty_init(void);
55int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *edge_level, 55int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
56 int *active_high_low, char **name); 56 int *polarity, char **name);
57int acpi_pci_link_free_irq(acpi_handle handle); 57int acpi_pci_link_free_irq(acpi_handle handle);
58 58
59/* ACPI PCI Interrupt Routing (pci_irq.c) */ 59/* ACPI PCI Interrupt Routing (pci_irq.c) */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 98e0b8cd14ed..768f63f391cd 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -8,7 +8,7 @@
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
10/* 10/*
11 * Copyright (C) 2000 - 2005, R. Byron Moore 11 * Copyright (C) 2000 - 2006, R. Byron Moore
12 * All rights reserved. 12 * All rights reserved.
13 * 13 *
14 * Redistribution and use in source and binary forms, with or without 14 * Redistribution and use in source and binary forms, with or without
@@ -108,9 +108,9 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle);
108 108
109void acpi_os_delete_lock(acpi_handle handle); 109void acpi_os_delete_lock(acpi_handle handle);
110 110
111unsigned long acpi_os_acquire_lock(acpi_handle handle); 111acpi_native_uint acpi_os_acquire_lock(acpi_handle handle);
112 112
113void acpi_os_release_lock(acpi_handle handle, unsigned long flags); 113void acpi_os_release_lock(acpi_handle handle, acpi_native_uint flags);
114 114
115/* 115/*
116 * Memory allocation and mapping 116 * Memory allocation and mapping
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 2a9dbc13b0f2..66cf2ecef57a 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2005, R. Byron Moore 9 * Copyright (C) 2000 - 2006, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -149,6 +149,9 @@ acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler);
149acpi_status 149acpi_status
150acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data); 150acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data);
151 151
152acpi_status
153acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags);
154
152/* 155/*
153 * Object manipulation and enumeration 156 * Object manipulation and enumeration
154 */ 157 */
@@ -269,6 +272,12 @@ acpi_status(*ACPI_WALK_RESOURCE_CALLBACK) (struct acpi_resource * resource,
269 void *context); 272 void *context);
270 273
271acpi_status 274acpi_status
275acpi_get_vendor_resource(acpi_handle device_handle,
276 char *name,
277 struct acpi_vendor_uuid *uuid,
278 struct acpi_buffer *ret_buffer);
279
280acpi_status
272acpi_get_current_resources(acpi_handle device_handle, 281acpi_get_current_resources(acpi_handle device_handle,
273 struct acpi_buffer *ret_buffer); 282 struct acpi_buffer *ret_buffer);
274 283
@@ -280,7 +289,7 @@ acpi_get_possible_resources(acpi_handle device_handle,
280 289
281acpi_status 290acpi_status
282acpi_walk_resources(acpi_handle device_handle, 291acpi_walk_resources(acpi_handle device_handle,
283 char *path, 292 char *name,
284 ACPI_WALK_RESOURCE_CALLBACK user_function, void *context); 293 ACPI_WALK_RESOURCE_CALLBACK user_function, void *context);
285 294
286acpi_status 295acpi_status
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__ */
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index 99d235339801..d8c1c2cdac0c 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.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
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index f92c1858b808..30a47542e1c8 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.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
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index a46f406e1c94..ed53f842dad4 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.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
@@ -45,6 +45,12 @@
45#define __ACTBL_H__ 45#define __ACTBL_H__
46 46
47/* 47/*
48 * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
49 * This is the only type that is even remotely portable. Anything else is not
50 * portable, so do not use any other bitfield types.
51 */
52
53/*
48 * Values for description table header signatures 54 * Values for description table header signatures
49 */ 55 */
50#define RSDP_NAME "RSDP" 56#define RSDP_NAME "RSDP"
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 67312c3a915a..cd428d57add0 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.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
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 50305ce2681a..dfc7ac1094bb 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.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
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 6213b27516e8..74819e9b4699 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.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,7 +44,15 @@
44#ifndef __ACTYPES_H__ 44#ifndef __ACTYPES_H__
45#define __ACTYPES_H__ 45#define __ACTYPES_H__
46 46
47/*! [Begin] no source code translation (keep the typedefs) */ 47/*
48 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
49 * and must be either 16, 32, or 64
50 */
51#ifndef ACPI_MACHINE_WIDTH
52#error ACPI_MACHINE_WIDTH not defined
53#endif
54
55/*! [Begin] no source code translation */
48 56
49/* 57/*
50 * Data type ranges 58 * Data type ranges
@@ -58,87 +66,150 @@
58#define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ 66#define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */
59#define ACPI_ASCII_MAX 0x7F 67#define ACPI_ASCII_MAX 0x7F
60 68
61#ifdef DEFINE_ALTERNATE_TYPES
62/* 69/*
63 * Types used only in translated source, defined here to enable 70 * Architecture-specific ACPICA Subsystem Data Types
64 * cross-platform compilation only. 71 *
72 * The goal of these types is to provide source code portability across
73 * 16-bit, 32-bit, and 64-bit targets.
74 *
75 * 1) The following types are of fixed size for all targets (16/32/64):
76 *
77 * BOOLEAN Logical boolean
78 *
79 * UINT8 8-bit (1 byte) unsigned value
80 * UINT16 16-bit (2 byte) unsigned value
81 * UINT32 32-bit (4 byte) unsigned value
82 * UINT64 64-bit (8 byte) unsigned value
83 *
84 * INT16 16-bit (2 byte) signed value
85 * INT32 32-bit (4 byte) signed value
86 * INT64 64-bit (8 byte) signed value
87 *
88 * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the
89 * compiler-dependent header(s) and were introduced because there is no common
90 * 64-bit integer type across the various compilation models, as shown in
91 * the table below.
92 *
93 * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit
94 * char 8 8 8 8 8 8
95 * short 16 16 16 16 16 16
96 * _int32 32
97 * int 32 64 32 32 16 16
98 * long 64 64 32 32 32 32
99 * long long 64 64
100 * pointer 64 64 64 32 32 32
101 *
102 * Note: ILP64 and LP32 are currently not supported.
103 *
104 *
105 * 2) These types represent the native word size of the target mode of the
106 * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are
107 * usually used for memory allocation, efficient loop counters, and array
108 * indexes. The types are similar to the size_t type in the C library and are
109 * required because there is no C type that consistently represents the native
110 * data width.
111 *
112 * ACPI_SIZE 16/32/64-bit unsigned value
113 * ACPI_NATIVE_UINT 16/32/64-bit unsigned value
114 * ACPI_NATIVE_INT 16/32/64-bit signed value
115 *
65 */ 116 */
66typedef int s32;
67typedef unsigned char u8;
68typedef unsigned short u16;
69typedef unsigned int u32;
70typedef COMPILER_DEPENDENT_UINT64 u64;
71 117
72#endif 118/*******************************************************************************
73
74/*
75 * Data types - Fixed across all compilation models (16/32/64)
76 * 119 *
77 * BOOLEAN Logical Boolean. 120 * Common types for all compilers, all targets
78 * INT8 8-bit (1 byte) signed value 121 *
79 * UINT8 8-bit (1 byte) unsigned value 122 ******************************************************************************/
80 * INT16 16-bit (2 byte) signed value
81 * UINT16 16-bit (2 byte) unsigned value
82 * INT32 32-bit (4 byte) signed value
83 * UINT32 32-bit (4 byte) unsigned value
84 * INT64 64-bit (8 byte) signed value
85 * UINT64 64-bit (8 byte) unsigned value
86 * ACPI_NATIVE_INT 32-bit on IA-32, 64-bit on IA-64 signed value
87 * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value
88 */
89 123
90#ifndef ACPI_MACHINE_WIDTH 124typedef unsigned char BOOLEAN;
91#error ACPI_MACHINE_WIDTH not defined 125typedef unsigned char UINT8;
92#endif 126typedef unsigned short UINT16;
127typedef COMPILER_DEPENDENT_UINT64 UINT64;
128typedef COMPILER_DEPENDENT_INT64 INT64;
129
130/*! [End] no source code translation !*/
131
132/*******************************************************************************
133 *
134 * Types specific to 64-bit targets
135 *
136 ******************************************************************************/
93 137
94#if ACPI_MACHINE_WIDTH == 64 138#if ACPI_MACHINE_WIDTH == 64
95 139
96/*! [Begin] no source code translation (keep the typedefs) */ 140/*! [Begin] no source code translation (keep the typedefs as-is) */
97 141
98/*
99 * 64-bit type definitions
100 */
101typedef unsigned char UINT8;
102typedef unsigned char BOOLEAN;
103typedef unsigned short UINT16;
104typedef int INT32;
105typedef unsigned int UINT32; 142typedef unsigned int UINT32;
106typedef COMPILER_DEPENDENT_INT64 INT64; 143typedef int INT32;
107typedef COMPILER_DEPENDENT_UINT64 UINT64;
108 144
109/*! [End] no source code translation !*/ 145/*! [End] no source code translation !*/
110 146
111typedef s64 acpi_native_int;
112typedef u64 acpi_native_uint; 147typedef u64 acpi_native_uint;
148typedef s64 acpi_native_int;
113 149
114typedef u64 acpi_table_ptr; 150typedef u64 acpi_table_ptr;
115typedef u64 acpi_io_address; 151typedef u64 acpi_io_address;
116typedef u64 acpi_physical_address; 152typedef u64 acpi_physical_address;
117typedef u64 acpi_size;
118 153
119#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */
120#define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */
121#define ACPI_MAX_PTR ACPI_UINT64_MAX 154#define ACPI_MAX_PTR ACPI_UINT64_MAX
122#define ACPI_SIZE_MAX ACPI_UINT64_MAX 155#define ACPI_SIZE_MAX ACPI_UINT64_MAX
123 156
124#elif ACPI_MACHINE_WIDTH == 16 157#define ALIGNED_ADDRESS_BOUNDARY 0x00000008
125 158#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */
126/*! [Begin] no source code translation (keep the typedefs) */
127 159
128/* 160/*
129 * 16-bit type definitions 161 * In the case of the Itanium Processor Family (IPF), the hardware does not
162 * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
163 * to indicate that special precautions must be taken to avoid alignment faults.
164 * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
165 *
166 * Note: Em64_t and other X86-64 processors support misaligned transfers,
167 * so there is no need to define this flag.
130 */ 168 */
131typedef unsigned char UINT8; 169#if defined (__IA64__) || defined (__ia64__)
132typedef unsigned char BOOLEAN; 170#define ACPI_MISALIGNMENT_NOT_SUPPORTED
133typedef unsigned int UINT16; 171#endif
134typedef long INT32;
135typedef int INT16;
136typedef unsigned long UINT32;
137 172
138struct { 173/*******************************************************************************
139 UINT32 Lo; 174 *
140 UINT32 Hi; 175 * Types specific to 32-bit targets
141}; 176 *
177 ******************************************************************************/
178
179#elif ACPI_MACHINE_WIDTH == 32
180
181/*! [Begin] no source code translation (keep the typedefs as-is) */
182
183typedef unsigned int UINT32;
184typedef int INT32;
185
186/*! [End] no source code translation !*/
187
188typedef u32 acpi_native_uint;
189typedef s32 acpi_native_int;
190
191typedef u64 acpi_table_ptr;
192typedef u32 acpi_io_address;
193typedef u64 acpi_physical_address;
194
195#define ACPI_MAX_PTR ACPI_UINT32_MAX
196#define ACPI_SIZE_MAX ACPI_UINT32_MAX
197
198#define ALIGNED_ADDRESS_BOUNDARY 0x00000004
199
200/*******************************************************************************
201 *
202 * Types specific to 16-bit targets
203 *
204 ******************************************************************************/
205
206#elif ACPI_MACHINE_WIDTH == 16
207
208/*! [Begin] no source code translation (keep the typedefs as-is) */
209
210typedef unsigned long UINT32;
211typedef short INT16;
212typedef long INT32;
142 213
143/*! [End] no source code translation !*/ 214/*! [End] no source code translation !*/
144 215
@@ -148,61 +219,57 @@ typedef s16 acpi_native_int;
148typedef u32 acpi_table_ptr; 219typedef u32 acpi_table_ptr;
149typedef u32 acpi_io_address; 220typedef u32 acpi_io_address;
150typedef char *acpi_physical_address; 221typedef char *acpi_physical_address;
151typedef u16 acpi_size;
152 222
153#define ALIGNED_ADDRESS_BOUNDARY 0x00000002
154#define ACPI_MISALIGNED_TRANSFERS
155#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
156#define ACPI_MAX_PTR ACPI_UINT16_MAX 223#define ACPI_MAX_PTR ACPI_UINT16_MAX
157#define ACPI_SIZE_MAX ACPI_UINT16_MAX 224#define ACPI_SIZE_MAX ACPI_UINT16_MAX
158 225
159/* 226#define ALIGNED_ADDRESS_BOUNDARY 0x00000002
160 * (16-bit only) internal integers must be 32-bits, so 227#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
161 * 64-bit integers cannot be supported
162 */
163#define ACPI_NO_INTEGER64_SUPPORT
164
165#elif ACPI_MACHINE_WIDTH == 32
166 228
167/*! [Begin] no source code translation (keep the typedefs) */ 229/* 64-bit integers cannot be supported */
168 230
169/* 231#define ACPI_NO_INTEGER64_SUPPORT
170 * 32-bit type definitions (default)
171 */
172typedef unsigned char UINT8;
173typedef unsigned char BOOLEAN;
174typedef unsigned short UINT16;
175typedef int INT32;
176typedef unsigned int UINT32;
177typedef COMPILER_DEPENDENT_INT64 INT64;
178typedef COMPILER_DEPENDENT_UINT64 UINT64;
179 232
180/*! [End] no source code translation !*/ 233#else
181 234
182typedef s32 acpi_native_int; 235/* ACPI_MACHINE_WIDTH must be either 64, 32, or 16 */
183typedef u32 acpi_native_uint;
184 236
185typedef u64 acpi_table_ptr; 237#error unknown ACPI_MACHINE_WIDTH
186typedef u32 acpi_io_address; 238#endif
187typedef u64 acpi_physical_address;
188typedef u32 acpi_size;
189 239
190#define ALIGNED_ADDRESS_BOUNDARY 0x00000004 240/*******************************************************************************
191#define ACPI_MISALIGNED_TRANSFERS 241 *
192#define ACPI_MAX_PTR ACPI_UINT32_MAX 242 * OS- or compiler-dependent types
193#define ACPI_SIZE_MAX ACPI_UINT32_MAX 243 *
244 ******************************************************************************/
194 245
195#else 246/*
196#error unknown ACPI_MACHINE_WIDTH 247 * If acpi_uintptr_t was not defined in the OS- or compiler-dependent header,
248 * define it now (use C99 uintptr_t for pointer casting if available,
249 * "void *" otherwise)
250 */
251#ifndef acpi_uintptr_t
252#define acpi_uintptr_t void *
197#endif 253#endif
198 254
199/* 255/*
200 * This type is used for bitfields in ACPI tables. The only type that is 256 * If acpi_cache_t was not defined in the OS-dependent header,
201 * even remotely portable is u8. Anything else is not portable, so 257 * define it now. This is typically the case where the local cache
202 * do not add any more bitfield types. 258 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
203 */ 259 */
204typedef u8 UINT8_BIT; 260#ifndef acpi_cache_t
205typedef acpi_native_uint ACPI_PTRDIFF; 261#define acpi_cache_t struct acpi_memory_list
262#endif
263
264/* Variable-width type, used instead of clib size_t */
265
266typedef acpi_native_uint acpi_size;
267
268/*******************************************************************************
269 *
270 * Independent types
271 *
272 ******************************************************************************/
206 273
207/* 274/*
208 * Pointer overlays to avoid lots of typecasting for 275 * Pointer overlays to avoid lots of typecasting for
@@ -234,18 +301,8 @@ struct acpi_pointer {
234#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER 301#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
235#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER 302#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER
236 303
237/* 304/* Logical defines and NULL */
238 * If acpi_cache_t was not defined in the OS-dependent header,
239 * define it now. This is typically the case where the local cache
240 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
241 */
242#ifndef acpi_cache_t
243#define acpi_cache_t struct acpi_memory_list
244#endif
245 305
246/*
247 * Useful defines
248 */
249#ifdef FALSE 306#ifdef FALSE
250#undef FALSE 307#undef FALSE
251#endif 308#endif
@@ -261,12 +318,12 @@ struct acpi_pointer {
261#endif 318#endif
262 319
263/* 320/*
264 * Local datatypes 321 * Mescellaneous types
265 */ 322 */
266typedef u32 acpi_status; /* All ACPI Exceptions */ 323typedef u32 acpi_status; /* All ACPI Exceptions */
267typedef u32 acpi_name; /* 4-byte ACPI name */ 324typedef u32 acpi_name; /* 4-byte ACPI name */
268typedef char *acpi_string; /* Null terminated ASCII string */ 325typedef char *acpi_string; /* Null terminated ASCII string */
269typedef void *acpi_handle; /* Actually a ptr to an Node */ 326typedef void *acpi_handle; /* Actually a ptr to a NS Node */
270 327
271struct uint64_struct { 328struct uint64_struct {
272 u32 lo; 329 u32 lo;
@@ -323,7 +380,7 @@ typedef u64 acpi_integer;
323/* 380/*
324 * Constants with special meanings 381 * Constants with special meanings
325 */ 382 */
326#define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR) 383#define ACPI_ROOT_OBJECT ACPI_ADD_PTR (acpi_handle, NULL, ACPI_MAX_PTR)
327 384
328/* 385/*
329 * Initialization sequence 386 * Initialization sequence
@@ -470,37 +527,6 @@ typedef u32 acpi_object_type;
470#define ACPI_TYPE_NOT_FOUND 0xFF 527#define ACPI_TYPE_NOT_FOUND 0xFF
471 528
472/* 529/*
473 * Bitmapped ACPI types. Used internally only
474 */
475#define ACPI_BTYPE_ANY 0x00000000
476#define ACPI_BTYPE_INTEGER 0x00000001
477#define ACPI_BTYPE_STRING 0x00000002
478#define ACPI_BTYPE_BUFFER 0x00000004
479#define ACPI_BTYPE_PACKAGE 0x00000008
480#define ACPI_BTYPE_FIELD_UNIT 0x00000010
481#define ACPI_BTYPE_DEVICE 0x00000020
482#define ACPI_BTYPE_EVENT 0x00000040
483#define ACPI_BTYPE_METHOD 0x00000080
484#define ACPI_BTYPE_MUTEX 0x00000100
485#define ACPI_BTYPE_REGION 0x00000200
486#define ACPI_BTYPE_POWER 0x00000400
487#define ACPI_BTYPE_PROCESSOR 0x00000800
488#define ACPI_BTYPE_THERMAL 0x00001000
489#define ACPI_BTYPE_BUFFER_FIELD 0x00002000
490#define ACPI_BTYPE_DDB_HANDLE 0x00004000
491#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000
492#define ACPI_BTYPE_REFERENCE 0x00010000
493#define ACPI_BTYPE_RESOURCE 0x00020000
494
495#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
496
497#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
498#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
499#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
500#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
501#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
502
503/*
504 * All I/O 530 * All I/O
505 */ 531 */
506#define ACPI_READ 0 532#define ACPI_READ 0
@@ -853,6 +879,14 @@ struct acpi_compatible_id_list {
853#define ACPI_VALID_CID 0x0010 879#define ACPI_VALID_CID 0x0010
854#define ACPI_VALID_SXDS 0x0020 880#define ACPI_VALID_SXDS 0x0020
855 881
882/* Flags for _STA method */
883
884#define ACPI_STA_DEVICE_PRESENT 0x01
885#define ACPI_STA_DEVICE_ENABLED 0x02
886#define ACPI_STA_DEVICE_UI 0x04
887#define ACPI_STA_DEVICE_OK 0x08
888#define ACPI_STA_BATTERY_PRESENT 0x10
889
856#define ACPI_COMMON_OBJ_INFO \ 890#define ACPI_COMMON_OBJ_INFO \
857 acpi_object_type type; /* ACPI object type */ \ 891 acpi_object_type type; /* ACPI object type */ \
858 acpi_name name /* ACPI object Name */ 892 acpi_name name /* ACPI object Name */
@@ -895,6 +929,8 @@ struct acpi_mem_space_context {
895/* 929/*
896 * Definitions for Resource Attributes 930 * Definitions for Resource Attributes
897 */ 931 */
932typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */
933typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (64_k-1)+3 */
898 934
899/* 935/*
900 * Memory Attributes 936 * Memory Attributes
@@ -916,7 +952,9 @@ struct acpi_mem_space_context {
916#define ACPI_ISA_ONLY_RANGES (u8) 0x02 952#define ACPI_ISA_ONLY_RANGES (u8) 0x02
917#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) 953#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
918 954
919#define ACPI_SPARSE_TRANSLATION (u8) 0x03 955/* Type of translation - 1=Sparse, 0=Dense */
956
957#define ACPI_SPARSE_TRANSLATION (u8) 0x01
920 958
921/* 959/*
922 * IO Port Descriptor Decode 960 * IO Port Descriptor Decode
@@ -927,8 +965,8 @@ struct acpi_mem_space_context {
927/* 965/*
928 * IRQ Attributes 966 * IRQ Attributes
929 */ 967 */
930#define ACPI_EDGE_SENSITIVE (u8) 0x00 968#define ACPI_LEVEL_SENSITIVE (u8) 0x00
931#define ACPI_LEVEL_SENSITIVE (u8) 0x01 969#define ACPI_EDGE_SENSITIVE (u8) 0x01
932 970
933#define ACPI_ACTIVE_HIGH (u8) 0x00 971#define ACPI_ACTIVE_HIGH (u8) 0x00
934#define ACPI_ACTIVE_LOW (u8) 0x01 972#define ACPI_ACTIVE_LOW (u8) 0x01
@@ -975,27 +1013,45 @@ struct acpi_mem_space_context {
975#define ACPI_CONSUMER (u8) 0x01 1013#define ACPI_CONSUMER (u8) 0x01
976 1014
977/* 1015/*
1016 * If possible, pack the following structures to byte alignment
1017 */
1018#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
1019#pragma pack(1)
1020#endif
1021
1022/* UUID data structures for use in vendor-defined resource descriptors */
1023
1024struct acpi_uuid {
1025 u8 data[ACPI_UUID_LENGTH];
1026};
1027
1028struct acpi_vendor_uuid {
1029 u8 subtype;
1030 u8 data[ACPI_UUID_LENGTH];
1031};
1032
1033/*
978 * Structures used to describe device resources 1034 * Structures used to describe device resources
979 */ 1035 */
980struct acpi_resource_irq { 1036struct acpi_resource_irq {
981 u32 edge_level; 1037 u8 triggering;
982 u32 active_high_low; 1038 u8 polarity;
983 u32 shared_exclusive; 1039 u8 sharable;
984 u32 number_of_interrupts; 1040 u8 interrupt_count;
985 u32 interrupts[1]; 1041 u8 interrupts[1];
986}; 1042};
987 1043
988struct acpi_resource_dma { 1044struct acpi_resource_dma {
989 u32 type; 1045 u8 type;
990 u32 bus_master; 1046 u8 bus_master;
991 u32 transfer; 1047 u8 transfer;
992 u32 number_of_channels; 1048 u8 channel_count;
993 u32 channels[1]; 1049 u8 channels[1];
994}; 1050};
995 1051
996struct acpi_resource_start_dpf { 1052struct acpi_resource_start_dependent {
997 u32 compatibility_priority; 1053 u8 compatibility_priority;
998 u32 performance_robustness; 1054 u8 performance_robustness;
999}; 1055};
1000 1056
1001/* 1057/*
@@ -1004,179 +1060,217 @@ struct acpi_resource_start_dpf {
1004 */ 1060 */
1005 1061
1006struct acpi_resource_io { 1062struct acpi_resource_io {
1007 u32 io_decode; 1063 u8 io_decode;
1008 u32 min_base_address; 1064 u8 alignment;
1009 u32 max_base_address; 1065 u8 address_length;
1010 u32 alignment; 1066 u16 minimum;
1011 u32 range_length; 1067 u16 maximum;
1012}; 1068};
1013 1069
1014struct acpi_resource_fixed_io { 1070struct acpi_resource_fixed_io {
1015 u32 base_address; 1071 u16 address;
1016 u32 range_length; 1072 u8 address_length;
1017}; 1073};
1018 1074
1019struct acpi_resource_vendor { 1075struct acpi_resource_vendor {
1020 u32 length; 1076 u16 byte_length;
1021 u8 reserved[1]; 1077 u8 byte_data[1];
1078};
1079
1080/* Vendor resource with UUID info (introduced in ACPI 3.0) */
1081
1082struct acpi_resource_vendor_typed {
1083 u16 byte_length;
1084 u8 uuid_subtype;
1085 u8 uuid[ACPI_UUID_LENGTH];
1086 u8 byte_data[1];
1022}; 1087};
1023 1088
1024struct acpi_resource_end_tag { 1089struct acpi_resource_end_tag {
1025 u8 checksum; 1090 u8 checksum;
1026}; 1091};
1027 1092
1028struct acpi_resource_mem24 { 1093struct acpi_resource_memory24 {
1029 u32 read_write_attribute; 1094 u8 write_protect;
1030 u32 min_base_address; 1095 u16 minimum;
1031 u32 max_base_address; 1096 u16 maximum;
1032 u32 alignment; 1097 u16 alignment;
1033 u32 range_length; 1098 u16 address_length;
1034}; 1099};
1035 1100
1036struct acpi_resource_mem32 { 1101struct acpi_resource_memory32 {
1037 u32 read_write_attribute; 1102 u8 write_protect;
1038 u32 min_base_address; 1103 u32 minimum;
1039 u32 max_base_address; 1104 u32 maximum;
1040 u32 alignment; 1105 u32 alignment;
1041 u32 range_length; 1106 u32 address_length;
1042}; 1107};
1043 1108
1044struct acpi_resource_fixed_mem32 { 1109struct acpi_resource_fixed_memory32 {
1045 u32 read_write_attribute; 1110 u8 write_protect;
1046 u32 range_base_address; 1111 u32 address;
1047 u32 range_length; 1112 u32 address_length;
1048}; 1113};
1049 1114
1050struct acpi_memory_attribute { 1115struct acpi_memory_attribute {
1051 u16 cache_attribute; 1116 u8 write_protect;
1052 u16 read_write_attribute; 1117 u8 caching;
1118 u8 range_type;
1119 u8 translation;
1053}; 1120};
1054 1121
1055struct acpi_io_attribute { 1122struct acpi_io_attribute {
1056 u16 range_attribute; 1123 u8 range_type;
1057 u16 translation_attribute; 1124 u8 translation;
1058}; 1125 u8 translation_type;
1059 1126 u8 reserved1;
1060struct acpi_bus_attribute {
1061 u16 reserved1;
1062 u16 reserved2;
1063}; 1127};
1064 1128
1065union acpi_resource_attribute { 1129union acpi_resource_attribute {
1066 struct acpi_memory_attribute memory; 1130 struct acpi_memory_attribute mem;
1067 struct acpi_io_attribute io; 1131 struct acpi_io_attribute io;
1068 struct acpi_bus_attribute bus; 1132
1133 /* Used for the *word_space macros */
1134
1135 u8 type_specific;
1069}; 1136};
1070 1137
1071struct acpi_resource_source { 1138struct acpi_resource_source {
1072 u32 index; 1139 u8 index;
1073 u32 string_length; 1140 u16 string_length;
1074 char *string_ptr; 1141 char *string_ptr;
1075}; 1142};
1076 1143
1077/* Fields common to all address descriptors, 16/32/64 bit */ 1144/* Fields common to all address descriptors, 16/32/64 bit */
1078 1145
1079#define ACPI_RESOURCE_ADDRESS_COMMON \ 1146#define ACPI_RESOURCE_ADDRESS_COMMON \
1080 u32 resource_type; \ 1147 u8 resource_type; \
1081 u32 producer_consumer; \ 1148 u8 producer_consumer; \
1082 u32 decode; \ 1149 u8 decode; \
1083 u32 min_address_fixed; \ 1150 u8 min_address_fixed; \
1084 u32 max_address_fixed; \ 1151 u8 max_address_fixed; \
1085 union acpi_resource_attribute attribute; 1152 union acpi_resource_attribute info;
1086 1153
1087struct acpi_resource_address { 1154struct acpi_resource_address {
1088ACPI_RESOURCE_ADDRESS_COMMON}; 1155ACPI_RESOURCE_ADDRESS_COMMON};
1089 1156
1090struct acpi_resource_address16 { 1157struct acpi_resource_address16 {
1091 ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; 1158 ACPI_RESOURCE_ADDRESS_COMMON u16 granularity;
1092 u32 min_address_range; 1159 u16 minimum;
1093 u32 max_address_range; 1160 u16 maximum;
1094 u32 address_translation_offset; 1161 u16 translation_offset;
1095 u32 address_length; 1162 u16 address_length;
1096 struct acpi_resource_source resource_source; 1163 struct acpi_resource_source resource_source;
1097}; 1164};
1098 1165
1099struct acpi_resource_address32 { 1166struct acpi_resource_address32 {
1100 ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; 1167 ACPI_RESOURCE_ADDRESS_COMMON u32 granularity;
1101 u32 min_address_range; 1168 u32 minimum;
1102 u32 max_address_range; 1169 u32 maximum;
1103 u32 address_translation_offset; 1170 u32 translation_offset;
1104 u32 address_length; 1171 u32 address_length;
1105 struct acpi_resource_source resource_source; 1172 struct acpi_resource_source resource_source;
1106}; 1173};
1107 1174
1108struct acpi_resource_address64 { 1175struct acpi_resource_address64 {
1109 ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; 1176 ACPI_RESOURCE_ADDRESS_COMMON u64 granularity;
1110 u64 min_address_range; 1177 u64 minimum;
1111 u64 max_address_range; 1178 u64 maximum;
1112 u64 address_translation_offset; 1179 u64 translation_offset;
1113 u64 address_length; 1180 u64 address_length;
1114 u64 type_specific_attributes;
1115 struct acpi_resource_source resource_source; 1181 struct acpi_resource_source resource_source;
1116}; 1182};
1117 1183
1118struct acpi_resource_ext_irq { 1184struct acpi_resource_extended_address64 {
1119 u32 producer_consumer; 1185 ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD;
1120 u32 edge_level; 1186 u64 granularity;
1121 u32 active_high_low; 1187 u64 minimum;
1122 u32 shared_exclusive; 1188 u64 maximum;
1123 u32 number_of_interrupts; 1189 u64 translation_offset;
1190 u64 address_length;
1191 u64 type_specific;
1192};
1193
1194struct acpi_resource_extended_irq {
1195 u8 producer_consumer;
1196 u8 triggering;
1197 u8 polarity;
1198 u8 sharable;
1199 u8 interrupt_count;
1124 struct acpi_resource_source resource_source; 1200 struct acpi_resource_source resource_source;
1125 u32 interrupts[1]; 1201 u32 interrupts[1];
1126}; 1202};
1127 1203
1204struct acpi_resource_generic_register {
1205 u8 space_id;
1206 u8 bit_width;
1207 u8 bit_offset;
1208 u8 access_size;
1209 u64 address;
1210};
1211
1128/* ACPI_RESOURCE_TYPEs */ 1212/* ACPI_RESOURCE_TYPEs */
1129 1213
1130#define ACPI_RSTYPE_IRQ 0 1214#define ACPI_RESOURCE_TYPE_IRQ 0
1131#define ACPI_RSTYPE_DMA 1 1215#define ACPI_RESOURCE_TYPE_DMA 1
1132#define ACPI_RSTYPE_START_DPF 2 1216#define ACPI_RESOURCE_TYPE_START_DEPENDENT 2
1133#define ACPI_RSTYPE_END_DPF 3 1217#define ACPI_RESOURCE_TYPE_END_DEPENDENT 3
1134#define ACPI_RSTYPE_IO 4 1218#define ACPI_RESOURCE_TYPE_IO 4
1135#define ACPI_RSTYPE_FIXED_IO 5 1219#define ACPI_RESOURCE_TYPE_FIXED_IO 5
1136#define ACPI_RSTYPE_VENDOR 6 1220#define ACPI_RESOURCE_TYPE_VENDOR 6
1137#define ACPI_RSTYPE_END_TAG 7 1221#define ACPI_RESOURCE_TYPE_END_TAG 7
1138#define ACPI_RSTYPE_MEM24 8 1222#define ACPI_RESOURCE_TYPE_MEMORY24 8
1139#define ACPI_RSTYPE_MEM32 9 1223#define ACPI_RESOURCE_TYPE_MEMORY32 9
1140#define ACPI_RSTYPE_FIXED_MEM32 10 1224#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10
1141#define ACPI_RSTYPE_ADDRESS16 11 1225#define ACPI_RESOURCE_TYPE_ADDRESS16 11
1142#define ACPI_RSTYPE_ADDRESS32 12 1226#define ACPI_RESOURCE_TYPE_ADDRESS32 12
1143#define ACPI_RSTYPE_ADDRESS64 13 1227#define ACPI_RESOURCE_TYPE_ADDRESS64 13
1144#define ACPI_RSTYPE_EXT_IRQ 14 1228#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
1145 1229#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
1146typedef u32 acpi_resource_type; 1230#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
1231#define ACPI_RESOURCE_TYPE_MAX 16
1147 1232
1148union acpi_resource_data { 1233union acpi_resource_data {
1149 struct acpi_resource_irq irq; 1234 struct acpi_resource_irq irq;
1150 struct acpi_resource_dma dma; 1235 struct acpi_resource_dma dma;
1151 struct acpi_resource_start_dpf start_dpf; 1236 struct acpi_resource_start_dependent start_dpf;
1152 struct acpi_resource_io io; 1237 struct acpi_resource_io io;
1153 struct acpi_resource_fixed_io fixed_io; 1238 struct acpi_resource_fixed_io fixed_io;
1154 struct acpi_resource_vendor vendor_specific; 1239 struct acpi_resource_vendor vendor;
1240 struct acpi_resource_vendor_typed vendor_typed;
1155 struct acpi_resource_end_tag end_tag; 1241 struct acpi_resource_end_tag end_tag;
1156 struct acpi_resource_mem24 memory24; 1242 struct acpi_resource_memory24 memory24;
1157 struct acpi_resource_mem32 memory32; 1243 struct acpi_resource_memory32 memory32;
1158 struct acpi_resource_fixed_mem32 fixed_memory32; 1244 struct acpi_resource_fixed_memory32 fixed_memory32;
1159 struct acpi_resource_address address; /* Common 16/32/64 address fields */
1160 struct acpi_resource_address16 address16; 1245 struct acpi_resource_address16 address16;
1161 struct acpi_resource_address32 address32; 1246 struct acpi_resource_address32 address32;
1162 struct acpi_resource_address64 address64; 1247 struct acpi_resource_address64 address64;
1163 struct acpi_resource_ext_irq extended_irq; 1248 struct acpi_resource_extended_address64 ext_address64;
1249 struct acpi_resource_extended_irq extended_irq;
1250 struct acpi_resource_generic_register generic_reg;
1251
1252 /* Common fields */
1253
1254 struct acpi_resource_address address; /* Common 16/32/64 address fields */
1164}; 1255};
1165 1256
1166struct acpi_resource { 1257struct acpi_resource {
1167 acpi_resource_type id; 1258 u32 type;
1168 u32 length; 1259 u32 length;
1169 union acpi_resource_data data; 1260 union acpi_resource_data data;
1170}; 1261};
1171 1262
1172#define ACPI_RESOURCE_LENGTH 12 1263/* restore default alignment */
1173#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ 1264
1265#pragma pack()
1174 1266
1175#define ACPI_SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) 1267#define ACPI_RS_SIZE_MIN 12
1268#define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */
1269#define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
1176 1270
1177#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) 1271#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length)
1178 1272
1179#ifdef ACPI_MISALIGNED_TRANSFERS 1273#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
1180#define ACPI_ALIGN_RESOURCE_SIZE(length) (length) 1274#define ACPI_ALIGN_RESOURCE_SIZE(length) (length)
1181#else 1275#else
1182#define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length) 1276#define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length)
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index c1086452696e..10f6625f6390 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.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,6 +44,39 @@
44#ifndef _ACUTILS_H 44#ifndef _ACUTILS_H
45#define _ACUTILS_H 45#define _ACUTILS_H
46 46
47extern const u8 acpi_gbl_resource_aml_sizes[];
48
49/* Strings used by the disassembler and debugger resource dump routines */
50
51#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
52
53extern const char *acpi_gbl_BMdecode[2];
54extern const char *acpi_gbl_config_decode[4];
55extern const char *acpi_gbl_consume_decode[2];
56extern const char *acpi_gbl_DECdecode[2];
57extern const char *acpi_gbl_HEdecode[2];
58extern const char *acpi_gbl_io_decode[2];
59extern const char *acpi_gbl_LLdecode[2];
60extern const char *acpi_gbl_max_decode[2];
61extern const char *acpi_gbl_MEMdecode[4];
62extern const char *acpi_gbl_min_decode[2];
63extern const char *acpi_gbl_MTPdecode[4];
64extern const char *acpi_gbl_RNGdecode[4];
65extern const char *acpi_gbl_RWdecode[2];
66extern const char *acpi_gbl_SHRdecode[2];
67extern const char *acpi_gbl_SIZdecode[4];
68extern const char *acpi_gbl_TRSdecode[2];
69extern const char *acpi_gbl_TTPdecode[2];
70extern const char *acpi_gbl_TYPdecode[4];
71#endif
72
73/* Types for Resource descriptor entries */
74
75#define ACPI_INVALID_RESOURCE 0
76#define ACPI_FIXED_LENGTH 1
77#define ACPI_VARIABLE_LENGTH 2
78#define ACPI_SMALL_VARIABLE_LENGTH 3
79
47typedef 80typedef
48acpi_status(*acpi_pkg_callback) (u8 object_type, 81acpi_status(*acpi_pkg_callback) (u8 object_type,
49 union acpi_operand_object * source_object, 82 union acpi_operand_object * source_object,
@@ -159,7 +192,6 @@ extern const u8 _acpi_ctype[];
159#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) 192#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
160#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) 193#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
161#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 194#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
162#define ACPI_IS_ASCII(c) ((c) < 0x80)
163 195
164#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 196#endif /* ACPI_USE_SYSTEM_CLIBRARY */
165 197
@@ -243,12 +275,11 @@ acpi_ut_ptr_exit(u32 line_number,
243 const char *function_name, 275 const char *function_name,
244 char *module_name, u32 component_id, u8 * ptr); 276 char *module_name, u32 component_id, u8 * ptr);
245 277
246void acpi_ut_report_info(char *module_name, u32 line_number, u32 component_id); 278void acpi_ut_report_error(char *module_name, u32 line_number);
247 279
248void acpi_ut_report_error(char *module_name, u32 line_number, u32 component_id); 280void acpi_ut_report_info(char *module_name, u32 line_number);
249 281
250void 282void acpi_ut_report_warning(char *module_name, u32 line_number);
251acpi_ut_report_warning(char *module_name, u32 line_number, u32 component_id);
252 283
253void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); 284void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id);
254 285
@@ -419,7 +450,19 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer);
419 450
420#define ACPI_ANY_BASE 0 451#define ACPI_ANY_BASE 0
421 452
422u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc); 453acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index);
454
455u32 acpi_ut_get_descriptor_length(void *aml);
456
457u16 acpi_ut_get_resource_length(void *aml);
458
459u8 acpi_ut_get_resource_header_length(void *aml);
460
461u8 acpi_ut_get_resource_type(void *aml);
462
463acpi_status
464acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc,
465 u8 ** end_tag);
423 466
424u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); 467u8 acpi_ut_generate_checksum(u8 * buffer, u32 length);
425 468
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h
index 7fdf5299f501..37964a59aef8 100644
--- a/include/acpi/amlcode.h
+++ b/include/acpi/amlcode.h
@@ -7,7 +7,7 @@
7 *****************************************************************************/ 7 *****************************************************************************/
8 8
9/* 9/*
10 * Copyright (C) 2000 - 2005, R. Byron Moore 10 * Copyright (C) 2000 - 2006, R. Byron Moore
11 * All rights reserved. 11 * All rights reserved.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h
index 051786e4b210..fb4735315ad3 100644
--- a/include/acpi/amlresrc.h
+++ b/include/acpi/amlresrc.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2005, R. Byron Moore 9 * Copyright (C) 2000 - 2006, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -92,182 +92,168 @@ struct asl_resource_node {
92 struct asl_resource_node *next; 92 struct asl_resource_node *next;
93}; 93};
94 94
95/* Macros used to generate AML resource length fields */
96
97#define ACPI_AML_SIZE_LARGE(r) (sizeof (r) - sizeof (struct aml_resource_large_header))
98#define ACPI_AML_SIZE_SMALL(r) (sizeof (r) - sizeof (struct aml_resource_small_header))
99
95/* 100/*
96 * Resource descriptors defined in the ACPI specification. 101 * Resource descriptors defined in the ACPI specification.
97 * 102 *
98 * Packing/alignment must be BYTE because these descriptors 103 * Packing/alignment must be BYTE because these descriptors
99 * are used to overlay the AML byte stream. 104 * are used to overlay the raw AML byte stream.
100 */ 105 */
101#pragma pack(1) 106#pragma pack(1)
102 107
103struct asl_irq_format_desc { 108/*
104 u8 descriptor_type; 109 * SMALL descriptors
105 u16 irq_mask; 110 */
111#define AML_RESOURCE_SMALL_HEADER_COMMON \
112 u8 descriptor_type;
113
114struct aml_resource_small_header {
115AML_RESOURCE_SMALL_HEADER_COMMON};
116
117struct aml_resource_irq {
118 AML_RESOURCE_SMALL_HEADER_COMMON u16 irq_mask;
106 u8 flags; 119 u8 flags;
107}; 120};
108 121
109struct asl_irq_noflags_desc { 122struct aml_resource_irq_noflags {
110 u8 descriptor_type; 123 AML_RESOURCE_SMALL_HEADER_COMMON u16 irq_mask;
111 u16 irq_mask;
112}; 124};
113 125
114struct asl_dma_format_desc { 126struct aml_resource_dma {
115 u8 descriptor_type; 127 AML_RESOURCE_SMALL_HEADER_COMMON u8 dma_channel_mask;
116 u8 dma_channel_mask;
117 u8 flags; 128 u8 flags;
118}; 129};
119 130
120struct asl_start_dependent_desc { 131struct aml_resource_start_dependent {
121 u8 descriptor_type; 132 AML_RESOURCE_SMALL_HEADER_COMMON u8 flags;
122 u8 flags;
123}; 133};
124 134
125struct asl_start_dependent_noprio_desc { 135struct aml_resource_start_dependent_noprio {
126 u8 descriptor_type; 136AML_RESOURCE_SMALL_HEADER_COMMON};
127};
128 137
129struct asl_end_dependent_desc { 138struct aml_resource_end_dependent {
130 u8 descriptor_type; 139AML_RESOURCE_SMALL_HEADER_COMMON};
131};
132 140
133struct asl_io_port_desc { 141struct aml_resource_io {
134 u8 descriptor_type; 142 AML_RESOURCE_SMALL_HEADER_COMMON u8 flags;
135 u8 information; 143 u16 minimum;
136 u16 address_min; 144 u16 maximum;
137 u16 address_max;
138 u8 alignment; 145 u8 alignment;
139 u8 length; 146 u8 address_length;
140}; 147};
141 148
142struct asl_fixed_io_port_desc { 149struct aml_resource_fixed_io {
143 u8 descriptor_type; 150 AML_RESOURCE_SMALL_HEADER_COMMON u16 address;
144 u16 base_address; 151 u8 address_length;
145 u8 length;
146}; 152};
147 153
148struct asl_small_vendor_desc { 154struct aml_resource_vendor_small {
149 u8 descriptor_type; 155AML_RESOURCE_SMALL_HEADER_COMMON};
150 u8 vendor_defined[7];
151};
152 156
153struct asl_end_tag_desc { 157struct aml_resource_end_tag {
154 u8 descriptor_type; 158 AML_RESOURCE_SMALL_HEADER_COMMON u8 checksum;
155 u8 checksum;
156}; 159};
157 160
158/* LARGE descriptors */ 161/*
162 * LARGE descriptors
163 */
164#define AML_RESOURCE_LARGE_HEADER_COMMON \
165 u8 descriptor_type;\
166 u16 resource_length;
167
168struct aml_resource_large_header {
169AML_RESOURCE_LARGE_HEADER_COMMON};
159 170
160struct asl_memory_24_desc { 171struct aml_resource_memory24 {
161 u8 descriptor_type; 172 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
162 u16 length; 173 u16 minimum;
163 u8 information; 174 u16 maximum;
164 u16 address_min;
165 u16 address_max;
166 u16 alignment; 175 u16 alignment;
167 u16 range_length; 176 u16 address_length;
168}; 177};
169 178
170struct asl_large_vendor_desc { 179struct aml_resource_vendor_large {
171 u8 descriptor_type; 180AML_RESOURCE_LARGE_HEADER_COMMON};
172 u16 length;
173 u8 vendor_defined[1];
174};
175 181
176struct asl_memory_32_desc { 182struct aml_resource_memory32 {
177 u8 descriptor_type; 183 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
178 u16 length; 184 u32 minimum;
179 u8 information; 185 u32 maximum;
180 u32 address_min;
181 u32 address_max;
182 u32 alignment; 186 u32 alignment;
183 u32 range_length; 187 u32 address_length;
184}; 188};
185 189
186struct asl_fixed_memory_32_desc { 190struct aml_resource_fixed_memory32 {
187 u8 descriptor_type; 191 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
188 u16 length; 192 u32 address;
189 u8 information; 193 u32 address_length;
190 u32 base_address;
191 u32 range_length;
192}; 194};
193 195
194struct asl_extended_address_desc { 196#define AML_RESOURCE_ADDRESS_COMMON \
195 u8 descriptor_type; 197 u8 resource_type; \
196 u16 length; 198 u8 flags; \
197 u8 resource_type; 199 u8 specific_flags;
198 u8 flags; 200
199 u8 specific_flags; 201struct aml_resource_address {
200 u8 revision_iD; 202AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON};
203
204struct aml_resource_extended_address64 {
205 AML_RESOURCE_LARGE_HEADER_COMMON
206 AML_RESOURCE_ADDRESS_COMMON u8 revision_iD;
201 u8 reserved; 207 u8 reserved;
202 u64 granularity; 208 u64 granularity;
203 u64 address_min; 209 u64 minimum;
204 u64 address_max; 210 u64 maximum;
205 u64 translation_offset; 211 u64 translation_offset;
206 u64 address_length; 212 u64 address_length;
207 u64 type_specific_attributes; 213 u64 type_specific;
208 u8 optional_fields[2]; /* Used for length calculation only */
209}; 214};
210 215
211#define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */ 216#define AML_RESOURCE_EXTENDED_ADDRESS_REVISION 1 /* ACPI 3.0 */
212 217
213struct asl_qword_address_desc { 218struct aml_resource_address64 {
214 u8 descriptor_type; 219 AML_RESOURCE_LARGE_HEADER_COMMON
215 u16 length; 220 AML_RESOURCE_ADDRESS_COMMON u64 granularity;
216 u8 resource_type; 221 u64 minimum;
217 u8 flags; 222 u64 maximum;
218 u8 specific_flags;
219 u64 granularity;
220 u64 address_min;
221 u64 address_max;
222 u64 translation_offset; 223 u64 translation_offset;
223 u64 address_length; 224 u64 address_length;
224 u8 optional_fields[2];
225}; 225};
226 226
227struct asl_dword_address_desc { 227struct aml_resource_address32 {
228 u8 descriptor_type; 228 AML_RESOURCE_LARGE_HEADER_COMMON
229 u16 length; 229 AML_RESOURCE_ADDRESS_COMMON u32 granularity;
230 u8 resource_type; 230 u32 minimum;
231 u8 flags; 231 u32 maximum;
232 u8 specific_flags;
233 u32 granularity;
234 u32 address_min;
235 u32 address_max;
236 u32 translation_offset; 232 u32 translation_offset;
237 u32 address_length; 233 u32 address_length;
238 u8 optional_fields[2];
239}; 234};
240 235
241struct asl_word_address_desc { 236struct aml_resource_address16 {
242 u8 descriptor_type; 237 AML_RESOURCE_LARGE_HEADER_COMMON
243 u16 length; 238 AML_RESOURCE_ADDRESS_COMMON u16 granularity;
244 u8 resource_type; 239 u16 minimum;
245 u8 flags; 240 u16 maximum;
246 u8 specific_flags;
247 u16 granularity;
248 u16 address_min;
249 u16 address_max;
250 u16 translation_offset; 241 u16 translation_offset;
251 u16 address_length; 242 u16 address_length;
252 u8 optional_fields[2];
253}; 243};
254 244
255struct asl_extended_xrupt_desc { 245struct aml_resource_extended_irq {
256 u8 descriptor_type; 246 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
257 u16 length; 247 u8 interrupt_count;
258 u8 flags; 248 u32 interrupts[1];
259 u8 table_length;
260 u32 interrupt_number[1];
261 /* res_source_index, res_source optional fields follow */ 249 /* res_source_index, res_source optional fields follow */
262}; 250};
263 251
264struct asl_general_register_desc { 252struct aml_resource_generic_register {
265 u8 descriptor_type; 253 AML_RESOURCE_LARGE_HEADER_COMMON u8 address_space_id;
266 u16 length;
267 u8 address_space_id;
268 u8 bit_width; 254 u8 bit_width;
269 u8 bit_offset; 255 u8 bit_offset;
270 u8 access_size; /* ACPI 3.0, was Reserved */ 256 u8 access_size; /* ACPI 3.0, was previously Reserved */
271 u64 address; 257 u64 address;
272}; 258};
273 259
@@ -277,26 +263,39 @@ struct asl_general_register_desc {
277 263
278/* Union of all resource descriptors, so we can allocate the worst case */ 264/* Union of all resource descriptors, so we can allocate the worst case */
279 265
280union asl_resource_desc { 266union aml_resource {
281 struct asl_irq_format_desc irq; 267 /* Descriptor headers */
282 struct asl_dma_format_desc dma; 268
283 struct asl_start_dependent_desc std; 269 struct aml_resource_small_header small_header;
284 struct asl_end_dependent_desc end; 270 struct aml_resource_large_header large_header;
285 struct asl_io_port_desc iop; 271
286 struct asl_fixed_io_port_desc fio; 272 /* Small resource descriptors */
287 struct asl_small_vendor_desc smv; 273
288 struct asl_end_tag_desc et; 274 struct aml_resource_irq irq;
289 275 struct aml_resource_dma dma;
290 struct asl_memory_24_desc M24; 276 struct aml_resource_start_dependent start_dpf;
291 struct asl_large_vendor_desc lgv; 277 struct aml_resource_end_dependent end_dpf;
292 struct asl_memory_32_desc M32; 278 struct aml_resource_io io;
293 struct asl_fixed_memory_32_desc F32; 279 struct aml_resource_fixed_io fixed_io;
294 struct asl_qword_address_desc qas; 280 struct aml_resource_vendor_small vendor_small;
295 struct asl_dword_address_desc das; 281 struct aml_resource_end_tag end_tag;
296 struct asl_word_address_desc was; 282
297 struct asl_extended_address_desc eas; 283 /* Large resource descriptors */
298 struct asl_extended_xrupt_desc exx; 284
299 struct asl_general_register_desc grg; 285 struct aml_resource_memory24 memory24;
286 struct aml_resource_generic_register generic_reg;
287 struct aml_resource_vendor_large vendor_large;
288 struct aml_resource_memory32 memory32;
289 struct aml_resource_fixed_memory32 fixed_memory32;
290 struct aml_resource_address16 address16;
291 struct aml_resource_address32 address32;
292 struct aml_resource_address64 address64;
293 struct aml_resource_extended_address64 ext_address64;
294 struct aml_resource_extended_irq extended_irq;
295
296 /* Utility overlays */
297
298 struct aml_resource_address address;
300 u32 u32_item; 299 u32 u32_item;
301 u16 u16_item; 300 u16 u16_item;
302 u8 U8item; 301 u8 U8item;
diff --git a/include/acpi/pdc_intel.h b/include/acpi/pdc_intel.h
index 91f4a12a99a1..3fa81d55cd0c 100644
--- a/include/acpi/pdc_intel.h
+++ b/include/acpi/pdc_intel.h
@@ -15,9 +15,7 @@
15#define ACPI_PDC_C_C1_FFH (0x0100) 15#define ACPI_PDC_C_C1_FFH (0x0100)
16 16
17#define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \ 17#define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \
18 ACPI_PDC_C_C1_HALT) 18 ACPI_PDC_C_C1_HALT | \
19
20#define ACPI_PDC_EST_CAPABILITY_SMP_MSR (ACPI_PDC_EST_CAPABILITY_SMP | \
21 ACPI_PDC_P_FFH) 19 ACPI_PDC_P_FFH)
22 20
23#define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \ 21#define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 16609c1ab2eb..31b0f18342f6 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.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
@@ -68,6 +68,7 @@
68#define ACPI_APPLICATION 68#define ACPI_APPLICATION
69#define ACPI_DEBUGGER 69#define ACPI_DEBUGGER
70#define ACPI_DISASSEMBLER 70#define ACPI_DISASSEMBLER
71#define ACPI_MUTEX_DEBUG
71#endif 72#endif
72 73
73#ifdef ACPI_ASL_COMPILER 74#ifdef ACPI_ASL_COMPILER
@@ -205,6 +206,8 @@
205 * 206 *
206 *****************************************************************************/ 207 *****************************************************************************/
207 208
209#define ACPI_IS_ASCII(c) ((c) < 0x80)
210
208#ifdef ACPI_USE_SYSTEM_CLIBRARY 211#ifdef ACPI_USE_SYSTEM_CLIBRARY
209/* 212/*
210 * Use the standard C library headers. 213 * Use the standard C library headers.
@@ -234,7 +237,7 @@
234#define ACPI_STRCAT(d,s) (void) strcat((d), (s)) 237#define ACPI_STRCAT(d,s) (void) strcat((d), (s))
235#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n)) 238#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n))
236#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n)) 239#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n))
237#define ACPI_MEMCMP(s1,s2,n) memcmp((s1), (s2), (acpi_size)(n)) 240#define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n))
238#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n)) 241#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n))
239#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n)) 242#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n))
240 243
@@ -246,7 +249,6 @@
246#define ACPI_IS_UPPER(i) isupper((int) (i)) 249#define ACPI_IS_UPPER(i) isupper((int) (i))
247#define ACPI_IS_PRINT(i) isprint((int) (i)) 250#define ACPI_IS_PRINT(i) isprint((int) (i))
248#define ACPI_IS_ALPHA(i) isalpha((int) (i)) 251#define ACPI_IS_ALPHA(i) isalpha((int) (i))
249#define ACPI_IS_ASCII(i) isascii((int) (i))
250 252
251#else 253#else
252 254
@@ -273,8 +275,8 @@ typedef char *va_list;
273/* 275/*
274 * Storage alignment properties 276 * Storage alignment properties
275 */ 277 */
276#define _AUPBND (sizeof (acpi_native_int) - 1) 278#define _AUPBND (sizeof (acpi_native_uint) - 1)
277#define _ADNBND (sizeof (acpi_native_int) - 1) 279#define _ADNBND (sizeof (acpi_native_uint) - 1)
278 280
279/* 281/*
280 * Variable argument list macro definitions 282 * Variable argument list macro definitions
@@ -296,7 +298,7 @@ typedef char *va_list;
296#define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s)) 298#define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s))
297#define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n)) 299#define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n))
298#define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n)) 300#define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n))
299#define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((s1), (s2), (acpi_size)(n)) 301#define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n))
300#define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n)) 302#define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n))
301#define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n)) 303#define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n))
302#define ACPI_TOUPPER acpi_ut_to_upper 304#define ACPI_TOUPPER acpi_ut_to_upper
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index 4c0e0ba09ba0..ea2a6322f64d 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.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
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index c93e6562f0e1..c21c27fe7e1e 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.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
@@ -71,6 +71,10 @@
71#define acpi_cache_t kmem_cache_t 71#define acpi_cache_t kmem_cache_t
72#endif 72#endif
73 73
74/* Full namespace pathname length limit - arbitrary */
75
76#define ACPI_PATHNAME_MAX 256
77
74#else /* !__KERNEL__ */ 78#else /* !__KERNEL__ */
75 79
76#include <stdarg.h> 80#include <stdarg.h>
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index edb5a8919cb6..badf0277b1be 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -62,9 +62,6 @@ struct acpi_processor_power {
62 u32 bm_activity; 62 u32 bm_activity;
63 int count; 63 int count;
64 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; 64 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
65
66 /* the _PDC objects passed by the driver, if any */
67 struct acpi_object_list *pdc;
68}; 65};
69 66
70/* Performance Management */ 67/* Performance Management */
@@ -96,8 +93,6 @@ struct acpi_processor_performance {
96 unsigned int state_count; 93 unsigned int state_count;
97 struct acpi_processor_px *states; 94 struct acpi_processor_px *states;
98 95
99 /* the _PDC objects passed by the driver, if any */
100 struct acpi_object_list *pdc;
101}; 96};
102 97
103/* Throttling Control */ 98/* Throttling Control */
@@ -151,6 +146,9 @@ struct acpi_processor {
151 struct acpi_processor_performance *performance; 146 struct acpi_processor_performance *performance;
152 struct acpi_processor_throttling throttling; 147 struct acpi_processor_throttling throttling;
153 struct acpi_processor_limit limit; 148 struct acpi_processor_limit limit;
149
150 /* the _PDC objects for this processor, if any */
151 struct acpi_object_list *pdc;
154}; 152};
155 153
156struct acpi_processor_errata { 154struct acpi_processor_errata {
@@ -178,22 +176,12 @@ int acpi_processor_notify_smm(struct module *calling_module);
178extern struct acpi_processor *processors[NR_CPUS]; 176extern struct acpi_processor *processors[NR_CPUS];
179extern struct acpi_processor_errata errata; 177extern struct acpi_processor_errata errata;
180 178
181int acpi_processor_set_pdc(struct acpi_processor *pr, 179void arch_acpi_processor_init_pdc(struct acpi_processor *pr);
182 struct acpi_object_list *pdc_in);
183 180
184#ifdef ARCH_HAS_POWER_PDC_INIT 181#ifdef ARCH_HAS_POWER_INIT
185void acpi_processor_power_init_pdc(struct acpi_processor_power *pow,
186 unsigned int cpu);
187void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, 182void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
188 unsigned int cpu); 183 unsigned int cpu);
189#else 184#else
190static inline void acpi_processor_power_init_pdc(struct acpi_processor_power
191 *pow, unsigned int cpu)
192{
193 pow->pdc = NULL;
194 return;
195}
196
197static inline void acpi_processor_power_init_bm_check(struct 185static inline void acpi_processor_power_init_bm_check(struct
198 acpi_processor_flags 186 acpi_processor_flags
199 *flags, unsigned int cpu) 187 *flags, unsigned int cpu)