LCOV - code coverage report
Current view: top level - arch/arm64/include/asm - jump_label.h (source / functions) Hit Total Coverage
Test: fstests of 6.5.0-rc4-xfsa @ Mon Jul 31 20:08:27 PDT 2023 Lines: 3 6 50.0 %
Date: 2023-07-31 20:08:27 Functions: 0 0 -

          Line data    Source code
       1             : /* SPDX-License-Identifier: GPL-2.0-only */
       2             : /*
       3             :  * Copyright (C) 2013 Huawei Ltd.
       4             :  * Author: Jiang Liu <liuj97@gmail.com>
       5             :  *
       6             :  * Based on arch/arm/include/asm/jump_label.h
       7             :  */
       8             : #ifndef __ASM_JUMP_LABEL_H
       9             : #define __ASM_JUMP_LABEL_H
      10             : 
      11             : #ifndef __ASSEMBLY__
      12             : 
      13             : #include <linux/types.h>
      14             : #include <asm/insn.h>
      15             : 
      16             : #define JUMP_LABEL_NOP_SIZE             AARCH64_INSN_SIZE
      17             : 
      18             : static __always_inline bool arch_static_branch(struct static_key * const key,
      19             :                                                const bool branch)
      20             : {
      21 >10820*10^8 :         asm_volatile_goto(
      22             :                 "1:        nop                                     \n\t"
      23             :                  " .pushsection    __jump_table, \"aw\"  \n\t"
      24             :                  " .align          3                       \n\t"
      25             :                  " .long           1b - ., %l[l_yes] - .   \n\t"
      26             :                  " .quad           %c0 - .                 \n\t"
      27             :                  " .popsection                             \n\t"
      28             :                  :  :  "i"(&((char *)key)[branch]) :  : l_yes);
      29             : 
      30             :         return false;
      31   146178429 : l_yes:
      32   146178429 :         return true;
      33             : }
      34             : 
      35             : static __always_inline bool arch_static_branch_jump(struct static_key * const key,
      36             :                                                     const bool branch)
      37             : {
      38           0 :         asm_volatile_goto(
      39             :                 "1:        b               %l[l_yes]               \n\t"
      40             :                  " .pushsection    __jump_table, \"aw\"  \n\t"
      41             :                  " .align          3                       \n\t"
      42             :                  " .long           1b - ., %l[l_yes] - .   \n\t"
      43             :                  " .quad           %c0 - .                 \n\t"
      44             :                  " .popsection                             \n\t"
      45             :                  :  :  "i"(&((char *)key)[branch]) :  : l_yes);
      46             : 
      47             :         return false;
      48           0 : l_yes:
      49           0 :         return true;
      50             : }
      51             : 
      52             : #endif  /* __ASSEMBLY__ */
      53             : #endif  /* __ASM_JUMP_LABEL_H */

Generated by: LCOV version 1.14