arm_bx.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Copyright (C) 2013 Yann E. MORIN <yann.morin.1998@free.fr>
  2. *
  3. * This file is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU Lesser General Public License as
  5. * published by the Free Software Foundation; either version 2.1 of
  6. * the License, or (at your option) any later version.
  7. *
  8. * This file is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public
  14. * License along with the GNU C Library; if not, see
  15. * <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef _ARM_BX_H
  18. #define _ARM_BX_H
  19. /* We need features.h first */
  20. #if !defined _FEATURES_H
  21. #error Please include features.h first
  22. #endif /* features.h not yet included */
  23. #if __ARM_ARCH > 4 || defined (__ARM_ARCH_4T__)
  24. # define ARCH_HAS_BX
  25. #endif
  26. #if defined(ARCH_HAS_BX)
  27. # define BX(reg) bx reg
  28. # define BXC(cond, reg) bx##cond reg
  29. #else
  30. # define BX(reg) mov pc, reg
  31. # define BXC(cond, reg) mov##cond pc, reg
  32. #endif
  33. #endif /* _ARM_BX_H */