AR# 22480

12.1 EDK - Are there target-specific definitions for the MicroBlaze and PowerPC processors?

描述

Are there target-specific definitions for the MicroBlaze and PowerPC processors in the GNU compiler?

解决方案

There are target-specific #defines built into mb-gcc and powerpc-eabi-gcc compilers. Following is an example piece of code to demonstrate usage for MicroBlaze and PowerPC, respectively:

#if defined(__PPC__)

if (hdr->ih_arch != IH_CPU_PPC)

#elif defined(__MICROBLAZE__)

if (hdr->ih_arch != IH_CPU_MICROBLAZE)

#else

# error Unknown CPU type

#endif

链接问答记录

主要问答记录

Answer Number 问答标题 问题版本 已解决问题的版本
34609 12.x EDK - 主要问答记录列表 N/A N/A
AR# 22480
日期 12/15/2012
状态 Active
Type 综合文章
Tools