linux/include/acpi
Lv Zheng d5caf1cdc4 ACPICA: OSL: Add configurability for memory allocation macros.
OSPMs like Linux trend to include all header files but leave empty stub
macros for a feature that is not configured during build.

For macros defined without other symbols referencesd it is safe to leave
them without protections.

By investigation, there are only the following internal/external
symbols referenced by the ACPICA macros:
1. C library symbols, including string, ctype, stdarg APIs.  Since such
   symbols are always accessbile in the kernel source tree, it is safe to
   leave macros referencing them without protected for Linux.
2. ACPICA OSL symbols, such symbols are designed to be used only by ACPICA
   internal APIs.  And there are macros directly referencing mutex and
   memory allocation OSL symbols.  We need to examine the external usages
   of such macros.
   For macros referencing the mutex OSL symbols, fortunately, there is no
   external user directly invoking such macros.
   ========================================================================
   !! IMPORTANT !!
   ========================================================================
   For macros referencing memory allocation OSL symbols -
    1. 'free' - ACPI_FREE
    2. 'alloc' - ACPI_ALLOCATE, ACPI_ALLOCATE_ZEROED, ACPI_ALLOCATE_BUFFER,
                 ACPI_ALLOCATE_LOCAL_BUFFER
   there are external users directly invoking 'alloc' macros.  And the more
   complicated situation is the reversals of such macros are not ACPI_FREE
   but acpi_os_free (or kfree) in Linux.  Though we can define such macros
   into no-op, we in fact cannot define their reversals into no-op.
   This patch adds mechanism to protect ACPICA memory allocation APIs for
   Linux so that acpi_os_free (or kfree) invoked in Linux can have a zero
   address returned by 'alloc' macros to free.  In this
   way, acpi_os_free (or kfree) can be converted into no-op.
   ========================================================================
3. ACPI_OFFSET and other macros that would access structure members, we
   need to check if such structure members are not accessible under a
   specific configuration.  Fortunately, currently Linux doesn't use such
   structure members when CONFIG_ACPI is disabled.

This patch thus only adds mechanism useful for implementing stubs for
ACPICA provided macros - the configurability of memory allocation APIs.

This patch doesn't include code for Linux to use this new mechanism, thus
no functional changes.  Lv Zheng.

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>
2014-05-07 00:55:00 +02:00
..
platform ACPICA: Linux-specific header: Add support for PPC64 compilation. 2014-04-20 22:59:38 +02:00
acbuffer.h ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)." 2014-03-18 01:53:45 +01:00
acconfig.h ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)." 2014-03-18 01:53:45 +01:00
acexcep.h ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)." 2014-03-18 01:53:45 +01:00
acnames.h ACPICA: Update ACPICA copyrights to 2014. 2014-02-11 00:30:25 +01:00
acoutput.h ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)." 2014-03-18 01:53:45 +01:00
acpi.h ACPICA: Add support for extra, optional OS-specific header file. 2014-02-11 00:30:25 +01:00
acpi_bus.h Merge branches 'pm-qos', 'pm-domains' and 'pm-drivers' 2014-03-20 13:25:36 +01:00
acpi_drivers.h ACPI / dock: Drop struct acpi_dock_ops and all code related to it 2014-02-22 00:48:56 +01:00
acpi_io.h ACPI / i915: Fix incorrect <acpi/acpi.h> inclusions via <linux/acpi_io.h> 2013-12-07 01:24:33 +01:00
acpi_numa.h ACPI / numa: Make __acpi_map_pxm_to_node(), acpi_get_pxm() static 2014-02-03 10:39:38 -07:00
acpiosxf.h ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)." 2014-03-18 01:53:45 +01:00
acpixf.h ACPICA: OSL: Move external globals from utglobal.c to acpixf.h using ACPI_INIT_GLOBAL/ACPI_GLOBAL. 2014-05-07 00:55:00 +02:00
acrestyp.h ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)." 2014-03-18 01:53:45 +01:00
actbl.h ACPICA: Table Manager: Misc cleanup and renames, no functional change. 2014-04-20 22:59:39 +02:00
actbl1.h ACPICA: Comment updates - no functional change. 2014-05-07 00:55:00 +02:00
actbl2.h ACPICA: Comment updates - no functional change. 2014-05-07 00:55:00 +02:00
actbl3.h ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)." 2014-03-18 01:53:45 +01:00
actypes.h ACPICA: OSL: Add configurability for memory allocation macros. 2014-05-07 00:55:00 +02:00
apei.h module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
button.h ACPI: make ACPI button funcs no-ops if not built in 2009-09-17 14:48:23 -07:00
ghes.h ACPI, CPER: Update cper info 2013-10-21 15:12:00 -07:00
hed.h ACPI Hardware Error Device (PNP0C33) support 2010-05-19 22:40:24 -04:00
pdc_intel.h ACPI: Enable bit 11 in _PDC to advertise hw coord 2009-02-07 00:41:14 -05:00
processor.h ACPI / processor: Do not request ACPI cpufreq module directly 2013-10-30 00:00:30 +01:00
reboot.h Add the ability to reset the machine using the RESET_REG in ACPI's FADT table. 2008-07-16 23:27:08 +02:00
video.h Revert "ACPI / video / i915: No ACPI backlight if firmware expects Windows 8" 2013-07-26 14:59:20 +02:00