assembler.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * arch/arm/include/asm/assembler.h
  3. *
  4. * Copyright (C) 1996-2000 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * This file contains arm architecture specific defines
  11. * for the different processors.
  12. *
  13. * Do not include any C declarations in this file - it is included by
  14. * assembler source.
  15. */
  16. #include <config.h>
  17. /*
  18. * Endian independent macros for shifting bytes within registers.
  19. */
  20. #ifndef __ARMEB__
  21. #define lspull lsr
  22. #define lspush lsl
  23. #define get_byte_0 lsl #0
  24. #define get_byte_1 lsr #8
  25. #define get_byte_2 lsr #16
  26. #define get_byte_3 lsr #24
  27. #define put_byte_0 lsl #0
  28. #define put_byte_1 lsl #8
  29. #define put_byte_2 lsl #16
  30. #define put_byte_3 lsl #24
  31. #else
  32. #define lspull lsl
  33. #define lspush lsr
  34. #define get_byte_0 lsr #24
  35. #define get_byte_1 lsr #16
  36. #define get_byte_2 lsr #8
  37. #define get_byte_3 lsl #0
  38. #define put_byte_0 lsl #24
  39. #define put_byte_1 lsl #16
  40. #define put_byte_2 lsl #8
  41. #define put_byte_3 lsl #0
  42. #endif
  43. /*
  44. * Data preload for architectures that support it
  45. */
  46. #if defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) || \
  47. defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
  48. defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || \
  49. defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_7A__) || \
  50. defined(__ARM_ARCH_7R__)
  51. #define PLD(code...) code
  52. #else
  53. #define PLD(code...)
  54. #endif
  55. .irp c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo
  56. .macro ret\c, reg
  57. #if defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__)
  58. mov\c pc, \reg
  59. #else
  60. .ifeqs "\reg", "lr"
  61. bx\c \reg
  62. .else
  63. mov\c pc, \reg
  64. .endif
  65. #endif
  66. .endm
  67. .endr
  68. /*
  69. * Cache aligned, used for optimized memcpy/memset
  70. * In the kernel this is only enabled for Feroceon CPU's...
  71. * We disable it especially for Thumb builds since those instructions
  72. * are not made in a Thumb ready way...
  73. */
  74. #ifdef CONFIG_SYS_THUMB_BUILD
  75. #define CALGN(code...)
  76. #else
  77. #define CALGN(code...) code
  78. #endif