synchronousMemoryDatabase.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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) 1995, 1996, 1997, 1999, 2001 by Ralf Baechle
  7. * Copyright (C) 1999 by Silicon Graphics, Inc.
  8. * Copyright (C) 2001 MIPS Technologies, Inc.
  9. * Copyright (C) 2002 Maciej W. Rozycki
  10. *
  11. * Some useful macros for MIPS assembler code
  12. *
  13. * Some of the routines below contain useless nops that will be optimized
  14. * away by gas in -O mode. These nops are however required to fill delay
  15. * slots in noreorder mode.
  16. */
  17. #ifndef __ASM_ASM_H
  18. #define __ASM_ASM_H
  19. #include <asm/sgidefs.h>
  20. #ifndef CAT
  21. #ifdef __STDC__
  22. #define __CAT(str1, str2) str1##str2
  23. #else
  24. #define __CAT(str1, str2) str1/**/str2
  25. #endif
  26. #define CAT(str1, str2) __CAT(str1, str2)
  27. #endif
  28. /*
  29. * PIC specific declarations
  30. * Not used for the kernel but here seems to be the right place.
  31. */
  32. #ifdef __PIC__
  33. #define CPRESTORE(register) \
  34. .cprestore register
  35. #define CPADD(register) \
  36. .cpadd register
  37. #define CPLOAD(register) \
  38. .cpload register
  39. #else
  40. #define CPRESTORE(register)
  41. #define CPADD(register)
  42. #define CPLOAD(register)
  43. #endif
  44. /*
  45. * LEAF - declare leaf routine
  46. */
  47. #define LEAF(symbol) \
  48. .globl symbol; \
  49. .align 2; \
  50. .type symbol, @function; \
  51. .ent symbol, 0; \
  52. symbol: .frame sp, 0, ra
  53. /*
  54. * NESTED - declare nested routine entry point
  55. */
  56. #define NESTED(symbol, framesize, rpc) \
  57. .globl symbol; \
  58. .align 2; \
  59. .type symbol, @function; \
  60. .ent symbol, 0; \
  61. symbol: .frame sp, framesize, rpc
  62. /*
  63. * END - mark end of function
  64. */
  65. #define END(function) \
  66. .end function; \
  67. .size function, .-function
  68. /*
  69. * EXPORT - export definition of symbol
  70. */
  71. #define EXPORT(symbol) \
  72. .globl symbol; \
  73. symbol:
  74. /*
  75. * FEXPORT - export definition of a function symbol
  76. */
  77. #define FEXPORT(symbol) \
  78. .globl symbol; \
  79. .type symbol, @function; \
  80. symbol:
  81. /*
  82. * ABS - export absolute symbol
  83. */
  84. #define ABS(symbol,value) \
  85. .globl symbol; \
  86. symbol = value
  87. #define PANIC(msg) \
  88. .set push; \
  89. .set reorder; \
  90. PTR_LA a0, 8f; \
  91. jal panic; \
  92. 9: b 9b; \
  93. .set pop; \
  94. TEXT(msg)
  95. /*
  96. * Print formatted string
  97. */
  98. #ifdef CONFIG_PRINTK
  99. #define PRINT(string) \
  100. .set push; \
  101. .set reorder; \
  102. PTR_LA a0, 8f; \
  103. jal printk; \
  104. .set pop; \
  105. TEXT(string)
  106. #else
  107. #define PRINT(string)
  108. #endif
  109. #define TEXT(msg) \
  110. .pushsection .data; \
  111. 8: .asciiz msg; \
  112. .popsection;
  113. /*
  114. * Build text tables
  115. */
  116. #define TTABLE(string) \
  117. .pushsection .text; \
  118. .word 1f; \
  119. .popsection \
  120. .pushsection .data; \
  121. 1: .asciiz string; \
  122. .popsection
  123. /*
  124. * MIPS IV pref instruction.
  125. * Use with .set noreorder only!
  126. *
  127. * MIPS IV implementations are free to treat this as a nop. The R5000
  128. * is one of them. So we should have an option not to use this instruction.
  129. */
  130. #ifdef CONFIG_CPU_HAS_PREFETCH
  131. #define PREF(hint,addr) \
  132. .set push; \
  133. .set mips4; \