diff options
Diffstat (limited to 'source/include')
-rw-r--r-- | source/include/acconfig.h | 2 | ||||
-rw-r--r-- | source/include/acdebug.h | 4 | ||||
-rw-r--r-- | source/include/aclocal.h | 3 | ||||
-rw-r--r-- | source/include/acmacros.h | 26 | ||||
-rw-r--r-- | source/include/acnames.h | 25 | ||||
-rw-r--r-- | source/include/acpiosxf.h | 118 | ||||
-rw-r--r-- | source/include/acpixf.h | 43 | ||||
-rw-r--r-- | source/include/actypes.h | 42 | ||||
-rw-r--r-- | source/include/acutils.h | 35 | ||||
-rw-r--r-- | source/include/platform/acgcc.h | 2 | ||||
-rw-r--r-- | source/include/platform/aclinux.h | 113 |
11 files changed, 306 insertions, 107 deletions
diff --git a/source/include/acconfig.h b/source/include/acconfig.h index 6a267fe..48f220b 100644 --- a/source/include/acconfig.h +++ b/source/include/acconfig.h @@ -101,7 +101,9 @@ * ACPI PM timer * FACS table (Waking vectors and Global Lock) */ +#ifndef ACPI_REDUCED_HARDWARE #define ACPI_REDUCED_HARDWARE FALSE +#endif /****************************************************************************** diff --git a/source/include/acdebug.h b/source/include/acdebug.h index 37d41d3..b8ae659 100644 --- a/source/include/acdebug.h +++ b/source/include/acdebug.h @@ -393,6 +393,10 @@ char * AcpiDbGetFromHistory ( char *CommandNumArg); +char * +AcpiDbGetHistoryByIndex ( + UINT32 CommanddNum); + /* * dbinput - user front-end to the AML debugger diff --git a/source/include/aclocal.h b/source/include/aclocal.h index 5ee1430..0febef4 100644 --- a/source/include/aclocal.h +++ b/source/include/aclocal.h @@ -1259,7 +1259,7 @@ typedef struct acpi_db_method_info char *Name; UINT32 Flags; UINT32 NumLoops; - char Pathname[128]; + char Pathname[ACPI_DB_LINE_BUFFER_SIZE]; char **Args; ACPI_OBJECT_TYPE *Types; @@ -1286,6 +1286,7 @@ typedef struct acpi_integrity_info } ACPI_INTEGRITY_INFO; +#define ACPI_DB_DISABLE_OUTPUT 0x00 #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 #define ACPI_DB_CONSOLE_OUTPUT 0x02 #define ACPI_DB_DUPLICATE_OUTPUT 0x03 diff --git a/source/include/acmacros.h b/source/include/acmacros.h index 28bd2af..5489db3 100644 --- a/source/include/acmacros.h +++ b/source/include/acmacros.h @@ -415,32 +415,6 @@ /* - * Memory allocation tracking (DEBUG ONLY) - */ -#define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__ - -#ifndef ACPI_DBG_TRACK_ALLOCATIONS - -/* Memory allocation */ - -#define ACPI_ALLOCATE(a) AcpiUtAllocate((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) -#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroed((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) -#define ACPI_FREE(a) AcpiOsFree(a) -#define ACPI_MEM_TRACKING(a) - -#else - -/* Memory allocation */ - -#define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) -#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) -#define ACPI_FREE(a) AcpiUtFreeAndTrack(a, ACPI_MEM_PARAMETERS) -#define ACPI_MEM_TRACKING(a) a - -#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ - - -/* * Macros used for ACPICA utilities only */ diff --git a/source/include/acnames.h b/source/include/acnames.h index d6fdaa6..cd8fb93 100644 --- a/source/include/acnames.h +++ b/source/include/acnames.h @@ -46,24 +46,25 @@ /* Method names - these methods can appear anywhere in the namespace */ -#define METHOD_NAME__SB_ "_SB_" -#define METHOD_NAME__HID "_HID" -#define METHOD_NAME__CID "_CID" -#define METHOD_NAME__UID "_UID" -#define METHOD_NAME__SUB "_SUB" #define METHOD_NAME__ADR "_ADR" -#define METHOD_NAME__INI "_INI" -#define METHOD_NAME__STA "_STA" -#define METHOD_NAME__REG "_REG" -#define METHOD_NAME__SEG "_SEG" +#define METHOD_NAME__AEI "_AEI" #define METHOD_NAME__BBN "_BBN" -#define METHOD_NAME__PRT "_PRT" +#define METHOD_NAME__CBA "_CBA" +#define METHOD_NAME__CID "_CID" #define METHOD_NAME__CRS "_CRS" +#define METHOD_NAME__HID "_HID" +#define METHOD_NAME__INI "_INI" +#define METHOD_NAME__PLD "_PLD" #define METHOD_NAME__PRS "_PRS" -#define METHOD_NAME__AEI "_AEI" +#define METHOD_NAME__PRT "_PRT" #define METHOD_NAME__PRW "_PRW" +#define METHOD_NAME__REG "_REG" +#define METHOD_NAME__SB_ "_SB_" +#define METHOD_NAME__SEG "_SEG" #define METHOD_NAME__SRS "_SRS" -#define METHOD_NAME__PLD "_PLD" +#define METHOD_NAME__STA "_STA" +#define METHOD_NAME__SUB "_SUB" +#define METHOD_NAME__UID "_UID" /* Method names - these methods must appear at the namespace root */ diff --git a/source/include/acpiosxf.h b/source/include/acpiosxf.h index f3f624d..4c4f226 100644 --- a/source/include/acpiosxf.h +++ b/source/include/acpiosxf.h @@ -6,7 +6,6 @@ * *****************************************************************************/ - /* * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. @@ -85,85 +84,111 @@ typedef struct acpi_signal_fatal_info /* * OSL Initialization and shutdown primitives */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize ACPI_STATUS AcpiOsInitialize ( void); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate ACPI_STATUS AcpiOsTerminate ( void); +#endif /* * ACPI Table interfaces */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetRootPointer ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer ( void); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPredefinedOverride ACPI_STATUS AcpiOsPredefinedOverride ( const ACPI_PREDEFINED_NAMES *InitVal, ACPI_STRING *NewVal); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTableOverride ACPI_STATUS AcpiOsTableOverride ( ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPhysicalTableOverride ACPI_STATUS AcpiOsPhysicalTableOverride ( ACPI_TABLE_HEADER *ExistingTable, ACPI_PHYSICAL_ADDRESS *NewAddress, UINT32 *NewTableLength); +#endif /* * Spinlock primitives */ -#ifndef AcpiOsCreateLock +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock ACPI_STATUS AcpiOsCreateLock ( ACPI_SPINLOCK *OutHandle); #endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteLock void AcpiOsDeleteLock ( ACPI_SPINLOCK Handle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireLock ACPI_CPU_FLAGS AcpiOsAcquireLock ( ACPI_SPINLOCK Handle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseLock void AcpiOsReleaseLock ( ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags); +#endif /* * Semaphore primitives */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateSemaphore ACPI_STATUS AcpiOsCreateSemaphore ( UINT32 MaxUnits, UINT32 InitialUnits, ACPI_SEMAPHORE *OutHandle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteSemaphore ACPI_STATUS AcpiOsDeleteSemaphore ( ACPI_SEMAPHORE Handle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitSemaphore ACPI_STATUS AcpiOsWaitSemaphore ( ACPI_SEMAPHORE Handle, UINT32 Units, UINT16 Timeout); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSignalSemaphore ACPI_STATUS AcpiOsSignalSemaphore ( ACPI_SEMAPHORE Handle, UINT32 Units); +#endif /* @@ -172,151 +197,208 @@ AcpiOsSignalSemaphore ( */ #if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE) +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateMutex ACPI_STATUS AcpiOsCreateMutex ( ACPI_MUTEX *OutHandle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteMutex void AcpiOsDeleteMutex ( ACPI_MUTEX Handle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireMutex ACPI_STATUS AcpiOsAcquireMutex ( ACPI_MUTEX Handle, UINT16 Timeout); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseMutex void AcpiOsReleaseMutex ( ACPI_MUTEX Handle); #endif +#endif + /* * Memory allocation and mapping */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate void * AcpiOsAllocate ( ACPI_SIZE Size); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed +void * +AcpiOsAllocateZeroed ( + ACPI_SIZE Size); +#endif + +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree void AcpiOsFree ( void * Memory); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory void * AcpiOsMapMemory ( ACPI_PHYSICAL_ADDRESS Where, ACPI_SIZE Length); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory void AcpiOsUnmapMemory ( void *LogicalAddress, ACPI_SIZE Size); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetPhysicalAddress ACPI_STATUS AcpiOsGetPhysicalAddress ( void *LogicalAddress, ACPI_PHYSICAL_ADDRESS *PhysicalAddress); +#endif /* * Memory/Object Cache */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateCache ACPI_STATUS AcpiOsCreateCache ( char *CacheName, UINT16 ObjectSize, UINT16 MaxDepth, ACPI_CACHE_T **ReturnCache); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteCache ACPI_STATUS AcpiOsDeleteCache ( ACPI_CACHE_T *Cache); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPurgeCache ACPI_STATUS AcpiOsPurgeCache ( ACPI_CACHE_T *Cache); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject void * AcpiOsAcquireObject ( ACPI_CACHE_T *Cache); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseObject ACPI_STATUS AcpiOsReleaseObject ( ACPI_CACHE_T *Cache, void *Object); +#endif /* * Interrupt handlers */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInstallInterruptHandler ACPI_STATUS AcpiOsInstallInterruptHandler ( UINT32 InterruptNumber, ACPI_OSD_HANDLER ServiceRoutine, void *Context); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRemoveInterruptHandler ACPI_STATUS AcpiOsRemoveInterruptHandler ( UINT32 InterruptNumber, ACPI_OSD_HANDLER ServiceRoutine); +#endif /* * Threads and Scheduling */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId ACPI_THREAD_ID AcpiOsGetThreadId ( void); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsExecute ACPI_STATUS AcpiOsExecute ( ACPI_EXECUTE_TYPE Type, ACPI_OSD_EXEC_CALLBACK Function, void *Context); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitEventsComplete void AcpiOsWaitEventsComplete ( void); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSleep void AcpiOsSleep ( UINT64 Milliseconds); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsStall void AcpiOsStall ( UINT32 Microseconds); +#endif /* * Platform and hardware-independent I/O interfaces */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadPort ACPI_STATUS AcpiOsReadPort ( ACPI_IO_ADDRESS Address, UINT32 *Value, UINT32 Width); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritePort ACPI_STATUS AcpiOsWritePort ( ACPI_IO_ADDRESS Address, UINT32 Value, UINT32 Width); +#endif /* * Platform and hardware-independent physical memory interfaces */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadMemory ACPI_STATUS AcpiOsReadMemory ( ACPI_PHYSICAL_ADDRESS Address, UINT64 *Value, UINT32 Width); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWriteMemory ACPI_STATUS AcpiOsWriteMemory ( ACPI_PHYSICAL_ADDRESS Address, UINT64 Value, UINT32 Width); +#endif /* @@ -324,103 +406,131 @@ AcpiOsWriteMemory ( * Note: Can't use "Register" as a parameter, changed to "Reg" -- * certain compilers complain. */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadPciConfiguration ACPI_STATUS AcpiOsReadPciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Reg, UINT64 *Value, UINT32 Width); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritePciConfiguration ACPI_STATUS AcpiOsWritePciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Reg, UINT64 Value, UINT32 Width); +#endif /* * Miscellaneous */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable BOOLEAN AcpiOsReadable ( void *Pointer, ACPI_SIZE Length); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable BOOLEAN AcpiOsWritable ( void *Pointer, ACPI_SIZE Length); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTimer UINT64 AcpiOsGetTimer ( void); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSignal ACPI_STATUS AcpiOsSignal ( UINT32 Function, void *Info); +#endif /* * Debug print routines */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPrintf void ACPI_INTERNAL_VAR_XFACE AcpiOsPrintf ( const char *Format, ...); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsVprintf void AcpiOsVprintf ( const char *Format, va_list Args); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput void AcpiOsRedirectOutput ( void *Destination); +#endif /* * Debug input */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine ACPI_STATUS AcpiOsGetLine ( char *Buffer, UINT32 BufferLength, UINT32 *BytesRead); +#endif /* * Obtain ACPI table(s) */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName ACPI_STATUS AcpiOsGetTableByName ( char *Signature, UINT32 Instance, ACPI_TABLE_HEADER **Table, ACPI_PHYSICAL_ADDRESS *Address); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex ACPI_STATUS AcpiOsGetTableByIndex ( UINT32 Index, ACPI_TABLE_HEADER **Table, UINT32 *Instance, ACPI_PHYSICAL_ADDRESS *Address); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress ACPI_STATUS AcpiOsGetTableByAddress ( ACPI_PHYSICAL_ADDRESS Address, ACPI_TABLE_HEADER **Table); +#endif /* * Directory manipulation */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory void * AcpiOsOpenDirectory ( char *Pathname, char *WildcardSpec, char RequestedFileType); +#endif /* RequesteFileType values */ @@ -428,13 +538,17 @@ AcpiOsOpenDirectory ( #define REQUEST_DIR_ONLY 1 +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename char * AcpiOsGetNextFilename ( void *DirHandle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory void AcpiOsCloseDirectory ( void *DirHandle); +#endif #endif /* __ACPIOSXF_H__ */ diff --git a/source/include/acpixf.h b/source/include/acpixf.h index 18e5200..cba3e56 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 0x20130823 +#define ACPI_CA_VERSION 0x20130927 #include "acconfig.h" #include "actypes.h" @@ -106,7 +106,7 @@ extern UINT8 AcpiGbl_DisableSsdtTableLoad; static ACPI_INLINE Prototype {return(AE_OK);} #define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \ - static ACPI_INLINE Prototype {} + static ACPI_INLINE Prototype {return;} #endif /* !ACPI_REDUCED_HARDWARE */ @@ -195,21 +195,6 @@ AcpiDecodePldBuffer ( ACPI_SIZE Length, ACPI_PLD_INFO **ReturnBuffer); -/* - * ACPI Memory management - */ -void * -AcpiAllocate ( - UINT32 Size); - -void * -AcpiCallocate ( - UINT32 Size); - -void -AcpiFree ( - void *Address); - /* * ACPI table load/unload interfaces @@ -766,48 +751,54 @@ AcpiGetTimerDuration ( /* * Error/Warning output */ +ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE AcpiError ( const char *ModuleName, UINT32 LineNumber, const char *Format, - ...) ACPI_PRINTF_LIKE(3); + ...); +ACPI_PRINTF_LIKE(4) void ACPI_INTERNAL_VAR_XFACE AcpiException ( const char *ModuleName, UINT32 LineNumber, ACPI_STATUS Status, const char *Format, - ...) ACPI_PRINTF_LIKE(4); + ...); +ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE AcpiWarning ( const char *ModuleName, UINT32 LineNumber, const char *Format, - ...) ACPI_PRINTF_LIKE(3); + ...); +ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE AcpiInfo ( const char *ModuleName, UINT32 LineNumber, const char *Format, - ...) ACPI_PRINTF_LIKE(3); + ...); +ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE AcpiBiosError ( const char *ModuleName, UINT32 LineNumber, const char *Format, - ...) ACPI_PRINTF_LIKE(3); + ...); +ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE AcpiBiosWarning ( const char *ModuleName, UINT32 LineNumber, const char *Format, - ...) ACPI_PRINTF_LIKE(3); + ...); /* @@ -815,6 +806,7 @@ AcpiBiosWarning ( */ #ifdef ACPI_DEBUG_OUTPUT +ACPI_PRINTF_LIKE(6) void ACPI_INTERNAL_VAR_XFACE AcpiDebugPrint ( UINT32 RequestedDebugLevel, @@ -823,8 +815,9 @@ AcpiDebugPrint ( const char *ModuleName, UINT32 ComponentId, const char *Format, - ...) ACPI_PRINTF_LIKE(6); + ...); +ACPI_PRINTF_LIKE(6) void ACPI_INTERNAL_VAR_XFACE AcpiDebugPrintRaw ( UINT32 RequestedDebugLevel, @@ -833,7 +826,7 @@ AcpiDebugPrintRaw ( const char *ModuleName, UINT32 ComponentId, const char *Format, - ...) ACPI_PRINTF_LIKE(6); + ...); #endif #endif /* __ACXFACE_H__ */ diff --git a/source/include/actypes.h b/source/include/actypes.h index dafbfd5..7c484b2 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -303,9 +303,18 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS; #endif /* - * All ACPICA functions that are available to the rest of the kernel are - * tagged with this macro which can be defined as appropriate for the host. + * All ACPICA external functions that are available to the rest of the kernel + * are tagged with thes macros which can be defined as appropriate for the host. + * + * Notes: + * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination + * interfaces that may need special processing. + * ACPI_EXPORT_SYMBOL is used for all other public external functions. */ +#ifndef ACPI_EXPORT_SYMBOL_INIT +#define ACPI_EXPORT_SYMBOL_INIT(Symbol) +#endif + #ifndef ACPI_EXPORT_SYMBOL #define ACPI_EXPORT_SYMBOL(Symbol) #endif @@ -319,6 +328,34 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS; #endif +/******************************************************************************* + * + * Configuration + * + ******************************************************************************/ + +#ifdef ACPI_DBG_TRACK_ALLOCATIONS +/* + * Memory allocation tracking (used by AcpiExec to detect memory leaks) + */ +#define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__ +#define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) +#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) +#define ACPI_FREE(a) AcpiUtFreeAndTrack (a, ACPI_MEM_PARAMETERS) +#define ACPI_MEM_TRACKING(a) a + +#else +/* + * Normal memory allocation directly via the OS services layer + */ +#define ACPI_ALLOCATE(a) AcpiOsAllocate ((ACPI_SIZE) (a)) +#define ACPI_ALLOCATE_ZEROED(a) AcpiOsAllocateZeroed ((ACPI_SIZE) (a)) +#define ACPI_FREE(a) AcpiOsFree (a) +#define ACPI_MEM_TRACKING(a) + +#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ + + /****************************************************************************** * * ACPI Specification constants (Do not change unless the specification changes) @@ -335,6 +372,7 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS; #define ACPI_PM1_REGISTER_WIDTH 16 #define ACPI_PM2_REGISTER_WIDTH 8 #define ACPI_PM_TIMER_WIDTH 32 +#define ACPI_RESET_REGISTER_WIDTH 8 /* Names within the namespace are 4 bytes long */ diff --git a/source/include/acutils.h b/source/include/acutils.h index c80dd36..de62498 100644 --- a/source/include/acutils.h +++ b/source/include/acutils.h @@ -926,6 +926,27 @@ void AcpiUtRepairName ( char *Name); +#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION) +BOOLEAN +AcpiUtSafeStrcpy ( + char *Dest, + ACPI_SIZE DestSize, + char *Source); + +BOOLEAN +AcpiUtSafeStrcat ( + char *Dest, + ACPI_SIZE DestSize, + char *Source); + +BOOLEAN +AcpiUtSafeStrncat ( + char *Dest, + ACPI_SIZE DestSize, + char *Source, + ACPI_SIZE MaxTransferLength); +#endif + /* * utmutex - mutex support @@ -967,20 +988,6 @@ AcpiUtInitializeBuffer ( ACPI_BUFFER *Buffer, ACPI_SIZE RequiredLength); -void * -AcpiUtAllocate ( - ACPI_SIZE Size, - UINT32 Component, - const char *Module, - UINT32 Line); - -void * -AcpiUtAllocateZeroed ( - ACPI_SIZE Size, - UINT32 Component, - const char *Module, - UINT32 Line); - #ifdef ACPI_DBG_TRACK_ALLOCATIONS void * AcpiUtAllocateAndTrack ( diff --git a/source/include/platform/acgcc.h b/source/include/platform/acgcc.h index 1662a9b..a091cc0 100644 --- a/source/include/platform/acgcc.h +++ b/source/include/platform/acgcc.h @@ -48,7 +48,7 @@ /* Function name is used for debug output. Non-ANSI, compiler-dependent */ -#define ACPI_GET_FUNCTION_NAME __FUNCTION__ +#define ACPI_GET_FUNCTION_NAME __func__ /* * This macro is used to tag functions as "printf-like" because diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h index edd4556..b6a7e17 100644 --- a/source/include/platform/aclinux.h +++ b/source/include/platform/aclinux.h @@ -111,13 +111,22 @@ #ifdef __KERNEL__ #include <acpi/actypes.h> + +ACPI_STATUS __init AcpiOsInitialize ( + void); +#define ACPI_USE_NATIVE_DECLARED_AcpiOsInitialize + +ACPI_STATUS __exit AcpiOsTerminate ( + void); +#define ACPI_USE_NATIVE_DECLARED_AcpiOsTerminate + /* - * Overrides for in-kernel ACPICA + * Memory allocation/deallocation */ -static inline acpi_thread_id acpi_os_get_thread_id(void) -{ - return (ACPI_THREAD_ID) (unsigned long) current; -} + +/* Use native linux version of acpi_os_allocate_zeroed */ + +#define USE_NATIVE_ALLOCATE_ZEROED /* * The irqs_disabled() check is for resume from RAM. @@ -125,25 +134,49 @@ static inline acpi_thread_id acpi_os_get_thread_id(void) * However, boot has (system_state != SYSTEM_RUNNING) * to quiet __might_sleep() in kmalloc() and resume does not. */ -static inline void *acpi_os_allocate(acpi_size size) +static inline void * +AcpiOsAllocate ( + ACPI_SIZE Size) { - return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); + return kmalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL); } +#define ACPI_USE_NATIVE_DECLARED_AcpiOsAllocate -static inline void *acpi_os_allocate_zeroed(acpi_size size) +static inline void * +AcpiOsAllocateZeroed ( + ACPI_SIZE Size) { - return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); + return kzalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL); } +#define ACPI_USE_NATIVE_DECLARED_AcpiOsAllocateZeroed -static inline void *acpi_os_acquire_object(acpi_cache_t * cache) +static inline void +AcpiOsFree ( + void *Memory) { - return kmem_cache_zalloc(cache, - irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); + kfree (Memory); } +#define ACPI_USE_NATIVE_DECLARED_AcpiOsFree -#define ACPI_ALLOCATE(a) acpi_os_allocate(a) -#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a) -#define ACPI_FREE(a) kfree(a) +static inline void * +AcpiOsAcquireObject ( + ACPI_CACHE_T *Cache) +{ + return kmem_cache_zalloc (Cache, + irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL); +} +#define ACPI_USE_NATIVE_DECLARED_AcpiOsAcquireObject + +/* + * Overrides for in-kernel ACPICA + */ +static inline ACPI_THREAD_ID +AcpiOsGetThreadId ( + void) +{ + return (ACPI_THREAD_ID) (unsigned long) current; +} +#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetThreadId #ifndef CONFIG_PREEMPT /* @@ -164,16 +197,48 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache) * all locks to the name of the argument of acpi_os_create_lock(), which * prevents lockdep from reporting false positives for ACPICA locks. */ -#define AcpiOsCreateLock(__handle) \ -({ \ - spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \ - \ - if (lock) { \ - *(__handle) = lock; \ - spin_lock_init(*(__handle)); \ - } \ - lock ? AE_OK : AE_NO_MEMORY; \ +#define AcpiOsCreateLock(__Handle) \ +({ \ + spinlock_t *Lock = ACPI_ALLOCATE(sizeof(*Lock)); \ + if (Lock) { \ + *(__Handle) = Lock; \ + spin_lock_init(*(__Handle)); \ + } \ + Lock ? AE_OK : AE_NO_MEMORY; \ }) +#define ACPI_USE_NATIVE_DECLARED_AcpiOsCreateLock + +void __iomem * +AcpiOsMapMemory ( + ACPI_PHYSICAL_ADDRESS Where, + ACPI_SIZE Length); +#define ACPI_USE_NATIVE_DECLARED_AcpiOsMapMemory + +void +AcpiOsUnmapMemory ( + void __iomem *LogicalAddress, + ACPI_SIZE Size); +#define ACPI_USE_NATIVE_DECLARED_AcpiOsUnmapMemory + +/* OSL interfaces used by debugger/disassembler */ +#define ACPI_USE_NATIVE_DECLARED_AcpiOsReadable +#define ACPI_USE_NATIVE_DECLARED_AcpiOsWritable + +/* OSL interfaces used by utilities */ +#define ACPI_USE_NATIVE_DECLARED_AcpiOsRedirectOutput +#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetLine +#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetTableByName +#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetTableByIndex +#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetTableByAddress +#define ACPI_USE_NATIVE_DECLARED_AcpiOsOpenDirectory +#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetNextFilename +#define ACPI_USE_NATIVE_DECLARED_AcpiOsCloseDirectory + +/* OSL interfaces added by Linux */ + +#ifdef EXPORT_ACPI_INTERFACES +#include <linux/export.h> +#endif #endif /* __KERNEL__ */ |