Subversion Repositories Kolibri OS

Rev

Rev 1498 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1498 Rev 2216
Line 6... Line 6...
6
 
6
 
7
/******************************************************************************
7
/******************************************************************************
8
 *
8
 *
9
 * 1. Copyright Notice
9
 * 1. Copyright Notice
10
 *
10
 *
11
 * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
11
 * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
12
 * All rights reserved.
12
 * All rights reserved.
13
 *
13
 *
14
 * 2. License
14
 * 2. License
15
 *
15
 *
Line 186... Line 186...
186
 * data width. ACPI_SIZE is needed because there is no guarantee that a
186
 * data width. ACPI_SIZE is needed because there is no guarantee that a
187
 * kernel-level C library is present.
187
 * kernel-level C library is present.
188
 *
188
 *
189
 * ACPI_SIZE        16/32/64-bit unsigned value
189
 * ACPI_SIZE        16/32/64-bit unsigned value
190
 * ACPI_NATIVE_INT  16/32/64-bit signed value
190
 * ACPI_NATIVE_INT  16/32/64-bit signed value
191
 *
-
 
192
 */
191
 */
Line 193... Line 192...
193
 
192
 
194
/*******************************************************************************
193
/*******************************************************************************
195
 *
194
 *
Line 203... Line 202...
203
typedef COMPILER_DEPENDENT_UINT64       UINT64;
202
typedef COMPILER_DEPENDENT_UINT64       UINT64;
204
typedef COMPILER_DEPENDENT_INT64        INT64;
203
typedef COMPILER_DEPENDENT_INT64        INT64;
Line 205... Line 204...
205
 
204
 
Line -... Line 205...
-
 
205
/*! [End] no source code translation !*/
-
 
206
 
-
 
207
/*
-
 
208
 * Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
-
 
209
 * across operating systems or even the various UNIX systems. Since ACPICA
-
 
210
 * only needs the thread ID as a unique thread identifier, we use a UINT64
-
 
211
 * as the only common data type - it will accommodate any type of pointer or
-
 
212
 * any type of integer. It is up to the host-dependent OSL to cast the
-
 
213
 * native thread ID type to a UINT64 (in AcpiOsGetThreadId).
-
 
214
 */
Line 206... Line 215...
206
/*! [End] no source code translation !*/
215
#define ACPI_THREAD_ID                  UINT64
207
 
216
 
208
 
217
 
209
/*******************************************************************************
218
/*******************************************************************************
Line 284... Line 293...
284
 * If the defaults below are not appropriate for the host system, they can
293
 * If the defaults below are not appropriate for the host system, they can
285
 * be defined in the OS-specific header, and this will take precedence.
294
 * be defined in the OS-specific header, and this will take precedence.
286
 *
295
 *
287
 ******************************************************************************/
296
 ******************************************************************************/
Line 288... Line -...
288
 
-
 
289
/* Value returned by AcpiOsGetThreadId */
-
 
290
 
-
 
291
#ifndef ACPI_THREAD_ID
-
 
292
#define ACPI_THREAD_ID                  ACPI_SIZE
-
 
293
#endif
-
 
294
 
297
 
Line 295... Line 298...
295
/* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */
298
/* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */
296
 
299
 
297
#ifndef ACPI_CPU_FLAGS
300
#ifndef ACPI_CPU_FLAGS
Line 454... Line 457...
454
 
457
 
455
typedef UINT8                           ACPI_OWNER_ID;
458
typedef UINT8                           ACPI_OWNER_ID;
Line 456... Line -...
456
#define ACPI_OWNER_ID_MAX               0xFF
-
 
457
 
-
 
458
 
-
 
459
typedef struct uint64_struct
-
 
460
{
-
 
461
    UINT32                          Lo;
-
 
462
    UINT32                          Hi;
-
 
463
 
-
 
464
} UINT64_STRUCT;
-
 
465
 
-
 
466
typedef union uint64_overlay
-
 
467
{
-
 
468
    UINT64                          Full;
-
 
469
    UINT64_STRUCT                   Part;
-
 
470
 
-
 
471
} UINT64_OVERLAY;
459
#define ACPI_OWNER_ID_MAX               0xFF
472
 
460
 
473
 
461
 
474
#define ACPI_INTEGER_BIT_SIZE           64
462
#define ACPI_INTEGER_BIT_SIZE           64
475
#define ACPI_MAX_DECIMAL_DIGITS         20  /* 2^64 = 18,446,744,073,709,551,616 */
463
#define ACPI_MAX_DECIMAL_DIGITS         20  /* 2^64 = 18,446,744,073,709,551,616 */
Line 740... Line 728...
740
 */
728
 */
