jump_label.h 598 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef _ASM_SPARC_JUMP_LABEL_H
  2. #define _ASM_SPARC_JUMP_LABEL_H
  3. #ifdef __KERNEL__
  4. #include <linux/types.h>
  5. #define JUMP_LABEL_NOP_SIZE 4
  6. static __always_inline bool arch_static_branch(struct static_key *key)
  7. {
  8. asm goto("1:\n\t"
  9. "nop\n\t"
  10. "nop\n\t"
  11. ".pushsection __jump_table, \"aw\"\n\t"
  12. ".align 4\n\t"
  13. ".word 1b, %l[l_yes], %c0\n\t"
  14. ".popsection \n\t"
  15. : : "i" (key) : : l_yes);
  16. return false;
  17. l_yes:
  18. return true;
  19. }
  20. #endif /* __KERNEL__ */
  21. typedef u32 jump_label_t;
  22. struct jump_entry {
  23. jump_label_t code;
  24. jump_label_t target;
  25. jump_label_t key;
  26. };
  27. #endif