Coverage Report

Created: 2017-10-25 09:10

/root/src/xen/xen/include/acpi/actypes.h
Line
Count
Source (jump to first uncovered line)
1
/******************************************************************************
2
 *
3
 * Name: actypes.h - Common data types for the entire ACPI subsystem
4
 *
5
 *****************************************************************************/
6
7
/*
8
 * Copyright (C) 2000 - 2007, R. Byron Moore
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.
29
 *
30
 * NO WARRANTY
31
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35
 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41
 * POSSIBILITY OF SUCH DAMAGES.
42
 */
43
44
#ifndef __ACTYPES_H__
45
#define __ACTYPES_H__
46
47
/* acpisrc:struct_defs -- for acpisrc conversion */
48
49
/*
50
 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
51
 * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of
52
 * 12/2006.
53
 */
54
#ifndef ACPI_MACHINE_WIDTH
55
#error ACPI_MACHINE_WIDTH not defined
56
#endif
57
58
/*! [Begin] no source code translation */
59
60
/*
61
 * Data type ranges
62
 * Note: These macros are designed to be compiler independent as well as
63
 * working around problems that some 32-bit compilers have with 64-bit
64
 * constants.
65
 */
66
#define ACPI_UINT8_MAX                  (UINT8) (~((UINT8)  0)) /* 0xFF               */
67
#define ACPI_UINT16_MAX                 (UINT16)(~((UINT16) 0)) /* 0xFFFF             */
68
#define ACPI_UINT32_MAX                 (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF         */
69
#define ACPI_UINT64_MAX                 (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */
70
#define ACPI_ASCII_MAX                  0x7F
71
72
/*
73
 * Architecture-specific ACPICA Subsystem Data Types
74
 *
75
 * The goal of these types is to provide source code portability across
76
 * 16-bit, 32-bit, and 64-bit targets.
77
 *
78
 * 1) The following types are of fixed size for all targets (16/32/64):
79
 *
80
 * BOOLEAN      Logical boolean
81
 *
82
 * UINT8        8-bit  (1 byte) unsigned value
83
 * UINT16       16-bit (2 byte) unsigned value
84
 * UINT32       32-bit (4 byte) unsigned value
85
 * UINT64       64-bit (8 byte) unsigned value
86
 *
87
 * INT16        16-bit (2 byte) signed value
88
 * INT32        32-bit (4 byte) signed value
89
 * INT64        64-bit (8 byte) signed value
90
 *
91
 * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the
92
 * compiler-dependent header(s) and were introduced because there is no common
93
 * 64-bit integer type across the various compilation models, as shown in
94
 * the table below.
95
 *
96
 * Datatype  LP64 ILP64 LLP64 ILP32 LP32 16bit
97
 * char      8    8     8     8     8    8
98
 * short     16   16    16    16    16   16
99
 * _int32         32
100
 * int       32   64    32    32    16   16
101
 * long      64   64    32    32    32   32
102
 * long long            64    64
103
 * pointer   64   64    64    32    32   32
104
 *
105
 * Note: ILP64 and LP32 are currently not supported.
106
 *
107
 *
108
 * 2) These types represent the native word size of the target mode of the
109
 * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are
110
 * usually used for memory allocation, efficient loop counters, and array
111
 * indexes. The types are similar to the size_t type in the C library and are
112
 * required because there is no C type that consistently represents the native
113
 * data width.
114
 *
115
 * ACPI_SIZE        16/32/64-bit unsigned value
116
 * ACPI_NATIVE_UINT 16/32/64-bit unsigned value
117
 * ACPI_NATIVE_INT  16/32/64-bit signed value
118
 *
119
 */
120
121
/*******************************************************************************
122
 *
123
 * Common types for all compilers, all targets
124
 *
125
 ******************************************************************************/
126
127
typedef unsigned char BOOLEAN;
128
typedef unsigned char UINT8;
129
typedef unsigned short UINT16;
130
typedef COMPILER_DEPENDENT_UINT64 UINT64;
131
typedef COMPILER_DEPENDENT_INT64 INT64;
132
133
/*! [End] no source code translation !*/
134
135
/*******************************************************************************
136
 *
137
 * Types specific to 64-bit targets
138
 *
139
 ******************************************************************************/
