ppc_asm.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __SELFTESTS_POWERPC_PPC_ASM_H
  3. #define __SELFTESTS_POWERPC_PPC_ASM_H
  4. #include <ppc-asm.h>
  5. #define CONFIG_ALTIVEC
  6. #define r1 1
  7. #define R14 r14
  8. #define R15 r15
  9. #define R16 r16
  10. #define R17 r17
  11. #define R18 r18
  12. #define R19 r19
  13. #define R20 r20
  14. #define R21 r21
  15. #define R22 r22
  16. #define R29 r29
  17. #define R30 r30
  18. #define R31 r31
  19. #define STACKFRAMESIZE 256
  20. #define STK_REG(i) (112 + ((i)-14)*8)
  21. #define _GLOBAL(A) FUNC_START(test_ ## A)
  22. #define _GLOBAL_TOC(A) _GLOBAL(A)
  23. #define _GLOBAL_TOC_KASAN(A) _GLOBAL(A)
  24. #define _GLOBAL_KASAN(A) _GLOBAL(A)
  25. #define CFUNC(name) name
  26. #define PPC_MTOCRF(A, B) mtocrf A, B
  27. #define EX_TABLE(x, y) \
  28. .section __ex_table,"a"; \
  29. .8byte x, y; \
  30. .previous
  31. #define BEGIN_FTR_SECTION .if test_feature
  32. #define FTR_SECTION_ELSE .else
  33. #define ALT_FTR_SECTION_END_IFCLR(x) .endif
  34. #define ALT_FTR_SECTION_END_IFSET(x) .endif
  35. #define ALT_FTR_SECTION_END(x, y) .endif
  36. #define END_FTR_SECTION_IFCLR(x) .endif
  37. #define END_FTR_SECTION_IFSET(x) .endif
  38. /* Default to taking the first of any alternative feature sections */
  39. test_feature = 1
  40. #define DCBT_SETUP_STREAMS(from, from_parms, to, to_parms, scratch) \
  41. lis scratch,0x8000; /* GO=1 */ \
  42. clrldi scratch,scratch,32; \
  43. /* setup read stream 0 */ \
  44. dcbt 0,from,0b01000; /* addr from */ \
  45. dcbt 0,from_parms,0b01010; /* length and depth from */ \
  46. /* setup write stream 1 */ \
  47. dcbtst 0,to,0b01000; /* addr to */ \
  48. dcbtst 0,to_parms,0b01010; /* length and depth to */ \
  49. eieio; \
  50. dcbt 0,scratch,0b01010; /* all streams GO */
  51. #endif /* __SELFTESTS_POWERPC_PPC_ASM_H */