提交 417b4a73 编写于 作者: L Lv Zheng 提交者: Rafael J. Wysocki

ACPI: Add support to force header inclusion rules for <acpi/acpi.h>.

As there is only CONFIG_ACPI=n processing in the <linux/acpi.h>, it is not
safe to include <acpi/acpi.h> directly for source out of Linux ACPI
subsystems.

This patch adds error messaging to warn developers of such wrong
inclusions.

In order not to be bisected and reverted as a wrong commit, warning
messages are carefully split into a seperate patch other than the wrong
inclusion cleanups.
Signed-off-by: NLv Zheng <lv.zheng@intel.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 f997ea54
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for ACPICA Core interpreter # Makefile for ACPICA Core interpreter
# #
ccflags-y := -Os ccflags-y := -Os -DBUILDING_ACPICA
ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT
# use acpi.o to put all files here into acpi.o modparam namespace # use acpi.o to put all files here into acpi.o modparam namespace
......
...@@ -44,6 +44,16 @@ ...@@ -44,6 +44,16 @@
#ifndef __ACLINUX_H__ #ifndef __ACLINUX_H__
#define __ACLINUX_H__ #define __ACLINUX_H__
#ifdef __KERNEL__
/* ACPICA external files should not include ACPICA headers directly. */
#if !defined(BUILDING_ACPICA) && !defined(_LINUX_ACPI_H)
#error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
#endif
#endif
/* Common (in-kernel/user-space) ACPICA configuration */ /* Common (in-kernel/user-space) ACPICA configuration */
#define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_SYSTEM_CLIBRARY
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册