140
141
#if ACPI_MACHINE_WIDTH == 64
142
143
/*! [Begin] no source code translation (keep the typedefs as-is) */
144
145
typedef unsigned int UINT32;
146
typedef int INT32;
147
148
/*! [End] no source code translation !*/
149
150
typedef u64 acpi_native_uint;
151
typedef s64 acpi_native_int;
152
153
typedef u64 acpi_io_address;
154
typedef u64 acpi_physical_address;
155
156
#define ACPI_MAX_PTR                    ACPI_UINT64_MAX
157
#define ACPI_SIZE_MAX                   ACPI_UINT64_MAX
158
159
#define ACPI_USE_NATIVE_DIVIDE  /* Has native 64-bit integer support */
160
161
/*
162
 * In the case of the Itanium Processor Family (IPF), the hardware does not
163
 * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
164
 * to indicate that special precautions must be taken to avoid alignment faults.
165
 * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
166
 *
167
 * Note: Em64_t and other X86-64 processors support misaligned transfers,
168
 * so there is no need to define this flag.
169
 */
170
#if defined (__IA64__) || defined (__ia64__)
171
#define ACPI_MISALIGNMENT_NOT_SUPPORTED
172
#endif
173
174
/*******************************************************************************
175
 *
176
 * Types specific to 32-bit targets
177
 *
178
 ******************************************************************************/
179
180
#elif ACPI_MACHINE_WIDTH == 32
181
182
/*! [Begin] no source code translation (keep the typedefs as-is) */
183
184
typedef unsigned int UINT32;
185
typedef int INT32;
186
187
/*! [End] no source code translation !*/
188
189
typedef u32 acpi_native_uint;
190
typedef s32 acpi_native_int;
191
192
typedef u32 acpi_io_address;
193
typedef u32 acpi_physical_address;
194
195
#define ACPI_MAX_PTR                    ACPI_UINT32_MAX
196
#define ACPI_SIZE_MAX                   ACPI_UINT32_MAX
197
198
#else
199
200
/* ACPI_MACHINE_WIDTH must be either 64 or 32 */
201
202
#error unknown ACPI_MACHINE_WIDTH
203
#endif
204
205
/* Variable-width type, used instead of clib size_t */
206
207
typedef acpi_native_uint acpi_size;
208
209
/*******************************************************************************
210
 *
211
 * OS-dependent and compiler-dependent types
212
 *
213
 * If the defaults below are not appropriate for the host system, they can
214
 * be defined in the compiler-specific or OS-specific header, and this will
215
 * take precedence.
216
 *
217
 ******************************************************************************/
218
219
/* Value returned by acpi_os_get_thread_id */
220
221
#ifndef acpi_thread_id
222
#define acpi_thread_id                  acpi_native_uint
223
#endif
224
225
/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
226
227
#ifndef acpi_uintptr_t
228
#define acpi_uintptr_t                  void *
229
#endif
230
231
/*
232
 * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because
233
 * some compilers can catch printf format string problems
234
 */
235
#ifndef ACPI_PRINTF_LIKE
236
#define ACPI_PRINTF_LIKE(c)
237
#endif
238
239
/*
240
 * Some compilers complain about unused variables. Sometimes we don't want to
241
 * use all the variables (for example, _acpi_module_name). This allows us
242
 * to to tell the compiler in a per-variable manner that a variable
243
 * is unused
244
 */
245
#ifndef ACPI_UNUSED_VAR
246
#define ACPI_UNUSED_VAR
247
#endif
248
249
/*
250
 * All ACPICA functions that are available to the rest of the kernel are
251
 * tagged with this macro which can be defined as appropriate for the host.
252
 */
253
#ifndef ACPI_EXPORT_SYMBOL
254
#define ACPI_EXPORT_SYMBOL(symbol)
255
#endif
256
257
/*******************************************************************************
258
 *
259
 * Independent types
260
 *
261
 ******************************************************************************/
262
263
/* Logical defines and NULL */
264
265
#ifdef FALSE
266
#undef FALSE
267
#endif
268
48
#define FALSE                           (1 == 0)
269
270
#ifdef TRUE
271
#undef TRUE
272
#endif
273
144
#define TRUE                            (1 == 1)
274
275
#ifndef NULL
276
#define NULL                            (void *) 0
277
#endif
278
279
/*
280
 * Mescellaneous types
281
 */