741
#define ACPI_GPE_INVALID                0xFF
729
#define ACPI_GPE_INVALID                0xFF
742
#define ACPI_GPE_MAX                    0xFF
730
#define ACPI_GPE_MAX                    0xFF
743
#define ACPI_NUM_GPE                    256
731
#define ACPI_NUM_GPE                    256
Line 744... Line 732...
744
 
732
 
Line 745... Line 733...
745
/* Actions for AcpiSetGpe */
733
/* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
746
 
734
 
747
#define ACPI_GPE_ENABLE                 0
-
 
748
#define ACPI_GPE_DISABLE                1
-
 
749
 
-
 
750
/* GpeTypes for AcpiEnableGpe and AcpiDisableGpe */
-
 
751
 
735
#define ACPI_GPE_ENABLE                 0
752
#define ACPI_GPE_TYPE_WAKE              (UINT8) 0x01
-
 
Line 753... Line 736...
753
#define ACPI_GPE_TYPE_RUNTIME           (UINT8) 0x02
736
#define ACPI_GPE_DISABLE                1
754
#define ACPI_GPE_TYPE_WAKE_RUN          (UINT8) 0x03
737
#define ACPI_GPE_CONDITIONAL_ENABLE     2
755
 
738
 
756
/*
739
/*
757
 * GPE info flags - Per GPE
740
 * GPE info flags - Per GPE
758
 * +-------+---+-+-+
741
 * +-------+-+-+---+
759
 * |  7:4  |3:2|1|0|
742
 * |  7:4  |3|2|1:0|
760
 * +-------+---+-+-+
743
 * +-------+-+-+---+
761
 *     |     |  | |
744
 *     |    | |  |
762
 *     |     |  | +--- Interrupt type: edge or level triggered
745
 *     |    | |  +-- Type of dispatch:to method, handler, notify, or none
763
 *     |     |  +----- GPE can wake the system
746
 *     |    | +----- Interrupt type: edge or level triggered
764
 *     |     +-------- Type of dispatch:to method, handler, or none
747
 *     |    +------- Is a Wake GPE
765
 *     +-------------- 
748
 *     +------------ 
-
 
749
 */
-
 
750
#define ACPI_GPE_DISPATCH_NONE          (UINT8) 0x00
766
 */
751
#define ACPI_GPE_DISPATCH_METHOD        (UINT8) 0x01
Line -... Line 752...
-
 
752
#define ACPI_GPE_DISPATCH_HANDLER       (UINT8) 0x02
767
#define ACPI_GPE_XRUPT_TYPE_MASK        (UINT8) 0x01
753
#define ACPI_GPE_DISPATCH_NOTIFY        (UINT8) 0x03
-
 
754
#define ACPI_GPE_DISPATCH_MASK          (UINT8) 0x03
Line 768... Line 755...
768
#define ACPI_GPE_LEVEL_TRIGGERED        (UINT8) 0x01
755
 
769
#define ACPI_GPE_EDGE_TRIGGERED         (UINT8) 0x00
-
 
770
 
-
 
771
#define ACPI_GPE_CAN_WAKE               (UINT8) 0x02
-
 
Line 772... Line 756...
772
 
756
#define ACPI_GPE_LEVEL_TRIGGERED        (UINT8) 0x04
773
#define ACPI_GPE_DISPATCH_MASK          (UINT8) 0x0C
757
#define ACPI_GPE_EDGE_TRIGGERED         (UINT8) 0x00
774
#define ACPI_GPE_DISPATCH_HANDLER       (UINT8) 0x04
758
#define ACPI_GPE_XRUPT_TYPE_MASK        (UINT8) 0x04
775
#define ACPI_GPE_DISPATCH_METHOD        (UINT8) 0x08
759
 
Line 802... Line 786...
802
#define ACPI_ADR_SPACE_EC               (ACPI_ADR_SPACE_TYPE) 3
786
#define ACPI_ADR_SPACE_EC               (ACPI_ADR_SPACE_TYPE) 3
803
#define ACPI_ADR_SPACE_SMBUS            (ACPI_ADR_SPACE_TYPE) 4
787
#define ACPI_ADR_SPACE_SMBUS            (ACPI_ADR_SPACE_TYPE) 4
804
#define ACPI_ADR_SPACE_CMOS             (ACPI_ADR_SPACE_TYPE) 5
788
#define ACPI_ADR_SPACE_CMOS             (ACPI_ADR_SPACE_TYPE) 5
805
#define ACPI_ADR_SPACE_PCI_BAR_TARGET   (ACPI_ADR_SPACE_TYPE) 6
789
#define ACPI_ADR_SPACE_PCI_BAR_TARGET   (ACPI_ADR_SPACE_TYPE) 6
806
#define ACPI_ADR_SPACE_IPMI             (ACPI_ADR_SPACE_TYPE) 7
790
#define ACPI_ADR_SPACE_IPMI             (ACPI_ADR_SPACE_TYPE) 7
807
#define ACPI_ADR_SPACE_DATA_TABLE       (ACPI_ADR_SPACE_TYPE) 8
-
 
