13.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

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

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

C LanguageWith the C compiler options --inline-max-incr and --inline-max-size you have more control over theautomatic function inlining process of the compiler.Combining inline with __asm to create intrinsic functionsWith the keyword __asm it is possible to use assembly instructions in the body of an inline function.Because the compiler inserts the (assembly) body at the place the function is called, you can create yourown intrinsic function. See Section 1.10.4.1, Writing Your Own Intrinsic Function.1.10.3. Interrupt Functions / Exception HandlersThe <strong>TASKING</strong> C compiler supports a number of function qualifiers and keywords to program exceptionhandlers. An exception handler (or: interrupt function) is called when an exception occurs.The <strong>ARM</strong> supports seven types of exceptions.The next table lists the types of exceptions and the processormode that is used to process that exception. When an exception occurs, execution is <strong>for</strong>ced from a fixedmemory address corresponding to the type of exception. These fixed addresses are called the exceptionvectors.Exception typeModeNormal addressHigh vectoraddressFunction type qualifierResetSupervisor0x000000000xFFFF0000UndefinedinstructionsUndefined0x000000040xFFFF0004__interrupt_undSupervisor call(software interrupt)Supervisor0x000000080xFFFF0008__interrupt_svcPrefetch abortAbort0x0000000C0xFFFF000C__interrupt_iabtData abortAbort0x000000100xFFFF0010__interrupt_dabtIRQ (interrupt)IRQ0x000000180xFFFF0018__interrupt_irqFIQ (fast interrupt)FIQ0x0000001C0xFFFF001C__interrupt_fiq<strong>ARM</strong>v6-M and <strong>ARM</strong>v7-M (M-profile architectures) have a different exception model. Read the<strong>ARM</strong> Architecture Reference Manual <strong>for</strong> details.1.10.3.1. Defining an Exception Handler: __interrupt KeywordsYou can define six types of exception handlers with the function type qualifiers __interrupt_und,__interrupt_svc, __interrupt_iabt, __interrupt_dabt, __interrupt_irq and__interrupt_fiq. You can also use the general __interrupt() function qualifier.Interrupt functions and other exception handlers cannot return anything and must have a void argumenttype list:void __interrupt_xxxisr( void ){25

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

Saved successfully!

Ooh no, something went wrong!