282
typedef u32 acpi_status;  /* All ACPI Exceptions */
283
typedef u32 acpi_name;    /* 4-byte ACPI name */
284
typedef char *acpi_string;  /* Null terminated ASCII string */
285
typedef void *acpi_handle;  /* Actually a ptr to a NS Node */
286
287
struct uint64_struct {
288
  u32 lo;
289
  u32 hi;
290
};
291
292
union uint64_overlay {
293
  u64 full;
294
  struct uint64_struct part;
295
};
296
297
struct uint32_struct {
298
  u32 lo;
299
  u32 hi;
300
};
301
302
/* Synchronization objects */
303
304
#define acpi_mutex                      void *
305
#define acpi_semaphore                  void *
306
307
/*
308
 * Acpi integer width. In ACPI version 1, integers are
309
 * 32 bits.  In ACPI version 2, integers are 64 bits.
310
 * Note that this pertains to the ACPI integer type only, not
311
 * other integers used in the implementation of the ACPI CA
312
 * subsystem.
313
 */
314
#ifdef ACPI_NO_INTEGER64_SUPPORT
315
316
/* 32-bit integers only, no 64-bit support */
317
318
typedef u32 acpi_integer;
319
#define ACPI_INTEGER_MAX                ACPI_UINT32_MAX
320
#define ACPI_INTEGER_BIT_SIZE           32
321
#define ACPI_MAX_DECIMAL_DIGITS         10  /* 2^32 = 4,294,967,296 */
322
323
#define ACPI_USE_NATIVE_DIVIDE  /* Use compiler native 32-bit divide */
324
325
#else
326
327
/* 64-bit integers */
328
329
typedef unsigned long long acpi_integer;
330
#define ACPI_INTEGER_MAX                ACPI_UINT64_MAX
331
#define ACPI_INTEGER_BIT_SIZE           64
332
#define ACPI_MAX_DECIMAL_DIGITS         20  /* 2^64 = 18,446,744,073,709,551,616 */
333
334
#if ACPI_MACHINE_WIDTH == 64
335
#define ACPI_USE_NATIVE_DIVIDE  /* Use compiler native 64-bit divide */
336
#endif
337
#endif
338
339
#define ACPI_MAX64_DECIMAL_DIGITS       20
340
#define ACPI_MAX32_DECIMAL_DIGITS       10
341
#define ACPI_MAX16_DECIMAL_DIGITS        5
342
#define ACPI_MAX8_DECIMAL_DIGITS         3
343
344
/*
345
 * Constants with special meanings
346
 */
347
#define ACPI_ROOT_OBJECT                ACPI_ADD_PTR (acpi_handle, NULL, ACPI_MAX_PTR)
348
349
/*
350
 * Initialization sequence
351
 */
352
#define ACPI_FULL_INITIALIZATION        0x00
353
#define ACPI_NO_ADDRESS_SPACE_INIT      0x01
354
#define ACPI_NO_HARDWARE_INIT           0x02
355
#define ACPI_NO_EVENT_INIT              0x04
356
#define ACPI_NO_HANDLER_INIT            0x08
357
#define ACPI_NO_ACPI_ENABLE             0x10
358
#define ACPI_NO_DEVICE_INIT             0x20
359
#define ACPI_NO_OBJECT_INIT             0x40
360
361
/*
362
 * Initialization state
363
 */
364
#define ACPI_SUBSYSTEM_INITIALIZE       0x01
365
#define ACPI_INITIALIZED_OK             0x02
366
367
/*
368
 * Power state values
369
 */
