acutils.h revision 199767f8919635c4928607450d9e0abb932109ce
/******************************************************************************
*
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef _ACUTILS_H
#define _ACUTILS_H
extern const UINT8 AcpiGbl_ResourceAmlSizes[];
extern const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[];
/* Strings used by the disassembler and debugger resource dump routines */
extern const char *AcpiGbl_BmDecode[];
extern const char *AcpiGbl_ConfigDecode[];
extern const char *AcpiGbl_ConsumeDecode[];
extern const char *AcpiGbl_DecDecode[];
extern const char *AcpiGbl_HeDecode[];
extern const char *AcpiGbl_IoDecode[];
extern const char *AcpiGbl_LlDecode[];
extern const char *AcpiGbl_MaxDecode[];
extern const char *AcpiGbl_MemDecode[];
extern const char *AcpiGbl_MinDecode[];
extern const char *AcpiGbl_MtpDecode[];
extern const char *AcpiGbl_RngDecode[];
extern const char *AcpiGbl_RwDecode[];
extern const char *AcpiGbl_ShrDecode[];
extern const char *AcpiGbl_SizDecode[];
extern const char *AcpiGbl_TrsDecode[];
extern const char *AcpiGbl_TtpDecode[];
extern const char *AcpiGbl_TypDecode[];
extern const char *AcpiGbl_PpcDecode[];
extern const char *AcpiGbl_IorDecode[];
extern const char *AcpiGbl_DtsDecode[];
extern const char *AcpiGbl_CtDecode[];
extern const char *AcpiGbl_SbtDecode[];
extern const char *AcpiGbl_AmDecode[];
extern const char *AcpiGbl_SmDecode[];
extern const char *AcpiGbl_WmDecode[];
extern const char *AcpiGbl_CphDecode[];
extern const char *AcpiGbl_CpoDecode[];
extern const char *AcpiGbl_DpDecode[];
extern const char *AcpiGbl_EdDecode[];
extern const char *AcpiGbl_BpbDecode[];
extern const char *AcpiGbl_SbDecode[];
extern const char *AcpiGbl_FcDecode[];
extern const char *AcpiGbl_PtDecode[];
#endif
/*
* For the iASL compiler case, the output is redirected to stderr so that
* any of the various ACPI errors and warnings do not appear in the output
* files, for either the compiler or disassembler portions of the tool.
*/
#ifdef ACPI_ASL_COMPILER
#include <stdio.h>
#define ACPI_MSG_REDIRECT_BEGIN \
#define ACPI_MSG_REDIRECT_END \
#else
/*
* non-iASL case - no redirection, nothing to do
*/
#define ACPI_MSG_REDIRECT_BEGIN
#define ACPI_MSG_REDIRECT_END
#endif
/*
* Common error message prefixes
*/
#define ACPI_MSG_ERROR "ACPI Error: "
#define ACPI_MSG_EXCEPTION "ACPI Exception: "
#define ACPI_MSG_WARNING "ACPI Warning: "
#define ACPI_MSG_INFO "ACPI: "
#define ACPI_MSG_BIOS_ERROR "ACPI BIOS Error (bug): "
#define ACPI_MSG_BIOS_WARNING "ACPI BIOS Warning (bug): "
/*
* Common message suffix
*/
#define ACPI_MSG_SUFFIX \
/* Types for Resource descriptor entries */
#define ACPI_INVALID_RESOURCE 0
#define ACPI_FIXED_LENGTH 1
#define ACPI_VARIABLE_LENGTH 2
#define ACPI_SMALL_VARIABLE_LENGTH 3
typedef
void **Context);
typedef
void *Context);
typedef struct acpi_pkg_info
{
/* Object reference counts */
#define REF_INCREMENT (UINT16) 0
/* AcpiUtDumpBuffer */
#define DB_BYTE_DISPLAY 1
#define DB_WORD_DISPLAY 2
#define DB_DWORD_DISPLAY 4
#define DB_QWORD_DISPLAY 8
/*
* utnonansi - Non-ANSI C library functions
*/
void
char *SrcString);
void
char *SrcString);
int
char *String1,
char *String2);
char *String,
UINT64 *RetInteger);
/*
* utglobal - Global data structures and procedures
*/
void);
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
char *
const char *
#endif
char *
char *
void *Object);
char *
void *Object);
const char *
char *
char *
char *
char
int HexChar);
/*
* utinit - miscellaneous initialization and shutdown
*/
void);
void
void);
/*
* utcopy - Object construction and conversion interfaces
*/
/*
* utcreate - Object creation
*/
/*
* utdebug - Debug interfaces
*/
void
void);
void
void);
void
const char *FunctionName,
const char *ModuleName,
void
const char *FunctionName,
const char *ModuleName,
void *Pointer);
void
const char *FunctionName,
const char *ModuleName,
void
const char *FunctionName,
const char *ModuleName,
char *String);
void
const char *FunctionName,
const char *ModuleName,
void
const char *FunctionName,
const char *ModuleName,
void
const char *FunctionName,
const char *ModuleName,
void
const char *FunctionName,
const char *ModuleName,
void
void
#ifdef ACPI_APPLICATION
void
#endif
void
char *ModuleName,
void
char *ModuleName,
void
char *ModuleName,
/*
* utdelete - Object deletion and reference counts
*/
void
void
void
void
void
/*
* uteval - object evaluation
*/
char *Path,
char *ObjectName,
const char **MethodNames,
/*
* utfileio - file operations
*/
#ifdef ACPI_APPLICATION
char *Filename,
#endif
/*
* utids - device ID support
*/
/*
*/
ACPI_RW_LOCK *Lock);
void
ACPI_RW_LOCK *Lock);
ACPI_RW_LOCK *Lock);
ACPI_RW_LOCK *Lock);
ACPI_RW_LOCK *Lock);
void
ACPI_RW_LOCK *Lock);
/*
*/
const char *ModuleName,
void *
const char *ModuleName,
#define AcpiUtCreateInternalObject(t) AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t)
#define AcpiUtAllocateObjectDesc() AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT)
void
void *Object);
/*
* utosi - Support for the _OSI predefined control method
*/
void);
void);
/*
* utpredef - support for predefined names
*/
const ACPI_PREDEFINED_INFO *
const ACPI_PREDEFINED_INFO *ThisName);
const ACPI_PREDEFINED_INFO *
char *Name);
void
char *Buffer,
#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
const ACPI_PREDEFINED_INFO *
char *Name);
void
char *Buffer,
const ACPI_PREDEFINED_INFO *ThisName,
char *Buffer,
#endif
/*
*/
void
void);
void);
void *InternalObject,
void *ExternalObject,
void);
void
/*
* utmath
*/
/*
* utmisc
*/
const ACPI_EXCEPTION_INFO *
char *Id);
#endif
void *TargetObject,
void *Context);
/* Values for Base above (16=Hex, 10=Decimal) */
#define ACPI_ANY_BASE 0
void
#ifdef ACPI_DEBUG_OUTPUT
void
char *Path);
#endif
/*
*/
void
/*
* utresrc
*/
void **Context);
void *Aml,
UINT8 *ReturnIndex);
void *Aml);
void *Aml);
void *Aml);
void *Aml);
/*
* utstring - String and character utilities
*/
void
char *String,
#if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP
void
char *Pathname);
#endif
char *Name);
char Character,
void
char *Name);
#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
char *Dest,
char *Source);
char *Dest,
char *Source);
#endif
/*
* utmutex - mutex support
*/
void);
void
void);
/*
* utalloc - memory allocation and object caching
*/
void);
void);
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
void *
const char *Module,
void *
const char *Module,
void
void *Address,
const char *Module,
void
void);
void
const char *Module);
char *ListName,
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
/*
* utaddress - address range check
*/
void
void
void);
/*
*/
const char *ModuleName,
char *Pathname,
const char *Format,
...);
const char *ModuleName,
char *Pathname,
const char *Format,
...);
const char *ModuleName,
char *Pathname,
const char *Format,
...);
void
const char *ModuleName,
const char *InternalName,
void
const char *ModuleName,
const char *Message,
const char *Path,
/*
* Utility functions for ACPI names and IDs
*/
const AH_PREDEFINED_NAME *
char *Nameseg);
const AH_DEVICE_ID *
char *Hid);
const char *
/*
*/
const char *
const char *String,
const char *
char *String,
int
char *String,
const char *Format,
int
char *String,
const char *Format,
...);
#ifdef ACPI_APPLICATION
int
const char *Format,
int
const char *Format,
...);
#endif
/*
* utuuid -- UUID support functions
*/
#if (defined ACPI_ASL_COMPILER || defined ACPI_DISASSEMBLER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
void
char *InString,
UINT8 *UuidBuffer);
#endif
#endif /* _ACUTILS_H */