aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2014-05-12 03:46:38 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-05-27 12:13:07 -0400
commit07d8391433380fc72f999d99c554b1cfedea9778 (patch)
treee497e4aff2a785ab234c60bc6d89db4da2d8a72f /arch/x86/include/asm
parentd13bd5a602982cd7f697e39b13ac736c2c553af1 (diff)
ACPICA: Linux headers: Add <asm/acenv.h> to remove mis-ordered inclusion of <asm/acpi.h>
There is a mis-order inclusion for <asm/acpi.h>. As we will enforce including <linux/acpi.h> for all Linux ACPI users, we can find the inclusion order is as follows: <linux/acpi.h> <acpi/acpi.h> <acpi/platform/acenv.h> (acenv.h before including aclinux.h) <acpi/platform/aclinux.h> ........................................................................... (aclinux.h before including asm/acpi.h) <asm/acpi.h> @Redundant@ (ACPICA specific stuff) ........................................................................... ........................................................................... (Linux ACPI specific stuff) ? - - - - - - - - - - - - + (aclinux.h after including asm/acpi.h) @Invisible@ | (acenv.h after including aclinux.h) @Invisible@ | other ACPICA headers @Invisible@ | ............................................................|.............. <acpi/acpi_bus.h> | <acpi/acpi_drivers.h> | <asm/acpi.h> (Excluded) | (Linux ACPI specific stuff) ! <- - - - - - - - - - - - - + NOTE that, in ACPICA, <acpi/platform/acenv.h> is more like Kconfig generated <generated/autoconf.h> for Linux, it is meant to be included before including any ACPICA code. In the above figure, there is a question mark for "Linux ACPI specific stuff" in <asm/acpi.h> which should be included after including all other ACPICA header files. Thus they really need to be moved to the position marked with exclaimation mark or the definitions in the blocks marked with "@Invisible@" will be invisible to such architecture specific "Linux ACPI specific stuff" header blocks. This leaves 2 issues: 1. All environmental definitions in these blocks should have a copy in the area marked with "@Redundant@" if they are required by the "Linux ACPI specific stuff". 2. We cannot use any ACPICA defined types in <asm/acpi.h>. This patch splits architecture specific ACPICA stuff from <asm/acpi.h> to fix this issue. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r--arch/x86/include/asm/acenv.h65
-rw-r--r--arch/x86/include/asm/acpi.h45
2 files changed, 65 insertions, 45 deletions
diff --git a/arch/x86/include/asm/acenv.h b/arch/x86/include/asm/acenv.h
new file mode 100644
index 000000000000..6978584934f7
--- /dev/null
+++ b/arch/x86/include/asm/acenv.h
@@ -0,0 +1,65 @@
1/*
2 * X86 specific ACPICA environments and implementation
3 *
4 * Copyright (C) 2014, Intel Corporation
5 * Author: Lv Zheng <lv.zheng@intel.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef _ASM_X86_ACENV_H
13#define _ASM_X86_ACENV_H
14
15#include <asm/special_insns.h>
16
17#define COMPILER_DEPENDENT_INT64 long long
18#define COMPILER_DEPENDENT_UINT64 unsigned long long
19
20/*
21 * Calling conventions:
22 *
23 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
24 * ACPI_EXTERNAL_XFACE - External ACPI interfaces
25 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
26 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
27 */
28#define ACPI_SYSTEM_XFACE
29#define ACPI_EXTERNAL_XFACE
30#define ACPI_INTERNAL_XFACE
31#define ACPI_INTERNAL_VAR_XFACE
32
33/* Asm macros */
34
35#define ACPI_FLUSH_CPU_CACHE() wbinvd()
36
37#ifdef CONFIG_ACPI
38
39int __acpi_acquire_global_lock(unsigned int *lock);
40int __acpi_release_global_lock(unsigned int *lock);
41
42#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
43 ((Acq) = __acpi_acquire_global_lock(&facs->global_lock))
44
45#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
46 ((Acq) = __acpi_release_global_lock(&facs->global_lock))
47
48/*
49 * Math helper asm macros
50 */
51#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
52 asm("divl %2;" \
53 : "=a"(q32), "=d"(r32) \
54 : "r"(d32), \
55 "0"(n_lo), "1"(n_hi))
56
57#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
58 asm("shrl $1,%2 ;" \
59 "rcrl $1,%3;" \
60 : "=r"(n_hi), "=r"(n_lo) \
61 : "0"(n_hi), "1"(n_lo))
62
63#endif
64
65#endif /* _ASM_X86_ACENV_H */
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index c8c1e700c26e..e06225eda635 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -32,51 +32,6 @@
32#include <asm/mpspec.h> 32#include <asm/mpspec.h>
33#include <asm/realmode.h> 33#include <asm/realmode.h>
34 34
35#define COMPILER_DEPENDENT_INT64 long long
36#define COMPILER_DEPENDENT_UINT64 unsigned long long
37
38/*
39 * Calling conventions:
40 *
41 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
42 * ACPI_EXTERNAL_XFACE - External ACPI interfaces
43 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
44 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
45 */
46#define ACPI_SYSTEM_XFACE
47#define ACPI_EXTERNAL_XFACE
48#define ACPI_INTERNAL_XFACE
49#define ACPI_INTERNAL_VAR_XFACE
50
51/* Asm macros */
52
53#define ACPI_FLUSH_CPU_CACHE() wbinvd()
54
55int __acpi_acquire_global_lock(unsigned int *lock);
56int __acpi_release_global_lock(unsigned int *lock);
57
58#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
59 ((Acq) = __acpi_acquire_global_lock(&facs->global_lock))
60
61#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
62 ((Acq) = __acpi_release_global_lock(&facs->global_lock))
63
64/*
65 * Math helper asm macros
66 */
67#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
68 asm("divl %2;" \
69 : "=a"(q32), "=d"(r32) \
70 : "r"(d32), \
71 "0"(n_lo), "1"(n_hi))
72
73
74#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
75 asm("shrl $1,%2 ;" \
76 "rcrl $1,%3;" \
77 : "=r"(n_hi), "=r"(n_lo) \
78 : "0"(n_hi), "1"(n_lo))
79
80#ifdef CONFIG_ACPI 35#ifdef CONFIG_ACPI
81extern int acpi_lapic; 36extern int acpi_lapic;
82extern int acpi_ioapic; 37extern int acpi_ioapic;