asmmacro.h 977 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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/btfixup.h>
  8. #include <asm/asi.h>
  9. #define GET_PROCESSOR4M_ID(reg) \
  10. rd %tbr, %reg; \
  11. srl %reg, 12, %reg; \
  12. and %reg, 3, %reg;
  13. #define GET_PROCESSOR4D_ID(reg) \
  14. lda [%g0] ASI_M_VIKING_TMP1, %reg;
  15. /* All trap entry points _must_ begin with this macro or else you
  16. * lose. It makes sure the kernel has a proper window so that
  17. * c-code can be called.
  18. */
  19. #define SAVE_ALL_HEAD \
  20. sethi %hi(trap_setup), %l4; \
  21. jmpl %l4 + %lo(trap_setup), %l6;
  22. #define SAVE_ALL \
  23. SAVE_ALL_HEAD \
  24. nop;
  25. /* All traps low-level code here must end with this macro. */
  26. #define RESTORE_ALL b ret_trap_entry; clr %l6;
  27. /* sun4 probably wants half word accesses to ASI_SEGMAP, while sun4c+
  28. likes byte accesses. These are to avoid ifdef mania. */
  29. #define lduXa lduba
  30. #define stXa stba
  31. #endif /* !(_SPARC_ASMMACRO_H) */