diff options
Diffstat (limited to 'source/include')
| -rw-r--r-- | source/include/acconfig.h | 1 | ||||
| -rw-r--r-- | source/include/acdebug.h | 33 | ||||
| -rw-r--r-- | source/include/acdisasm.h | 2 | ||||
| -rw-r--r-- | source/include/acevents.h | 29 | ||||
| -rw-r--r-- | source/include/acglobal.h | 1 | ||||
| -rw-r--r-- | source/include/acinterp.h | 2 | ||||
| -rw-r--r-- | source/include/acmacros.h | 139 | ||||
| -rw-r--r-- | source/include/acnamesp.h | 20 | ||||
| -rw-r--r-- | source/include/acoutput.h | 154 | ||||
| -rw-r--r-- | source/include/acparser.h | 35 | ||||
| -rw-r--r-- | source/include/acpixf.h | 8 | ||||
| -rw-r--r-- | source/include/acresrc.h | 8 | ||||
| -rw-r--r-- | source/include/acrestyp.h | 10 | ||||
| -rw-r--r-- | source/include/actbl2.h | 26 | ||||
| -rw-r--r-- | source/include/actbl3.h | 37 | ||||
| -rw-r--r-- | source/include/actypes.h | 26 | ||||
| -rw-r--r-- | source/include/acutils.h | 109 | ||||
| -rw-r--r-- | source/include/platform/acenv.h | 2 | ||||
| -rw-r--r-- | source/include/platform/acgcc.h | 2 | 
19 files changed, 425 insertions, 219 deletions
| diff --git a/source/include/acconfig.h b/source/include/acconfig.h index b414383b496b..429a2411be90 100644 --- a/source/include/acconfig.h +++ b/source/include/acconfig.h @@ -194,6 +194,7 @@  /* Maximum SpaceIds for Operation Regions */  #define ACPI_MAX_ADDRESS_SPACE          255 +#define ACPI_NUM_DEFAULT_SPACES         4  /* Array sizes. Used for range checking also */ diff --git a/source/include/acdebug.h b/source/include/acdebug.h index de915b44017a..836eb5b8ae2f 100644 --- a/source/include/acdebug.h +++ b/source/include/acdebug.h @@ -161,6 +161,34 @@ AcpiDbGenerateGpe (  /* + * dbconvert - miscellaneous conversion routines + */ +ACPI_STATUS +AcpiDbHexCharToValue ( +    int                     HexChar, +    UINT8                   *ReturnValue); + +ACPI_STATUS +AcpiDbConvertToPackage ( +    char                    *String, +    ACPI_OBJECT             *Object); + +ACPI_STATUS +AcpiDbConvertToObject ( +    ACPI_OBJECT_TYPE        Type, +    char                    *String, +    ACPI_OBJECT             *Object); + +UINT8 * +AcpiDbEncodePldBuffer ( +    ACPI_PLD_INFO           *PldInfo); + +void +AcpiDbDumpPldBuffer ( +    ACPI_OBJECT             *ObjDesc); + + +/*   * dbmethod - control method commands   */  void @@ -299,6 +327,11 @@ AcpiDbCreateExecutionThreads (      char                    *NumLoopsArg,      char                    *MethodNameArg); +void +AcpiDbDeleteObjects ( +    UINT32                  Count, +    ACPI_OBJECT             *Objects); +  #ifdef ACPI_DBG_TRACK_ALLOCATIONS  UINT32  AcpiDbGetCacheInfo ( diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h index 3c0b798af9a0..198189498b1f 100644 --- a/source/include/acdisasm.h +++ b/source/include/acdisasm.h @@ -237,6 +237,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoCpep[];  extern ACPI_DMTABLE_INFO        AcpiDmTableInfoCpep0[];  extern ACPI_DMTABLE_INFO        AcpiDmTableInfoCsrt0[];  extern ACPI_DMTABLE_INFO        AcpiDmTableInfoCsrt1[]; +extern ACPI_DMTABLE_INFO        AcpiDmTableInfoCsrt2[];  extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDbg2[];  extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDbg2Device[];  extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDbg2Addr[]; @@ -340,6 +341,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat0[];  extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat1[];  extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat2[];  extern ACPI_DMTABLE_INFO        AcpiDmTableInfoTcpa[]; +extern ACPI_DMTABLE_INFO        AcpiDmTableInfoTpm2[];  extern ACPI_DMTABLE_INFO        AcpiDmTableInfoUefi[];  extern ACPI_DMTABLE_INFO        AcpiDmTableInfoWaet[];  extern ACPI_DMTABLE_INFO        AcpiDmTableInfoWdat[]; diff --git a/source/include/acevents.h b/source/include/acevents.h index 3b874f10759e..3a1ad99a58d4 100644 --- a/source/include/acevents.h +++ b/source/include/acevents.h @@ -167,6 +167,7 @@ AcpiEvGpeDispatch (      ACPI_GPE_EVENT_INFO     *GpeEventInfo,      UINT32                  GpeNumber); +  /*   * evgpeinit - GPE initialization and update   */ @@ -186,6 +187,7 @@ AcpiEvMatchGpeMethod (      void                    *Context,      void                    **ReturnValue); +  /*   * evgpeutil - GPE utilities   */ @@ -220,13 +222,30 @@ AcpiEvDeleteGpeHandlers (  /* - * evregion - Address Space handling + * evhandler - Address space handling   */ +BOOLEAN +AcpiEvHasDefaultHandler ( +    ACPI_NAMESPACE_NODE     *Node, +    ACPI_ADR_SPACE_TYPE     SpaceId); +  ACPI_STATUS  AcpiEvInstallRegionHandlers (      void);  ACPI_STATUS +AcpiEvInstallSpaceHandler ( +    ACPI_NAMESPACE_NODE     *Node, +    ACPI_ADR_SPACE_TYPE     SpaceId, +    ACPI_ADR_SPACE_HANDLER  Handler, +    ACPI_ADR_SPACE_SETUP    Setup, +    void                    *Context); + + +/* + * evregion - Operation region support + */ +ACPI_STATUS  AcpiEvInitializeOpRegions (      void); @@ -251,14 +270,6 @@ AcpiEvDetachRegion (      BOOLEAN                 AcpiNsIsLocked);  ACPI_STATUS -AcpiEvInstallSpaceHandler ( -    ACPI_NAMESPACE_NODE     *Node, -    ACPI_ADR_SPACE_TYPE     SpaceId, -    ACPI_ADR_SPACE_HANDLER  Handler, -    ACPI_ADR_SPACE_SETUP    Setup, -    void                    *Context); - -ACPI_STATUS  AcpiEvExecuteRegMethods (      ACPI_NAMESPACE_NODE     *Node,      ACPI_ADR_SPACE_TYPE     SpaceId); diff --git a/source/include/acglobal.h b/source/include/acglobal.h index 42c623457dae..1139729010a0 100644 --- a/source/include/acglobal.h +++ b/source/include/acglobal.h @@ -349,7 +349,6 @@ ACPI_EXTERN UINT32                      AcpiGbl_DeepestNesting;   *   ****************************************************************************/ -  ACPI_EXTERN ACPI_THREAD_STATE          *AcpiGbl_CurrentWalkList;  /* Control method single step flag */ diff --git a/source/include/acinterp.h b/source/include/acinterp.h index 45e9814f7930..37e935deafa0 100644 --- a/source/include/acinterp.h +++ b/source/include/acinterp.h @@ -620,7 +620,7 @@ void  AcpiExRelinquishInterpreter (      void); -void +BOOLEAN  AcpiExTruncateFor32bitTable (      ACPI_OPERAND_OBJECT     *ObjDesc); diff --git a/source/include/acmacros.h b/source/include/acmacros.h index 9b446719dfa3..d1b04c26ff0e 100644 --- a/source/include/acmacros.h +++ b/source/include/acmacros.h @@ -314,6 +314,12 @@  #define ACPI_EXTRACT_3BIT_FLAG(Field, Position)     (ACPI_GET_3BIT_FLAG ((Field) >> Position))  #define ACPI_EXTRACT_4BIT_FLAG(Field, Position)     (ACPI_GET_4BIT_FLAG ((Field) >> Position)) +/* ACPI Pathname helpers */ + +#define ACPI_IS_ROOT_PREFIX(c)      ((c) == (UINT8) 0x5C) /* Backslash */ +#define ACPI_IS_PARENT_PREFIX(c)    ((c) == (UINT8) 0x5E) /* Carat */ +#define ACPI_IS_PATH_SEPARATOR(c)   ((c) == (UINT8) 0x2E) /* Period (dot) */ +  /*   * An object of type ACPI_NAMESPACE_NODE can appear in some contexts   * where a pointer to an object of type ACPI_OPERAND_OBJECT can also @@ -385,139 +391,6 @@  #endif /* ACPI_NO_ERROR_MESSAGES */ -/* - * Debug macros that are conditionally compiled - */ -#ifdef ACPI_DEBUG_OUTPUT -/* - * Function entry tracing - */ -#define ACPI_FUNCTION_TRACE(a)          ACPI_FUNCTION_NAME(a) \ -                                            AcpiUtTrace(ACPI_DEBUG_PARAMETERS) -#define ACPI_FUNCTION_TRACE_PTR(a, b)   ACPI_FUNCTION_NAME(a) \ -                                            AcpiUtTracePtr(ACPI_DEBUG_PARAMETERS, (void *)b) -#define ACPI_FUNCTION_TRACE_U32(a, b)   ACPI_FUNCTION_NAME(a) \ -                                            AcpiUtTraceU32(ACPI_DEBUG_PARAMETERS, (UINT32)b) -#define ACPI_FUNCTION_TRACE_STR(a, b)   ACPI_FUNCTION_NAME(a) \ -                                            AcpiUtTraceStr(ACPI_DEBUG_PARAMETERS, (char *)b) - -#define ACPI_FUNCTION_ENTRY()           AcpiUtTrackStackPtr() - -/* - * Function exit tracing. - * WARNING: These macros include a return statement. This is usually considered - * bad form, but having a separate exit macro is very ugly and difficult to maintain. - * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros - * so that "_AcpiFunctionName" is defined. - * - * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining - * about these constructs. - */ -#ifdef ACPI_USE_DO_WHILE_0 -#define ACPI_DO_WHILE0(a)               do a while(0) -#else -#define ACPI_DO_WHILE0(a)               a -#endif - -#define return_VOID                     ACPI_DO_WHILE0 ({ \ -                                            AcpiUtExit (ACPI_DEBUG_PARAMETERS); \ -                                            return;}) -/* - * There are two versions of most of the return macros. The default version is - * safer, since it avoids side-effects by guaranteeing that the argument will - * not be evaluated twice. - * - * A less-safe version of the macros is provided for optional use if the - * compiler uses excessive CPU stack (for example, this may happen in the - * debug case if code optimzation is disabled.) - */ -#ifndef ACPI_SIMPLE_RETURN_MACROS - -#define return_ACPI_STATUS(s)           ACPI_DO_WHILE0 ({ \ -                                            register ACPI_STATUS _s = (s); \ -                                            AcpiUtStatusExit (ACPI_DEBUG_PARAMETERS, _s); \ -                                            return (_s); }) -#define return_PTR(s)                   ACPI_DO_WHILE0 ({ \ -                                            register void *_s = (void *) (s); \ -                                            AcpiUtPtrExit (ACPI_DEBUG_PARAMETERS, (UINT8 *) _s); \ -                                            return (_s); }) -#define return_VALUE(s)                 ACPI_DO_WHILE0 ({ \ -                                            register UINT64 _s = (s); \ -                                            AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, _s); \ -                                            return (_s); }) -#define return_UINT8(s)                 ACPI_DO_WHILE0 ({ \ -                                            register UINT8 _s = (UINT8) (s); \ -                                            AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) _s); \ -                                            return (_s); }) -#define return_UINT32(s)                ACPI_DO_WHILE0 ({ \ -                                            register UINT32 _s = (UINT32) (s); \ -                                            AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) _s); \ -                                            return (_s); }) -#else /* Use original less-safe macros */ - -#define return_ACPI_STATUS(s)           ACPI_DO_WHILE0 ({ \ -                                            AcpiUtStatusExit (ACPI_DEBUG_PARAMETERS, (s)); \ -                                            return((s)); }) -#define return_PTR(s)                   ACPI_DO_WHILE0 ({ \ -                                            AcpiUtPtrExit (ACPI_DEBUG_PARAMETERS, (UINT8 *) (s)); \ -                                            return((s)); }) -#define return_VALUE(s)                 ACPI_DO_WHILE0 ({ \ -                                            AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) (s)); \ -                                            return((s)); }) -#define return_UINT8(s)                 return_VALUE(s) -#define return_UINT32(s)                return_VALUE(s) - -#endif /* ACPI_SIMPLE_RETURN_MACROS */ - -/* Conditional execution */ - -#define ACPI_DEBUG_EXEC(a)              a -#define ACPI_DEBUG_ONLY_MEMBERS(a)      a; -#define _VERBOSE_STRUCTURES - - -/* Various object display routines for debug */ - -#define ACPI_DUMP_STACK_ENTRY(a)        AcpiExDumpOperand((a), 0) -#define ACPI_DUMP_OPERANDS(a, b ,c)     AcpiExDumpOperands(a, b, c) -#define ACPI_DUMP_ENTRY(a, b)           AcpiNsDumpEntry (a, b) -#define ACPI_DUMP_PATHNAME(a, b, c, d)  AcpiNsDumpPathname(a, b, c, d) -#define ACPI_DUMP_BUFFER(a, b)          AcpiUtDebugDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) - -#else -/* - * This is the non-debug case -- make everything go away, - * leaving no executable debug code! - */ -#define ACPI_DEBUG_EXEC(a) -#define ACPI_DEBUG_ONLY_MEMBERS(a) -#define ACPI_FUNCTION_TRACE(a) -#define ACPI_FUNCTION_TRACE_PTR(a, b) -#define ACPI_FUNCTION_TRACE_U32(a, b) -#define ACPI_FUNCTION_TRACE_STR(a, b) -#define ACPI_FUNCTION_EXIT -#define ACPI_FUNCTION_STATUS_EXIT(s) -#define ACPI_FUNCTION_VALUE_EXIT(s) -#define ACPI_FUNCTION_ENTRY() -#define ACPI_DUMP_STACK_ENTRY(a) -#define ACPI_DUMP_OPERANDS(a, b, c) -#define ACPI_DUMP_ENTRY(a, b) -#define ACPI_DUMP_TABLES(a, b) -#define ACPI_DUMP_PATHNAME(a, b, c, d) -#define ACPI_DUMP_BUFFER(a, b) -#define ACPI_DEBUG_PRINT(pl) -#define ACPI_DEBUG_PRINT_RAW(pl) - -#define return_VOID                     return -#define return_ACPI_STATUS(s)           return(s) -#define return_VALUE(s)                 return(s) -#define return_UINT8(s)                 return(s) -#define return_UINT32(s)                return(s) -#define return_PTR(s)                   return(s) - -#endif /* ACPI_DEBUG_OUTPUT */ - -  #if (!ACPI_REDUCED_HARDWARE)  #define ACPI_HW_OPTIONAL_FUNCTION(addr)     addr  #else diff --git a/source/include/acnamesp.h b/source/include/acnamesp.h index 4a91108eae42..b64b4b11a538 100644 --- a/source/include/acnamesp.h +++ b/source/include/acnamesp.h @@ -277,6 +277,22 @@ AcpiNsCheckParameterCount (      UINT32                      UserParamCount,      const ACPI_PREDEFINED_INFO  *Info); +ACPI_STATUS +AcpiNsCheckObjectType ( +    ACPI_PREDEFINED_DATA        *Data, +    ACPI_OPERAND_OBJECT         **ReturnObjectPtr, +    UINT32                      ExpectedBtypes, +    UINT32                      PackageIndex); + + +/* + * nsprepkg - Validation of predefined name packages + */ +ACPI_STATUS +AcpiNsCheckPackage ( +    ACPI_PREDEFINED_DATA        *Data, +    ACPI_OPERAND_OBJECT         **ReturnObjectPtr); +  /*   * nsnames - Name and Scope manipulation @@ -430,10 +446,6 @@ AcpiNsInstallNode (  /*   * nsutils - Utility functions   */ -BOOLEAN -AcpiNsValidRootPrefix ( -    char                    Prefix); -  ACPI_OBJECT_TYPE  AcpiNsGetType (      ACPI_NAMESPACE_NODE     *Node); diff --git a/source/include/acoutput.h b/source/include/acoutput.h index 193d0acc4c81..236124dda278 100644 --- a/source/include/acoutput.h +++ b/source/include/acoutput.h @@ -267,18 +267,140 @@   * Common parameters used for debug output functions:   * line number, function name, module(file) name, component ID   */ -#define ACPI_DEBUG_PARAMETERS           __LINE__, ACPI_GET_FUNCTION_NAME, _AcpiModuleName, _COMPONENT +#define ACPI_DEBUG_PARAMETERS \ +    __LINE__, ACPI_GET_FUNCTION_NAME, _AcpiModuleName, _COMPONENT + +/* Check if debug output is currently dynamically enabled */ + +#define ACPI_IS_DEBUG_ENABLED(Level, Component) \ +    ((Level & AcpiDbgLevel) && (Component & AcpiDbgLayer))  /*   * Master debug print macros   * Print message if and only if:   *    1) Debug print for the current component is enabled   *    2) Debug error level or trace level for the print statement is enabled + * + * November 2012: Moved the runtime check for whether to actually emit the + * debug message outside of the print function itself. This improves overall + * performance at a relatively small code cost. Implementation involves the + * use of variadic macros supported by C99. + */ + +/* DEBUG_PRINT functions */ + +#define ACPI_DEBUG_PRINT(plist)         ACPI_ACTUAL_DEBUG plist +#define ACPI_DEBUG_PRINT_RAW(plist)     ACPI_ACTUAL_DEBUG_RAW plist + +/* Helper macros for DEBUG_PRINT */ + +#define ACPI_DEBUG(Function, Level, Line, Filename, Modulename, Component, ...) \ +    if (ACPI_IS_DEBUG_ENABLED (Level, Component)) \ +    { \ +        Function (Level, Line, Filename, Modulename, Component, __VA_ARGS__); \ +    } + +#define ACPI_ACTUAL_DEBUG(Level, Line, Filename, Modulename, Component, ...) \ +    ACPI_DEBUG (AcpiDebugPrint, Level, Line, Filename, Modulename, Component, __VA_ARGS__) + +#define ACPI_ACTUAL_DEBUG_RAW(Level, Line, Filename, Modulename, Component, ...) \ +    ACPI_DEBUG (AcpiDebugPrintRaw, Level, Line, Filename, Modulename, Component, __VA_ARGS__) + + +/* + * Function entry tracing + * + * The name of the function is emitted as a local variable that is + * intended to be used by both the entry trace and the exit trace.   */ -#define ACPI_DEBUG_PRINT(plist)         AcpiDebugPrint plist -#define ACPI_DEBUG_PRINT_RAW(plist)     AcpiDebugPrintRaw plist +/* Helper macro */ + +#define ACPI_TRACE_ENTRY(Name, Function, Cast, Param) \ +    ACPI_FUNCTION_NAME (Name) \ +    Function (ACPI_DEBUG_PARAMETERS, Cast (Param)) + +/* The actual entry trace macros */ + +#define ACPI_FUNCTION_TRACE(Name) \ +    ACPI_FUNCTION_NAME(Name) \ +    AcpiUtTrace (ACPI_DEBUG_PARAMETERS) + +#define ACPI_FUNCTION_TRACE_PTR(Name, Pointer) \ +    ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, (void *), Pointer) + +#define ACPI_FUNCTION_TRACE_U32(Name, Value) \ +    ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, (UINT32), Value) + +#define ACPI_FUNCTION_TRACE_STR(Name, String) \ +    ACPI_TRACE_ENTRY (Name, AcpiUtTraceStr, (char *), String) + +#define ACPI_FUNCTION_ENTRY() \ +    AcpiUtTrackStackPtr() + + +/* + * Function exit tracing + * + * These macros include a return statement. This is usually considered + * bad form, but having a separate exit macro before the actual return + * is very ugly and difficult to maintain. + * + * One of the FUNCTION_TRACE macros above must be used in conjunction + * with these macros so that "_AcpiFunctionName" is defined. + * + * Note: the DO_WHILE0 macro is used to prevent some compilers from + * complaining about these constructs. On other compilers the do...while + * adds some extra code, so this feature is optional. + */ +#ifdef ACPI_USE_DO_WHILE_0 +#define ACPI_DO_WHILE0(a)               do a while(0)  #else +#define ACPI_DO_WHILE0(a)               a +#endif + +/* Exit trace helper macro */ + +#define ACPI_TRACE_EXIT(Function, Cast, Param) \ +    ACPI_DO_WHILE0 ({ \ +        Function (ACPI_DEBUG_PARAMETERS, Cast (Param)); \ +        return ((Param)); \ +    }) + +/* The actual exit macros */ + +#define return_VOID \ +    ACPI_DO_WHILE0 ({ \ +        AcpiUtExit (ACPI_DEBUG_PARAMETERS); \ +        return; \ +    }) + +#define return_ACPI_STATUS(Status) \ +    ACPI_TRACE_EXIT (AcpiUtStatusExit, (ACPI_STATUS), Status) + +#define return_PTR(Pointer) \ +    ACPI_TRACE_EXIT (AcpiUtPtrExit, (UINT8 *), Pointer) + +#define return_VALUE(Value) \ +    ACPI_TRACE_EXIT (AcpiUtValueExit, (UINT64), Value) + + +/* Conditional execution */ + +#define ACPI_DEBUG_EXEC(a)              a +#define ACPI_DEBUG_ONLY_MEMBERS(a)      a; +#define _VERBOSE_STRUCTURES + + +/* Various object display routines for debug */ + +#define ACPI_DUMP_STACK_ENTRY(a)        AcpiExDumpOperand((a), 0) +#define ACPI_DUMP_OPERANDS(a, b ,c)     AcpiExDumpOperands(a, b, c) +#define ACPI_DUMP_ENTRY(a, b)           AcpiNsDumpEntry (a, b) +#define ACPI_DUMP_PATHNAME(a, b, c, d)  AcpiNsDumpPathname(a, b, c, d) +#define ACPI_DUMP_BUFFER(a, b)          AcpiUtDebugDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) + +#else /* ACPI_DEBUG_OUTPUT */  /*   * This is the non-debug case -- make everything go away,   * leaving no executable debug code! @@ -286,6 +408,32 @@  #define ACPI_FUNCTION_NAME(a)  #define ACPI_DEBUG_PRINT(pl)  #define ACPI_DEBUG_PRINT_RAW(pl) +#define ACPI_DEBUG_EXEC(a) +#define ACPI_DEBUG_ONLY_MEMBERS(a) +#define ACPI_FUNCTION_TRACE(a) +#define ACPI_FUNCTION_TRACE_PTR(a, b) +#define ACPI_FUNCTION_TRACE_U32(a, b) +#define ACPI_FUNCTION_TRACE_STR(a, b) +#define ACPI_FUNCTION_EXIT +#define ACPI_FUNCTION_STATUS_EXIT(s) +#define ACPI_FUNCTION_VALUE_EXIT(s) +#define ACPI_FUNCTION_ENTRY() +#define ACPI_DUMP_STACK_ENTRY(a) +#define ACPI_DUMP_OPERANDS(a, b, c) +#define ACPI_DUMP_ENTRY(a, b) +#define ACPI_DUMP_TABLES(a, b) +#define ACPI_DUMP_PATHNAME(a, b, c, d) +#define ACPI_DUMP_BUFFER(a, b) +#define ACPI_DEBUG_PRINT(pl) +#define ACPI_DEBUG_PRINT_RAW(pl) +#define ACPI_IS_DEBUG_ENABLED(Level, Component) 0 + +/* Return macros must have a return statement at the minimum */ + +#define return_VOID                     return +#define return_ACPI_STATUS(s)           return(s) +#define return_VALUE(s)                 return(s) +#define return_PTR(s)                   return(s)  #endif /* ACPI_DEBUG_OUTPUT */ diff --git a/source/include/acparser.h b/source/include/acparser.h index f46d3cbc2ca9..a577156a53c8 100644 --- a/source/include/acparser.h +++ b/source/include/acparser.h @@ -129,7 +129,36 @@ AcpiPsGetParent (  /* - * psopcode - AML Opcode information + * psobject - support for parse object processing + */ +ACPI_STATUS +AcpiPsBuildNamedOp ( +    ACPI_WALK_STATE         *WalkState, +    UINT8                   *AmlOpStart, +    ACPI_PARSE_OBJECT       *UnnamedOp, +    ACPI_PARSE_OBJECT       **Op); + +ACPI_STATUS +AcpiPsCreateOp ( +    ACPI_WALK_STATE         *WalkState, +    UINT8                   *AmlOpStart, +    ACPI_PARSE_OBJECT       **NewOp); + +ACPI_STATUS +AcpiPsCompleteOp ( +    ACPI_WALK_STATE         *WalkState, +    ACPI_PARSE_OBJECT       **Op, +    ACPI_STATUS             Status); + +ACPI_STATUS +AcpiPsCompleteFinalOp ( +    ACPI_WALK_STATE         *WalkState, +    ACPI_PARSE_OBJECT       *Op, +    ACPI_STATUS             Status); + + +/* + * psopinfo - AML Opcode information   */  const ACPI_OPCODE_INFO *  AcpiPsGetOpcodeInfo ( @@ -294,10 +323,6 @@ BOOLEAN  AcpiPsIsLeadingChar (      UINT32                  c); -BOOLEAN -AcpiPsIsPrefixChar ( -    UINT32                  c); -  UINT32  AcpiPsGetName(      ACPI_PARSE_OBJECT       *op); diff --git a/source/include/acpixf.h b/source/include/acpixf.h index fde6744142e0..68c38c1b4d24 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -47,7 +47,7 @@  /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION                 0x20121114 +#define ACPI_CA_VERSION                 0x20121220  #include "acconfig.h"  #include "actypes.h" @@ -618,6 +618,12 @@ AcpiGetEventResources (      ACPI_BUFFER             *RetBuffer);  ACPI_STATUS +AcpiWalkResourceBuffer ( +    ACPI_BUFFER                 *Buffer, +    ACPI_WALK_RESOURCE_CALLBACK UserFunction, +    void                        *Context); + +ACPI_STATUS  AcpiWalkResources (      ACPI_HANDLE                 Device,      char                        *Name, diff --git a/source/include/acresrc.h b/source/include/acresrc.h index c879fdc4a3f1..c4bf777f501e 100644 --- a/source/include/acresrc.h +++ b/source/include/acresrc.h @@ -265,7 +265,7 @@ AcpiRsConvertAmlToResources (      UINT32                  Length,      UINT32                  Offset,      UINT8                   ResourceIndex, -    void                    *Context); +    void                    **Context);  ACPI_STATUS  AcpiRsConvertResourcesToAml ( @@ -405,18 +405,21 @@ extern ACPI_RSDUMP_INFO         *AcpiGbl_DumpResourceDispatch[];  extern ACPI_RSDUMP_INFO         *AcpiGbl_DumpSerialBusDispatch[];  /* - * rsdump + * rsdumpinfo   */  extern ACPI_RSDUMP_INFO         AcpiRsDumpIrq[]; +extern ACPI_RSDUMP_INFO         AcpiRsDumpPrt[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpDma[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpStartDpf[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpEndDpf[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpIo[]; +extern ACPI_RSDUMP_INFO         AcpiRsDumpIoFlags[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpFixedIo[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpVendor[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpEndTag[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpMemory24[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpMemory32[]; +extern ACPI_RSDUMP_INFO         AcpiRsDumpMemoryFlags[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpFixedMemory32[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpAddress16[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpAddress32[]; @@ -430,6 +433,7 @@ extern ACPI_RSDUMP_INFO         AcpiRsDumpCommonSerialBus[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpI2cSerialBus[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpSpiSerialBus[];  extern ACPI_RSDUMP_INFO         AcpiRsDumpUartSerialBus[]; +extern ACPI_RSDUMP_INFO         AcpiRsDumpGeneralFlags[];  #endif  #endif  /* __ACRESRC_H__ */ diff --git a/source/include/acrestyp.h b/source/include/acrestyp.h index 07a6076dcf26..6be537f33f49 100644 --- a/source/include/acrestyp.h +++ b/source/include/acrestyp.h @@ -103,8 +103,11 @@ typedef UINT32                          ACPI_RSDESC_SIZE;  /* Max Resource Descr  #define ACPI_EXCLUSIVE                  (UINT8) 0x00  #define ACPI_SHARED                     (UINT8) 0x01 -#define ACPI_EXCLUSIVE_AND_WAKE         (UINT8) 0x02 -#define ACPI_SHARED_AND_WAKE            (UINT8) 0x03 + +/* Wake */ + +#define ACPI_NOT_WAKE_CAPABLE           (UINT8) 0x00 +#define ACPI_WAKE_CAPABLE               (UINT8) 0x01  /*   * DMA Attributes @@ -177,6 +180,7 @@ typedef struct acpi_resource_irq      UINT8                           Triggering;      UINT8                           Polarity;      UINT8                           Sharable; +    UINT8                           WakeCapable;      UINT8                           InterruptCount;      UINT8                           Interrupts[1]; @@ -402,6 +406,7 @@ typedef struct acpi_resource_extended_irq      UINT8                           Triggering;      UINT8                           Polarity;      UINT8                           Sharable; +    UINT8                           WakeCapable;      UINT8                           InterruptCount;      ACPI_RESOURCE_SOURCE            ResourceSource;      UINT32                          Interrupts[1]; @@ -425,6 +430,7 @@ typedef struct acpi_resource_gpio      UINT8                           ProducerConsumer;   /* For values, see Producer/Consumer above */      UINT8                           PinConfig;      UINT8                           Sharable;           /* For values, see Interrupt Attributes above */ +    UINT8                           WakeCapable;        /* For values, see Interrupt Attributes above */      UINT8                           IoRestriction;      UINT8                           Triggering;         /* For values, see Interrupt Attributes above */      UINT8                           Polarity;           /* For values, see Interrupt Attributes above */ diff --git a/source/include/actbl2.h b/source/include/actbl2.h index 2d2d5caceab8..8c82200ba02e 100644 --- a/source/include/actbl2.h +++ b/source/include/actbl2.h @@ -285,6 +285,7 @@ typedef struct acpi_table_csrt  } ACPI_TABLE_CSRT; +  /* Resource Group subtable */  typedef struct acpi_csrt_group @@ -296,12 +297,33 @@ typedef struct acpi_csrt_group      UINT16                  SubdeviceId;      UINT16                  Revision;      UINT16                  Reserved; -    UINT32                  InfoLength; +    UINT32                  SharedInfoLength; -    /* Shared data (length = InfoLength) immediately follows */ +    /* Shared data immediately follows (Length = SharedInfoLength) */  } ACPI_CSRT_GROUP; +/* Shared Info subtable */ + +typedef struct acpi_csrt_shared_info +{ +    UINT16                  MajorVersion; +    UINT16                  MinorVersion; +    UINT32                  MmioBaseLow; +    UINT32                  MmioBaseHigh; +    UINT32                  GsiInterrupt; +    UINT8                   InterruptPolarity; +    UINT8                   InterruptMode; +    UINT8                   NumChannels; +    UINT8                   DmaAddressWidth; +    UINT16                  BaseRequestLine; +    UINT16                  NumHandshakeSignals; +    UINT32                  MaxBlockSize; + +    /* Resource descriptors immediately follow (Length = Group Length - SharedInfoLength) */ + +} ACPI_CSRT_SHARED_INFO; +  /* Resource Descriptor subtable */  typedef struct acpi_csrt_descriptor diff --git a/source/include/actbl3.h b/source/include/actbl3.h index 874e348e9ea1..645c9acc2e29 100644 --- a/source/include/actbl3.h +++ b/source/include/actbl3.h @@ -70,13 +70,13 @@  #define ACPI_SIG_PCCT           "PCCT"      /* Platform Communications Channel Table */  #define ACPI_SIG_PMTT           "PMTT"      /* Platform Memory Topology Table */  #define ACPI_SIG_RASF           "RASF"      /* RAS Feature table */ +#define ACPI_SIG_TPM2           "TPM2"      /* Trusted Platform Module 2.0 H/W interface table */  #define ACPI_SIG_S3PT           "S3PT"      /* S3 Performance (sub)Table */  #define ACPI_SIG_PCCS           "PCC"       /* PCC Shared Memory Region */  /* Reserved table signatures */ -#define ACPI_SIG_CSRT           "CSRT"      /* Core System Resources Table */  #define ACPI_SIG_MATR           "MATR"      /* Memory Address Translation Table */  #define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */  #define ACPI_SIG_WPBT           "WPBT"      /* Windows Platform Binary Table */ @@ -648,6 +648,41 @@ enum AcpiRasfStatus  #define ACPI_RASF_STATUS                (0x1F<<3) +/******************************************************************************* + * + * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table + *        Version 3 + * + * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011 + * + ******************************************************************************/ + +typedef struct acpi_table_tpm2 +{ +    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */ +    UINT32                  Flags; +    UINT64                  ControlAddress; +    UINT32                  StartMethod; + +} ACPI_TABLE_TPM2; + +/* Control area structure (not part of table, pointed to by ControlAddress) */ + +typedef struct acpi_tpm2_control +{ +    UINT32                  Reserved; +    UINT32                  Error; +    UINT32                  Cancel; +    UINT32                  Start; +    UINT64                  InterruptControl; +    UINT32                  CommandSize; +    UINT64                  CommandAddress; +    UINT32                  ResponseSize; +    UINT64                  ResponseAddress; + +} ACPI_TPM2_CONTROL; + +  /* Reset to default packing */  #pragma pack() diff --git a/source/include/actypes.h b/source/include/actypes.h index 611c41836af4..f28a7a4d3eb7 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -295,7 +295,7 @@ typedef UINT32                          ACPI_PHYSICAL_ADDRESS;  /*   * Some compilers complain about unused variables. Sometimes we don't want to   * use all the variables (for example, _AcpiModuleName). This allows us - * to to tell the compiler in a per-variable manner that a variable + * to tell the compiler in a per-variable manner that a variable   * is unused   */  #ifndef ACPI_UNUSED_VAR @@ -346,7 +346,7 @@ typedef UINT32                          ACPI_PHYSICAL_ADDRESS;  /* PM Timer ticks per second (HZ) */ -#define PM_TIMER_FREQUENCY              3579545 +#define ACPI_PM_TIMER_FREQUENCY         3579545  /******************************************************************************* @@ -381,6 +381,22 @@ typedef char *                          ACPI_STRING;    /* Null terminated ASCII  typedef void *                          ACPI_HANDLE;    /* Actually a ptr to a NS Node */ +/* Time constants for timer calculations */ + +#define ACPI_MSEC_PER_SEC               1000L + +#define ACPI_USEC_PER_MSEC              1000L +#define ACPI_USEC_PER_SEC               1000000L + +#define ACPI_100NSEC_PER_USEC           10L +#define ACPI_100NSEC_PER_MSEC           10000L +#define ACPI_100NSEC_PER_SEC            10000000L + +#define ACPI_NSEC_PER_USEC              1000L +#define ACPI_NSEC_PER_MSEC              1000000L +#define ACPI_NSEC_PER_SEC               1000000000L + +  /* Owner IDs are used to track namespace nodes for selective deletion */  typedef UINT8                           ACPI_OWNER_ID; @@ -596,7 +612,7 @@ typedef UINT32                          ACPI_OBJECT_TYPE;  /*   * These are special object types that never appear in - * a Namespace node, only in an ACPI_OPERAND_OBJECT + * a Namespace node, only in an object of ACPI_OPERAND_OBJECT   */  #define ACPI_TYPE_LOCAL_EXTRA           0x1C  #define ACPI_TYPE_LOCAL_DATA            0x1D @@ -904,6 +920,10 @@ typedef struct acpi_buffer  } ACPI_BUFFER; +/* Free a buffer created in an ACPI_BUFFER via ACPI_ALLOCATE_LOCAL_BUFFER */ + +#define ACPI_FREE_BUFFER(b)         ACPI_FREE(b.Pointer) +  /*   * NameType for AcpiGetName diff --git a/source/include/acutils.h b/source/include/acutils.h index f663a1ecc12e..84e40b260d12 100644 --- a/source/include/acutils.h +++ b/source/include/acutils.h @@ -101,7 +101,7 @@ ACPI_STATUS (*ACPI_WALK_AML_CALLBACK) (      UINT32                  Length,      UINT32                  Offset,      UINT8                   ResourceIndex, -    void                    *Context); +    void                    **Context);  typedef  ACPI_STATUS (*ACPI_PKG_CALLBACK) ( @@ -709,10 +709,6 @@ AcpiUtShortDivide (  /*   * utmisc   */ -void -UtConvertBackslashes ( -    char                    *Pathname); -  const char *  AcpiUtValidateException (      ACPI_STATUS             Status); @@ -726,56 +722,12 @@ AcpiUtIsAmlTable (      ACPI_TABLE_HEADER       *Table);  ACPI_STATUS -AcpiUtAllocateOwnerId ( -    ACPI_OWNER_ID           *OwnerId); - -void -AcpiUtReleaseOwnerId ( -    ACPI_OWNER_ID           *OwnerId); - -ACPI_STATUS  AcpiUtWalkPackageTree (      ACPI_OPERAND_OBJECT     *SourceObject,      void                    *TargetObject,      ACPI_PKG_CALLBACK       WalkCallback,      void                    *Context); -void -AcpiUtStrupr ( -    char                    *SrcString); - -void -AcpiUtStrlwr ( -    char                    *SrcString); - -int -AcpiUtStricmp ( -    char                    *String1, -    char                    *String2); - -void -AcpiUtPrintString ( -    char                    *String, -    UINT8                   MaxLength); - -BOOLEAN -AcpiUtValidAcpiName ( -    UINT32                  Name); - -void -AcpiUtRepairName ( -    char                    *Name); - -BOOLEAN -AcpiUtValidAcpiChar ( -    char                    Character, -    UINT32                  Position); - -ACPI_STATUS -AcpiUtStrtoul64 ( -    char                    *String, -    UINT32                  Base, -    UINT64                  *RetInteger);  /* Values for Base above (16=Hex, 10=Decimal) */ @@ -799,6 +751,18 @@ AcpiUtDisplayInitPathname (  /* + * utownerid - Support for Table/Method Owner IDs + */ +ACPI_STATUS +AcpiUtAllocateOwnerId ( +    ACPI_OWNER_ID           *OwnerId); + +void +AcpiUtReleaseOwnerId ( +    ACPI_OWNER_ID           *OwnerId); + + +/*   * utresrc   */  ACPI_STATUS @@ -807,7 +771,7 @@ AcpiUtWalkAmlResources (      UINT8                   *Aml,      ACPI_SIZE               AmlLength,      ACPI_WALK_AML_CALLBACK  UserFunction, -    void                    *Context); +    void                    **Context);  ACPI_STATUS  AcpiUtValidateResource ( @@ -838,6 +802,51 @@ AcpiUtGetResourceEndTag (  /* + * utstring - String and character utilities + */ +void +AcpiUtStrupr ( +    char                    *SrcString); + +void +AcpiUtStrlwr ( +    char                    *SrcString); + +int +AcpiUtStricmp ( +    char                    *String1, +    char                    *String2); + +ACPI_STATUS +AcpiUtStrtoul64 ( +    char                    *String, +    UINT32                  Base, +    UINT64                  *RetInteger); + +void +AcpiUtPrintString ( +    char                    *String, +    UINT8                   MaxLength); + +void +UtConvertBackslashes ( +    char                    *Pathname); + +BOOLEAN +AcpiUtValidAcpiName ( +    UINT32                  Name); + +BOOLEAN +AcpiUtValidAcpiChar ( +    char                    Character, +    UINT32                  Position); + +void +AcpiUtRepairName ( +    char                    *Name); + + +/*   * utmutex - mutex support   */  ACPI_STATUS diff --git a/source/include/platform/acenv.h b/source/include/platform/acenv.h index dc18e8651f8c..2dff1ed8b9be 100644 --- a/source/include/platform/acenv.h +++ b/source/include/platform/acenv.h @@ -300,7 +300,7 @@   */  #ifdef ACPI_USE_SYSTEM_CLIBRARY -/* Use the standard C library headers. We want to keep these to a minimum */ +/* Use the standard C library headers. We want to keep these to a minimum. */  #ifdef ACPI_USE_STANDARD_HEADERS diff --git a/source/include/platform/acgcc.h b/source/include/platform/acgcc.h index d2eafff39584..c10a190e9e90 100644 --- a/source/include/platform/acgcc.h +++ b/source/include/platform/acgcc.h @@ -59,7 +59,7 @@  /*   * Some compilers complain about unused variables. Sometimes we don't want to   * use all the variables (for example, _AcpiModuleName). This allows us - * to to tell the compiler warning in a per-variable manner that a variable + * to tell the compiler warning in a per-variable manner that a variable   * is unused.   */  #define ACPI_UNUSED_VAR __attribute__ ((unused)) | 