808
#define ACPI_ADR_SPACE_FIXED_HARDWARE   (ACPI_ADR_SPACE_TYPE) 127
-
 
Line -... Line 791...
-
 
791
 
-
 
792
#define ACPI_NUM_PREDEFINED_REGIONS     8
-
 
793
 
-
 
794
/*
-
 
795
 * Special Address Spaces
-
 
796
 *
-
 
797
 * Note: A Data Table region is a special type of operation region
-
 
798
 * that has its own AML opcode. However, internally, the AML
-
 
799
 * interpreter simply creates an operation region with an an address
-
 
800
 * space type of ACPI_ADR_SPACE_DATA_TABLE.
-
 
801
 */
-
 
802
#define ACPI_ADR_SPACE_DATA_TABLE       (ACPI_ADR_SPACE_TYPE) 0x7E /* Internal to ACPICA only */
-
 
803
#define ACPI_ADR_SPACE_FIXED_HARDWARE   (ACPI_ADR_SPACE_TYPE) 0x7F
-
 
804
 
-
 
805
/* Values for _REG connection code */
-
 
806
 
-
 
807
#define ACPI_REG_DISCONNECT             0
Line 809... Line 808...
809
 
808
#define ACPI_REG_CONNECT                1
810
 
809
 
811
/*
810
/*
812
 * BitRegister IDs
811
 * BitRegister IDs
Line 1030... Line 1029...
1030
 
1029
 
1031
/*
1030
/*
1032
 * Various handlers and callback procedures
1031
 * Various handlers and callback procedures
1033
 */
1032
 */
-
 
1033
typedef
-
 
1034
void (*ACPI_GBL_EVENT_HANDLER) (
-
 
1035
    UINT32                          EventType,
-
 
1036
    ACPI_HANDLE                     Device,
-
 
1037
    UINT32                          EventNumber,
-
 
1038
    void                            *Context);
-
 
1039
 
-
 
1040
#define ACPI_EVENT_TYPE_GPE         0
-
 
1041
#define ACPI_EVENT_TYPE_FIXED       1
-
 
1042
 
1034
typedef
1043
typedef
1035
UINT32 (*ACPI_EVENT_HANDLER) (
1044
UINT32 (*ACPI_EVENT_HANDLER) (
Line 1036... Line 1045...
1036
    void                            *Context);
1045
    void                            *Context);
-
 
1046
 
-
 
1047
typedef
-
 
1048
UINT32 (*ACPI_GPE_HANDLER) (
-
 
1049
    ACPI_HANDLE                     GpeDevice,
-
 
1050
    UINT32                          GpeNumber,
-
 
1051
    void                            *Context);
1037
 
1052
 
1038
typedef
1053
typedef
1039
void (*ACPI_NOTIFY_HANDLER) (
1054
void (*ACPI_NOTIFY_HANDLER) (
1040
    ACPI_HANDLE                     Device,
1055
    ACPI_HANDLE                     Device,
Line 1102... Line 1117...
1102
    ACPI_HANDLE                     Object,
1117
    ACPI_HANDLE                     Object,
1103
    UINT32                          NestingLevel,
1118
    UINT32                          NestingLevel,
1104
    void                            *Context,
1119
    void                            *Context,
1105
    void                            **ReturnValue);
1120
    void                            **ReturnValue);
Line -... Line 1121...
-
 
1121
 
-
 
1122
typedef
-
 
1123
UINT32 (*ACPI_INTERFACE_HANDLER) (
-
 
1124
    ACPI_STRING                     InterfaceName,
-
 
1125
    UINT32                          Supported);
Line 1106... Line 1126...
1106
 
1126
 
Line 1107... Line 1127...
1107
 
1127
 
1108
/* Interrupt handler return values */
1128
/* Interrupt handler return values */
Line -... Line 1129...
-
 
1129
 
-
 
1130
#define ACPI_INTERRUPT_NOT_HANDLED      0x00
-
 
1131
#define ACPI_INTERRUPT_HANDLED          0x01
-
 
1132
 
-
 
1133
/* GPE handler return values */
1109
 
1134
 
Line 1110... Line 1135...
1110
#define ACPI_INTERRUPT_NOT_HANDLED      0x00
1135
#define ACPI_REENABLE_GPE               0x80
Line 1111... Line 1136...
1111
#define ACPI_INTERRUPT_HANDLED          0x01
1136