ACPICA: Fix some mis-ordered inclusions.
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
cover ACPICA: Fix some mis-ordered inclusions.
This patch fixes some mis-ordered inclusions for Linux resident ACPICA. There is no real issue in the Linux kernel, but this can help to cleanup the inclusions so that:
1. Redundant environment definitions can be removed from <asm/acpi.h> and <acpi/platform/aclinux.h>
2. Using ACPICA defined types in <asm/acpi.h> is possible.
Lv Zheng (4):
ACPICA: Add <acpi/platform/aclinuxxf.h> to remove mis-ordered
inclusion of <acpi/actypes.h> from <acpi/platform/aclinux.h>.
ACPICA: Add <asm/acenv.h> to remove mis-ordered inclusion of
<asm/acpi.h> from <acpi/platform/aclinux.h>.
ACPICA: Cleanup redudant definitions that already have defaults in
<acpi/platform/acenv.h>.
ACPICA: Remove deprecated _LINUX definitions for ACPICA.
arch/ia64/include/asm/acenv.h | 56 +++++++++++++++++ arch/ia64/include/asm/acpi.h | 50 --------------- arch/x86/include/asm/acenv.h | 49 +++++++++++++++ arch/x86/include/asm/acpi.h | 45 -------------- include/acpi/platform/aclinux.h | 104 ++++--------------------------- include/acpi/platform/aclinuxxf.h | 122 +++++++++++++++++++++++++++++++++++++ include/linux/acpi.h | 4 -- 7 files changed, 239 insertions(+), 191 deletions(-) create mode 100644 arch/ia64/include/asm/acenv.h create mode 100644 arch/x86/include/asm/acenv.h create mode 100644 include/acpi/platform/aclinuxxf.h
Signature · 1 line
1.7.10
PATCH 1/4 ACPICA: Add <acpi/platform/aclinuxxf.h> to remove mis-ordered inclusion of <acpi/actypes.h> from <acpi/platform/aclinux.h>.
Quoted 1 line
From ACPICA's perspective, <
acpi/actypes.h> should be included after
inclusion of <acpi/platform/acenv.h>. But currently in Linux, <acpi/platform/aclinux.h> included by <acpi/platform/acenv.h> has included <acpi/actypes.h> to find ACPICA types for inline functions.
This causes the following problem:
1. Redundant code in <asm/acpi.h> and <acpi/platform/aclinux.h>:
Linux must be careful to keep conditions for <acpi/actypes.h> inclusion consistent with the conditions for <acpi/platform/aclinux.h> inclusion. Which finally leads to the issue that we have to keep many useless macro definitions in <acpi/platform/aclinux.h> or <asm/acpi.h>.
Such conditions include:
COMPILER_DEPENDENT_UINT64
COMPILER_DEPENDENT_INT64
ACPI_INLINE
ACPI_SYSTEM_XFACE
ACPI_EXTERNAL_XFACE
ACPI_INTERNAL_XFACE
ACPI_INTERNAL_VAR_XFACE
ACPI_MUTEX_TYPE
DEBUGGER_THREADING
ACPI_ACQUIRE_GLOBAL_LOCK
ACPI_RELEASE_GLOBAL_LOCK
ACPI_FLUSH_CPU_CACHE
They have default implementations in <include/acpi/platform/acenv.h> while Linux need to keep a copy in <asm/acpi.h> to avoid build errors. Typical Linux build error if we deletes COMPILER_DEPENDENT_x and ACPI_x_XFACE definitions from asm/acpi.h:
CC init/main.o
In file included from include/acpi/platform/aclinux.h:293:0,
from include/acpi/platform/acenv.h:149,
from include/acpi/acpi.h:56,
from include/linux/acpi.h:41,
from init/main.c:27:
include/acpi/actypes.h:129:1: error: unknown type name 'COMPILER_DEPENDENT_UINT64' include/acpi/actypes.h:130:1: error: unknown type name 'COMPILER_DEPENDENT_INT64' In file included from include/acpi/platform/aclinux.h:293:0,
from include/acpi/platform/acenv.h:149,
from include/acpi/acpi.h:56,
from include/linux/acpi.h:41,
from init/main.c:27:
include/acpi/actypes.h:1025:21: error: expected ')' before '*' token include/acpi/actypes.h:1028:21: error: expected ')' before '*' token In file included from include/acpi/acpi.h:63:0,
from include/linux/acpi.h:41,
from init/main.c:27:
include/acpi/acpiosxf.h:240:7: error: unknown type name 'acpi_osd_handler' include/acpi/acpiosxf.h:247:6: error: unknown type name 'acpi_osd_handler' include/acpi/acpiosxf.h:260:3: error: unknown type name 'acpi_osd_exec_callback'
This patch introduces <acpi/platform/aclinuxxf.h> to fix this issue by splitting conditions and declarations (most of them are inline functions) into 2 header files so that the wrong inclusion of <acpi/actypes.h> can be removed from <acpi/platform/aclinux.h>.
--- include/acpi/platform/aclinux.h | 101 ++++-------------------------- include/acpi/platform/aclinuxxf.h | 122 +++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 90 deletions(-) create mode 100644 include/acpi/platform/aclinuxxf.h
include/acpi/platform/aclinux.h +11 -90
@@ -130,73 +130,6 @@#ifdef __KERNEL__ -/* -* FIXME: Inclusion of actypes.h -* Linux kernel need this before defining inline OSL interfaces as -* actypes.h need to be included to find ACPICA type definitions. -* Since from ACPICA's perspective, the actypes.h should be included after -* acenv.h (aclinux.h), this leads to a inclusion mis-ordering issue. -*/ -#include <acpi/actypes.h> - -/* -* Overrides for in-kernel ACPICA -*/ -acpi_status __init acpi_os_initialize (void ); -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize - -acpi_status acpi_os_terminate (void ); -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate - -/* -* Memory allocation/deallocation -*/ - -/* -* The irqs_disabled() check is for resume from RAM. -* Interrupts are off during resume, just like they are for boot. -* However, boot has (system_state != SYSTEM_RUNNING) -* to quiet __might_sleep() in kmalloc() and resume does not. -*/ -static inline void *acpi_os_allocate (acpi_size size) -{ -return kmalloc (size,irqs_disabled ()?GFP_ATOMIC :GFP_KERNEL ); -} - -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate - -/* Use native linux version of acpi_os_allocate_zeroed */ - -static inline void *acpi_os_allocate_zeroed (acpi_size size) -{ -return kzalloc (size,irqs_disabled ()?GFP_ATOMIC :GFP_KERNEL ); -} - -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate_zeroed -#define USE_NATIVE_ALLOCATE_ZEROED - -static inline void acpi_os_free (void *memory) -{ -kfree (memory); -} - -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_free - -static inline void *acpi_os_acquire_object (acpi_cache_t * cache) -{ -return kmem_cache_zalloc (cache, -irqs_disabled ()?GFP_ATOMIC :GFP_KERNEL ); -} - -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_object - -static inline acpi_thread_id acpi_os_get_thread_id (void ) -{ -return (acpi_thread_id ) (unsigned long )current; -} - -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id -#ifndef CONFIG_PREEMPT /*
@@ -212,27 +145,18 @@ static inline acpi_thread_id acpi_os_get_thread_id(void)#endif /* -* When lockdep is enabled, the spin_lock_init() macro stringifies it's -* argument and uses that as a name for the lock in debugging. -* By executing spin_lock_init() in a macro the key changes from "lock" for -* all locks to the name of the argument of acpi_os_create_lock(), which -* prevents lockdep from reporting false positives for ACPICA locks. +* Overrides for in-kernel ACPICA */ -#define acpi_os_create_lock (__handle) \ - ({ \ - spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \ - if (lock) { \ - *(__handle) = lock; \ - spin_lock_init(*(__handle)); \ - } \ - lock ? AE_OK : AE_NO_MEMORY; \ - }) +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate_zeroed +#define USE_NATIVE_ALLOCATE_ZEROED +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_free +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_object +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_lock - -void __iomem *acpi_os_map_memory (acpi_physical_address where,acpi_size length);#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_map_memory - -void acpi_os_unmap_memory (void __iomem * logical_address,acpi_size size);#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_unmap_memory/*
@@ -253,11 +177,8 @@ void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_next_filename#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_directory -/* -* OSL interfaces added by Linux -*/ -void early_acpi_os_unmap_memory (void __iomem * virt,acpi_size size); -#endif /* __KERNEL__ */ +#define ACPI_NATIVE_INTERFACE_HEADER <acpi/platform/aclinuxxf.h> +#endif /* __ACLINUX_H__ */
include/acpi/platform/aclinuxxf.h new file +122 -0
122 lines not on this page · raw message
Signature · 1 line
1.7.10
Re: [PATCH 1/4] ACPICA: Add <acpi/platform/aclinuxxf.h> to remove mis-ordered inclusion of <acpi/actypes.h> from <acpi/platform/aclinux.h>.
Quoted 179 lines · Lv Zheng
From ACPICA's perspective, <
acpi/actypes.h> should be included after inclusion of <acpi/platform/acenv.h>. But currently in Linux, <acpi/platform/aclinux.h> included by <acpi/platform/acenv.h> has included <acpi/actypes.h> to find ACPICA types for inline functions.This causes the following problem:
1. Redundant code in <asm/acpi.h> and <acpi/platform/aclinux.h>:
Linux must be careful to keep conditions for <acpi/actypes.h> inclusion consistent with the conditions for <acpi/platform/aclinux.h> inclusion. Which finally leads to the issue that we have to keep many useless macro definitions in <acpi/platform/aclinux.h> or <asm/acpi.h>.
Such conditions include:
COMPILER_DEPENDENT_UINT64
COMPILER_DEPENDENT_INT64
ACPI_INLINE
ACPI_SYSTEM_XFACE
ACPI_EXTERNAL_XFACE
ACPI_INTERNAL_XFACE
ACPI_INTERNAL_VAR_XFACE
ACPI_MUTEX_TYPE
DEBUGGER_THREADING
ACPI_ACQUIRE_GLOBAL_LOCK
ACPI_RELEASE_GLOBAL_LOCK
ACPI_FLUSH_CPU_CACHE
They have default implementations in <include/acpi/platform/acenv.h> while Linux need to keep a copy in <asm/acpi.h> to avoid build errors. Typical Linux build error if we deletesCOMPILER_DEPENDENT_xandACPI_x_XFACEdefinitions fromasm/acpi.h:
CCinit/main.o
In file included frominclude/acpi/platform/aclinux.h:293:0,
frominclude/acpi/platform/acenv.h:149,
frominclude/acpi/acpi.h:56,
frominclude/linux/acpi.h:41,
frominit/main.c:27:
include/acpi/actypes.h:129:1: error: unknown type name 'COMPILER_DEPENDENT_UINT64'include/acpi/actypes.h:130:1: error: unknown type name 'COMPILER_DEPENDENT_INT64' In file included frominclude/acpi/platform/aclinux.h:293:0,
frominclude/acpi/platform/acenv.h:149,
frominclude/acpi/acpi.h:56,
frominclude/linux/acpi.h:41,
frominit/main.c:27:
include/acpi/actypes.h:1025:21: error: expected ')' before '*' tokeninclude/acpi/actypes.h:1028:21: error: expected ')' before '*' token In file included frominclude/acpi/acpi.h:63:0,
frominclude/linux/acpi.h:41,
frominit/main.c:27:
include/acpi/acpiosxf.h:240:7: error: unknown type name 'acpi_osd_handler'include/acpi/acpiosxf.h:247:6: error: unknown type name 'acpi_osd_handler'include/acpi/acpiosxf.h:260:3: error: unknown type name 'acpi_osd_exec_callback'This patch introduces <
acpi/platform/aclinuxxf.h> to fix this issue by splitting conditions and declarations (most of them are inline functions) into 2 header files so that the wrong inclusion of <acpi/actypes.h> can be removed from <acpi/platform/aclinux.h>.Signed-off-by Lv Zheng <[email protected]>--- include/acpi/platform/aclinux.h | 101 ++++-------------------------- include/acpi/platform/aclinuxxf.h | 122 +++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 90 deletions(-) create mode 100644 include/acpi/platform/aclinuxxf.hinclude/acpi/platform/aclinux.h +9
-85@@ -130,73 +130,6 @@#ifdef __KERNEL__ -/* -* FIXME: Inclusion of actypes.h -* Linux kernel need this before defining inline OSL interfaces as -* actypes.h need to be included to find ACPICA type definitions. -* Since from ACPICA's perspective, the actypes.h should be included after -* acenv.h (aclinux.h), this leads to a inclusion mis-ordering issue. -*/ -#include <acpi/actypes.h> - -/* -* Overrides for in-kernel ACPICA -*/ -acpi_status __init acpi_os_initialize (void ); -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize - -acpi_status acpi_os_terminate (void ); -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate - -/* -* Memory allocation/deallocation -*/ - -/* -* The irqs_disabled() check is for resume from RAM. -* Interrupts are off during resume, just like they are for boot. -* However, boot has (system_state != SYSTEM_RUNNING) -* to quiet __might_sleep() in kmalloc() and resume does not. -*/ -static inline void *acpi_os_allocate (acpi_size size) -{ -return kmalloc (size,irqs_disabled ()?GFP_ATOMIC :GFP_KERNEL ); -} - -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate - -/* Use native linux version of acpi_os_allocate_zeroed */ - -static inline void *acpi_os_allocate_zeroed (acpi_size size) -{ -return kzalloc (size,irqs_disabled ()?GFP_ATOMIC :GFP_KERNEL ); -} - -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate_zeroed -#define USE_NATIVE_ALLOCATE_ZEROED - -static inline void acpi_os_free (void *memory) -{ -kfree (memory); -} - -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_free - -static inline void *acpi_os_acquire_object (acpi_cache_t * cache) -{ -return kmem_cache_zalloc (cache, -irqs_disabled ()?GFP_ATOMIC :GFP_KERNEL ); -} - -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_object - -static inline acpi_thread_id acpi_os_get_thread_id (void ) -{ -return (acpi_thread_id ) (unsigned long )current; -} - -#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id -#ifndef CONFIG_PREEMPT /* @@ -212,27 +145,18 @@ static inline acpi_thread_id acpi_os_get_thread_id(void)#endif /* -* When lockdep is enabled, the spin_lock_init() macro stringifies it's -* argument and uses that as a name for the lock in debugging. -* By executing spin_lock_init() in a macro the key changes from "lock" for -* all locks to the name of the argument of acpi_os_create_lock(), which -* prevents lockdep from reporting false positives for ACPICA locks. +* Overrides for in-kernel ACPICA */ -#define acpi_os_create_lock (__handle) \ - ({ \ - spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \ - if (lock) { \ - *(__handle) = lock; \ - spin_lock_init(*(__handle)); \ - } \ - lock ? AE_OK : AE_NO_MEMORY; \ - }) +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate_zeroed +#define USE_NATIVE_ALLOCATE_ZEROED +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_free +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_object +#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_lock - -void __iomem *acpi_os_map_memory (acpi_physical_address where,acpi_size length);#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_map_memory - -void acpi_os_unmap_memory (void __iomem * logical_address,acpi_size size);#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_unmap_memory/* @@ -253,11 +177,8 @@ void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_next_filename
include/acpi/platform/aclinux.h void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); · line 182
Quoted 10 lines
include/acpi/platform/aclinux.h +1
-5#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_directory -/* -* OSL interfaces added by Linux -*/ -void early_acpi_os_unmap_memory (void __iomem * virt,acpi_size size); -#endif /* __KERNEL__ */ +#define ACPI_NATIVE_INTERFACE_HEADER <acpi/platform/aclinuxxf.h>
This is not good.
We don't do things like this in the kernel, because they are confusing and hard to debug if necessary, so please find a different way to make this work.
And the name aclinuxxf.h is not one of my favourite.
Thanks!
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
RE: [PATCH 1/4] ACPICA: Add <acpi/platform/aclinuxxf.h> to remove mis-ordered inclusion of <acpi/actypes.h> from <acpi/platform/aclinux.h>.
Hi,
<skip>
Quoted 6 lines
Quoted 1 line
+#define
ACPI_NATIVE_INTERFACE_HEADER<acpi/platform/aclinuxxf.h>This is not good.
We don't do things like this in the kernel, because they are confusing and hard to debug if necessary, so please find a different way to make this work.
I use this extra header file to collect:
1. static inline OSL functions
2. divergences of prototypes that haven't been back ported to ACPICA. This file is useful for ACPICA release automation.
There are the following concerns that lead to the use of this solution:
1. for this extra header file itself
A. The new header file is OSPM specific, thus it needn't be upstreamed to ACPICA;
B. Since it needn't be upstreamed to ACPICA, ACPICA needn't determine the name of this extra header;
C. It has to be the last file included by <acpi/acpi.h>.2. for the file that includes this extra header file
A. Currently there is no OSPM specific code in <acpi/acpi.h>.
Thus I use a macro so that there is still no OSPM specific code in <acpi/acpi.h> and the name of the extra header can be determined by OSPM.
If you want another solution, is the following acceptable?
1. In <acpi/platform/aclinux.h>
#define ACPI_INCLUDE_EXTRA_NATIVE_HEADER 1
2. In <acpi/acpi.h> <- this is an ACPICA header file,
#ifdef ACPI_INCLUDE_EXTRA_NATIVE_HEADER
#include <acpi/platform/acextra.h>
#endifNote that in this solution, the name of the extra header file will be determined by ACPICA.
Quoted 1 line
And the name
aclinuxxf.his not one of my favourite.
Since this file needn't be upstreamed into ACPICA, could you help to determine it if the acextra.h was still not acceptable?
Thanks and best regards
-Lv
Quoted 6 lines
Thanks!
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
Re: [PATCH 1/4] ACPICA: Add <acpi/platform/aclinuxxf.h> to remove mis-ordered inclusion of <acpi/actypes.h> from <acpi/platform/aclinux.h>.
Quoted 4 lines · Lv
Hi,
<skip>
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
+#define
ACPI_NATIVE_INTERFACE_HEADER<acpi/platform/aclinuxxf.h>This is not good.
We don't do things like this in the kernel, because they are confusing and hard to debug if necessary, so please find a different way to make this work.
I use this extra header file to collect:
I was not talking about the new header, which is basically OK, but about the #define above, which is just too confusing to live.
Please use header file paths directly with #include.
Quoted 13 lines
1. static inline OSL functions
2. divergences of prototypes that haven't been back ported to ACPICA. This file is useful for ACPICA release automation.There are the following concerns that lead to the use of this solution:
1. for this extra header file itselfA. The new header file is OSPM specific, thus it needn't be upstreamed to ACPICA; B. Since it needn't be upstreamed to ACPICA, ACPICA needn't determine the name of this extra header; C. It has to be the last file included by <acpi/acpi.h>.2. for the file that includes this extra header file
A. Currently there is no OSPM specific code in <acpi/acpi.h>.
Thus I use a macro so that there is still no OSPM specific code in <acpi/acpi.h> and the name of the extra header can be determined by OSPM.
Quoted 8 lines
If you want another solution, is the following acceptable?
1. In <acpi/platform/aclinux.h>#define ACPI_INCLUDE_EXTRA_NATIVE_HEADER 1 2. In <acpi/acpi.h> <- this is an ACPICA header file, #ifdef ACPI_INCLUDE_EXTRA_NATIVE_HEADER #include <acpi/platform/acextra.h> #endifNote that in this solution, the name of the extra header file will be determined by ACPICA.
I think I see what you're trying to do now. And I see that this ACPI_NATIVE_INTERFACE_HEADER thing is already there in the Linus' tree which is not good at all.
I probably would create an extra ACPICA header, something like <acpios_opt.h>, that would be empty for all hosts except for Linux and that would contain the stuff you want to put into acextra.h in Linux.
That would be clean enough I suppose?
Rafael
RE: [PATCH 1/4] ACPICA: Add <acpi/platform/aclinuxxf.h> to remove mis-ordered inclusion of <acpi/actypes.h> from <acpi/platform/aclinux.h>.
Hi, Rafael
Quoted 15 lines
From: Rafael J. Wysocki [mailto:[email protected]]
Sent: Tuesday, April 22, 2014 7:16 PMQuoted 11 lines · Lv
Hi,
<skip>
Quoted 6 lines
Quoted 1 line
+#define
ACPI_NATIVE_INTERFACE_HEADER<acpi/platform/aclinuxxf.h>This is not good.
We don't do things like this in the kernel, because they are confusing and hard to debug if necessary, so please find a different way to make this work.
Quoted 6 lines
Quoted 1 line
I use this extra header file to collect:
I was not talking about the new header, which is basically OK, but about the #define above, which is just too confusing to live.
Please use header file paths directly with #include.
OK.
Quoted 24 lines
Quoted 5 lines
1. static inline OSL functions
2. divergences of prototypes that haven't been back ported to ACPICA. This file is useful for ACPICA release automation.Quoted 8 lines
There are the following concerns that lead to the use of this solution:
1. for this extra header file itselfA. The new header file is OSPM specific, thus it needn't be upstreamed to ACPICA; B. Since it needn't be upstreamed to ACPICA, ACPICA needn't determine the name of this extra header; C. It has to be the last file included by <acpi/acpi.h>.2. for the file that includes this extra header file
A. Currently there is no OSPM specific code in <acpi/acpi.h>.
Thus I use a macro so that there is still no OSPM specific code in <acpi/acpi.h> and the name of the extra header can be determinedby OSPM.
Quoted 9 lines
If you want another solution, is the following acceptable?
1. In <acpi/platform/aclinux.h>#define ACPI_INCLUDE_EXTRA_NATIVE_HEADER 1 2. In <acpi/acpi.h> <- this is an ACPICA header file, #ifdef ACPI_INCLUDE_EXTRA_NATIVE_HEADER #include <acpi/platform/acextra.h> #endifNote that in this solution, the name of the extra header file will be determined by ACPICA.
Quoted 8 lines
I think I see what you're trying to do now. And I see that this
ACPI_NATIVE_INTERFACE_HEADERthing is already there in the Linus' tree which is not good at all.I probably would create an extra ACPICA header, something like <
acpios_opt.h>, that would be empty for all hosts except for Linux and that would contain the stuff you want to put intoacextra.hin Linux.That would be clean enough I suppose?
Yes, it is clear.
Thanks for the helping.
I'll update this patch and re-send this series.
Best regards
-Lv
PATCH 2/4 ACPICA: Add <asm/acenv.h> to remove mis-ordered inclusion of <asm/acpi.h> from <acpi/platform/aclinux.h>.
In reply to Lv ZhengThere 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.
--- arch/ia64/include/asm/acenv.h | 71 +++++++++++++++++++++++++++++++++++++++ arch/ia64/include/asm/acpi.h | 50 --------------------------- arch/x86/include/asm/acenv.h | 65 +++++++++++++++++++++++++++++++++++ arch/x86/include/asm/acpi.h | 45 ------------------------- include/acpi/platform/aclinux.h | 2 +- 5 files changed, 137 insertions(+), 96 deletions(-) create mode 100644 arch/ia64/include/asm/acenv.h create mode 100644 arch/x86/include/asm/acenv.h
arch/ia64/include/asm/acenv.h new file +71 -0
@@ -0,0 +1,71 @@ +/* +* IA64 specific ACPICA environments and implementation +* +* Copyright (C) 2014, Intel Corporation +* Author: Lv Zheng <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_IA64_ACENV_H +#define _ASM_IA64_ACENV_H + +#include <asm/intrinsics.h> + +#define COMPILER_DEPENDENT_INT64 long +#define COMPILER_DEPENDENT_UINT64 unsigned long + +/* +* Calling conventions: +* +* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) +* ACPI_EXTERNAL_XFACE - External ACPI interfaces +* ACPI_INTERNAL_XFACE - Internal ACPI interfaces +* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces +*/ +#define ACPI_SYSTEM_XFACE +#define ACPI_EXTERNAL_XFACE +#define ACPI_INTERNAL_XFACE +#define ACPI_INTERNAL_VAR_XFACE + +/* Asm macros */ + +#define ACPI_FLUSH_CPU_CACHE () + +#ifdef CONFIG_ACPI + +static inline int +ia64_acpi_acquire_global_lock (unsigned int *lock) +{ +unsigned int old, new, val; +do { + old = *lock; + new = (((old & ~0x3 ) +2 ) + ((old >>1 ) &0x1 )); + val =ia64_cmpxchg4_acq (lock, new, old); + }while (unlikely (val != old)); +return (new <3 ) ?-1 :0 ; +} + +static inline int +ia64_acpi_release_global_lock (unsigned int *lock) +{ +unsigned int old, new, val; +do { + old = *lock; + new = old & ~0x3 ; + val =ia64_cmpxchg4_acq (lock, new, old); + }while (unlikely (val != old)); +return old &0x1 ; +} + +#define ACPI_ACQUIRE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock)) + +#define ACPI_RELEASE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) + +#endif + +#endif /* _ASM_IA64_ACENV_H */
arch/ia64/include/asm/acpi.h +0 -50
56 lines not on this page · raw message
arch/x86/include/asm/acenv.h new file +65 -0
65 lines not on this page · raw message
arch/x86/include/asm/acpi.h +0 -45
51 lines not on this page · raw message
include/acpi/platform/aclinux.h +1 -1
@@ -71,7 +71,7 @@#ifdef EXPORT_ACPI_INTERFACES #include <linux/export.h> #endif -#include <asm/acpi.h> +#include <asm/acenv.h> /* Host-dependent types and defines for in-kernel ACPICA */
Signature · 1 line
1.7.10
PATCH 3/4 ACPICA: Cleanup redudant definitions that already have defaults in <acpi/platform/acenv.h>.
In reply to Lv ZhengSince mis-order issues have been solved, we can cleanup redundant definitions that already have defaults in <acpi/platform/acenv.h>.
This patch removes redudant environments for __KERNEL__ surrounded code.
--- arch/ia64/include/asm/acenv.h | 15 --------------- arch/x86/include/asm/acenv.h | 16 ---------------- include/acpi/platform/aclinux.h | 1 - 3 files changed, 32 deletions(-)
arch/ia64/include/asm/acenv.h +0 -15
@@ -17,23 +17,8 @@#define COMPILER_DEPENDENT_INT64 long#define COMPILER_DEPENDENT_UINT64 unsigned long -/* -* Calling conventions: -* -* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) -* ACPI_EXTERNAL_XFACE - External ACPI interfaces -* ACPI_INTERNAL_XFACE - Internal ACPI interfaces -* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces -*/ -#define ACPI_SYSTEM_XFACE -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE -/* Asm macros */ -#define ACPI_FLUSH_CPU_CACHE () -#ifdef CONFIG_ACPI static inline int
arch/x86/include/asm/acenv.h +0 -16
@@ -14,22 +14,6 @@#include <asm/special_insns.h> -#define COMPILER_DEPENDENT_INT64 long long -#define COMPILER_DEPENDENT_UINT64 unsigned long long - -/* -* Calling conventions: -* -* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) -* ACPI_EXTERNAL_XFACE - External ACPI interfaces -* ACPI_INTERNAL_XFACE - Internal ACPI interfaces -* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces -*/ -#define ACPI_SYSTEM_XFACE -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE -/* Asm macros */ #define ACPI_FLUSH_CPU_CACHE () wbinvd()
include/acpi/platform/aclinux.h +0 -1
@@ -48,7 +48,6 @@#define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_DO_WHILE_0 -#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE#ifdef __KERNEL__
Signature · 1 line
1.7.10
PATCH 4/4 ACPICA: Remove deprecated _LINUX definitions for ACPICA.
In reply to Lv ZhengThere are _LINUX defined so that when Linux kernel is compiled using broken compilers that having not __linux__ defined can still include <acpi/platform/aclinux.h> from <acpi/platform/acenv.h>.
This behavior is deprecated as all drivers/acpi/acpica files are compiled without including <linux/acpi.h>, thus without _LINUX defined. As there is no issues encountered when we compile ACPICA code without _LINUX defined, it is OK to remove _LINUX from <linux/acpi.h> now.
--- include/linux/acpi.h | 4 ---- 1 file changed, 4 deletions(-)
include/linux/acpi.h +0 -4
@@ -31,10 +31,6 @@#ifdef CONFIG_ACPI -#ifndef _LINUX -#define _LINUX -#endif -#include <linux/list.h> #include <linux/mod_devicetable.h>
Signature · 1 line
1.7.10
v2 cover ACPICA: Fix some mis-ordered inclusions.
In reply to Lv ZhengThis patch fixes some mis-ordered inclusions for Linux resident ACPICA.
There is no real issue in the Linux kernel, but this can help to cleanup the code so that (benefits):
1. Redundant environment definitions can be removed from <asm/acpi.h> and <acpi/platform/aclinux.h>.
2. Lift a burden off the ACPICA release automation - copying default ACPICA environment setting to all <asm/acpi.h> file each time a new environment is introduced just in order to avoid build errors.
3. The wrong <acpi/actypes.h> inclusion can be removed from <acpi/platform/aclinux.h>.
4. Using ACPICA defined types in <asm/acpi.h> is possible.
5. Using "static inline" to define ACPICA OSL functions is still possible and won't cause build errors any longer.
6. All non back ported prototypes are collected in a single file.
The patch set has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + default + COFNIG_ACPI=y
2. i386 + default + COFNIG_ACPI=n
3. x86_64 + default + COFNIG_ACPI=y
4. x86_64 + default + COFNIG_ACPI=n
Boot tests are performed as follows:
1. i386 + default + COFNIG_ACPI=y
2. x86_64 + default + COFNIG_ACPI=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All drivers/acpi configurations
All platform drivers
All ACPI drivers
4 DRM drivers that implement ACPI opregion
All buses with ACPI bindings
All cpufreq configurations
All xen configurations
All ACPI tabln drivers
Lv Zheng (5):
ACPICA: OSL: Add direct inclusion of extra header.
ACPICA: Add <acpi/acpi_opt.h> to remove mis-ordered inclusion of
<acpi/actypes.h> from <acpi/platform/aclinux.h>.
ACPICA: Add <asm/acenv.h> to remove mis-ordered inclusion of
<asm/acpi.h> from <acpi/platform/aclinux.h>.
ACPICA: Cleanup redudant definitions that already have defaults in
<acpi/platform/acenv.h>.
ACPICA: Remove deprecated _LINUX definitions for ACPICA.
arch/ia64/include/asm/acenv.h | 56 +++++++++++++++++++++ arch/ia64/include/asm/acpi.h | 50 ------------------- arch/x86/include/asm/acenv.h | 49 ++++++++++++++++++ arch/x86/include/asm/acpi.h | 45 ----------------- include/acpi/acpi.h | 4 +- include/acpi/acpi_opt.h | 90 +++++++++++++++++++++++++++++++++ include/acpi/platform/aclinux.h | 104 +++++---------------------------------- include/linux/acpi.h | 4 -- 8 files changed, 209 insertions(+), 193 deletions(-) create mode 100644 arch/ia64/include/asm/acenv.h create mode 100644 arch/x86/include/asm/acenv.h create mode 100644 include/acpi/acpi_opt.h
Signature · 1 line
1.7.10
PATCH v2 1/5 ACPICA: OSL: Add direct inclusion of extra header.
This is a linuxized result of an ACPICA commit to upgrade the extra header mechanism.
This patch enhances the extra header solution to allow Linux to use ACPI_USE_NATIVE_INTERFACE_HEADER and the file name can be automatically replaced during ACPICA release process. Using this way, the rest of the ACPICA users needn't know the name of the extra header file. Lv Zheng.
--- include/acpi/acpi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/acpi/acpi.h +2 -2
@@ -62,8 +62,8 @@#include <acpi/acrestyp.h> /* Resource Descriptor structs */ #include <acpi/acpiosxf.h> /* OSL interfaces (ACPICA-to-OS) */ #include <acpi/acpixf.h> /* ACPI core subsystem external interfaces */ -#ifdef ACPI_NATIVE_INTERFACE_HEADER -#include ACPI_NATIVE_INTERFACE_HEADER +#ifdef ACPI_USE_NATIVE_INTERFACE_HEADER +#include <acpi/acpi_opt.h> #endif #endif /* __ACPI_H__ */
Signature · 1 line
1.7.10
Re: [PATCH v2 1/5] ACPICA: OSL: Add direct inclusion of extra header.
Quoted 18 lines · Lv Zheng
This is a linuxized result of an ACPICA commit to upgrade the extra header mechanism.
This patch enhances the extra header solution to allow Linux to use
ACPI_USE_NATIVE_INTERFACE_HEADERand the file name can be automatically replaced during ACPICA release process. Using this way, the rest of the ACPICA users needn't know the name of the extra header file. Lv Zheng.Signed-off-by Lv Zheng <[email protected]>--- include/acpi/acpi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)include/acpi/acpi.h +0
-0
include/acpi/acpi.h line 69
Quoted 10 lines
include/acpi/acpi.h +2
-2@@ -62,8 +62,8 @@#include <acpi/acrestyp.h> /* Resource Descriptor structs */ #include <acpi/acpiosxf.h> /* OSL interfaces (ACPICA-to-OS) */ #include <acpi/acpixf.h> /* ACPI core subsystem external interfaces */ -#ifdef ACPI_NATIVE_INTERFACE_HEADER -#include ACPI_NATIVE_INTERFACE_HEADER +#ifdef ACPI_USE_NATIVE_INTERFACE_HEADER +#include <acpi/acpi_opt.h> #endif #endif /* __ACPI_H__ */
Well, I still think there's a better way.
Introduce <acpi/platform/acenvex.h> into ACPICA and put this into it:
#if defined(_LINUX) || defined(__linux__)
#include <acpi/platform/aclinuxex.h>
#endif
and then move stuff you want in acpi/acpi_opt.h into acpi/platform/aclinuxex.h.
Then, you'll have in acpi.h:
#include <acpi/acrestyp.h> /* Resource Descriptor structs */
#include <acpi/acpiosxf.h> /* OSL interfaces (ACPICA-to-OS) */
#include <acpi/acpixf.h> /* ACPI core subsystem external interfaces */
#include <acpi/platform/acenvex.h> /* Extra environment-specific items */
That should work I suppose, shouldn't it?
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
RE: [PATCH v2 1/5] ACPICA: OSL: Add direct inclusion of extra header.
Hi, Rafael
Quoted 46 lines
From: Rafael J. Wysocki [mailto:[email protected]]
Sent: Monday, April 28, 2014 5:34 AMQuoted 18 lines · Lv Zheng
This is a linuxized result of an ACPICA commit to upgrade the extra header mechanism.
This patch enhances the extra header solution to allow Linux to use
ACPI_USE_NATIVE_INTERFACE_HEADERand the file name can be automatically replaced during ACPICA release process. Using this way, the rest of the ACPICA users needn't know the name of the extra header file. Lv Zheng.Signed-off-by Lv Zheng <[email protected]>--- include/acpi/acpi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)include/acpi/acpi.h +0
-0include/acpi/acpi.h line 69
Quoted 10 lines
include/acpi/acpi.h +2
-2@@ -62,8 +62,8 @@#include <acpi/acrestyp.h> /* Resource Descriptor structs */ #include <acpi/acpiosxf.h> /* OSL interfaces (ACPICA-to-OS) */ #include <acpi/acpixf.h> /* ACPI core subsystem external interfaces */ -#ifdef ACPI_NATIVE_INTERFACE_HEADER -#include ACPI_NATIVE_INTERFACE_HEADER +#ifdef ACPI_USE_NATIVE_INTERFACE_HEADER +#include <acpi/acpi_opt.h> #endif #endif /* __ACPI_H__ */ Well, I still think there's a better way.
Introduce <
acpi/platform/acenvex.h> into ACPICA and put this into it:#if
defined(_LINUX)||defined(__linux__)
#include <acpi/platform/aclinuxex.h>#endif
and then move stuff you want in
acpi/acpi_opt.hintoacpi/platform/aclinuxex.h.Then, you'll have in
acpi.h:
Quoted 7 lines
#include <
acpi/acrestyp.h> /* Resource Descriptor structs */
#include <acpi/acpiosxf.h> /* OSL interfaces (ACPICA-to-OS) */
#include <acpi/acpixf.h> /* ACPI core subsystem external interfaces */
#include <acpi/platform/acenvex.h> /* Extra environment-specific items */That should work I suppose, shouldn't it?
I think this should work.
I'll modify this patch according the above suggestion.
Thanks and best regards
-Lv
Quoted 3 lines
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
PATCH v2 2/5 ACPICA: Add <acpi/acpi_opt.h> to remove mis-ordered inclusion of <acpi/actypes.h> from <acpi/platform/aclinux.h>.
In reply to Lv ZhengQuoted 1 line
From ACPICA's perspective, <
acpi/actypes.h> should be included after
inclusion of <acpi/platform/acenv.h>. But currently in Linux, <acpi/platform/aclinux.h> included by <acpi/platform/acenv.h> has included <acpi/actypes.h> to find ACPICA types for inline functions.
This causes the following problem:
1. Redundant code in <asm/acpi.h> and <acpi/platform/aclinux.h>:
Linux must be careful to keep conditions for <acpi/actypes.h> inclusion consistent with the conditions for <acpi/platform/aclinux.h> inclusion. Which finally leads to the issue that we have to keep many useless macro definitions in <acpi/platform/aclinux.h> or <asm/acpi.h>.
Such conditions include:
COMPILER_DEPENDENT_UINT64
COMPILER_DEPENDENT_INT64
ACPI_INLINE
ACPI_SYSTEM_XFACE
ACPI_EXTERNAL_XFACE
ACPI_INTERNAL_XFACE
ACPI_INTERNAL_VAR_XFACE
ACPI_MUTEX_TYPE
DEBUGGER_THREADING
ACPI_ACQUIRE_GLOBAL_LOCK
ACPI_RELEASE_GLOBAL_LOCK
ACPI_FLUSH_CPU_CACHE
They have default implementations in <include/acpi/platform/acenv.h> while Linux need to keep a copy in <asm/acpi.h> to avoid build errors. Typical Linux build error if we deletes COMPILER_DEPENDENT_x and ACPI_x_XFACE definitions from asm/acpi.h:
CC init/main.o
In file included from include/acpi/platform/aclinux.h:293:0,
from include/acpi/platform/acenv.h:149,
from include/acpi/acpi.h:56,
from include/linux/acpi.h:41,
from init/main.c:27:
include/acpi/actypes.h:129:1: error: unknown type name 'COMPILER_DEPENDENT_UINT64' include/acpi/actypes.h:130:1: error: unknown type name 'COMPILER_DEPENDENT_INT64' In file included from include/acpi/platform/aclinux.h:293:0,
from include/acpi/platform/acenv.h:149,
from include/acpi/acpi.h:56,
from include/linux/acpi.h:41,
from init/main.c:27:
include/acpi/actypes.h:1025:21: error: expected ')' before '*' token include/acpi/actypes.h:1028:21: error: expected ')' before '*' token In file included from include/acpi/acpi.h:63:0,
from include/linux/acpi.h:41,
from init/main.c:27:
include/acpi/acpiosxf.h:240:7: error: unknown type name 'acpi_osd_handler' include/acpi/acpiosxf.h:247:6: error: unknown type name 'acpi_osd_handler' include/acpi/acpiosxf.h:260:3: error: unknown type name 'acpi_osd_exec_callback'
This patch introduces <acpi/acpi_opt.h> to fix this issue by splitting conditions and declarations (most of them are inline functions) into 2 header files so that the wrong inclusion of <acpi/actypes.h> can be removed from <acpi/platform/aclinux.h>.
--- include/acpi/acpi_opt.h | 90 ++++++++++++++++++++++++++++++++++ include/acpi/platform/aclinux.h | 101 +++++---------------------------------- 2 files changed, 101 insertions(+), 90 deletions(-) create mode 100644 include/acpi/acpi_opt.h
include/acpi/acpi_opt.h new file +90 -0
@@ -0,0 +1,90 @@ +/* +* Extra OS specific ACPI defines for Linux. +* +* Copyright (C) 2014, Intel Corporation +* Authors: Lv Zheng <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ACPI_OPT_H_ +#define _ACPI_OPT_H_ + +#ifdef __KERNEL__ + +/* +* Overrides for in-kernel ACPICA +*/ +acpi_status __init acpi_os_initialize (void ); + +acpi_status acpi_os_terminate (void ); + +/* +* Memory allocation/deallocation +*/ + +/* +* The irqs_disabled() check is for resume from RAM. +* Interrupts are off during resume, just like they are for boot. +* However, boot has (system_state != SYSTEM_RUNNING) +* to quiet __might_sleep() in kmalloc() and resume does not. +*/ +static inline void *acpi_os_allocate (acpi_size size) +{ +return kmalloc (size,irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL ); +} + +/* Use native linux version of acpi_os_allocate_zeroed */ + +static inline void *acpi_os_allocate_zeroed (acpi_size size) +{ +return kzalloc (size,irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL ); +} + +static inline void acpi_os_free (void *memory) +{ +kfree (memory); +} + +static inline void *acpi_os_acquire_object (acpi_cache_t *cache) +{ +return kmem_cache_zalloc (cache, +irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL ); +} + +static inline acpi_thread_id acpi_os_get_thread_id (void ) +{ +return (acpi_thread_id )(unsigned long )current; +} + +/* +* When lockdep is enabled, the spin_lock_init() macro stringifies it's +* argument and uses that as a name for the lock in debugging. +* By executing spin_lock_init() in a macro the key changes from "lock" for +* all locks to the name of the argument of acpi_os_create_lock(), which +* prevents lockdep from reporting false positives for ACPICA locks. +*/ +#define acpi_os_create_lock (__handle) \ + ({ \ + spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \ + if (lock) { \ + *(__handle) = lock; \ + spin_lock_init(*(__handle)); \ + } \ + lock ? AE_OK : AE_NO_MEMORY; \ + }) + +void __iomem *acpi_os_map_memory (acpi_physical_address where,acpi_size length); + +void acpi_os_unmap_memory (void __iomem *logical_address,acpi_size size); + +/* +* OSL interfaces added by Linux +*/ +void early_acpi_os_unmap_memory (void __iomem *virt,acpi_size size); + +#endif + +#endif
include/acpi/platform/aclinux.h +11 -90
122 lines not on this page · raw message
Signature · 1 line
1.7.10
PATCH v2 3/5 ACPICA: Add <asm/acenv.h> to remove mis-ordered inclusion of <asm/acpi.h> from <acpi/platform/aclinux.h>.
In reply to Lv ZhengThere 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.
--- arch/ia64/include/asm/acenv.h | 71 +++++++++++++++++++++++++++++++++++++++ arch/ia64/include/asm/acpi.h | 50 --------------------------- arch/x86/include/asm/acenv.h | 65 +++++++++++++++++++++++++++++++++++ arch/x86/include/asm/acpi.h | 45 ------------------------- include/acpi/platform/aclinux.h | 2 +- 5 files changed, 137 insertions(+), 96 deletions(-) create mode 100644 arch/ia64/include/asm/acenv.h create mode 100644 arch/x86/include/asm/acenv.h
arch/ia64/include/asm/acenv.h new file +71 -0
@@ -0,0 +1,71 @@ +/* +* IA64 specific ACPICA environments and implementation +* +* Copyright (C) 2014, Intel Corporation +* Author: Lv Zheng <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_IA64_ACENV_H +#define _ASM_IA64_ACENV_H + +#include <asm/intrinsics.h> + +#define COMPILER_DEPENDENT_INT64 long +#define COMPILER_DEPENDENT_UINT64 unsigned long + +/* +* Calling conventions: +* +* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) +* ACPI_EXTERNAL_XFACE - External ACPI interfaces +* ACPI_INTERNAL_XFACE - Internal ACPI interfaces +* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces +*/ +#define ACPI_SYSTEM_XFACE +#define ACPI_EXTERNAL_XFACE +#define ACPI_INTERNAL_XFACE +#define ACPI_INTERNAL_VAR_XFACE + +/* Asm macros */ + +#define ACPI_FLUSH_CPU_CACHE () + +#ifdef CONFIG_ACPI + +static inline int +ia64_acpi_acquire_global_lock (unsigned int *lock) +{ +unsigned int old, new, val; +do { + old = *lock; + new = (((old & ~0x3 ) +2 ) + ((old >>1 ) &0x1 )); + val =ia64_cmpxchg4_acq (lock, new, old); + }while (unlikely (val != old)); +return (new <3 ) ?-1 :0 ; +} + +static inline int +ia64_acpi_release_global_lock (unsigned int *lock) +{ +unsigned int old, new, val; +do { + old = *lock; + new = old & ~0x3 ; + val =ia64_cmpxchg4_acq (lock, new, old); + }while (unlikely (val != old)); +return old &0x1 ; +} + +#define ACPI_ACQUIRE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock)) + +#define ACPI_RELEASE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) + +#endif + +#endif /* _ASM_IA64_ACENV_H */
arch/ia64/include/asm/acpi.h +0 -50
56 lines not on this page · raw message
arch/x86/include/asm/acenv.h new file +65 -0
65 lines not on this page · raw message
arch/x86/include/asm/acpi.h +0 -45
51 lines not on this page · raw message
include/acpi/platform/aclinux.h +1 -1
@@ -71,7 +71,7 @@#ifdef EXPORT_ACPI_INTERFACES #include <linux/export.h> #endif -#include <asm/acpi.h> +#include <asm/acenv.h> /* Host-dependent types and defines for in-kernel ACPICA */
Signature · 1 line
1.7.10
Re: [PATCH v2 3/5] ACPICA: Add <asm/acenv.h> to remove mis-ordered inclusion of <asm/acpi.h> from <acpi/platform/aclinux.h>.
Quoted 52 lines · Lv Zheng
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.hbefore includingaclinux.h) <acpi/platform/aclinux.h>
...........................................................................
(aclinux.hbefore includingasm/acpi.h)
<asm/acpi.h> @Redundant@
(ACPICA specific stuff)
...........................................................................
...........................................................................
(Linux ACPI specific stuff) ? - - - - - - - - - - - - +
(aclinux.hafter includingasm/acpi.h) @Invisible@ |
(acenv.hafter includingaclinux.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 likeKconfiggenerated <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 <[email protected]>Cc Tony Luck <[email protected]>Cc Fenghua Yu <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>
Quoted 6 lines
--- arch/ia64/include/asm/acenv.h | 71 +++++++++++++++++++++++++++++++++++++++ arch/ia64/include/asm/acpi.h | 50 --------------------------- arch/x86/include/asm/acenv.h | 65 +++++++++++++++++++++++++++++++++++ arch/x86/include/asm/acpi.h | 45 ------------------------- include/acpi/platform/aclinux.h | 2 +-
Please rename the files first (in a separate patch) and then modify the renamed ones. That will make changes much easier to follow.
Quoted 283 lines
5 files changed, 137 insertions(+), 96 deletions(-) create mode 100644 arch/ia64/include/asm/acenv.h create mode 100644 arch/x86/include/asm/acenv.harch/ia64/include/asm/acenv.h new file +71
-0@@ -0,0 +1,71 @@ +/* +* IA64 specific ACPICA environments and implementation +* +* Copyright (C) 2014, Intel Corporation +* Author: Lv Zheng <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_IA64_ACENV_H +#define _ASM_IA64_ACENV_H + +#include <asm/intrinsics.h> + +#define COMPILER_DEPENDENT_INT64 long +#define COMPILER_DEPENDENT_UINT64 unsigned long + +/* +* Calling conventions: +* +* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) +* ACPI_EXTERNAL_XFACE - External ACPI interfaces +* ACPI_INTERNAL_XFACE - Internal ACPI interfaces +* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces +*/ +#define ACPI_SYSTEM_XFACE +#define ACPI_EXTERNAL_XFACE +#define ACPI_INTERNAL_XFACE +#define ACPI_INTERNAL_VAR_XFACE + +/* Asm macros */ + +#define ACPI_FLUSH_CPU_CACHE () + +#ifdef CONFIG_ACPI + +static inline int +ia64_acpi_acquire_global_lock (unsigned int *lock) +{ +unsigned int old, new, val; +do { + old = *lock; + new = (((old & ~0x3 ) +2 ) + ((old >>1 ) &0x1 )); + val =ia64_cmpxchg4_acq (lock, new, old); + }while (unlikely (val != old)); +return (new <3 ) ?-1 :0 ; +} + +static inline int +ia64_acpi_release_global_lock (unsigned int *lock) +{ +unsigned int old, new, val; +do { + old = *lock; + new = old & ~0x3 ; + val =ia64_cmpxchg4_acq (lock, new, old); + }while (unlikely (val != old)); +return old &0x1 ; +} + +#define ACPI_ACQUIRE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock)) + +#define ACPI_RELEASE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) + +#endif + +#endif /* _ASM_IA64_ACENV_H */ arch/ia64/include/asm/acpi.h +0
-50@@ -34,56 +34,6 @@#include <linux/numa.h> #include <asm/numa.h> -#define COMPILER_DEPENDENT_INT64 long -#define COMPILER_DEPENDENT_UINT64 unsigned long - -/* -* Calling conventions: -* -* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) -* ACPI_EXTERNAL_XFACE - External ACPI interfaces -* ACPI_INTERNAL_XFACE - Internal ACPI interfaces -* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces -*/ -#define ACPI_SYSTEM_XFACE -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE - -/* Asm macros */ - -#define ACPI_FLUSH_CPU_CACHE () - -static inline int -ia64_acpi_acquire_global_lock (unsigned int *lock) -{ -unsigned int old, new, val; -do { - old = *lock; - new = (((old & ~0x3 ) +2 ) + ((old >>1 ) &0x1 )); - val =ia64_cmpxchg4_acq (lock, new, old); - }while (unlikely (val != old)); -return (new <3 ) ?-1 :0 ; -} - -static inline int -ia64_acpi_release_global_lock (unsigned int *lock) -{ -unsigned int old, new, val; -do { - old = *lock; - new = old & ~0x3 ; - val =ia64_cmpxchg4_acq (lock, new, old); - }while (unlikely (val != old)); -return old &0x1 ; -} - -#define ACPI_ACQUIRE_GLOBAL_LOCK (facs, Acq) \ - ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock)) - -#define ACPI_RELEASE_GLOBAL_LOCK (facs, Acq) \ - ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) -#ifdef CONFIG_ACPI #define acpi_disabled 0/* ACPI always enabled on IA64 */ #define acpi_noirq 0/* ACPI always enabled on IA64 */ arch/x86/include/asm/acenv.h new file +65
-0@@ -0,0 +1,65 @@ +/* +* X86 specific ACPICA environments and implementation +* +* Copyright (C) 2014, Intel Corporation +* Author: Lv Zheng <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_X86_ACENV_H +#define _ASM_X86_ACENV_H + +#include <asm/special_insns.h> + +#define COMPILER_DEPENDENT_INT64 long long +#define COMPILER_DEPENDENT_UINT64 unsigned long long + +/* +* Calling conventions: +* +* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) +* ACPI_EXTERNAL_XFACE - External ACPI interfaces +* ACPI_INTERNAL_XFACE - Internal ACPI interfaces +* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces +*/ +#define ACPI_SYSTEM_XFACE +#define ACPI_EXTERNAL_XFACE +#define ACPI_INTERNAL_XFACE +#define ACPI_INTERNAL_VAR_XFACE + +/* Asm macros */ + +#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); + +#define ACPI_ACQUIRE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = __acpi_acquire_global_lock(&facs->global_lock)) + +#define ACPI_RELEASE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = __acpi_release_global_lock(&facs->global_lock)) + +/* +* Math helper asm macros +*/ +#define ACPI_DIV_64_BY_32 (n_hi, n_lo, d32, q32, r32) \ + asm("divl %2;" \ + : "=a"(q32), "=d"(r32) \ + : "r"(d32), \ + "0"(n_lo), "1"(n_hi)) + +#define ACPI_SHIFT_RIGHT_64 (n_hi, n_lo) \ + asm("shrl $1,%2 ;" \ + "rcrl $1,%3;" \ + : "=r"(n_hi), "=r"(n_lo) \ + : "0"(n_hi), "1"(n_lo)) + +#endif + +#endif /* _ASM_X86_ACENV_H */ arch/x86/include/asm/acpi.h +0
-45@@ -32,51 +32,6 @@#include <asm/mpspec.h> #include <asm/realmode.h> -#define COMPILER_DEPENDENT_INT64 long long -#define COMPILER_DEPENDENT_UINT64 unsigned long long - -/* -* Calling conventions: -* -* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) -* ACPI_EXTERNAL_XFACE - External ACPI interfaces -* ACPI_INTERNAL_XFACE - Internal ACPI interfaces -* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces -*/ -#define ACPI_SYSTEM_XFACE -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE - -/* Asm macros */ - -#define ACPI_FLUSH_CPU_CACHE () wbinvd() - -int __acpi_acquire_global_lock (unsigned int *lock); -int __acpi_release_global_lock (unsigned int *lock); - -#define ACPI_ACQUIRE_GLOBAL_LOCK (facs, Acq) \ - ((Acq) = __acpi_acquire_global_lock(&facs->global_lock)) - -#define ACPI_RELEASE_GLOBAL_LOCK (facs, Acq) \ - ((Acq) = __acpi_release_global_lock(&facs->global_lock)) - -/* -* Math helper asm macros -*/ -#define ACPI_DIV_64_BY_32 (n_hi, n_lo, d32, q32, r32) \ - asm("divl %2;" \ - : "=a"(q32), "=d"(r32) \ - : "r"(d32), \ - "0"(n_lo), "1"(n_hi)) - - -#define ACPI_SHIFT_RIGHT_64 (n_hi, n_lo) \ - asm("shrl $1,%2 ;" \ - "rcrl $1,%3;" \ - : "=r"(n_hi), "=r"(n_lo) \ - : "0"(n_hi), "1"(n_lo)) -#ifdef CONFIG_ACPI extern int acpi_lapic;extern int acpi_ioapic;include/acpi/platform/aclinux.h +1
-1@@ -71,7 +71,7 @@#ifdef EXPORT_ACPI_INTERFACES #include <linux/export.h> #endif -#include <asm/acpi.h> +#include <asm/acenv.h> /* Host-dependent types and defines for in-kernel ACPICA */
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
RE: [PATCH v2 3/5] ACPICA: Add <asm/acenv.h> to remove mis-ordered inclusion of <asm/acpi.h> from <acpi/platform/aclinux.h>.
Hi, Rafael
Quoted 64 lines
From: [email protected] [mailto:[email protected]] On Behalf Of Rafael J. Wysocki
Sent: Monday, April 28, 2014 5:37 AM
To: Zheng, LvQuoted 52 lines · Lv Zheng
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.hbefore includingaclinux.h) <acpi/platform/aclinux.h>
...........................................................................
(aclinux.hbefore includingasm/acpi.h)
<asm/acpi.h> @Redundant@
(ACPICA specific stuff)
...........................................................................
...........................................................................
(Linux ACPI specific stuff) ? - - - - - - - - - - - - +
(aclinux.hafter includingasm/acpi.h) @Invisible@ |
(acenv.hafter includingaclinux.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 likeKconfiggenerated <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 <[email protected]>Cc Tony Luck <[email protected]>Cc Fenghua Yu <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>Quoted 6 lines
--- arch/ia64/include/asm/acenv.h | 71 +++++++++++++++++++++++++++++++++++++++ arch/ia64/include/asm/acpi.h | 50 --------------------------- arch/x86/include/asm/acenv.h | 65 +++++++++++++++++++++++++++++++++++ arch/x86/include/asm/acpi.h | 45 ------------------------- include/acpi/platform/aclinux.h | 2 +-
Quoted 2 lines
Please rename the files first (in a separate patch) and then modify the renamed ones. That will make changes much easier to follow.
This patch doesn't provide a rename.
Currently, <asm/acpi.h> includes:
1. arch specific ACPI stuff
2. arch specific ACPICA stuff
This patch moves "2" to a separate file <asm/acenv.h>, thus no renaming happens here.
Thanks and best regards
-Lv
Quoted 292 lines
Quoted 276 lines
5 files changed, 137 insertions(+), 96 deletions(-) create mode 100644 arch/ia64/include/asm/acenv.h create mode 100644 arch/x86/include/asm/acenv.harch/ia64/include/asm/acenv.h new file +71
-0@@ -0,0 +1,71 @@ +/* +* IA64 specific ACPICA environments and implementation +* +* Copyright (C) 2014, Intel Corporation +* Author: Lv Zheng <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_IA64_ACENV_H +#define _ASM_IA64_ACENV_H + +#include <asm/intrinsics.h> + +#define COMPILER_DEPENDENT_INT64 long +#define COMPILER_DEPENDENT_UINT64 unsigned long + +/* +* Calling conventions: +* +* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) +* ACPI_EXTERNAL_XFACE - External ACPI interfaces +* ACPI_INTERNAL_XFACE - Internal ACPI interfaces +* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces +*/ +#define ACPI_SYSTEM_XFACE +#define ACPI_EXTERNAL_XFACE +#define ACPI_INTERNAL_XFACE +#define ACPI_INTERNAL_VAR_XFACE + +/* Asm macros */ + +#define ACPI_FLUSH_CPU_CACHE () + +#ifdef CONFIG_ACPI + +static inline int +ia64_acpi_acquire_global_lock (unsigned int *lock) +{ +unsigned int old, new, val; +do { + old = *lock; + new = (((old & ~0x3 ) +2 ) + ((old >>1 ) &0x1 )); + val =ia64_cmpxchg4_acq (lock, new, old); + }while (unlikely (val != old)); +return (new <3 ) ?-1 :0 ; +} + +static inline int +ia64_acpi_release_global_lock (unsigned int *lock) +{ +unsigned int old, new, val; +do { + old = *lock; + new = old & ~0x3 ; + val =ia64_cmpxchg4_acq (lock, new, old); + }while (unlikely (val != old)); +return old &0x1 ; +} + +#define ACPI_ACQUIRE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock)) + +#define ACPI_RELEASE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) + +#endif + +#endif /* _ASM_IA64_ACENV_H */ arch/ia64/include/asm/acpi.h +0
-50@@ -34,56 +34,6 @@#include <linux/numa.h> #include <asm/numa.h> -#define COMPILER_DEPENDENT_INT64 long -#define COMPILER_DEPENDENT_UINT64 unsigned long - -/* -* Calling conventions: -* -* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) -* ACPI_EXTERNAL_XFACE - External ACPI interfaces -* ACPI_INTERNAL_XFACE - Internal ACPI interfaces -* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces -*/ -#define ACPI_SYSTEM_XFACE -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE - -/* Asm macros */ - -#define ACPI_FLUSH_CPU_CACHE () - -static inline int -ia64_acpi_acquire_global_lock (unsigned int *lock) -{ -unsigned int old, new, val; -do { - old = *lock; - new = (((old & ~0x3 ) +2 ) + ((old >>1 ) &0x1 )); - val =ia64_cmpxchg4_acq (lock, new, old); - }while (unlikely (val != old)); -return (new <3 ) ?-1 :0 ; -} - -static inline int -ia64_acpi_release_global_lock (unsigned int *lock) -{ -unsigned int old, new, val; -do { - old = *lock; - new = old & ~0x3 ; - val =ia64_cmpxchg4_acq (lock, new, old); - }while (unlikely (val != old)); -return old &0x1 ; -} - -#define ACPI_ACQUIRE_GLOBAL_LOCK (facs, Acq) \ - ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock)) - -#define ACPI_RELEASE_GLOBAL_LOCK (facs, Acq) \ - ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) -#ifdef CONFIG_ACPI #define acpi_disabled 0/* ACPI always enabled on IA64 */ #define acpi_noirq 0/* ACPI always enabled on IA64 */ arch/x86/include/asm/acenv.h new file +65
-0@@ -0,0 +1,65 @@ +/* +* X86 specific ACPICA environments and implementation +* +* Copyright (C) 2014, Intel Corporation +* Author: Lv Zheng <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_X86_ACENV_H +#define _ASM_X86_ACENV_H + +#include <asm/special_insns.h> + +#define COMPILER_DEPENDENT_INT64 long long +#define COMPILER_DEPENDENT_UINT64 unsigned long long + +/* +* Calling conventions: +* +* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) +* ACPI_EXTERNAL_XFACE - External ACPI interfaces +* ACPI_INTERNAL_XFACE - Internal ACPI interfaces +* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces +*/ +#define ACPI_SYSTEM_XFACE +#define ACPI_EXTERNAL_XFACE +#define ACPI_INTERNAL_XFACE +#define ACPI_INTERNAL_VAR_XFACE + +/* Asm macros */ + +#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); + +#define ACPI_ACQUIRE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = __acpi_acquire_global_lock(&facs->global_lock)) + +#define ACPI_RELEASE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = __acpi_release_global_lock(&facs->global_lock)) + +/* +* Math helper asm macros +*/ +#define ACPI_DIV_64_BY_32 (n_hi, n_lo, d32, q32, r32) \ + asm("divl %2;" \ + : "=a"(q32), "=d"(r32) \ + : "r"(d32), \ + "0"(n_lo), "1"(n_hi)) + +#define ACPI_SHIFT_RIGHT_64 (n_hi, n_lo) \ + asm("shrl $1,%2 ;" \ + "rcrl $1,%3;" \ + : "=r"(n_hi), "=r"(n_lo) \ + : "0"(n_hi), "1"(n_lo)) + +#endif + +#endif /* _ASM_X86_ACENV_H */ arch/x86/include/asm/acpi.h +0
-45@@ -32,51 +32,6 @@#include <asm/mpspec.h> #include <asm/realmode.h> -#define COMPILER_DEPENDENT_INT64 long long -#define COMPILER_DEPENDENT_UINT64 unsigned long long - -/* -* Calling conventions: -* -* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) -* ACPI_EXTERNAL_XFACE - External ACPI interfaces -* ACPI_INTERNAL_XFACE - Internal ACPI interfaces -* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces -*/ -#define ACPI_SYSTEM_XFACE -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE - -/* Asm macros */ - -#define ACPI_FLUSH_CPU_CACHE () wbinvd() - -int __acpi_acquire_global_lock (unsigned int *lock); -int __acpi_release_global_lock (unsigned int *lock); - -#define ACPI_ACQUIRE_GLOBAL_LOCK (facs, Acq) \ - ((Acq) = __acpi_acquire_global_lock(&facs->global_lock)) - -#define ACPI_RELEASE_GLOBAL_LOCK (facs, Acq) \ - ((Acq) = __acpi_release_global_lock(&facs->global_lock)) - -/* -* Math helper asm macros -*/ -#define ACPI_DIV_64_BY_32 (n_hi, n_lo, d32, q32, r32) \ - asm("divl %2;" \ - : "=a"(q32), "=d"(r32) \ - : "r"(d32), \ - "0"(n_lo), "1"(n_hi)) - - -#define ACPI_SHIFT_RIGHT_64 (n_hi, n_lo) \ - asm("shrl $1,%2 ;" \ - "rcrl $1,%3;" \ - : "=r"(n_hi), "=r"(n_lo) \ - : "0"(n_hi), "1"(n_lo)) -#ifdef CONFIG_ACPI extern int acpi_lapic;extern int acpi_ioapic;include/acpi/platform/aclinux.h +0
-0include/acpi/platform/aclinux.h line 77
Quoted 8 lines
include/acpi/platform/aclinux.h +1
-1@@ -71,7 +71,7 @@#ifdef EXPORT_ACPI_INTERFACES #include <linux/export.h> #endif -#include <asm/acpi.h> +#include <asm/acenv.h> /* Host-dependent types and defines for in-kernel ACPICA */ --
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 3/5] ACPICA: Add <asm/acenv.h> to remove mis-ordered inclusion of <asm/acpi.h> from <acpi/platform/aclinux.h>.
Quoted 65 lines · Lv
Hi, Rafael
Quoted 63 lines
From: [email protected] [mailto:[email protected]] On Behalf Of Rafael J. Wysocki
Sent: Monday, April 28, 2014 5:37 AM
To: Zheng, LvQuoted 58 lines · Lv Zheng
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.hbefore includingaclinux.h) <acpi/platform/aclinux.h>
...........................................................................
(aclinux.hbefore includingasm/acpi.h)
<asm/acpi.h> @Redundant@
(ACPICA specific stuff)
...........................................................................
...........................................................................
(Linux ACPI specific stuff) ? - - - - - - - - - - - - +
(aclinux.hafter includingasm/acpi.h) @Invisible@ |
(acenv.hafter includingaclinux.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 likeKconfiggenerated <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 <[email protected]>Cc Tony Luck <[email protected]>Cc Fenghua Yu <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Ingo Molnar <[email protected]>Cc "H. Peter Anvin" <[email protected]>--- arch/ia64/include/asm/acenv.h | 71 +++++++++++++++++++++++++++++++++++++++ arch/ia64/include/asm/acpi.h | 50 --------------------------- arch/x86/include/asm/acenv.h | 65 +++++++++++++++++++++++++++++++++++ arch/x86/include/asm/acpi.h | 45 ------------------------- include/acpi/platform/aclinux.h | 2 +-
Quoted 7 lines
Quoted 2 lines
Please rename the files first (in a separate patch) and then modify the renamed ones. That will make changes much easier to follow.
This patch doesn't provide a rename.
Currently, <asm/acpi.h> includes:
1. arch specific ACPI stuff
2. arch specific ACPICA stuff
This patch moves "2" to a separate file <asm/acenv.h>, thus no renaming happens here.
Ah, I overlooked that, sorry.
Which I might not do if the changelog said what the patch was really doing.
Thanks,
Rafael
RE: [PATCH v2 3/5] ACPICA: Add <asm/acenv.h> to remove mis-ordered inclusion of <asm/acpi.h> from <acpi/platform/aclinux.h>.
SGksIFJhZmFlbA0KDQo+IEZyb206IFd5c29ja2ksIFJhZmFlbCBKDQo+IFNlbnQ6IFR1ZXNkYXks IEFwcmlsIDI5LCAyMDE0IDQ6MzAgQU0NCj4gDQo+IE9uIDQvMjgvMjAxNCA1OjAyIEFNLCBaaGVu ZywgTHYgd3JvdGU6DQo+ID4gSGksIFJhZmFlbA0KPiA+DQo+ID4+IEZyb206IGxpbnV4LWFjcGkt b3duZXJAdmdlci5rZXJuZWwub3JnIFttYWlsdG86bGludXgtYWNwaS1vd25lckB2Z2VyLmtlcm5l bC5vcmddIE9uIEJlaGFsZiBPZiBSYWZhZWwgSi4gV3lzb2NraQ0KPiA+PiBTZW50OiBNb25kYXks IEFwcmlsIDI4LCAyMDE0IDU6MzcgQU0NCj4gPj4gVG86IFpoZW5nLCBMdg0KPiA+Pg0KPiA+PiBP biBXZWRuZXNkYXksIEFwcmlsIDIzLCAyMDE0IDAyOjU0OjA2IFBNIEx2IFpoZW5nIHdyb3RlOg0K PiA+Pj4gVGhlcmUgaXMgYSBtaXMtb3JkZXIgaW5jbHVzaW9uIGZvciA8YXNtL2FjcGkuaD4uDQo+ ID4+Pg0KPiA+Pj4gQXMgd2Ugd2lsbCBlbmZvcmNlIGluY2x1ZGluZyA8bGludXgvYWNwaS5oPiBm b3IgYWxsIExpbnV4IEFDUEkgdXNlcnMsIHdlDQo+ID4+PiBjYW4gZmluZCB0aGUgaW5jbHVzaW9u IG9yZGVyIGlzIGFzIGZvbGxvd3M6DQo+ID4+Pg0KPiA+Pj4gPGxpbnV4L2FjcGkuaD4NCj4gPj4+ ICAgIDxhY3BpL2FjcGkuaD4NCj4gPj4+ICAgICA8YWNwaS9wbGF0Zm9ybS9hY2Vudi5oPg0KPiA+ Pj4gICAgICAoYWNlbnYuaCBiZWZvcmUgaW5jbHVkaW5nIGFjbGludXguaCkNCj4gPj4+ICAgICAg PGFjcGkvcGxhdGZvcm0vYWNsaW51eC5oPg0KPiA+Pj4gLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u Li4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uDQo+ID4+ PiAgICAgICAoYWNsaW51eC5oIGJlZm9yZSBpbmNsdWRpbmcgYXNtL2FjcGkuaCkNCj4gPj4+ICAg ICAgIDxhc20vYWNwaS5oPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQFJlZHVuZGFudEAN Cj4gPj4+ICAgICAgICAoQUNQSUNBIHNwZWNpZmljIHN0dWZmKQ0KPiA+Pj4gLi4uLi4uLi4uLi4u Li4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u Li4uLi4uDQo+ID4+PiAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u Li4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4NCj4gPj4+ICAgICAgICAoTGludXggQUNQ SSBzcGVjaWZpYyBzdHVmZikgPyAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSArDQo+ID4+PiAgICAg ICAoYWNsaW51eC5oIGFmdGVyIGluY2x1ZGluZyBhc20vYWNwaS5oKSAgIEBJbnZpc2libGVAICAg fA0KPiA+Pj4gICAgICAoYWNlbnYuaCBhZnRlciBpbmNsdWRpbmcgYWNsaW51eC5oKSAgICAgICBA SW52aXNpYmxlQCAgIHwNCj4gPj4+ICAgICBvdGhlciBBQ1BJQ0EgaGVhZGVycyAgICAgICAgICAg ICAgICAgICAgICAgQEludmlzaWJsZUAgICB8DQo+ID4+PiAuLi4uLi4uLi4uLi4uLi4uLi4uLi4u Li4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi58Li4uLi4uLi4uLi4uLi4NCj4g Pj4+ICAgIDxhY3BpL2FjcGlfYnVzLmg+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB8DQo+ID4+PiAgICA8YWNwaS9hY3BpX2RyaXZlcnMuaD4gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgfA0KPiA+Pj4gICAgPGFzbS9hY3BpLmg+IChFeGNsdWRlZCkg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwNCj4gPj4+ICAgICAoTGludXggQUNQ SSBzcGVjaWZpYyBzdHVmZikgISA8LSAtIC0gLSAtIC0gLSAtIC0gLSAtIC0gLSArDQo+ID4+Pg0K PiA+Pj4gTk9URSB0aGF0LCBpbiBBQ1BJQ0EsIDxhY3BpL3BsYXRmb3JtL2FjZW52Lmg+IGlzIG1v cmUgbGlrZSBLY29uZmlnDQo+ID4+PiBnZW5lcmF0ZWQgPGdlbmVyYXRlZC9hdXRvY29uZi5oPiBm b3IgTGludXgsIGl0IGlzIG1lYW50IHRvIGJlIGluY2x1ZGVkDQo+ID4+PiBiZWZvcmUgaW5jbHVk aW5nIGFueSBBQ1BJQ0EgY29kZS4NCj4gPj4+DQo+ID4+PiBJbiB0aGUgYWJvdmUgZmlndXJlLCB0 aGVyZSBpcyBhIHF1ZXN0aW9uIG1hcmsgZm9yICJMaW51eCBBQ1BJIHNwZWNpZmljDQo+ID4+PiBz dHVmZiIgaW4gPGFzbS9hY3BpLmg+IHdoaWNoIHNob3VsZCBiZSBpbmNsdWRlZCBhZnRlciBpbmNs dWRpbmcgYWxsIG90aGVyDQo+ID4+PiBBQ1BJQ0EgaGVhZGVyIGZpbGVzLiAgVGh1cyB0aGV5IHJl YWxseSBuZWVkIHRvIGJlIG1vdmVkIHRvIHRoZSBwb3NpdGlvbg0KPiA+Pj4gbWFya2VkIHdpdGgg ZXhjbGFpbWF0aW9uIG1hcmsgb3IgdGhlIGRlZmluaXRpb25zIGluIHRoZSBibG9ja3MgbWFya2Vk IHdpdGgNCj4gPj4+ICJASW52aXNpYmxlQCIgd2lsbCBiZSBpbnZpc2libGUgdG8gc3VjaCBhcmNo aXRlY3R1cmUgc3BlY2lmaWMgIkxpbnV4IEFDUEkNCj4gPj4+IHNwZWNpZmljIHN0dWZmIiBoZWFk ZXIgYmxvY2tzLiAgVGhpcyBsZWF2ZXMgMiBpc3N1ZXM6DQo+ID4+PiAxLiBBbGwgZW52aXJvbm1l bnRhbCBkZWZpbml0aW9ucyBpbiB0aGVzZSBibG9ja3Mgc2hvdWxkIGhhdmUgYSBjb3B5IGluIHRo ZQ0KPiA+Pj4gICAgIGFyZWEgbWFya2VkIHdpdGggIkBSZWR1bmRhbnRAIiBpZiB0aGV5IGFyZSBy ZXF1aXJlZCBieSB0aGUgIkxpbnV4IEFDUEkNCj4gPj4+ICAgICBzcGVjaWZpYyBzdHVmZiIuDQo+ ID4+PiAyLiBXZSBjYW5ub3QgdXNlIGFueSBBQ1BJQ0EgZGVmaW5lZCB0eXBlcyBpbiA8YXNtL2Fj cGkuaD4uDQo+ID4+Pg0KPiA+Pj4gVGhpcyBwYXRjaCBzcGxpdHMgYXJjaGl0ZWN0dXJlIHNwZWNp ZmljIEFDUElDQSBzdHVmZiBmcm9tIDxhc20vYWNwaS5oPiB0bw0KPiA+Pj4gZml4IHRoaXMgaXNz dWUuDQo+ID4+Pg0KPiA+Pj4gU2lnbmVkLW9mZi1ieTogTHYgWmhlbmcgPGx2LnpoZW5nQGludGVs LmNvbT4NCj4gPj4+IENjOiBUb255IEx1Y2sgPHRvbnkubHVja0BpbnRlbC5jb20+DQo+ID4+PiBD YzogRmVuZ2h1YSBZdSA8ZmVuZ2h1YS55dUBpbnRlbC5jb20+DQo+ID4+PiBDYzogbGludXgtaWE2 NEB2Z2VyLmtlcm5lbC5vcmcNCj4gPj4+IENjOiBUaG9tYXMgR2xlaXhuZXIgPHRnbHhAbGludXRy b25peC5kZT4NCj4gPj4+IENjOiBJbmdvIE1vbG5hciA8bWluZ29AcmVkaGF0LmNvbT4NCj4gPj4+ IENjOiAiSC4gUGV0ZXIgQW52aW4iIDxocGFAenl0b3IuY29tPg0KPiA+Pj4gQ2M6IHg4NkBrZXJu ZWwub3JnDQo+ID4+PiAtLS0NCj4gPj4+ICAgYXJjaC9pYTY0L2luY2x1ZGUvYXNtL2FjZW52Lmgg ICB8ICAgNzEgKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrDQo+ID4+PiAg IGFyY2gvaWE2NC9pbmNsdWRlL2FzbS9hY3BpLmggICAgfCAgIDUwIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLQ0KPiA+Pj4gICBhcmNoL3g4Ni9pbmNsdWRlL2FzbS9hY2Vudi5oICAgIHwgICA2 NSArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKw0KPiA+Pj4gICBhcmNoL3g4Ni9p bmNsdWRlL2FzbS9hY3BpLmggICAgIHwgICA0NSAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQo+ ID4+PiAgIGluY2x1ZGUvYWNwaS9wbGF0Zm9ybS9hY2xpbnV4LmggfCAgICAyICstDQo+ID4+IFBs ZWFzZSByZW5hbWUgdGhlIGZpbGVzIGZpcnN0IChpbiBhIHNlcGFyYXRlIHBhdGNoKSBhbmQgdGhl biBtb2RpZnkgdGhlDQo+ID4+IHJlbmFtZWQgb25lcy4gIFRoYXQgd2lsbCBtYWtlIGNoYW5nZXMg bXVjaCBlYXNpZXIgdG8gZm9sbG93Lg0KPiA+IFRoaXMgcGF0Y2ggZG9lc24ndCBwcm92aWRlIGEg cmVuYW1lLg0KPiA+IEN1cnJlbnRseSwgPGFzbS9hY3BpLmg+IGluY2x1ZGVzOg0KPiA+IDEuIGFy Y2ggc3BlY2lmaWMgQUNQSSBzdHVmZg0KPiA+IDIuIGFyY2ggc3BlY2lmaWMgQUNQSUNBIHN0dWZm DQo+ID4gVGhpcyBwYXRjaCBtb3ZlcyAiMiIgdG8gYSBzZXBhcmF0ZSBmaWxlIDxhc20vYWNlbnYu aD4sIHRodXMgbm8gcmVuYW1pbmcgaGFwcGVucyBoZXJlLg0KPiANCj4gQWgsIEkgb3Zlcmxvb2tl ZCB0aGF0LCBzb3JyeS4NCj4gDQo+IFdoaWNoIEkgbWlnaHQgbm90IGRvIGlmIHRoZSBjaGFuZ2Vs b2cgc2FpZCB3aGF0IHRoZSBwYXRjaCB3YXMgcmVhbGx5IGRvaW5nLg0KDQpIbW0sIEknbGwgcmVm aW5lIHRoZSBjaGFuZ2Vsb2cgaW4gdGhlIG5leHQgcmV2aXNpb24uIDotKQ0KVGhhbmtzIGZvciB0 aGUgaGVscGluZy4NCg0KQmVzdCByZWdhcmRzDQotTHYNCg=
PATCH v2 4/5 ACPICA: Cleanup redudant definitions that already have defaults in <acpi/platform/acenv.h>.
In reply to Lv ZhengSince mis-order issues have been solved, we can cleanup redundant definitions that already have defaults in <acpi/platform/acenv.h>.
This patch removes redudant environments for __KERNEL__ surrounded code.
--- arch/ia64/include/asm/acenv.h | 15 --------------- arch/x86/include/asm/acenv.h | 16 ---------------- include/acpi/platform/aclinux.h | 1 - 3 files changed, 32 deletions(-)
arch/ia64/include/asm/acenv.h +0 -15
@@ -17,23 +17,8 @@#define COMPILER_DEPENDENT_INT64 long#define COMPILER_DEPENDENT_UINT64 unsigned long -/* -* Calling conventions: -* -* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) -* ACPI_EXTERNAL_XFACE - External ACPI interfaces -* ACPI_INTERNAL_XFACE - Internal ACPI interfaces -* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces -*/ -#define ACPI_SYSTEM_XFACE -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE -/* Asm macros */ -#define ACPI_FLUSH_CPU_CACHE () -#ifdef CONFIG_ACPI static inline int
arch/x86/include/asm/acenv.h +0 -16
@@ -14,22 +14,6 @@#include <asm/special_insns.h> -#define COMPILER_DEPENDENT_INT64 long long -#define COMPILER_DEPENDENT_UINT64 unsigned long long - -/* -* Calling conventions: -* -* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) -* ACPI_EXTERNAL_XFACE - External ACPI interfaces -* ACPI_INTERNAL_XFACE - Internal ACPI interfaces -* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces -*/ -#define ACPI_SYSTEM_XFACE -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE -/* Asm macros */ #define ACPI_FLUSH_CPU_CACHE () wbinvd()
include/acpi/platform/aclinux.h +0 -1
@@ -48,7 +48,6 @@#define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_DO_WHILE_0 -#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE#ifdef __KERNEL__
Signature · 1 line
1.7.10
PATCH v2 5/5 ACPICA: Remove deprecated _LINUX definitions for ACPICA.
In reply to Lv ZhengThere are _LINUX defined so that when Linux kernel is compiled using broken compilers that having not __linux__ defined can still include <acpi/platform/aclinux.h> from <acpi/platform/acenv.h>.
This behavior is deprecated as all drivers/acpi/acpica files are compiled without including <linux/acpi.h>, thus without _LINUX defined. As there is no issues encountered when we compile ACPICA code without _LINUX defined, it is OK to remove _LINUX from <linux/acpi.h> now.
--- include/linux/acpi.h | 4 ---- 1 file changed, 4 deletions(-)
include/linux/acpi.h +0 -4
@@ -31,10 +31,6 @@#ifdef CONFIG_ACPI -#ifndef _LINUX -#define _LINUX -#endif -#include <linux/list.h> #include <linux/mod_devicetable.h>
Signature · 1 line
1.7.10
Re: [PATCH v2 5/5] ACPICA: Remove deprecated _LINUX definitions for ACPICA.
Quoted 19 lines · Lv Zheng
There are
_LINUXdefined so that when Linux kernel is compiled using broken compilers that having not__linux__defined can still include <acpi/platform/aclinux.h> from <acpi/platform/acenv.h>.This behavior is deprecated as all
drivers/acpi/acpicafiles are compiled without including <linux/acpi.h>, thus without_LINUXdefined. As there is no issues encountered when we compile ACPICA code without_LINUXdefined, it is OK to remove_LINUXfrom <linux/acpi.h> now.Signed-off-by Lv Zheng <[email protected]>--- include/linux/acpi.h | 4 ---- 1 file changed, 4 deletions(-)include/linux/acpi.h +0
-0
include/linux/acpi.h line 35
Quoted 9 lines
include/linux/acpi.h +0
-4@@ -31,10 +31,6 @@#ifdef CONFIG_ACPI -#ifndef _LINUX -#define _LINUX -#endif -#include <linux/list.h> #include <linux/mod_devicetable.h>
What about <acpi/platform/acenv.h>? Should it still check if _LINUX is defined after this change?
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
RE: [PATCH v2 5/5] ACPICA: Remove deprecated _LINUX definitions for ACPICA.
Hi, Rafael
Quoted 26 lines
From: Rafael J. Wysocki [mailto:[email protected]]
Sent: Monday, April 28, 2014 5:39 AMQuoted 22 lines · Lv Zheng
There are
_LINUXdefined so that when Linux kernel is compiled using broken compilers that having not__linux__defined can still include <acpi/platform/aclinux.h> from <acpi/platform/acenv.h>.This behavior is deprecated as all
drivers/acpi/acpicafiles are compiled without including <linux/acpi.h>, thus without_LINUXdefined. As there is no issues encountered when we compile ACPICA code without_LINUXdefined, it is OK to remove_LINUXfrom <linux/acpi.h> now.Signed-off-by Lv Zheng <[email protected]>--- include/linux/acpi.h | 4 ---- 1 file changed, 4 deletions(-)include/linux/acpi.h +0
-0@@ -31,10 +31,6 @@#ifdef CONFIG_ACPI
Quoted 9 lines
include/linux/acpi.h line 35
Quoted 6 lines
include/linux/acpi.h +0
-4-#ifndef _LINUX -#define _LINUX -#endif -#include <linux/list.h> #include <linux/mod_devicetable.h> What about <
acpi/platform/acenv.h>? Should it still check if_LINUXis defined after this change?
If you mean these lines:
#if defined(_LINUX) || defined(__linux__)
#include <acpi/platform/aclinux.h>
After deleting "_LINUX" from <linux/acpi.h>, acenv.h still can include aclinux.h because of "__linux__".
Actually all drivers/acpi/acpica source files are compiled without including <linux/acpi.h>, so "_LINUX" defined in this file is useless to Linux. We needn't delete "_LINUX" from acenv.h.
"_LINUX" is only used in ACPICA makefiles, Linux never uses it:
https://github.com/acpica/acpica/blob/master/generate/unix/Makefile.config
ACPICA can be compiled using the following make command:
make HOST=_LINUX
I think this is the only usage of "_LINUX" for now.
Thanks and best regards
-Lv
Quoted 5 lines
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
Re: [PATCH v2 5/5] ACPICA: Remove deprecated _LINUX definitions for ACPICA.
Quoted 43 lines · Lv
Hi, Rafael
Quoted 26 lines
From: Rafael J. Wysocki [mailto:[email protected]]
Sent: Monday, April 28, 2014 5:39 AMQuoted 22 lines · Lv Zheng
There are
_LINUXdefined so that when Linux kernel is compiled using broken compilers that having not__linux__defined can still include <acpi/platform/aclinux.h> from <acpi/platform/acenv.h>.This behavior is deprecated as all
drivers/acpi/acpicafiles are compiled without including <linux/acpi.h>, thus without_LINUXdefined. As there is no issues encountered when we compile ACPICA code without_LINUXdefined, it is OK to remove_LINUXfrom <linux/acpi.h> now.Signed-off-by Lv Zheng <[email protected]>--- include/linux/acpi.h | 4 ---- 1 file changed, 4 deletions(-)include/linux/acpi.h +0
-0@@ -31,10 +31,6 @@#ifdef CONFIG_ACPI Quoted 8 lines
include/linux/acpi.h line 35
Quoted 6 lines
include/linux/acpi.h +0
-4-#ifndef _LINUX -#define _LINUX -#endif -#include <linux/list.h> #include <linux/mod_devicetable.h> What about <
acpi/platform/acenv.h>? Should it still check if_LINUXis defined after this change?If you mean these lines:
#if defined(_LINUX) || defined(__linux__) #include <acpi/platform/aclinux.h>After deleting "
_LINUX" from <linux/acpi.h>,acenv.hstill can includeaclinux.hbecause of "__linux__".
Actually alldrivers/acpi/acpicasource files are compiled without including <linux/acpi.h>, so "_LINUX" defined in this file is useless to Linux. We needn't delete "_LINUX" fromacenv.h.
Quoted 5 lines
"
_LINUX" is only used in ACPICA makefiles, Linux never uses it:
https://github.com/acpica/acpica/blob/master/generate/unix/Makefile.config
ACPICA can be compiled using the following make command:
make HOST=_LINUX
I think this is the only usage of "_LINUX" for now.
Well, my point was: If we delete the definition of _LINUX, why don't we drop the symbol itself from everywhere along with it?
It definitely is not useful to refer to a symbol that's never defined, is it?
Rafael
RE: [PATCH v2 5/5] ACPICA: Remove deprecated _LINUX definitions for ACPICA.
Hi,
Quoted 54 lines
From: Wysocki, Rafael J
Sent: Tuesday, April 29, 2014 4:27 AMQuoted 36 lines · Lv
Hi, Rafael
Quoted 26 lines
From: Rafael J. Wysocki [mailto:[email protected]]
Sent: Monday, April 28, 2014 5:39 AMQuoted 22 lines · Lv Zheng
There are
_LINUXdefined so that when Linux kernel is compiled using broken compilers that having not__linux__defined can still include <acpi/platform/aclinux.h> from <acpi/platform/acenv.h>.This behavior is deprecated as all
drivers/acpi/acpicafiles are compiled without including <linux/acpi.h>, thus without_LINUXdefined. As there is no issues encountered when we compile ACPICA code without_LINUXdefined, it is OK to remove_LINUXfrom <linux/acpi.h> now.Signed-off-by Lv Zheng <[email protected]>--- include/linux/acpi.h | 4 ---- 1 file changed, 4 deletions(-)include/linux/acpi.h +0
-0@@ -31,10 +31,6 @@#ifdef CONFIG_ACPI Quoted 8 lines
include/linux/acpi.h line 35
Quoted 6 lines
include/linux/acpi.h +0
-4-#ifndef _LINUX -#define _LINUX -#endif -#include <linux/list.h> #include <linux/mod_devicetable.h> What about <
acpi/platform/acenv.h>? Should it still check if_LINUXis defined after this change?Quoted 5 lines
If you mean these lines:
#if defined(_LINUX) || defined(__linux__) #include <acpi/platform/aclinux.h>After deleting "
_LINUX" from <linux/acpi.h>,acenv.hstill can includeaclinux.hbecause of "__linux__".
Actually alldrivers/acpi/acpicasource files are compiled without including <linux/acpi.h>, so "_LINUX" defined in this file is useless toLinux.
Quoted 7 lines
We needn't delete "
_LINUX" fromacenv.h."
_LINUX" is only used in ACPICA makefiles, Linux never uses it:
https://github.com/acpica/acpica/blob/master/generate/unix/Makefile.config
ACPICA can be compiled using the following make command:
make HOST=_LINUX
I think this is the only usage of "_LINUX" for now.
Quoted 5 lines
Well, my point was: If we delete the definition of
_LINUX, why don't we drop the symbol itself from everywhere along with it?It definitely is not useful to refer to a symbol that's never defined, is it?
It sounds like I should clean up acenv.h first than deleting this. OK, I'll drop this patch from this series.
I might re-do the deletion after cleaning up the acenv.h.
Thanks and best regards
-Lv
Quoted 2 lines
Rafael
v3 cover ACPICA: Cleanups for <acpi/platform/acenv.h> and <acpi/platform/aclinux.h>.
In reply to Lv ZhengThis patch series cleans up <acpi/platform/acenv.h> and <acpi/platform/aclinux.h>. it also fixes some mis-ordered inclusions for Linux resident ACPICA.
There is no real issue in the Linux kernel, but this can help to cleanup the code so that (benefits):
1. Redundant environment definitions can be removed from <asm/acpi.h> and <acpi/platform/aclinux.h>.
2. Lift a burden off the ACPICA release automation - copying default ACPICA environment setting to all <asm/acpi.h> file each time a new environment is introduced just in order to avoid build errors.
3. The wrong <acpi/actypes.h> inclusion can be removed from <acpi/platform/aclinux.h>.
4. Using ACPICA defined types in <asm/acpi.h> is possible.
5. Using "static inline" to define ACPICA OSL functions is still possible and won't cause build errors any longer.
6. All non back ported prototypes are collected in a single file.
The patch set has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + default + COFNIG_ACPI=y
2. i386 + default + COFNIG_ACPI=n
3. x86_64 + default + COFNIG_ACPI=y
4. x86_64 + default + COFNIG_ACPI=n
Boot tests are performed as follows:
1. i386 + default + COFNIG_ACPI=y
2. x86_64 + default + COFNIG_ACPI=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All drivers/acpi configurations
All platform drivers
All ACPI drivers
4 DRM drivers that implement ACPI opregion
All buses with ACPI bindings
All cpufreq configurations
All xen configurations
All ACPI table drivers
Lv Zheng (4):
ACPICA: Linux headers: Remove ACPI_PREEMPTION_POINT() due to no
usages.
ACPICA: Linux headers: Add <acpi/platform/aclinuxex.h> to remove
mis-ordered inclusion of <acpi/actypes.h> from <acpi/platform/aclinux.h>.
ACPICA: Linux headers: Add <asm/acenv.h> to remove mis-ordered
inclusion of <asm/acpi.h> from <acpi/platform/aclinux.h>.
ACPICA: Cleanup redudant definitions that already have defaults in
<acpi/platform/acenv.h>.
arch/ia64/include/asm/acenv.h | 56 ++++++++++++ arch/ia64/include/asm/acpi.h | 50 ----------- arch/x86/include/asm/acenv.h | 49 +++++++++++ arch/x86/include/asm/acpi.h | 45 ---------- include/acpi/acpi.h | 4 +- include/acpi/platform/acenvex.h | 63 ++++++++++++++ include/acpi/platform/aclinux.h | 171 ++++++++----------------------------- include/acpi/platform/aclinuxex.h | 116 +++++++++++++++++++++++++ 8 files changed, 322 insertions(+), 232 deletions(-) create mode 100644 arch/ia64/include/asm/acenv.h create mode 100644 arch/x86/include/asm/acenv.h create mode 100644 include/acpi/platform/acenvex.h create mode 100644 include/acpi/platform/aclinuxex.h
Signature · 1 line
1.7.10
PATCH v3 1/4 ACPICA: Linux headers: Remove ACPI_PREEMPTION_POINT() due to no usages.
This patch deletes deprecated ACPI_PREEMPTION_POINT(), there is no user for it in Linux kernel now. Lv Zheng.
--- include/acpi/platform/aclinux.h | 14 -------------- 1 file changed, 14 deletions(-)
include/acpi/platform/aclinux.h +0 -14
@@ -228,20 +228,6 @@ static inline acpi_thread_id acpi_os_get_thread_id(void)#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id -#ifndef CONFIG_PREEMPT - -/* -* Used within ACPICA to show where it is safe to preempt execution -* when CONFIG_PREEMPT=n -*/ -#define ACPI_PREEMPTION_POINT () \ - do { \ - if (!irqs_disabled()) \ - cond_resched(); \ - } while (0) - -#endif -/* * When lockdep is enabled, the spin_lock_init() macro stringifies it's * argument and uses that as a name for the lock in debugging.
Signature · 1 line
1.7.10
PATCH v3 2/4 ACPICA: Linux headers: Add <acpi/platform/aclinuxex.h> to remove mis-ordered inclusion of <acpi/actypes.h> from <acpi/platform/aclinux.h>.
In reply to Lv ZhengQuoted 1 line
From ACPICA's perspective, <
acpi/actypes.h> should be included after
inclusion of <acpi/platform/acenv.h>. But currently in Linux, <acpi/platform/aclinux.h> included by <acpi/platform/acenv.h> has included <acpi/actypes.h> to find ACPICA types for inline functions.
This causes the following problem:
1. Redundant code in <asm/acpi.h> and <acpi/platform/aclinux.h>:
Linux must be careful to keep conditions for <acpi/actypes.h> inclusion consistent with the conditions for <acpi/platform/aclinux.h> inclusion. Which finally leads to the issue that we have to keep many useless macro definitions in <acpi/platform/aclinux.h> or <asm/acpi.h>.
Such conditions include:
COMPILER_DEPENDENT_UINT64
COMPILER_DEPENDENT_INT64
ACPI_INLINE
ACPI_SYSTEM_XFACE
ACPI_EXTERNAL_XFACE
ACPI_INTERNAL_XFACE
ACPI_INTERNAL_VAR_XFACE
ACPI_MUTEX_TYPE
DEBUGGER_THREADING
ACPI_ACQUIRE_GLOBAL_LOCK
ACPI_RELEASE_GLOBAL_LOCK
ACPI_FLUSH_CPU_CACHE
They have default implementations in <include/acpi/platform/acenv.h> while Linux need to keep a copy in <asm/acpi.h> to avoid build errors. Typical Linux build error if we deletes COMPILER_DEPENDENT_x and ACPI_x_XFACE definitions from asm/acpi.h:
CC init/main.o
In file included from include/acpi/platform/aclinux.h:293:0,
from include/acpi/platform/acenv.h:149,
from include/acpi/acpi.h:56,
from include/linux/acpi.h:41,
from init/main.c:27:
include/acpi/actypes.h:129:1: error: unknown type name 'COMPILER_DEPENDENT_UINT64' include/acpi/actypes.h:130:1: error: unknown type name 'COMPILER_DEPENDENT_INT64' In file included from include/acpi/platform/aclinux.h:293:0,
from include/acpi/platform/acenv.h:149,
from include/acpi/acpi.h:56,
from include/linux/acpi.h:41,
from init/main.c:27:
include/acpi/actypes.h:1025:21: error: expected ')' before '*' token include/acpi/actypes.h:1028:21: error: expected ')' before '*' token In file included from include/acpi/acpi.h:63:0,
from include/linux/acpi.h:41,
from init/main.c:27:
include/acpi/acpiosxf.h:240:7: error: unknown type name 'acpi_osd_handler' include/acpi/acpiosxf.h:247:6: error: unknown type name 'acpi_osd_handler' include/acpi/acpiosxf.h:260:3: error: unknown type name 'acpi_osd_exec_callback'
This patch introduces <acpi/platform/aclinuxex.h> to fix this issue by splitting conditions and declarations (most of them are inline functions) into 2 header files so that the wrong inclusion of <acpi/actypes.h> can be removed from <acpi/platform/aclinux.h>.
This patch also removes old ACPI_NATIVE_INTERFACE_HEADER mechanism which is not preferred by Linux and adds the platform/acenvex.h to be the solution to solve this issue. Lv Zheng.
--- include/acpi/acpi.h | 4 +- include/acpi/platform/acenvex.h | 63 +++++++++++++++ include/acpi/platform/aclinux.h | 154 +++++++++---------------------------- include/acpi/platform/aclinuxex.h | 116 ++++++++++++++++++++++++++++ 4 files changed, 216 insertions(+), 121 deletions(-) create mode 100644 include/acpi/platform/acenvex.h create mode 100644 include/acpi/platform/aclinuxex.h
include/acpi/acpi.h +1 -3
@@ -62,8 +62,6 @@#include <acpi/acrestyp.h> /* Resource Descriptor structs */ #include <acpi/acpiosxf.h> /* OSL interfaces (ACPICA-to-OS) */ #include <acpi/acpixf.h> /* ACPI core subsystem external interfaces */ -#ifdef ACPI_NATIVE_INTERFACE_HEADER -#include ACPI_NATIVE_INTERFACE_HEADER -#endif +#include <acpi/platform/acenvex.h> /* Extra environment-specific items */ #endif /* __ACPI_H__ */
include/acpi/platform/acenvex.h new file +63 -0
63 lines not on this page · raw message
include/acpi/platform/aclinux.h +36 -118
164 lines not on this page · raw message
include/acpi/platform/aclinuxex.h new file +116 -0
116 lines not on this page · raw message
Signature · 1 line
1.7.10
PATCH v3 3/4 ACPICA: Linux headers: Add <asm/acenv.h> to remove mis-ordered inclusion of <asm/acpi.h> from <acpi/platform/aclinux.h>.
In reply to Lv ZhengThere 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.
--- arch/ia64/include/asm/acenv.h | 71 +++++++++++++++++++++++++++++++++++++++ arch/ia64/include/asm/acpi.h | 50 --------------------------- arch/x86/include/asm/acenv.h | 65 +++++++++++++++++++++++++++++++++++ arch/x86/include/asm/acpi.h | 45 ------------------------- include/acpi/platform/aclinux.h | 2 +- 5 files changed, 137 insertions(+), 96 deletions(-) create mode 100644 arch/ia64/include/asm/acenv.h create mode 100644 arch/x86/include/asm/acenv.h
arch/ia64/include/asm/acenv.h new file +71 -0
@@ -0,0 +1,71 @@ +/* +* IA64 specific ACPICA environments and implementation +* +* Copyright (C) 2014, Intel Corporation +* Author: Lv Zheng <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _ASM_IA64_ACENV_H +#define _ASM_IA64_ACENV_H + +#include <asm/intrinsics.h> + +#define COMPILER_DEPENDENT_INT64 long +#define COMPILER_DEPENDENT_UINT64 unsigned long + +/* +* Calling conventions: +* +* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) +* ACPI_EXTERNAL_XFACE - External ACPI interfaces +* ACPI_INTERNAL_XFACE - Internal ACPI interfaces +* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces +*/ +#define ACPI_SYSTEM_XFACE +#define ACPI_EXTERNAL_XFACE +#define ACPI_INTERNAL_XFACE +#define ACPI_INTERNAL_VAR_XFACE + +/* Asm macros */ + +#define ACPI_FLUSH_CPU_CACHE () + +#ifdef CONFIG_ACPI + +static inline int +ia64_acpi_acquire_global_lock (unsigned int *lock) +{ +unsigned int old, new, val; +do { + old = *lock; + new = (((old & ~0x3 ) +2 ) + ((old >>1 ) &0x1 )); + val =ia64_cmpxchg4_acq (lock, new, old); + }while (unlikely (val != old)); +return (new <3 ) ?-1 :0 ; +} + +static inline int +ia64_acpi_release_global_lock (unsigned int *lock) +{ +unsigned int old, new, val; +do { + old = *lock; + new = old & ~0x3 ; + val =ia64_cmpxchg4_acq (lock, new, old); + }while (unlikely (val != old)); +return old &0x1 ; +} + +#define ACPI_ACQUIRE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock)) + +#define ACPI_RELEASE_GLOBAL_LOCK (facs, Acq) \ + ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) + +#endif + +#endif /* _ASM_IA64_ACENV_H */
arch/ia64/include/asm/acpi.h +0 -50
56 lines not on this page · raw message
arch/x86/include/asm/acenv.h new file +65 -0
65 lines not on this page · raw message
arch/x86/include/asm/acpi.h +0 -45
51 lines not on this page · raw message
include/acpi/platform/aclinux.h +1 -1
@@ -71,7 +71,7 @@#ifdef EXPORT_ACPI_INTERFACES #include <linux/export.h> #endif -#include <asm/acpi.h> +#include <asm/acenv.h> #ifndef CONFIG_ACPI
Signature · 1 line
1.7.10
PATCH v3 4/4 ACPICA: Cleanup redudant definitions that already have defaults in <acpi/platform/acenv.h>.
In reply to Lv ZhengSince mis-order issues have been solved, we can cleanup redundant definitions that already have defaults in <acpi/platform/acenv.h>.
This patch removes redudant environments for __KERNEL__ surrounded code.
--- arch/ia64/include/asm/acenv.h | 15 --------------- arch/x86/include/asm/acenv.h | 16 ---------------- include/acpi/platform/aclinux.h | 1 - 3 files changed, 32 deletions(-)
arch/ia64/include/asm/acenv.h +0 -15
@@ -17,23 +17,8 @@#define COMPILER_DEPENDENT_INT64 long#define COMPILER_DEPENDENT_UINT64 unsigned long -/* -* Calling conventions: -* -* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) -* ACPI_EXTERNAL_XFACE - External ACPI interfaces -* ACPI_INTERNAL_XFACE - Internal ACPI interfaces -* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces -*/ -#define ACPI_SYSTEM_XFACE -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE -/* Asm macros */ -#define ACPI_FLUSH_CPU_CACHE () -#ifdef CONFIG_ACPI static inline int
arch/x86/include/asm/acenv.h +0 -16
@@ -14,22 +14,6 @@#include <asm/special_insns.h> -#define COMPILER_DEPENDENT_INT64 long long -#define COMPILER_DEPENDENT_UINT64 unsigned long long - -/* -* Calling conventions: -* -* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) -* ACPI_EXTERNAL_XFACE - External ACPI interfaces -* ACPI_INTERNAL_XFACE - Internal ACPI interfaces -* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces -*/ -#define ACPI_SYSTEM_XFACE -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE -/* Asm macros */ #define ACPI_FLUSH_CPU_CACHE () wbinvd()
include/acpi/platform/aclinux.h +0 -1
@@ -48,7 +48,6 @@#define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_DO_WHILE_0 -#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE#ifdef __KERNEL__
Signature · 1 line
1.7.10
Re: [PATCH v3 0/4] ACPICA: Cleanups for <acpi/platform/acenv.h> and <acpi/platform/aclinux.h>.
In reply to Lv ZhengQuoted 52 lines · Lv Zheng
This patch series cleans up <
acpi/platform/acenv.h> and <acpi/platform/aclinux.h>. it also fixes some mis-ordered inclusions for Linux resident ACPICA.There is no real issue in the Linux kernel, but this can help to cleanup the code so that (benefits):
1. Redundant environment definitions can be removed from <asm/acpi.h> and <acpi/platform/aclinux.h>.
2. Lift a burden off the ACPICA release automation - copying default ACPICA environment setting to all <asm/acpi.h> file each time a new environment is introduced just in order to avoid build errors.
3. The wrong <acpi/actypes.h> inclusion can be removed from <acpi/platform/aclinux.h>.
4. Using ACPICA defined types in <asm/acpi.h> is possible.
5. Using "static inline" to define ACPICA OSL functions is still possible and won't cause build errors any longer.
6. All non back ported prototypes are collected in a single file.The patch set has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + default + COFNIG_ACPI=y
2. i386 + default + COFNIG_ACPI=n
3.x86_64+ default + COFNIG_ACPI=y
4.x86_64+ default + COFNIG_ACPI=n
Boot tests are performed as follows:
1. i386 + default + COFNIG_ACPI=y
2.x86_64+ default + COFNIG_ACPI=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2.x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 Alldrivers/acpiconfigurations
All platform drivers
All ACPI drivers
4 DRM drivers that implement ACPI opregion
All buses with ACPI bindings
All cpufreq configurations
All xen configurations
All ACPI table driversLv Zheng (4):
ACPICA: Linux headers: RemoveACPI_PREEMPTION_POINT()due to no
usages.
ACPICA: Linux headers: Add <acpi/platform/aclinuxex.h> to remove
mis-ordered inclusion of <acpi/actypes.h> from <acpi/platform/aclinux.h>.
ACPICA: Linux headers: Add <asm/acenv.h> to remove mis-ordered
inclusion of <asm/acpi.h> from <acpi/platform/aclinux.h>.
ACPICA: Cleanup redudant definitions that already have defaults in
<acpi/platform/acenv.h>.
Quoted 13 lines
arch/ia64/include/asm/acenv.h | 56 ++++++++++++ arch/ia64/include/asm/acpi.h | 50 ----------- arch/x86/include/asm/acenv.h | 49 +++++++++++ arch/x86/include/asm/acpi.h | 45 ---------- include/acpi/acpi.h | 4 +- include/acpi/platform/acenvex.h | 63 ++++++++++++++ include/acpi/platform/aclinux.h | 171 ++++++++----------------------------- include/acpi/platform/aclinuxex.h | 116 +++++++++++++++++++++++++ 8 files changed, 322 insertions(+), 232 deletions(-) create mode 100644 arch/ia64/include/asm/acenv.h create mode 100644 arch/x86/include/asm/acenv.h create mode 100644 include/acpi/platform/acenvex.h create mode 100644 include/acpi/platform/aclinuxex.h
All four applied to bleeding-edge, thanks Lv!
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.