diff options
Diffstat (limited to 'source/include')
| -rw-r--r-- | source/include/acapps.h | 8 | ||||
| -rw-r--r-- | source/include/acglobal.h | 6 | ||||
| -rw-r--r-- | source/include/acpiosxf.h | 22 | ||||
| -rw-r--r-- | source/include/acpixf.h | 3 | ||||
| -rw-r--r-- | source/include/actypes.h | 8 | ||||
| -rw-r--r-- | source/include/acutils.h | 45 | ||||
| -rw-r--r-- | source/include/platform/acenv.h | 8 | ||||
| -rw-r--r-- | source/include/platform/acmacosx.h | 58 | ||||
| -rw-r--r-- | source/include/platform/acmsvc.h | 18 |
9 files changed, 172 insertions, 4 deletions
diff --git a/source/include/acapps.h b/source/include/acapps.h index 8266d49975c44..0d6bf9f99cf92 100644 --- a/source/include/acapps.h +++ b/source/include/acapps.h @@ -103,11 +103,18 @@ AcpiGetopt( char **argv, char *opts); +int +AcpiGetoptArgument ( + int argc, + char **argv); + extern int AcpiGbl_Optind; extern int AcpiGbl_Opterr; +extern int AcpiGbl_SubOptChar; extern char *AcpiGbl_Optarg; +#ifndef ACPI_DUMP_APP /* * adisasm */ @@ -212,5 +219,6 @@ AdWriteTable ( UINT32 Length, char *TableName, char *OemTableId); +#endif #endif /* _ACAPPS */ diff --git a/source/include/acglobal.h b/source/include/acglobal.h index 91661d631a29b..32ae55f855f99 100644 --- a/source/include/acglobal.h +++ b/source/include/acglobal.h @@ -134,6 +134,12 @@ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_TruncateIoAddresses, FALSE); */ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableAutoRepair, FALSE); +/* + * Optionally do not load any SSDTs from the RSDT/XSDT during initialization. + * This can be useful for debugging ACPI problems on some machines. + */ +UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableSsdtTableLoad, FALSE); + /* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */ diff --git a/source/include/acpiosxf.h b/source/include/acpiosxf.h index a1acbd1991bbd..a1ac1d9a09b67 100644 --- a/source/include/acpiosxf.h +++ b/source/include/acpiosxf.h @@ -391,6 +391,28 @@ AcpiOsGetLine ( /* + * Obtain ACPI table(s) + */ +ACPI_STATUS +AcpiOsGetTableByName ( + char *Signature, + UINT32 Instance, + ACPI_TABLE_HEADER **Table, + ACPI_PHYSICAL_ADDRESS *Address); + +ACPI_STATUS +AcpiOsGetTableByIndex ( + UINT32 Index, + ACPI_TABLE_HEADER **Table, + ACPI_PHYSICAL_ADDRESS *Address); + +ACPI_STATUS +AcpiOsGetTableByAddress ( + ACPI_PHYSICAL_ADDRESS Address, + ACPI_TABLE_HEADER **Table); + + +/* * Directory manipulation */ void * diff --git a/source/include/acpixf.h b/source/include/acpixf.h index 88b1ce007441b..9f94e52c3782c 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 0x20130418 +#define ACPI_CA_VERSION 0x20130517 #include "acconfig.h" #include "actypes.h" @@ -79,6 +79,7 @@ extern UINT8 AcpiGbl_EnableAmlDebugObject; extern UINT8 AcpiGbl_CopyDsdtLocally; extern UINT8 AcpiGbl_TruncateIoAddresses; extern UINT8 AcpiGbl_DisableAutoRepair; +extern UINT8 AcpiGbl_DisableSsdtTableLoad; /* diff --git a/source/include/actypes.h b/source/include/actypes.h index 9c8ec7d939b0d..840c146c304e8 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -310,6 +310,14 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS; #define ACPI_EXPORT_SYMBOL(Symbol) #endif +/* + * Compiler/Clibrary-dependent debug initialization. Used for ACPICA + * utilities only. + */ +#ifndef ACPI_DEBUG_INITIALIZE +#define ACPI_DEBUG_INITIALIZE() +#endif + /****************************************************************************** * diff --git a/source/include/acutils.h b/source/include/acutils.h index b4ea7e53a1273..c79240ca648db 100644 --- a/source/include/acutils.h +++ b/source/include/acutils.h @@ -88,6 +88,49 @@ 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> +extern FILE *AcpiGbl_OutputFile; + +#define ACPI_MSG_REDIRECT_BEGIN \ + FILE *OutputFile = AcpiGbl_OutputFile; \ + AcpiOsRedirectOutput (stderr); + +#define ACPI_MSG_REDIRECT_END \ + AcpiOsRedirectOutput (OutputFile); + +#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 \ + AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber) + + /* Types for Resource descriptor entries */ #define ACPI_INVALID_RESOURCE 0 @@ -868,7 +911,7 @@ UtConvertBackslashes ( BOOLEAN AcpiUtValidAcpiName ( - UINT32 Name); + char *Name); BOOLEAN AcpiUtValidAcpiChar ( diff --git a/source/include/platform/acenv.h b/source/include/platform/acenv.h index a9e78a8f8ccf4..8895ceb5f19ce 100644 --- a/source/include/platform/acenv.h +++ b/source/include/platform/acenv.h @@ -97,10 +97,11 @@ #endif /* - * AcpiBin/AcpiHelp/AcpiSrc configuration. All single threaded, with - * no debug output. + * AcpiBin/AcpiDump/AcpiSrc/AcpiXtract configuration. All single + * threaded, with no debug output. */ #if (defined ACPI_BIN_APP) || \ + (defined ACPI_DUMP_APP) || \ (defined ACPI_SRC_APP) || \ (defined ACPI_XTRACT_APP) #define ACPI_APPLICATION @@ -147,6 +148,9 @@ #if defined(_LINUX) || defined(__linux__) #include "aclinux.h" +#elif defined(_APPLE) || defined(__APPLE__) +#include "acmacosx.h" + #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include "acfreebsd.h" diff --git a/source/include/platform/acmacosx.h b/source/include/platform/acmacosx.h new file mode 100644 index 0000000000000..91afeb6d2b5b3 --- /dev/null +++ b/source/include/platform/acmacosx.h @@ -0,0 +1,58 @@ +/****************************************************************************** + * + * Name: acmacosx.h - OS specific defines, etc. for Mac OS X + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2013, 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 __ACMACOSX_H__ +#define __ACMACOSX_H__ + +#include "aclinux.h" + +#ifdef __APPLE__ +#define sem_destroy sem_close +#define ACPI_USE_ALTERNATE_TIMEOUT +#endif /* __APPLE__ */ + +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wformat-nonliteral" +#endif + +#endif /* __ACMACOSX_H__ */ diff --git a/source/include/platform/acmsvc.h b/source/include/platform/acmsvc.h index 799dfdb0a28e0..d552f7d599648 100644 --- a/source/include/platform/acmsvc.h +++ b/source/include/platform/acmsvc.h @@ -146,4 +146,22 @@ #pragma warning( disable : 4295 ) /* needed for acpredef.h array */ #endif + +/* Debug support. Must be last in this file, do not move. */ + +#ifdef _DEBUG +#include <crtdbg.h> + +/* + * Debugging memory corruption issues with windows: + * Add #include <crtdbg.h> to accommon.h if necessary. + * Add _ASSERTE(_CrtCheckMemory()); where needed to test memory integrity. + * This can quickly localize the memory corruption. + */ +#define ACPI_DEBUG_INITIALIZE() \ + _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | \ + _CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_CRT_DF | \ + _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)) +#endif + #endif /* __ACMSVC_H__ */ |