370
#define ACPI_STATE_UNKNOWN              (u8) 0xFF
371
372
0
#define ACPI_STATE_S0                   (u8) 0
373
#define ACPI_STATE_S1                   (u8) 1
374
#define ACPI_STATE_S2                   (u8) 2
375
6
#define ACPI_STATE_S3                   (u8) 3
376
0
#define ACPI_STATE_S4                   (u8) 4
377
0
#define ACPI_STATE_S5                   (u8) 5
378
0
#define ACPI_S_STATES_MAX               ACPI_STATE_S5
379
7
#define ACPI_S_STATE_COUNT              6
380
381
#define ACPI_STATE_D0                   (u8) 0
382
#define ACPI_STATE_D1                   (u8) 1
383
#define ACPI_STATE_D2                   (u8) 2
384
#define ACPI_STATE_D3                   (u8) 3
385
#define ACPI_D_STATES_MAX               ACPI_STATE_D3
386
#define ACPI_D_STATE_COUNT              4
387
388
0
#define ACPI_STATE_C0                   (u8) 0
389
12
#define ACPI_STATE_C1                   (u8) 1
390
0
#define ACPI_STATE_C2                   (u8) 2
391
0
#define ACPI_STATE_C3                   (u8) 3
392
#define ACPI_C_STATES_MAX               ACPI_STATE_C3
393
#define ACPI_C_STATE_COUNT              4
394
395
/*
396
 * Sleep type invalid value
397
 */
398
0
#define ACPI_SLEEP_TYPE_MAX             0x7
399
0
#define ACPI_SLEEP_TYPE_INVALID         0xFF
400
401
/*
402
 * Standard notify values
403
 */
404
#define ACPI_NOTIFY_BUS_CHECK           (u8) 0
405
#define ACPI_NOTIFY_DEVICE_CHECK        (u8) 1
406
#define ACPI_NOTIFY_DEVICE_WAKE         (u8) 2
407
#define ACPI_NOTIFY_EJECT_REQUEST       (u8) 3
408
#define ACPI_NOTIFY_DEVICE_CHECK_LIGHT  (u8) 4
409
#define ACPI_NOTIFY_FREQUENCY_MISMATCH  (u8) 5
410
#define ACPI_NOTIFY_BUS_MODE_MISMATCH   (u8) 6
411
#define ACPI_NOTIFY_POWER_FAULT         (u8) 7
412
413
/*
414
 * Types associated with ACPI names and objects.  The first group of
415
 * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
416
 * of the ACPI object_type() operator (See the ACPI Spec). Therefore,
417
 * only add to the first group if the spec changes.
418
 *
419
 * NOTE: Types must be kept in sync with the global acpi_ns_properties
420
 * and acpi_ns_type_names arrays.
421
 */
422
typedef u32 acpi_object_type;
423
424
#define ACPI_TYPE_ANY                   0x00
425
#define ACPI_TYPE_INTEGER               0x01  /* Byte/Word/Dword/Zero/One/Ones */
426
#define ACPI_TYPE_STRING                0x02
427
#define ACPI_TYPE_BUFFER                0x03
428
#define ACPI_TYPE_PACKAGE               0x04  /* byte_const, multiple data_term/Constant/super_name */
429
#define ACPI_TYPE_FIELD_UNIT            0x05
430
#define ACPI_TYPE_DEVICE                0x06  /* Name, multiple Node */
431
#define ACPI_TYPE_EVENT                 0x07
432
#define ACPI_TYPE_METHOD                0x08  /* Name, byte_const, multiple Code */
433
#define ACPI_TYPE_MUTEX                 0x09
434
#define ACPI_TYPE_REGION                0x0A
435
#define ACPI_TYPE_POWER                 0x0B  /* Name,byte_const,word_const,multi Node */
436
#define ACPI_TYPE_PROCESSOR             0x0C  /* Name,byte_const,Dword_const,byte_const,multi nm_o */
437
#define ACPI_TYPE_THERMAL               0x0D  /* Name, multiple Node */
438
#define ACPI_TYPE_BUFFER_FIELD          0x0E
439
#define ACPI_TYPE_DDB_HANDLE            0x0F
440
#define ACPI_TYPE_DEBUG_OBJECT          0x10
441
442
#define ACPI_TYPE_EXTERNAL_MAX          0x10
443
444
/*
445
 * These are object types that do not map directly to the ACPI
446
 * object_type() operator. They are used for various internal purposes only.
447
 * If new predefined ACPI_TYPEs are added (via the ACPI specification), these
448
 * internal types must move upwards. (There is code that depends on these
449
 * values being contiguous with the external types above.)
450
 */
