1
2 /******************************************************************************
3 *
4 * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only)
5 *
6 *****************************************************************************/
7
8 /*
9 * Copyright (C) 2000 - 2011, Intel Corp.
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions, and the following disclaimer,
17 * without modification.
18 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 * substantially similar to the "NO WARRANTY" disclaimer below
20 * ("Disclaimer") and any redistribution must be conditioned upon
21 * including a substantially similar Disclaimer requirement for further
22 * binary redistribution.
23 * 3. Neither the names of the above-listed copyright holders nor the names
24 * of any contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * Alternatively, this software may be distributed under the terms of the
28 * GNU General Public License ("GPL") version 2 as published by the Free
29 * Software Foundation.
77 *
78 * Note: The DescriptorType and Type fields must appear in the identical
79 * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT
80 * structures.
81 */
82 #define ACPI_OBJECT_COMMON_HEADER \
83 union acpi_operand_object *NextObject; /* Objects linked to parent NS node */\
84 UINT8 DescriptorType; /* To differentiate various internal objs */\
85 UINT8 Type; /* ACPI_OBJECT_TYPE */\
86 UINT16 ReferenceCount; /* For object deletion management */\
87 UINT8 Flags;
88 /*
89 * Note: There are 3 bytes available here before the
90 * next natural alignment boundary (for both 32/64 cases)
91 */
92
93 /* Values for Flag byte above */
94
95 #define AOPOBJ_AML_CONSTANT 0x01 /* Integer is an AML constant */
96 #define AOPOBJ_STATIC_POINTER 0x02 /* Data is part of an ACPI table, don't delete */
97 #define AOPOBJ_DATA_VALID 0x04 /* Object is intialized and data is valid */
98 #define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */
99 #define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */
100 #define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */
101
102
103 /******************************************************************************
104 *
105 * Basic data types
106 *
107 *****************************************************************************/
108
109 typedef struct acpi_object_common
110 {
111 ACPI_OBJECT_COMMON_HEADER
112
113 } ACPI_OBJECT_COMMON;
114
115
116 typedef struct acpi_object_integer
117 {
118 ACPI_OBJECT_COMMON_HEADER
119 UINT8 Fill[3]; /* Prevent warning on some compilers */
120 UINT64 Value;
121
122 } ACPI_OBJECT_INTEGER;
123
124
125 /*
126 * Note: The String and Buffer object must be identical through the Pointer
127 * and length elements. There is code that depends on this.
128 *
129 * Fields common to both Strings and Buffers
130 */
131 #define ACPI_COMMON_BUFFER_INFO(_Type) \
132 _Type *Pointer; \
133 UINT32 Length;
134
135
136 typedef struct acpi_object_string /* Null terminated, ASCII characters only */
137 {
138 ACPI_OBJECT_COMMON_HEADER
139 ACPI_COMMON_BUFFER_INFO (char) /* String in AML stream or allocated string */
140
141 } ACPI_OBJECT_STRING;
142
143
144 typedef struct acpi_object_buffer
145 {
146 ACPI_OBJECT_COMMON_HEADER
147 ACPI_COMMON_BUFFER_INFO (UINT8) /* Buffer in AML stream or allocated buffer */
229
230 /* Flags for InfoFlags field above */
231
232 #define ACPI_METHOD_MODULE_LEVEL 0x01 /* Method is actually module-level code */
233 #define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */
234 #define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */
235 #define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */
236 #define ACPI_METHOD_MODIFIED_NAMESPACE 0x10 /* Method modified the namespace */
237
238
239 /******************************************************************************
240 *
241 * Objects that can be notified. All share a common NotifyInfo area.
242 *
243 *****************************************************************************/
244
245 /*
246 * Common fields for objects that support ASL notifications
247 */
248 #define ACPI_COMMON_NOTIFY_INFO \
249 union acpi_operand_object *SystemNotify; /* Handler for system notifies */\
250 union acpi_operand_object *DeviceNotify; /* Handler for driver notifies */\
251 union acpi_operand_object *Handler; /* Handler for Address space */
252
253
254 typedef struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */
255 {
256 ACPI_OBJECT_COMMON_HEADER
257 ACPI_COMMON_NOTIFY_INFO
258
259 } ACPI_OBJECT_NOTIFY_COMMON;
260
261
262 typedef struct acpi_object_device
263 {
264 ACPI_OBJECT_COMMON_HEADER
265 ACPI_COMMON_NOTIFY_INFO
266 ACPI_GPE_BLOCK_INFO *GpeBlock;
267
268 } ACPI_OBJECT_DEVICE;
269
270
303 /******************************************************************************
304 *
305 * Fields. All share a common header/info field.
306 *
307 *****************************************************************************/
308
309 /*
310 * Common bitfield for the field objects
311 * "Field Datum" -- a datum from the actual field object
312 * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field
313 */
314 #define ACPI_COMMON_FIELD_INFO \
315 UINT8 FieldFlags; /* Access, update, and lock bits */\
316 UINT8 Attribute; /* From AccessAs keyword */\
317 UINT8 AccessByteWidth; /* Read/Write size in bytes */\
318 ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */\
319 UINT32 BitLength; /* Length of field in bits */\
320 UINT32 BaseByteOffset; /* Byte offset within containing object */\
321 UINT32 Value; /* Value to store into the Bank or Index register */\
322 UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\
323
324
325 typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
326 {
327 ACPI_OBJECT_COMMON_HEADER
328 ACPI_COMMON_FIELD_INFO
329 union acpi_operand_object *RegionObj; /* Parent Operation Region object (REGION/BANK fields only) */
330
331 } ACPI_OBJECT_FIELD_COMMON;
332
333
334 typedef struct acpi_object_region_field
335 {
336 ACPI_OBJECT_COMMON_HEADER
337 ACPI_COMMON_FIELD_INFO
338 union acpi_operand_object *RegionObj; /* Containing OpRegion object */
339
340 } ACPI_OBJECT_REGION_FIELD;
341
342
343 typedef struct acpi_object_bank_field
344 {
345 ACPI_OBJECT_COMMON_HEADER
346 ACPI_COMMON_FIELD_INFO
347 union acpi_operand_object *RegionObj; /* Containing OpRegion object */
348 union acpi_operand_object *BankObj; /* BankSelect Register object */
349
350 } ACPI_OBJECT_BANK_FIELD;
351
352
353 typedef struct acpi_object_index_field
354 {
355 ACPI_OBJECT_COMMON_HEADER
356 ACPI_COMMON_FIELD_INFO
357
358 /*
369
370 typedef struct acpi_object_buffer_field
371 {
372 ACPI_OBJECT_COMMON_HEADER
373 ACPI_COMMON_FIELD_INFO
374 union acpi_operand_object *BufferObj; /* Containing Buffer object */
375
376 } ACPI_OBJECT_BUFFER_FIELD;
377
378
379 /******************************************************************************
380 *
381 * Objects for handlers
382 *
383 *****************************************************************************/
384
385 typedef struct acpi_object_notify_handler
386 {
387 ACPI_OBJECT_COMMON_HEADER
388 ACPI_NAMESPACE_NODE *Node; /* Parent device */
389 ACPI_NOTIFY_HANDLER Handler;
390 void *Context;
391
392 } ACPI_OBJECT_NOTIFY_HANDLER;
393
394
395 typedef struct acpi_object_addr_handler
396 {
397 ACPI_OBJECT_COMMON_HEADER
398 UINT8 SpaceId;
399 UINT8 HandlerFlags;
400 ACPI_ADR_SPACE_HANDLER Handler;
401 ACPI_NAMESPACE_NODE *Node; /* Parent device */
402 void *Context;
403 ACPI_ADR_SPACE_SETUP Setup;
404 union acpi_operand_object *RegionList; /* regions using this handler */
405 union acpi_operand_object *Next;
406
407 } ACPI_OBJECT_ADDR_HANDLER;
408
409 /* Flags for address handler (HandlerFlags) */
410
411 #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x01
412
413
414 /******************************************************************************
415 *
416 * Special internal objects
417 *
418 *****************************************************************************/
419
420 /*
421 * The Reference object is used for these opcodes:
422 * Arg[0-6], Local[0-7], IndexOp, NameOp, RefOfOp, LoadOp, LoadTableOp, DebugOp
423 * The Reference.Class differentiates these types.
424 */
446 ACPI_REFCLASS_TABLE = 4, /* DdbHandle - Load(), LoadTable() */
447 ACPI_REFCLASS_NAME = 5, /* Reference to a named object */
448 ACPI_REFCLASS_DEBUG = 6, /* Debug object */
449
450 ACPI_REFCLASS_MAX = 6
451
452 } ACPI_REFERENCE_CLASSES;
453
454
455 /*
456 * Extra object is used as additional storage for types that
457 * have AML code in their declarations (TermArgs) that must be
458 * evaluated at run time.
459 *
460 * Currently: Region and FieldUnit types
461 */
462 typedef struct acpi_object_extra
463 {
464 ACPI_OBJECT_COMMON_HEADER
465 ACPI_NAMESPACE_NODE *Method_REG; /* _REG method for this region (if any) */
466 void *RegionContext; /* Region-specific data */
467 UINT8 *AmlStart;
468 UINT32 AmlLength;
469
470 } ACPI_OBJECT_EXTRA;
471
472
473 /* Additional data that can be attached to namespace nodes */
474
475 typedef struct acpi_object_data
476 {
477 ACPI_OBJECT_COMMON_HEADER
478 ACPI_OBJECT_HANDLER Handler;
479 void *Pointer;
480
481 } ACPI_OBJECT_DATA;
482
483
484 /* Structure used when objects are cached for reuse */
485
|
1 /******************************************************************************
2 *
3 * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only)
4 *
5 *****************************************************************************/
6
7 /*
8 * Copyright (C) 2000 - 2014, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
76 *
77 * Note: The DescriptorType and Type fields must appear in the identical
78 * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT
79 * structures.
80 */
81 #define ACPI_OBJECT_COMMON_HEADER \
82 union acpi_operand_object *NextObject; /* Objects linked to parent NS node */\
83 UINT8 DescriptorType; /* To differentiate various internal objs */\
84 UINT8 Type; /* ACPI_OBJECT_TYPE */\
85 UINT16 ReferenceCount; /* For object deletion management */\
86 UINT8 Flags;
87 /*
88 * Note: There are 3 bytes available here before the
89 * next natural alignment boundary (for both 32/64 cases)
90 */
91
92 /* Values for Flag byte above */
93
94 #define AOPOBJ_AML_CONSTANT 0x01 /* Integer is an AML constant */
95 #define AOPOBJ_STATIC_POINTER 0x02 /* Data is part of an ACPI table, don't delete */
96 #define AOPOBJ_DATA_VALID 0x04 /* Object is initialized and data is valid */
97 #define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */
98 #define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */
99 #define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */
100
101
102 /******************************************************************************
103 *
104 * Basic data types
105 *
106 *****************************************************************************/
107
108 typedef struct acpi_object_common
109 {
110 ACPI_OBJECT_COMMON_HEADER
111
112 } ACPI_OBJECT_COMMON;
113
114
115 typedef struct acpi_object_integer
116 {
117 ACPI_OBJECT_COMMON_HEADER
118 UINT8 Fill[3]; /* Prevent warning on some compilers */
119 UINT64 Value;
120
121 } ACPI_OBJECT_INTEGER;
122
123
124 /*
125 * Note: The String and Buffer object must be identical through the
126 * pointer and length elements. There is code that depends on this.
127 *
128 * Fields common to both Strings and Buffers
129 */
130 #define ACPI_COMMON_BUFFER_INFO(_Type) \
131 _Type *Pointer; \
132 UINT32 Length;
133
134
135 typedef struct acpi_object_string /* Null terminated, ASCII characters only */
136 {
137 ACPI_OBJECT_COMMON_HEADER
138 ACPI_COMMON_BUFFER_INFO (char) /* String in AML stream or allocated string */
139
140 } ACPI_OBJECT_STRING;
141
142
143 typedef struct acpi_object_buffer
144 {
145 ACPI_OBJECT_COMMON_HEADER
146 ACPI_COMMON_BUFFER_INFO (UINT8) /* Buffer in AML stream or allocated buffer */
228
229 /* Flags for InfoFlags field above */
230
231 #define ACPI_METHOD_MODULE_LEVEL 0x01 /* Method is actually module-level code */
232 #define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */
233 #define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */
234 #define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */
235 #define ACPI_METHOD_MODIFIED_NAMESPACE 0x10 /* Method modified the namespace */
236
237
238 /******************************************************************************
239 *
240 * Objects that can be notified. All share a common NotifyInfo area.
241 *
242 *****************************************************************************/
243
244 /*
245 * Common fields for objects that support ASL notifications
246 */
247 #define ACPI_COMMON_NOTIFY_INFO \
248 union acpi_operand_object *NotifyList[2]; /* Handlers for system/device notifies */\
249 union acpi_operand_object *Handler; /* Handler for Address space */
250
251
252 typedef struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */
253 {
254 ACPI_OBJECT_COMMON_HEADER
255 ACPI_COMMON_NOTIFY_INFO
256
257 } ACPI_OBJECT_NOTIFY_COMMON;
258
259
260 typedef struct acpi_object_device
261 {
262 ACPI_OBJECT_COMMON_HEADER
263 ACPI_COMMON_NOTIFY_INFO
264 ACPI_GPE_BLOCK_INFO *GpeBlock;
265
266 } ACPI_OBJECT_DEVICE;
267
268
301 /******************************************************************************
302 *
303 * Fields. All share a common header/info field.
304 *
305 *****************************************************************************/
306
307 /*
308 * Common bitfield for the field objects
309 * "Field Datum" -- a datum from the actual field object
310 * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field
311 */
312 #define ACPI_COMMON_FIELD_INFO \
313 UINT8 FieldFlags; /* Access, update, and lock bits */\
314 UINT8 Attribute; /* From AccessAs keyword */\
315 UINT8 AccessByteWidth; /* Read/Write size in bytes */\
316 ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */\
317 UINT32 BitLength; /* Length of field in bits */\
318 UINT32 BaseByteOffset; /* Byte offset within containing object */\
319 UINT32 Value; /* Value to store into the Bank or Index register */\
320 UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\
321 UINT8 AccessLength; /* For serial regions/fields */
322
323
324 typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
325 {
326 ACPI_OBJECT_COMMON_HEADER
327 ACPI_COMMON_FIELD_INFO
328 union acpi_operand_object *RegionObj; /* Parent Operation Region object (REGION/BANK fields only) */
329
330 } ACPI_OBJECT_FIELD_COMMON;
331
332
333 typedef struct acpi_object_region_field
334 {
335 ACPI_OBJECT_COMMON_HEADER
336 ACPI_COMMON_FIELD_INFO
337 UINT16 ResourceLength;
338 union acpi_operand_object *RegionObj; /* Containing OpRegion object */
339 UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */
340
341 } ACPI_OBJECT_REGION_FIELD;
342
343
344 typedef struct acpi_object_bank_field
345 {
346 ACPI_OBJECT_COMMON_HEADER
347 ACPI_COMMON_FIELD_INFO
348 union acpi_operand_object *RegionObj; /* Containing OpRegion object */
349 union acpi_operand_object *BankObj; /* BankSelect Register object */
350
351 } ACPI_OBJECT_BANK_FIELD;
352
353
354 typedef struct acpi_object_index_field
355 {
356 ACPI_OBJECT_COMMON_HEADER
357 ACPI_COMMON_FIELD_INFO
358
359 /*
370
371 typedef struct acpi_object_buffer_field
372 {
373 ACPI_OBJECT_COMMON_HEADER
374 ACPI_COMMON_FIELD_INFO
375 union acpi_operand_object *BufferObj; /* Containing Buffer object */
376
377 } ACPI_OBJECT_BUFFER_FIELD;
378
379
380 /******************************************************************************
381 *
382 * Objects for handlers
383 *
384 *****************************************************************************/
385
386 typedef struct acpi_object_notify_handler
387 {
388 ACPI_OBJECT_COMMON_HEADER
389 ACPI_NAMESPACE_NODE *Node; /* Parent device */
390 UINT32 HandlerType; /* Type: Device/System/Both */
391 ACPI_NOTIFY_HANDLER Handler; /* Handler address */
392 void *Context;
393 union acpi_operand_object *Next[2]; /* Device and System handler lists */
394
395 } ACPI_OBJECT_NOTIFY_HANDLER;
396
397
398 typedef struct acpi_object_addr_handler
399 {
400 ACPI_OBJECT_COMMON_HEADER
401 UINT8 SpaceId;
402 UINT8 HandlerFlags;
403 ACPI_ADR_SPACE_HANDLER Handler;
404 ACPI_NAMESPACE_NODE *Node; /* Parent device */
405 void *Context;
406 ACPI_ADR_SPACE_SETUP Setup;
407 union acpi_operand_object *RegionList; /* Regions using this handler */
408 union acpi_operand_object *Next;
409
410 } ACPI_OBJECT_ADDR_HANDLER;
411
412 /* Flags for address handler (HandlerFlags) */
413
414 #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x01
415
416
417 /******************************************************************************
418 *
419 * Special internal objects
420 *
421 *****************************************************************************/
422
423 /*
424 * The Reference object is used for these opcodes:
425 * Arg[0-6], Local[0-7], IndexOp, NameOp, RefOfOp, LoadOp, LoadTableOp, DebugOp
426 * The Reference.Class differentiates these types.
427 */
449 ACPI_REFCLASS_TABLE = 4, /* DdbHandle - Load(), LoadTable() */
450 ACPI_REFCLASS_NAME = 5, /* Reference to a named object */
451 ACPI_REFCLASS_DEBUG = 6, /* Debug object */
452
453 ACPI_REFCLASS_MAX = 6
454
455 } ACPI_REFERENCE_CLASSES;
456
457
458 /*
459 * Extra object is used as additional storage for types that
460 * have AML code in their declarations (TermArgs) that must be
461 * evaluated at run time.
462 *
463 * Currently: Region and FieldUnit types
464 */
465 typedef struct acpi_object_extra
466 {
467 ACPI_OBJECT_COMMON_HEADER
468 ACPI_NAMESPACE_NODE *Method_REG; /* _REG method for this region (if any) */
469 ACPI_NAMESPACE_NODE *ScopeNode;
470 void *RegionContext; /* Region-specific data */
471 UINT8 *AmlStart;
472 UINT32 AmlLength;
473
474 } ACPI_OBJECT_EXTRA;
475
476
477 /* Additional data that can be attached to namespace nodes */
478
479 typedef struct acpi_object_data
480 {
481 ACPI_OBJECT_COMMON_HEADER
482 ACPI_OBJECT_HANDLER Handler;
483 void *Pointer;
484
485 } ACPI_OBJECT_DATA;
486
487
488 /* Structure used when objects are cached for reuse */
489
|