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 18 #ifndef _ARM_BX_H 19 #define _ARM_BX_H 20 21 /* We need features.h first */ 22 #if !defined _FEATURES_H 23 #error Please include features.h first 24 #endif /* features.h not yet included */ 25 26 #if __ARM_ARCH > 4 || defined (__ARM_ARCH_4T__) 27 # define ARCH_HAS_BX 28 #endif 29 30 #if defined(ARCH_HAS_BX) 31 # define BX(reg) bx reg 32 # define BXC(cond, reg) bx##cond reg 33 #else 34 # define BX(reg) mov pc, reg 35 # define BXC(cond, reg) mov##cond pc, reg 36 #endif 37 38 #endif /* _ARM_BX_H */ 39