Skip to content

Commit

Permalink
Merge branch 'acpi-headers'
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Rafael J. Wysocki committed Jul 27, 2014
2 parents 92a1840 + 417b4a7 commit 7e1c1a8
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 29 deletions.
4 changes: 0 additions & 4 deletions arch/ia64/include/asm/acenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

/* Asm macros */

#ifdef CONFIG_ACPI

static inline int
ia64_acpi_acquire_global_lock(unsigned int *lock)
{
Expand Down Expand Up @@ -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 */
4 changes: 0 additions & 4 deletions arch/x86/include/asm/acenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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 */
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
28 changes: 17 additions & 11 deletions include/acpi/acpixf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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_EXTERNAL_RETURN_STATUS(acpi_status
acpi_get_id(acpi_handle object,
acpi_owner_id * out_type))

acpi_status acpi_unload_table_id(acpi_owner_id id);
ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_unload_table_id(acpi_owner_id id))

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_table_with_size(acpi_string signature,
u32 instance,
struct acpi_table_header
**out_table,
acpi_size *tbl_size))

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_data_full(acpi_handle object,
acpi_object_handler handler,
void **data,
void (*callback)(void *)))

#endif /* __ACXFACE_H__ */
12 changes: 12 additions & 0 deletions include/acpi/platform/aclinux.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -70,7 +80,9 @@
#ifdef EXPORT_ACPI_INTERFACES
#include <linux/export.h>
#endif
#ifdef CONFIG_ACPI
#include <asm/acenv.h>
#endif

#ifndef CONFIG_ACPI

Expand Down
22 changes: 22 additions & 0 deletions include/acpi/platform/aclinuxex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
6 changes: 3 additions & 3 deletions include/linux/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 0 additions & 3 deletions include/linux/sfi_acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *));
Expand All @@ -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 *))
Expand Down

0 comments on commit 7e1c1a8

Please sign in to comment.