451
#define ACPI_TYPE_LOCAL_REGION_FIELD    0x11
452
#define ACPI_TYPE_LOCAL_BANK_FIELD      0x12
453
#define ACPI_TYPE_LOCAL_INDEX_FIELD     0x13
454
#define ACPI_TYPE_LOCAL_REFERENCE       0x14  /* Arg#, Local#, Name, Debug, ref_of, Index */
455
#define ACPI_TYPE_LOCAL_ALIAS           0x15
456
#define ACPI_TYPE_LOCAL_METHOD_ALIAS    0x16
457
#define ACPI_TYPE_LOCAL_NOTIFY          0x17
458
#define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18
459
#define ACPI_TYPE_LOCAL_RESOURCE        0x19
460
#define ACPI_TYPE_LOCAL_RESOURCE_FIELD  0x1A
461
#define ACPI_TYPE_LOCAL_SCOPE           0x1B  /* 1 Name, multiple object_list Nodes */
462
463
#define ACPI_TYPE_NS_NODE_MAX           0x1B  /* Last typecode used within a NS Node */
464
465
/*
466
 * These are special object types that never appear in
467
 * a Namespace node, only in an union acpi_operand_object
468
 */
469
#define ACPI_TYPE_LOCAL_EXTRA           0x1C
470
#define ACPI_TYPE_LOCAL_DATA            0x1D
471
472
#define ACPI_TYPE_LOCAL_MAX             0x1D
473
474
/* All types above here are invalid */
475
476
#define ACPI_TYPE_INVALID               0x1E
477
#define ACPI_TYPE_NOT_FOUND             0xFF
478
479
/*
480
 * All I/O
481
 */
482
#define ACPI_READ                       0
483
#define ACPI_WRITE                      1
484
#define ACPI_IO_MASK                    1
485
486
/*
487
 * Event Types: Fixed & General Purpose
488
 */
489
typedef u32 acpi_event_type;
490
491
/*
492
 * Fixed events
493
 */
494
#define ACPI_EVENT_PMTIMER              0
495
#define ACPI_EVENT_GLOBAL               1
496
#define ACPI_EVENT_POWER_BUTTON         2
497
#define ACPI_EVENT_SLEEP_BUTTON         3
498
#define ACPI_EVENT_RTC                  4
499
#define ACPI_EVENT_MAX                  4
500
#define ACPI_NUM_FIXED_EVENTS           ACPI_EVENT_MAX + 1
501
502
/*
503
 * Event Status - Per event
504
 * -------------
505
 * The encoding of acpi_event_status is illustrated below.
506
 * Note that a set bit (1) indicates the property is TRUE
507
 * (e.g. if bit 0 is set then the event is enabled).
508
 * +-------------+-+-+-+
509
 * |   Bits 31:3 |2|1|0|
510
 * +-------------+-+-+-+
511
 *          |     | | |
512
 *          |     | | +- Enabled?
513
 *          |     | +--- Enabled for wake?
514
 *          |     +----- Set?
515
 *          +----------- <Reserved>
516
 */
517
typedef u32 acpi_event_status;
518
519
#define ACPI_EVENT_FLAG_DISABLED        (acpi_event_status) 0x00
520
#define ACPI_EVENT_FLAG_ENABLED         (acpi_event_status) 0x01
521
#define ACPI_EVENT_FLAG_WAKE_ENABLED    (acpi_event_status) 0x02
522
#define ACPI_EVENT_FLAG_SET             (acpi_event_status) 0x04
523
524
/* Notify types */
525
526
#define ACPI_SYSTEM_NOTIFY              0x1
527
#define ACPI_DEVICE_NOTIFY              0x2
528
#define ACPI_ALL_NOTIFY                 0x3
529
#define ACPI_MAX_NOTIFY_HANDLER_TYPE    0x3
530
531
#define ACPI_MAX_SYS_NOTIFY             0x7f
532
533
/* Address Space (Operation Region) Types */
534
535
typedef u8 acpi_adr_space_type;
536
537
35
#define ACPI_ADR_SPACE_SYSTEM_MEMORY    (acpi_adr_space_type) 0
538
0
#define ACPI_ADR_SPACE_SYSTEM_IO        (acpi_adr_space_type) 1
539
0
#define ACPI_ADR_SPACE_PCI_CONFIG       (acpi_adr_space_type) 2
540
#define ACPI_ADR_SPACE_EC               (acpi_adr_space_type) 3
541
#define ACPI_ADR_SPACE_SMBUS            (acpi_adr_space_type) 4
542
#define ACPI_ADR_SPACE_CMOS             (acpi_adr_space_type) 5
543
#define ACPI_ADR_SPACE_PCI_BAR_TARGET   (acpi_adr_space_type) 6
544
#define ACPI_ADR_SPACE_DATA_TABLE       (acpi_adr_space_type) 7
545
0
#define ACPI_ADR_SPACE_FIXED_HARDWARE   (acpi_adr_space_type) 127
546
547
/*
548
 * bit_register IDs
549
 * These are bitfields defined within the full ACPI registers
550
 */
