This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Fwd: __ARM_ARCH_2__
- From: zhaobin xv <xvzhaobin at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 8 Aug 2013 17:37:02 +0800
- Subject: Fwd: __ARM_ARCH_2__
- References: <CANEcUBX5RvrUEkC2iFZ9ZbvUEkDr4U3F+9v3QKiL_s675MNnwA at mail dot gmail dot com> <5203632d dot c25d0e0a dot 099a dot ffffedaaSMTPIN_ADDED_BROKEN at mx dot google dot com> <CANEcUBU0KGifh91nB9VEvXBUxgk081uw-=Q-ntLPS6V=EtvxaQ at mail dot gmail dot com>
Thank you for your answer
if __ARM_ARCH_2__ is defined by GCC when compiling for the ARMv2
architecture,how do gcc know the architecture is ARMv2?
and I can't find thing about __ARM_ARCH_2__ in gcc manual,could you
tell me where I can find
2013/8/8 Kyrylo Tkachov <kyrylo.tkachov@arm.com>:
>> Hi
>>
>> In linux/arch/arm/boot/
>> compressed/head.S:
>>
>>
>> #ifndef __ARM_ARCH_2__
>> /*
>> * Booting from Angel - need to enter SVC mode and disable
>> * FIQs/IRQs (numeric definitions from angel arm.h source).
>> * We only do this if we were in user mode on entry.
>> */
>> mrs r2, cpsr @ get current mode
>> tst r2, #3 @ not user?
>> bne not_angel
>> mov r0, #0x17 @ angel_SWIreason_EnterSVC
>> swi 0x123456 @ angel_SWI_ARM
>>
>>
>> I don't know what the"__ARM_ARCH_2__" mean?
>
> __ARM_ARCH_2__ is defined by GCC when compiling for the ARMv2 architecture.
> GCC defines an __ARM_ARCH_<architecture version>__ predefine when compiling
> for a particular architecture.
>
> In the snippet you posted it is used to make sure the code below the #ifndef
> is not used/compiled when targeting ARMv2.
>
> HTH,
> Kyrill
>
> P.S. In the future, questions like these go on the gcc-help list. The gcc list
> is used for discussions on the development of gcc.
>
>
>