aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/acenv.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/acenv.h')
-rw-r--r--arch/x86/include/asm/acenv.h65
1 files changed, 65 insertions, 0 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 */