551
#define ACPI_BITREG_TIMER_STATUS                0x00
552
0
#define ACPI_BITREG_BUS_MASTER_STATUS           0x01
553
#define ACPI_BITREG_GLOBAL_LOCK_STATUS          0x02
554
#define ACPI_BITREG_POWER_BUTTON_STATUS         0x03
555
#define ACPI_BITREG_SLEEP_BUTTON_STATUS         0x04
556
#define ACPI_BITREG_RT_CLOCK_STATUS             0x05
557
#define ACPI_BITREG_WAKE_STATUS                 0x06
558
#define ACPI_BITREG_PCIEXP_WAKE_STATUS          0x07
559
560
#define ACPI_BITREG_TIMER_ENABLE                0x08
561
#define ACPI_BITREG_GLOBAL_LOCK_ENABLE          0x09
562
#define ACPI_BITREG_POWER_BUTTON_ENABLE         0x0A
563
#define ACPI_BITREG_SLEEP_BUTTON_ENABLE         0x0B
564
#define ACPI_BITREG_RT_CLOCK_ENABLE             0x0C
565
#define ACPI_BITREG_WAKE_ENABLE                 0x0D
566
#define ACPI_BITREG_PCIEXP_WAKE_DISABLE         0x0E
567
568
#define ACPI_BITREG_SCI_ENABLE                  0x0F
569
0
#define ACPI_BITREG_BUS_MASTER_RLD              0x10
570
#define ACPI_BITREG_GLOBAL_LOCK_RELEASE         0x11
571
#define ACPI_BITREG_SLEEP_TYPE_A                0x12
572
#define ACPI_BITREG_SLEEP_TYPE_B                0x13
573
#define ACPI_BITREG_SLEEP_ENABLE                0x14
574
575
0
#define ACPI_BITREG_ARB_DISABLE                 0x15
576
577
0
#define ACPI_BITREG_MAX                         0x15
578
#define ACPI_NUM_BITREG                         ACPI_BITREG_MAX + 1
579
580
/*
581
 * External ACPI object definition
582
 */
583
union acpi_object {
584
  acpi_object_type type;  /* See definition of acpi_ns_type for values */
585
  struct {
586
    acpi_object_type type;
587
    acpi_integer value; /* The actual number */
588
  } integer;
589
590
  struct {
591
    acpi_object_type type;
592
    u32 length; /* # of bytes in string, excluding trailing null */
593
    char *pointer;  /* points to the string value */
594
  } string;
595
596
  struct {
597
    acpi_object_type type;
598
    u32 length; /* # of bytes in buffer */
599
    u8 *pointer;  /* points to the buffer */
600
  } buffer;
601
602
  struct {
603
    acpi_object_type type;
604
    u32 fill1;
605
    acpi_handle handle; /* object reference */
606
  } reference;
607
608
  struct {
609
    acpi_object_type type;
610
    u32 count;  /* # of elements in package */
611
    union acpi_object *elements;  /* Pointer to an array of ACPI_OBJECTs */
612
  } package;
613
614
  struct {
615
    acpi_object_type type;
616
    u32 proc_id;
617
    acpi_io_address pblk_address;
618
    u32 pblk_length;
619
  } processor;
620
621
  struct {
622
    acpi_object_type type;
623
    u32 system_level;
624
    u32 resource_order;
625
  } power_resource;
626
};
627
628
/*
629
 * List of objects, used as a parameter list for control method evaluation
630
 */
631
struct acpi_object_list {
632
  u32 count;
633
  union acpi_object *pointer;
634
};
635
636
/*
637
 * Miscellaneous common Data Structures used by the interfaces
638
 */
