asm_defines.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Copyright (c) 2008-2012, Freescale Semiconductor, Inc.
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without modification,
  6. * are permitted provided that the following conditions are met:
  7. *
  8. * o Redistributions of source code must retain the above copyright notice, this list
  9. * of conditions and the following disclaimer.
  10. *
  11. * o Redistributions in binary form must reproduce the above copyright notice, this
  12. * list of conditions and the following disclaimer in the documentation and/or
  13. * other materials provided with the distribution.
  14. *
  15. * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
  16. * contributors may be used to endorse or promote products derived from this
  17. * software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  20. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  21. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  22. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  23. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  24. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  25. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  26. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. */
  30. /*!
  31. * @file asm_defines.h
  32. * @brief defines for startup assembly code
  33. *
  34. * @ingroup diag_util
  35. */
  36. #ifndef _ASM_DEFINES_H_
  37. #define _ASM_DEFINES_H_
  38. ////////////////////////////////////////////////////////////////////////////////
  39. // Definitions
  40. ////////////////////////////////////////////////////////////////////////////////
  41. //! @name CPSR fields
  42. //@{
  43. #define CPSR_N (1 << 31) //!< Negative
  44. #define CPSR_Z (1 << 30) //!< Zero
  45. #define CPSR_C (1 << 29) //!< Carry
  46. #define CPSR_V (1 << 28) //!< Overflow
  47. #define CPSR_Q (1 << 27) //!< Saturation
  48. #define CPSR_E (1 << 9) //!< Endianness
  49. #define CPSR_A (1 << 8) //!< Async abort mask
  50. #define CPSR_I (1 << 7) //!< IRQ mask
  51. #define CPSR_F (1 << 6) //!< FIQ mask
  52. #define CPSR_T (1 << 5) //!< Thumb mode
  53. #define CPSR_MODE (0x1f) //!< Current processor mode
  54. //@}
  55. //! @name Mode bits in CPSR
  56. //@{
  57. #define MODE_USR 0x10 //!< User mode
  58. #define MODE_FIQ 0x11 //!< FIQ mode
  59. #define MODE_IRQ 0x12 //!< IRQ mode
  60. #define MODE_SVC 0x13 //!< Supervisor mode
  61. #define MODE_ABT 0x17 //!< Abort exception mode
  62. #define MODE_UND 0x1B //!< Undefined instruction exception mode
  63. #define MODE_SYS 0x1F //!< System mode
  64. //@}
  65. //! @name Interrupt enable bits in CPSR
  66. //@{
  67. #define I_BIT 0x80 //!< When I bit is set, IRQ is disabled
  68. #define F_BIT 0x40 //!< When F bit is set, FIQ is disabled
  69. //@}
  70. //! @name Stack sizes
  71. //@{
  72. //! @brief Size of stacks for exceptions.
  73. #define EXCEPTION_STACK_SIZE 2048
  74. //! @brief Supervisor mode stack size.
  75. //!
  76. //! This stack is much larger because most application code runs in
  77. //! Supervisor mode.
  78. #define SVC_STACK_SIZE 8192
  79. //@}
  80. #endif /*_ASM_DEFINES_H_ */
  81. ////////////////////////////////////////////////////////////////////////////////
  82. // EOF
  83. ////////////////////////////////////////////////////////////////////////////////