Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752899AbaD1DCX (ORCPT ); Sun, 27 Apr 2014 23:02:23 -0400 Received: from mga02.intel.com ([134.134.136.20]:7213 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752419AbaD1DCU (ORCPT ); Sun, 27 Apr 2014 23:02:20 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,940,1389772800"; d="scan'208";a="502033342" From: "Zheng, Lv" To: "Rafael J. Wysocki" CC: "Wysocki, Rafael J" , "Brown, Len" , Lv Zheng , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "Luck, Tony" , "Yu, Fenghua" , "linux-ia64@vger.kernel.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "x86@kernel.org" Subject: RE: [PATCH v2 3/5] ACPICA: Add to remove mis-ordered inclusion of from . Thread-Topic: [PATCH v2 3/5] ACPICA: Add to remove mis-ordered inclusion of from . Thread-Index: AQHPYl6Ei5A5bX/F70+i/inXfH4mrJsmVyaA Date: Mon, 28 Apr 2014 03:02:12 +0000 Message-ID: <1AE640813FDE7649BE1B193DEA596E880255865E@SHSMSX101.ccr.corp.intel.com> References: <522ac0c3a52f1697d75363cc808a213773dca295.1398232409.git.lv.zheng@intel.com> <1469560.3p9s15HIYZ@vostro.rjw.lan> In-Reply-To: <1469560.3p9s15HIYZ@vostro.rjw.lan> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id s3S32Wnx020128 Hi, Rafael > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Rafael J. Wysocki > Sent: Monday, April 28, 2014 5:37 AM > To: Zheng, Lv > > On Wednesday, April 23, 2014 02:54:06 PM Lv Zheng wrote: > > There is a mis-order inclusion for . > > > > As we will enforce including for all Linux ACPI users, we > > can find the inclusion order is as follows: > > > > > > > > > > (acenv.h before including aclinux.h) > > > > ........................................................................... > > (aclinux.h before including 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@ | > > ............................................................|.............. > > | > > | > > (Excluded) | > > (Linux ACPI specific stuff) ! <- - - - - - - - - - - - - + > > > > NOTE that, in ACPICA, is more like Kconfig > > generated 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 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 . > > > > This patch splits architecture specific ACPICA stuff from to > > fix this issue. > > > > Signed-off-by: Lv Zheng > > Cc: Tony Luck > > Cc: Fenghua Yu > > Cc: linux-ia64@vger.kernel.org > > Cc: Thomas Gleixner > > Cc: Ingo Molnar > > Cc: "H. Peter Anvin" > > Cc: x86@kernel.org > > --- > > 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. This patch doesn't provide a rename. Currently, includes: 1. arch specific ACPI stuff 2. arch specific ACPICA stuff This patch moves "2" to a separate file , thus no renaming happens here. Thanks and best regards -Lv > > > 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 > > > > diff --git a/arch/ia64/include/asm/acenv.h b/arch/ia64/include/asm/acenv.h > > new file mode 100644 > > index 0000000..e0896eb > > --- /dev/null > > +++ b/arch/ia64/include/asm/acenv.h > > @@ -0,0 +1,71 @@ > > +/* > > + * IA64 specific ACPICA environments and implementation > > + * > > + * Copyright (C) 2014, Intel Corporation > > + * Author: Lv Zheng > > + * > > + * 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 > > + > > +#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 */ > > diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h > > index d651102..b0ddcfd 100644 > > --- a/arch/ia64/include/asm/acpi.h > > +++ b/arch/ia64/include/asm/acpi.h > > @@ -34,56 +34,6 @@ > > #include > > #include > > > > -#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 */ > > diff --git a/arch/x86/include/asm/acenv.h b/arch/x86/include/asm/acenv.h > > new file mode 100644 > > index 0000000..6978584 > > --- /dev/null > > +++ b/arch/x86/include/asm/acenv.h > > @@ -0,0 +1,65 @@ > > +/* > > + * X86 specific ACPICA environments and implementation > > + * > > + * Copyright (C) 2014, Intel Corporation > > + * Author: Lv Zheng > > + * > > + * 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 > > + > > +#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 */ > > diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h > > index c8c1e70..e06225e 100644 > > --- a/arch/x86/include/asm/acpi.h > > +++ b/arch/x86/include/asm/acpi.h > > @@ -32,51 +32,6 @@ > > #include > > #include > > > > -#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; > > diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h > > index a20f051..99d0546 100644 > > --- a/include/acpi/platform/aclinux.h > > +++ b/include/acpi/platform/aclinux.h > > @@ -71,7 +71,7 @@ > > #ifdef EXPORT_ACPI_INTERFACES > > #include > > #endif > > -#include > > +#include > > > > /* 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 majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?