Merge branch 'acpi-headers'

* acpi-headers:
  ACPI: Add support to force header inclusion rules for <acpi/acpi.h>.
  ACPI / SFI: Fix wrong <acpi/acpi.h> inclusion in SFI/ACPI wrapper - table definitions.
  ACPICA: Linux: Allow ACPICA inclusion for CONFIG_ACPI=n builds.
  ACPICA: Linux: Add support to exclude <asm/acenv.h> inclusion.
  ACPICA: Linux: Add stub implementation of ACPICA 64-bit mathematics.
  ACPICA: Linux: Add stub support for Linux specific variables and functions.
This commit is contained in:
Rafael J. Wysocki 2014-07-27 23:52:05 +02:00
commit 7e1c1a82f5
9 changed files with 55 additions and 29 deletions

View file

@ -19,8 +19,6 @@
/* Asm macros */
#ifdef CONFIG_ACPI
static inline int
ia64_acpi_acquire_global_lock(unsigned int *lock)
{
@ -51,6 +49,4 @@ ia64_acpi_release_global_lock(unsigned int *lock)
#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
((Acq) = ia64_acpi_release_global_lock(&facs->global_lock))
#endif
#endif /* _ASM_IA64_ACENV_H */

View file

@ -18,8 +18,6 @@
#define ACPI_FLUSH_CPU_CACHE() wbinvd()
#ifdef CONFIG_ACPI
int __acpi_acquire_global_lock(unsigned int *lock);
int __acpi_release_global_lock(unsigned int *lock);
@ -44,6 +42,4 @@ int __acpi_release_global_lock(unsigned int *lock);
: "=r"(n_hi), "=r"(n_lo) \
: "0"(n_hi), "1"(n_lo))
#endif
#endif /* _ASM_X86_ACENV_H */

View file

@ -2,7 +2,7 @@
# Makefile for ACPICA Core interpreter
#
ccflags-y := -Os
ccflags-y := -Os -DBUILDING_ACPICA
ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT
# use acpi.o to put all files here into acpi.o modparam namespace

View file

@ -477,9 +477,6 @@ static int __init acpi_bus_init_irq(void)
return 0;
}
u8 acpi_gbl_permanent_mmap;
void __init acpi_early_init(void)
{
acpi_status status;

View file

@ -53,8 +53,6 @@
#include <acpi/actbl.h>
#include <acpi/acbuffer.h>
extern u8 acpi_gbl_permanent_mmap;
/*****************************************************************************
*
* Macros used for ACPICA globals and configuration
@ -889,17 +887,25 @@ ACPI_APP_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1)
/*
* Divergences
*/
acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type);
ACPI_GLOBAL(u8, acpi_gbl_permanent_mmap);
acpi_status acpi_unload_table_id(acpi_owner_id id);
ACPI_EXTERNAL_RETURN_STATUS(acpi_status
acpi_get_id(acpi_handle object,
acpi_owner_id * out_type))
acpi_status
acpi_get_table_with_size(acpi_string signature,
u32 instance, struct acpi_table_header **out_table,
acpi_size *tbl_size);
ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_unload_table_id(acpi_owner_id id))
acpi_status
acpi_get_data_full(acpi_handle object, acpi_object_handler handler, void **data,
void (*callback)(void *));
ACPI_EXTERNAL_RETURN_STATUS(acpi_status
acpi_get_table_with_size(acpi_string signature,
u32 instance,
struct acpi_table_header
**out_table,
acpi_size *tbl_size))
ACPI_EXTERNAL_RETURN_STATUS(acpi_status
acpi_get_data_full(acpi_handle object,
acpi_object_handler handler,
void **data,
void (*callback)(void *)))
#endif /* __ACXFACE_H__ */

View file

@ -44,6 +44,16 @@
#ifndef __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 */
#define ACPI_USE_SYSTEM_CLIBRARY
@ -70,7 +80,9 @@
#ifdef EXPORT_ACPI_INTERFACES
#include <linux/export.h>
#endif
#ifdef CONFIG_ACPI
#include <asm/acenv.h>
#endif
#ifndef CONFIG_ACPI

View file

@ -46,6 +46,28 @@
#ifdef __KERNEL__
#ifndef ACPI_USE_NATIVE_DIVIDE
#ifndef ACPI_DIV_64_BY_32
#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
do { \
u64 (__n) = ((u64) n_hi) << 32 | (n_lo); \
(r32) = do_div ((__n), (d32)); \
(q32) = (u32) (__n); \
} while (0)
#endif
#ifndef ACPI_SHIFT_RIGHT_64
#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
do { \
(n_lo) >>= 1; \
(n_lo) |= (((n_hi) & 1) << 31); \
(n_hi) >>= 1; \
} while (0)
#endif
#endif
/*
* Overrides for in-kernel ACPICA
*/

View file

@ -29,17 +29,17 @@
#include <linux/ioport.h> /* for struct resource */
#include <linux/device.h>
#ifdef CONFIG_ACPI
#ifndef _LINUX
#define _LINUX
#endif
#include <acpi/acpi.h>
#ifdef CONFIG_ACPI
#include <linux/list.h>
#include <linux/mod_devicetable.h>
#include <linux/dynamic_debug.h>
#include <acpi/acpi.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <acpi/acpi_numa.h>

View file

@ -63,8 +63,6 @@
#include <linux/sfi.h>
#ifdef CONFIG_SFI
#include <acpi/acpi.h> /* FIXME: inclusion should be removed */
extern int sfi_acpi_table_parse(char *signature, char *oem_id,
char *oem_table_id,
int (*handler)(struct acpi_table_header *));
@ -78,7 +76,6 @@ static inline int __init acpi_sfi_table_parse(char *signature,
return sfi_acpi_table_parse(signature, NULL, NULL, handler);
}
#else /* !CONFIG_SFI */
static inline int sfi_acpi_table_parse(char *signature, char *oem_id,
char *oem_table_id,
int (*handler)(struct acpi_table_header *))