12.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C LanguageLoad exclusive byte.__LDREXHunsigned volatile short __LDREXH(unsigned short *addr);Load exclusive half-word.__LDREXWunsigned int volatile __LDREXW(unsigned int *addr);Load exclusive word.__STREXBunsigned int volatile __STREXB(unsigned char value, unsigned char *addr);Store exclusive byte.__STREXHunsigned int volatile __STREXH(unsigned short value, unsigned short *addr);Store exclusive half-word.__STREXWunsigned int volatile __STREXW(unsigned int value, unsigned int *addr);Store exclusive word.__CLREXvoid volatile __CLREX(void);Remove the exclusive lock created by __LDREXB, __LDREXH, or __LDREXW.1.10.4.1. Writing Your Own Intrinsic FunctionBecause you can use any assembly instruction with the __asm() keyword, you can use the __asm()keyword to create your own intrinsic functions. The essence of an intrinsic function is that it is inlined.1. First write a function with assembly in the body using the keyword __asm(). See Section 1.5, UsingAssembly in the C Source: __asm()2. Next make sure that the function is inlined rather than being called.You can do this with the functionqualifier inline.This qualifier is discussed in more detail in Section 1.10.2, Inlining Functions: inline.inline int __my_pow( int base, int power ){int result;31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!