AR# 22480

|

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

Description

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

Solution

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

Linked Answer Records

Master Answer Records

Answer Number Answer Title Version Found Version Resolved
34609 12.x EDK - Master Answer Record List N/A N/A
AR# 22480
Date 12/15/2012
Status Active
Type General Article
Tools
People Also Viewed