1. 05 2月, 2015 1 次提交
  2. 23 7月, 2014 3 次提交
    • L
      ACPI: Add support to force header inclusion rules for <acpi/acpi.h>. · 417b4a73
      Lv Zheng 提交于
      As there is only CONFIG_ACPI=n processing in the <linux/acpi.h>, it is not
      safe to include <acpi/acpi.h> directly for source out of Linux ACPI
      subsystems.
      
      This patch adds error messaging to warn developers of such wrong
      inclusions.
      
      In order not to be bisected and reverted as a wrong commit, warning
      messages are carefully split into a seperate patch other than the wrong
      inclusion cleanups.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      417b4a73
    • L
      ACPICA: Linux: Add support to exclude <asm/acenv.h> inclusion. · d334c823
      Lv Zheng 提交于
      The forthcoming patch will make <acpi/acpi.h> to be visible to all kernel
      source code. Thus for the architectures that do not support ACPI and
      haven't implemented <asm/acenv.h>, we need to make it excluded.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d334c823
    • L
      ACPICA: Linux: Add stub implementation of ACPICA 64-bit mathematics. · daba25d6
      Lv Zheng 提交于
      This patch adds default 64-bit mathematics in aclinux.h using do_div(). As
      do_div() can be used for all Linux architectures, this can also be used as
      stub macros for ACPICA 64-bit mathematics.
      
      These macros are required by drivers/acpi/utmath.c when ACPI_USE_NATIVE_DIVIDE
      is not defined.  It is used by ACPICA, so currently this is only meaningful to
      CONFIG_ACPI builds.  So the kernel will not use these macros unless CONFIG_ACPI
      is defined and ACPI_USE_DIVIDE is not defined.
      
      For 64-bit kernels:
      In include/acpi/actypes.h, for ACPI_MACHINE_WIDTH=64,
      ACPI_USE_NATIVE_DIVIDE will be defined, thus these macros are not used.
      In include/acpi/platform/aclinux.h, for __KERNEL__ surrounded code,
      ACPI_MACHINE_WIDTH is defined to be BITS_PER_LONG.
      So all 64-bit kernels do not use these macros.
      
      For 32-bit kernels:
      As mentioned above, these macros will be used when BITS_PER_LONG is 32.
      Thus currently the i328 kernels are the only users for these macros.
      But they won't use this default implementation provided by this patch,
      because in arch/x86/include/asm/acenv.h, there are already overrides
      implemented.  So these default macros are not used by 32-bit x86 (i386)
      kernels.
      
      These macros will only be used by future non x86 32-bit architectures
      that try to support ACPI in Linux kernel.
      
      During the period they do not have arch specific implementations of such
      macros, we can avoid build errors for them.
      
      And since they can see ACPICA functioning without implementing any arch
      specific environment tunings, we  can also avoid function errors for
      them.
      
      As this implementation is not performance friendly, those architectures
      still need to implement real support in the end.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      [rjw: Changelog]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      daba25d6
  3. 08 7月, 2014 3 次提交
  4. 28 5月, 2014 5 次提交
    • L
      ACPI: Clean up acpi_os_map/unmap_memory() to eliminate __iomem. · a238317c
      Lv Zheng 提交于
      ACPICA doesn't include protections around address space checking, Linux
      build tests always complain increased sparse warnings around ACPICA
      internal acpi_os_map/unmap_memory() invocations.  This patch tries to fix
      this issue permanently.
      
      There are 2 choices left for us to solve this issue:
       1. Add __iomem address space awareness into ACPICA.
       2. Remove sparse checker of __iomem from ACPICA source code.
      
      This patch chooses solution 2, because:
       1.  Most of the acpi_os_map/unmap_memory() invocations are used for ACPICA.
           table mappings, which in fact are not IO addresses.
       2.  The only IO addresses usage is for "system memory space" mapping code in:
            drivers/acpi/acpica/exregion.c
            drivers/acpi/acpica/evrgnini.c
            drivers/acpi/acpica/exregion.c
          The mapped address is accessed in the handler of "system memory space"
          - acpi_ex_system_memory_space_handler().  This function in fact can be
          changed to invoke acpi_os_read/write_memory() so that __iomem can
          always be type-casted in the OSL layer.
      
      According to the above investigation, we drew the following conclusion:
      It is not a good idea to introduce __iomem address space awareness into
      ACPICA mostly in order to protect non-IO addresses.
      
      We can simply remove __iomem for acpi_os_map/unmap_memory() to remove
      __iomem checker for ACPICA code. Then we need to enforce external usages
      to invoke other APIs that are aware of __iomem address space.
      The external usages are:
       drivers/acpi/apei/einj.c
       drivers/acpi/acpi_extlog.c
       drivers/char/tpm/tpm_acpi.c
       drivers/acpi/nvs.c
      
      This patch thus performs cleanups in this way:
       1. Add acpi_os_map/unmap_iomem() to be invoked by non-ACPICA code.
       2. Remove __iomem from acpi_os_map/unmap_memory().
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a238317c
    • L
      ACPICA: Clean up redudant definitions already defined elsewhere · 92985ef1
      Lv Zheng 提交于
      Since 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.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      92985ef1
    • L
      ACPICA: Linux headers: Add <asm/acenv.h> to remove mis-ordered inclusion of <asm/acpi.h> · 07d83914
      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.h before including aclinux.h)
          <acpi/platform/aclinux.h>
      ...........................................................................
           (aclinux.h before including asm/acpi.h)
           <asm/acpi.h>                             @Redundant@
            (ACPICA specific stuff)
      ...........................................................................
      ...........................................................................
            (Linux ACPI specific stuff) ? - - - - - - - - - - - - +
           (aclinux.h after including asm/acpi.h)   @Invisible@   |
          (acenv.h after including aclinux.h)       @Invisible@   |
         other ACPICA headers                       @Invisible@   |
      ............................................................|..............
        <acpi/acpi_bus.h>                                         |
        <acpi/acpi_drivers.h>                                     |
        <asm/acpi.h> (Excluded)                                   |
         (Linux ACPI specific stuff) ! <- - - - - - - - - - - - - +
      
      NOTE that, in ACPICA, <acpi/platform/acenv.h> is more like Kconfig
      generated <generated/autoconf.h> for Linux, it is meant to be included
      before including any ACPICA code.
      
      In the above figure, there is a question mark for "Linux ACPI specific
      stuff" in <asm/acpi.h> which should be included after including all other
      ACPICA header files.  Thus they really need to be moved to the position
      marked with exclaimation mark or the definitions in the blocks marked with
      "@Invisible@" will be invisible to such architecture specific "Linux ACPI
      specific stuff" header blocks.  This leaves 2 issues:
      1. All environmental definitions in these blocks should have a copy in the
         area marked with "@Redundant@" if they are required by the "Linux ACPI
         specific stuff".
      2. We cannot use any ACPICA defined types in <asm/acpi.h>.
      
      This patch splits architecture specific ACPICA stuff from <asm/acpi.h> to
      fix this issue.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      07d83914
    • L
      ACPICA: Linux headers: Add <acpi/platform/aclinuxex.h> · d13bd5a6
      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.
      
      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.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d13bd5a6
    • L
      ACPICA: Linux headers: Remove ACPI_PREEMPTION_POINT() due to no usages. · 636fcfef
      Lv Zheng 提交于
      This patch deletes deprecated ACPI_PREEMPTION_POINT(), there is no user
      for it in Linux kernel now.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      636fcfef
  5. 07 5月, 2014 1 次提交
  6. 21 4月, 2014 3 次提交
  7. 13 2月, 2014 2 次提交
    • L
      ACPICA: acpidump: Remove integer types translation protection. · e252652f
      Lv Zheng 提交于
      Remove translation protection for applications as Linux tools folder will
      start to use such types.
      
      In Linux kernel source tree, after removing this translation protection,
      the u8/u16/u32/u64/s32/s64 typedefs are exposed for both __KERNEL__ builds
      and !__KERNEL__ builds (tools/power/acpi) and the original definitions of
      ACPI_UINT8/16/32/64_MAX are changed.
      
      For !__KERNEL__ builds, this kind of defintions should already been tested
      by the distribution vendors that are distributing binary ACPICA package and
      we've achieved the successful built/run test result in the kernel source
      tree.
      
      For __KERNEL__ builds, there are 2 things affected:
      1. u8/u16/u32/u64/s32/s64 type definitions:
         Since Linux has already type defined u8/u16/u32/u64/s32/s64 in
         include/uapi/asm-generic/int-ll64.h for __KERNEL__.  In order not to
         introduce build regressions where the 2 typedefs are differed,
         ACPI_USE_SYSTEM_INTTYPES is introduced to mask out ACPICA's typedefs.
         It must be defined for Linux __KERNEL__ builds.
      2. ACPI_UINT8/16/32/64_MAX definitions:
         Before applying this change:
           ACPI_UINT8_MAX: sizeof (UINT8)
            UINT8: unsigned char
           ACPI_UINT16_MAX: sizeof (UINT16)
            UINT16: unsigned short
           ACPI_UINT32_MAX: sizeof (UINT32)
            INT32: int
            UINT32: unsigned int
           ACPI_UINT64_MAX: sizeof (UINT64)
            INT64: COMPILER_DEPENDENT_INT64
             COMPILER_DEPENDENT_INT64: signed long (IA64) or
                                       signed long long (IA32)
            UINT64: COMPILER_DEPENDENT_UINT64
             COMPILER_DEPENDENT_UINT64: unsigned long (IA64) or
                                        unsigned long long (IA32)
         After applying this change:
           ACPI_UINT8_MAX: sizeof (u8)
            u8: unsigned char
            UINT8: (removed from actypes.h)
           ACPI_UINT16_MAX: sizeof (u16)
            u16: unsigned short
            UINT16: (removed from actypes.h)
           ACPI_UINT32_MAX: sizeof (u32)
            INT32/UINT32: (removed from actypes.h)
            s32: signed int
            u32: unsigned int
           ACPI_UINT64_MAX: sizeof (u64)
            INT64/UINT64: (removed from actypes.h)
            u64: unsigned long long
            s64: signed long long
            COMPILER_DEPENDENT_INT64: signed long (IA64) (not used any more)
                                      signed long long (IA32) (not used any more)
            COMPILER_DEPENDENT_UINT64: unsigned long (IA64) (not used any more)
                                       unsigned long long (IA32) (not used any more)
         All definitions are equal except ACPI_UINT64_MAX for CONFIG_IA64.  It
         is changed from sizeof(unsigned long) to sizeof(unsigned long long).
         By investigation, 64bit Linux kernel build is LP64 compliant, i.e.,
         sizeof(long) and (pointer) are 64.  As sizeof(unsigned long) equals to
         sizeof(unsigned long long) on IA64 platform where CONFIG_64BIT cannot be
         disabled, this change actually will not affect the value of
         ACPI_UINT64_MAX on IA64 platforms.
      
      This patch is necessary for the ACPICA's acpidump tool to build
      correctly.  Lv Zheng.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e252652f
    • L
      ACPICA: acpidump: Add sparse declarators support. · 7e66b46b
      Lv Zheng 提交于
      Linux kernel resident ACPICA headers include some sparse declarators for
      kernel static checkers.  This patch adds code to disable them for non
      __KERNEL__ defined code so that it is possible for the ACPICA user space
      tool's source files to be built with Linux kernel ACPICA header files
      included.  Lv Zheng.
      
      Linux kernel build is not affected by this commit.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      7e66b46b
  8. 11 2月, 2014 1 次提交
  9. 05 2月, 2014 1 次提交
    • A
      ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE_ONLY · af1ae78a
      Al Stone 提交于
      ACPI hardware reduced mode exists to allow newer platforms to use a
      simpler form of ACPI that does not require supporting legacy versions
      of the specification and their associated hardware.  This mode was
      introduced in the ACPI 5.0 specification.
      
      The ACPI hardware reduced mode is supposed to be used on systems
      having the HW_REDUCED_ACPI flag set in the FADT.  ACPICA checks
      that flag to determine whether or not it should work in the HW
      reduced mode and there are pieces of code in it that will never
      be used in that case.
      
      Since some architecutres will always use the ACPI HW reduced mode,
      it doesn't make sense for them to ever compile support for anything
      else.  Thus, they should set the flag ACPI_REDUCED_HARDWARE to TRUE
      in the ACPICA source.  To enable them to do that, introduce a new
      kernel configuration option, CONFIG_ACPI_REDUCED_HARDWARE_ONLY, that
      will cause the ACPICA's ACPI_REDUCED_HARDWARE flag to be TRUE when
      set.
      
      Introducing this configuration item is based on suggestions from Lv
      Zheng saying that this does not belong in ACPICA, but rather to the
      Linux kernel itself.
      
      References: http://www.spinics.net/lists/linux-acpi/msg46369.htmlSigned-off-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NAl Stone <al.stone@linaro.org>
      [rjw: Subject and changelog]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      af1ae78a
  10. 08 1月, 2014 3 次提交
  11. 31 10月, 2013 5 次提交
  12. 30 10月, 2013 1 次提交
  13. 24 9月, 2013 1 次提交
  14. 25 1月, 2013 1 次提交
  15. 10 1月, 2013 5 次提交
    • L
      ACPICA: Cleanup indentation to reduce differences between Linux and ACPICA. · 3e8214e5
      Lv Zheng 提交于
      This is a cosmetic patch only. Comparison of the resulting binary showed
      only line number differences.
      
      This patch does not affect the generation of the Linux binary.
      This patch decreases 210 lines of 20121018 divergence.diff.
      
      The ACPICA source codes uses a totally different indentation style from the
      Linux to be compatible with other users (operating systems or BIOS).
      
      Indentation differences are critical to the release automation. There are
      two causes related to the "indentation" that are affecting the release
      automation:
      1. The ACPICA -> Linux release process is:
           ACPICA source -- acpisrc - hierarchy - indent ->
           linuxized ACPICA source -- diff ->
           linuxized ACPICA patch (x) -- human intervention ->
           linuxized ACPICA patch (o)
           Where
             'x' means "cannot be directly applied to the Linux"
             'o' means "can be directly applied to the Linux"
         Different "indent" version or "indent" options used in the "indent"
         step will lead to different divergences.
         The version of "indent" used for the current release process is:
           GNU indent 2.2.11
         The options of "indent" used for the current release process is:
           -npro -kr -i8 -ts8 -sob -l80 -ss -ncs
      2. Manual indentation prettifying work in the Linux side will also harm the
         automatically generated linuxized ACPICA patches, making them impossible
         to apply directly.
      
      This patch fixes source code differences caused by the two causes so that
      the "human intervention" can be reduced in the future.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3e8214e5
    • L
      ACPICA: Cleanup source to reduce differences between Linux and ACPICA. · 739dcbb9
      Lv Zheng 提交于
      This is a cosmetic patch only. Comparison of the resulting binary showed
      only line number differences.
      
      This patch does not affect the generation of the Linux binary.
      This patch decreases 389 lines of 20121018 divergence.diff.
      
      This patch reduces source code diff caused by the simple code maintenance
      work:
      1. Deletion of the unused include files.
      2. Deletion of the deprecated codes blocks.
      3. Repositioning of the code blocks.
      4. Replacing the values with the well defined macros.
      5. Replacing the types with the equivalent types.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      739dcbb9
    • L
      ACPICA: Update codes under disabled build options. · 56324c10
      Lv Zheng 提交于
      This is a cosmetic patch only. Comparison of the resulting binary showed
      only line number differences.
      
      This patch does not affect the generation of the Linux binary.
      This patch decreases 170 lines of 20121018 divergence.diff.
      
      This patch updates ACPICA codes surrounded by some disabled build options
      so that the source code diff between Linux and ACPICA can be reduced.
      
      Some of these build options may never be used in the kernel, so they may
      be deleted entirely in future patches.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      56324c10
    • L
      ACPICA: Update compilation environment settings. · 0947c6de
      Lv Zheng 提交于
      This patch does not affect the generation of the Linux binary.
      This patch decreases 300 lines of 20121018 divergence.diff.
      
      This patch updates architecture specific environment settings for compiling
      ACPICA as such enhancement already has been done in ACPICA.
      
      Note that the appended compiler default settings in the
      <acpi/platform/acenv.h> will deprecate some of the macros defined in the
      architecture specific <asm/acpi.h>. Thus two of the <asm/acpi.h> headers
      have been cleaned up in this patch accordingly.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0947c6de
    • L
      ACPICA: Cleanup updated comments. · 75c8044f
      Lv Zheng 提交于
      This is a cosmetic patch only. Comparison of the resulting binary showed
      only line number differences.
      
      This patch does not affect the generation of the Linux binary.
      This patch decreases 558 lines of 20121018 divergence.diff.
      
      This patch reduces the source code diff between Linux and ACPICA by
      cleaning the comments that already have been updated in ACPICA.
      
      There is no extra indentation done in this patch. Even the empty line
      deletions and insertions are also splitted into another cleanup patch so
      that this patch can be easily reviewed, and the binary differences can be
      held to a lowest level.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      75c8044f
  16. 03 10月, 2012 1 次提交
  17. 17 7月, 2012 1 次提交
  18. 29 3月, 2012 1 次提交
  19. 01 11月, 2011 1 次提交