639
#define ACPI_NO_BUFFER              0
640
#define ACPI_ALLOCATE_BUFFER        (acpi_size) (-1)
641
#define ACPI_ALLOCATE_LOCAL_BUFFER  (acpi_size) (-2)
642
643
struct acpi_buffer {
644
  acpi_size length; /* Length in bytes of the buffer */
645
  void *pointer;    /* pointer to buffer */
646
};
647
648
/*
649
 *  Memory Attributes
650
 */
651
#define ACPI_READ_ONLY_MEMORY           (u8) 0x00
652
#define ACPI_READ_WRITE_MEMORY          (u8) 0x01
653
654
#define ACPI_NON_CACHEABLE_MEMORY       (u8) 0x00
655
#define ACPI_CACHABLE_MEMORY            (u8) 0x01
656
#define ACPI_WRITE_COMBINING_MEMORY     (u8) 0x02
657
#define ACPI_PREFETCHABLE_MEMORY        (u8) 0x03
658
659
/*
660
 *  IO Attributes
661
 *  The ISA IO ranges are:     n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh.
662
 *  The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh.
663
 */
664
#define ACPI_NON_ISA_ONLY_RANGES        (u8) 0x01
665
#define ACPI_ISA_ONLY_RANGES            (u8) 0x02
666
#define ACPI_ENTIRE_RANGE               (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
667
668
/* Type of translation - 1=Sparse, 0=Dense */
669
670
#define ACPI_SPARSE_TRANSLATION         (u8) 0x01
671
672
/*
673
 *  IO Port Descriptor Decode
674
 */
675
#define ACPI_DECODE_10                  (u8) 0x00 /* 10-bit IO address decode */
676
#define ACPI_DECODE_16                  (u8) 0x01 /* 16-bit IO address decode */
677
678
/*
679
 *  IRQ Attributes
680
 */
681
#define ACPI_LEVEL_SENSITIVE            (u8) 0x00
682
#define ACPI_EDGE_SENSITIVE             (u8) 0x01
683
684
#define ACPI_ACTIVE_HIGH                (u8) 0x00
685
#define ACPI_ACTIVE_LOW                 (u8) 0x01
686
687
#define ACPI_EXCLUSIVE                  (u8) 0x00
688
#define ACPI_SHARED                     (u8) 0x01
689
690
/*
691
 *  DMA Attributes
692
 */
693
#define ACPI_COMPATIBILITY              (u8) 0x00
694
#define ACPI_TYPE_A                     (u8) 0x01
695
#define ACPI_TYPE_B                     (u8) 0x02
696
#define ACPI_TYPE_F                     (u8) 0x03
697
698
#define ACPI_NOT_BUS_MASTER             (u8) 0x00
699
#define ACPI_BUS_MASTER                 (u8) 0x01
700
701
#define ACPI_TRANSFER_8                 (u8) 0x00
702
#define ACPI_TRANSFER_8_16              (u8) 0x01
703
#define ACPI_TRANSFER_16                (u8) 0x02
704
705
/*
706
 * Start Dependent Functions Priority definitions
707
 */
708
#define ACPI_GOOD_CONFIGURATION         (u8) 0x00
709
#define ACPI_ACCEPTABLE_CONFIGURATION   (u8) 0x01
710
#define ACPI_SUB_OPTIMAL_CONFIGURATION  (u8) 0x02
711
712
/*
713
 *  16, 32 and 64-bit Address Descriptor resource types
714
 */
715
#define ACPI_MEMORY_RANGE               (u8) 0x00
716
#define ACPI_IO_RANGE                   (u8) 0x01
717
#define ACPI_BUS_NUMBER_RANGE           (u8) 0x02
718
719
#define ACPI_ADDRESS_NOT_FIXED          (u8) 0x00
720
#define ACPI_ADDRESS_FIXED              (u8) 0x01
721
722
#define ACPI_POS_DECODE                 (u8) 0x00
723
#define ACPI_SUB_DECODE                 (u8) 0x01
724
725
#define ACPI_PRODUCER                   (u8) 0x00
726
#define ACPI_CONSUMER                   (u8) 0x01
727
728
#endif        /* __ACTYPES_H__ */