asmmacro.h 912 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2003 Ralf Baechle
  7. */
  8. #ifndef _ASM_ASMMACRO_H
  9. #define _ASM_ASMMACRO_H
  10. #include <linux/config.h>
  11. #include <asm/hazards.h>
  12. #ifdef CONFIG_32BIT
  13. #include <asm/asmmacro-32.h>
  14. #endif
  15. #ifdef CONFIG_64BIT
  16. #include <asm/asmmacro-64.h>
  17. #endif
  18. .macro local_irq_enable reg=t0
  19. mfc0 \reg, CP0_STATUS
  20. ori \reg, \reg, 1
  21. mtc0 \reg, CP0_STATUS
  22. irq_enable_hazard
  23. .endm
  24. .macro local_irq_disable reg=t0
  25. mfc0 \reg, CP0_STATUS
  26. ori \reg, \reg, 1
  27. xori \reg, \reg, 1
  28. mtc0 \reg, CP0_STATUS
  29. irq_disable_hazard
  30. .endm
  31. #ifdef CONFIG_CPU_SB1
  32. .macro fpu_enable_hazard
  33. .set push
  34. .set noreorder
  35. .set mips2
  36. SSNOP
  37. bnezl $0, .+4
  38. SSNOP
  39. .set pop
  40. .endm
  41. #else
  42. .macro fpu_enable_hazard
  43. .endm
  44. #endif
  45. #endif /* _ASM_ASMMACRO_H */