jump_label.h 560 B

12345678910111213141516171819202122232425262728293031
  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. ".word 1b, %l[" #label "], %c0\n\t" \
  13. ".popsection \n\t" \
  14. : : "i" (key) : : label);\
  15. } while (0)
  16. #endif /* __KERNEL__ */
  17. typedef u32 jump_label_t;
  18. struct jump_entry {
  19. jump_label_t code;
  20. jump_label_t target;
  21. jump_label_t key;
  22. };
  23. #endif