asmmacro.h 783 B

123456789101112131415161718192021222324252627282930313233
  1. /* asmmacro.h: Assembler macros.
  2. *
  3. * Copyright (C) 1996 David S. Miller (davem@caipfs.rutgers.edu)
  4. */
  5. #ifndef _SPARC_ASMMACRO_H
  6. #define _SPARC_ASMMACRO_H
  7. #include <asm/asi.h>
  8. #define GET_PROCESSOR4M_ID(reg) \
  9. rd %tbr, %reg; \
  10. srl %reg, 12, %reg; \
  11. and %reg, 3, %reg;
  12. #define GET_PROCESSOR4D_ID(reg) \
  13. lda [%g0] ASI_M_VIKING_TMP1, %reg;
  14. /* All trap entry points _must_ begin with this macro or else you
  15. * lose. It makes sure the kernel has a proper window so that
  16. * c-code can be called.
  17. */
  18. #define SAVE_ALL_HEAD \
  19. sethi %hi(trap_setup), %l4; \
  20. jmpl %l4 + %lo(trap_setup), %l6;
  21. #define SAVE_ALL \
  22. SAVE_ALL_HEAD \
  23. nop;
  24. /* All traps low-level code here must end with this macro. */
  25. #define RESTORE_ALL b ret_trap_entry; clr %l6;
  26. #endif /* !(_SPARC_ASMMACRO_H) */