LCOV - code coverage report
Current view: top level - arch/arm64/include/asm - lse.h (source / functions) Hit Total Coverage
Test: fstests of 6.5.0-rc3-acha @ Mon Jul 31 20:08:06 PDT 2023 Lines: 1 1 100.0 %
Date: 2023-07-31 20:08:07 Functions: 0 0 -

          Line data    Source code
       1             : /* SPDX-License-Identifier: GPL-2.0 */
       2             : #ifndef __ASM_LSE_H
       3             : #define __ASM_LSE_H
       4             : 
       5             : #include <asm/atomic_ll_sc.h>
       6             : 
       7             : #ifdef CONFIG_ARM64_LSE_ATOMICS
       8             : 
       9             : #define __LSE_PREAMBLE  ".arch_extension lse\n"
      10             : 
      11             : #include <linux/compiler_types.h>
      12             : #include <linux/export.h>
      13             : #include <linux/stringify.h>
      14             : #include <asm/alternative.h>
      15             : #include <asm/alternative-macros.h>
      16             : #include <asm/atomic_lse.h>
      17             : #include <asm/cpucaps.h>
      18             : 
      19             : static __always_inline bool system_uses_lse_atomics(void)
      20             : {
      21 >44397*10^7 :         return alternative_has_cap_likely(ARM64_HAS_LSE_ATOMICS);
      22             : }
      23             : 
      24             : #define __lse_ll_sc_body(op, ...)                                       \
      25             : ({                                                                      \
      26             :         system_uses_lse_atomics() ?                                     \
      27             :                 __lse_##op(__VA_ARGS__) :                               \
      28             :                 __ll_sc_##op(__VA_ARGS__);                              \
      29             : })
      30             : 
      31             : /* In-line patching at runtime */
      32             : #define ARM64_LSE_ATOMIC_INSN(llsc, lse)                                \
      33             :         ALTERNATIVE(llsc, __LSE_PREAMBLE lse, ARM64_HAS_LSE_ATOMICS)
      34             : 
      35             : #else   /* CONFIG_ARM64_LSE_ATOMICS */
      36             : 
      37             : static inline bool system_uses_lse_atomics(void) { return false; }
      38             : 
      39             : #define __lse_ll_sc_body(op, ...)               __ll_sc_##op(__VA_ARGS__)
      40             : 
      41             : #define ARM64_LSE_ATOMIC_INSN(llsc, lse)        llsc
      42             : 
      43             : #endif  /* CONFIG_ARM64_LSE_ATOMICS */
      44             : #endif  /* __ASM_LSE_H */

Generated by: LCOV version 1.14