armv6.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * File : armv6.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, RT-Thread Development Team
  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 as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. */
  23. #ifndef __ARMV6_H__
  24. #define __ARMV6_H__
  25. /*****************************/
  26. /* CPU Mode */
  27. /*****************************/
  28. #define USERMODE 0x10
  29. #define FIQMODE 0x11
  30. #define IRQMODE 0x12
  31. #define SVCMODE 0x13
  32. #define ABORTMODE 0x17
  33. #define UNDEFMODE 0x1b
  34. #define MODEMASK 0x1f
  35. #define NOINT 0xc0
  36. #ifndef __ASSEMBLY__
  37. struct rt_hw_register
  38. {
  39. rt_uint32_t cpsr;
  40. rt_uint32_t r0;
  41. rt_uint32_t r1;
  42. rt_uint32_t r2;
  43. rt_uint32_t r3;
  44. rt_uint32_t r4;
  45. rt_uint32_t r5;
  46. rt_uint32_t r6;
  47. rt_uint32_t r7;
  48. rt_uint32_t r8;
  49. rt_uint32_t r9;
  50. rt_uint32_t r10;
  51. rt_uint32_t fp;
  52. rt_uint32_t ip;
  53. rt_uint32_t sp;
  54. rt_uint32_t lr;
  55. rt_uint32_t pc;
  56. };
  57. #if(0)
  58. struct rt_hw_register{
  59. rt_uint32_t r0;
  60. rt_uint32_t r1;
  61. rt_uint32_t r2;
  62. rt_uint32_t r3;
  63. rt_uint32_t r4;
  64. rt_uint32_t r5;
  65. rt_uint32_t r6;
  66. rt_uint32_t r7;
  67. rt_uint32_t r8;
  68. rt_uint32_t r9;
  69. rt_uint32_t r10;
  70. rt_uint32_t fp;
  71. rt_uint32_t ip;
  72. rt_uint32_t sp;
  73. rt_uint32_t lr;
  74. rt_uint32_t pc;
  75. rt_uint32_t cpsr;
  76. rt_uint32_t ORIG_r0;
  77. };
  78. #endif
  79. #endif
  80. /* rt_hw_register offset */
  81. #define S_FRAME_SIZE 68
  82. #define S_PC 64
  83. #define S_LR 60
  84. #define S_SP 56
  85. #define S_IP 52
  86. #define S_FP 48
  87. #define S_R10 44
  88. #define S_R9 40
  89. #define S_R8 36
  90. #define S_R7 32
  91. #define S_R6 28
  92. #define S_R5 24
  93. #define S_R4 20
  94. #define S_R3 16
  95. #define S_R2 12
  96. #define S_R1 8
  97. #define S_R0 4
  98. #define S_CPSR 0
  99. #endif