aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/platform
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2013-10-28 21:29:27 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-30 07:24:21 -0400
commitb3c86c30efd83ebfa7010c5890e2ebf2678e49f8 (patch)
treef354d1d0a7a01d40345b155e3d271ca9275adb09 /include/acpi/platform
parent73424473d0801f7079258897901ba1edc660dbd3 (diff)
ACPICA: Cleanup memory allocation macros and configurability.
In the common case, the ACPI_ALLOCATE and related macros now resolve directly to their respective acpi_os* OSL interfaces. Two options: 1) The ACPI_ALLOCATE_ZEROED macro defaults to a simple local implementation by default, unless overridden by the USE_NATIVE_ALLOCATE_ZEROED define. 2) For ACPI execution simulation environment (AcpiExec) which is not shipped with the Linux kernel, the macros can optionally be resolved to the local interfaces that track each allocation (used to immediately detect memory leaks). Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/acpi/platform')
-rw-r--r--include/acpi/platform/aclinux.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index fda0f3e35c03..7346a9235a4c 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -119,6 +119,14 @@ static inline acpi_thread_id acpi_os_get_thread_id(void)
119} 119}
120 120
121/* 121/*
122 * Memory allocation/deallocation
123 */
124
125/* Use native linux version of acpi_os_allocate_zeroed */
126
127#define USE_NATIVE_ALLOCATE_ZEROED
128
129/*
122 * The irqs_disabled() check is for resume from RAM. 130 * The irqs_disabled() check is for resume from RAM.
123 * Interrupts are off during resume, just like they are for boot. 131 * Interrupts are off during resume, just like they are for boot.
124 * However, boot has (system_state != SYSTEM_RUNNING) 132 * However, boot has (system_state != SYSTEM_RUNNING)
@@ -140,9 +148,10 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
140 irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); 148 irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
141} 149}
142 150
143#define ACPI_ALLOCATE(a) acpi_os_allocate(a) 151static inline void acpi_os_free(void *a)
144#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a) 152{
145#define ACPI_FREE(a) kfree(a) 153 kfree(a);
154}
146 155
147#ifndef CONFIG_PREEMPT 156#ifndef CONFIG_PREEMPT
148/* 157/*