[RFC PATCH 07/15] ACPICA: OSL: Add configurability mechanism for external APIs.

From: Lv Zheng
Date: Wed Dec 18 2013 - 04:09:57 EST


OSPMs like Linux trend to include all header files but leave empty inline
stub functions for a feature that is not configured during build.
This patch adds wrappers mechanism to be used around ACPICA external
interfaces to facilitate OSPM with such configurability.
This patch doesn't include code for Linux to use this mechanism.

Note that in order to the reduce the difficulties caused by the source code
differences between Linux and ACPICA upstream of maintaining large
ACPI_EXTERNAL_RETURN_x macro updates, actual ACPI_EXTERNAL_RETURN_x macro
usages are done and split into other commits.

ACPICA commits will be linuxized by the scripts. If there were divergences
in the middle of a diff block, the linuxized diff block should require
human intervention to be performed to make it possible to apply the
linuxized commit into Linux source tree. Sometime such human intervention
will be very difficult as the linuxized commits will be messed up in
addition to the normal line offsettings by the patch/diff based utilities.
Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@xxxxxxxxx>
---
include/acpi/acpixf.h | 33 ++++++++++++++++++++++++++++++---
include/acpi/platform/aclinux.h | 13 +++++++++++++
2 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 08a1fdb..ed6c53b 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -95,6 +95,33 @@ extern u32 acpi_rsdt_forced;

#endif

+/* ACPICA prototypes */
+
+#ifndef ACPI_EXTERNAL_RETURN_STATUS
+#define ACPI_EXTERNAL_RETURN_STATUS(prototype) \
+ prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_OK
+#define ACPI_EXTERNAL_RETURN_OK(prototype) \
+ prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_VOID
+#define ACPI_EXTERNAL_RETURN_VOID(prototype) \
+ prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_UINT32
+#define ACPI_EXTERNAL_RETURN_UINT32(prototype) \
+ prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_PTR
+#define ACPI_EXTERNAL_RETURN_PTR(prototype) \
+ prototype;
+#endif
+
/* Public globals, available from outside ACPICA subsystem */

/*****************************************************************************
@@ -215,11 +242,11 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_no_resource_disassembly, FALSE)
*/
#if (!ACPI_REDUCED_HARDWARE)
#define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
- prototype;
+ ACPI_EXTERNAL_RETURN_STATUS(prototype)
#define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
- prototype;
+ ACPI_EXTERNAL_RETURN_OK(prototype)
#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
- prototype;
+ ACPI_EXTERNAL_RETURN_VOID(prototype)
#else
#define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);}
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 45df524..12ef8be 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -100,6 +100,19 @@
#define ACPI_INIT_GLOBAL(t,a,b)
#define ACPI_GLOBAL_FADT

+/* External interface for __KERNEL__, stub is needed */
+
+#define ACPI_EXTERNAL_RETURN_STATUS(prototype) \
+ static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);}
+#define ACPI_EXTERNAL_RETURN_OK(prototype) \
+ static ACPI_INLINE prototype {return(AE_OK);}
+#define ACPI_EXTERNAL_RETURN_VOID(prototype) \
+ static ACPI_INLINE prototype {return;}
+#define ACPI_EXTERNAL_RETURN_UINT32(prototype) \
+ static ACPI_INLINE prototype {return(0);}
+#define ACPI_EXTERNAL_RETURN_PTR(prototype) \
+ static ACPI_INLINE prototype {return(NULL);}
+
/* Immediates to protect global variables accesses */

#define acpi_current_gpe_count 0
--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/