jump_label.h 584 B

1234567891011121314151617181920212223242526272829303132
  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. #define JUMP_LABEL(key, label) \
  7. do { \
  8. asm goto("1:\n\t" \
  9. "nop\n\t" \
  10. "nop\n\t" \
  11. ".pushsection __jump_table, \"a\"\n\t"\
  12. ".align 4\n\t" \
  13. ".word 1b, %l[" #label "], %c0\n\t" \
  14. ".popsection \n\t" \
  15. : : "i" (key) : : label);\
  16. } while (0)
  17. #endif /* __KERNEL__ */
  18. typedef u32 jump_label_t;
  19. struct jump_entry {
  20. jump_label_t code;
  21. jump_label_t target;
  22. jump_label_t key;
  23. };
  24. #endif