12.07.2015 Views

MPLAB C32 C COMPILER USER'S GUIDE

MPLAB C32 C COMPILER USER'S GUIDE

MPLAB C32 C COMPILER USER'S GUIDE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>MPLAB</strong> ® <strong>C32</strong> C Compiler User’s GuideThe standard library function exit calls the weak function _exit prior to returning.The standard library functions for signals, signal and raise, are implemented asweak functions which always fail.The standard library functions for locales, setlocale and localeconv, areimplemented as weak functions which do nothing.The standard library function for accessing environment variables, getenv, isimplemented as a weak function which always returns NULL.2.5 “HELPER” HEADER FILES2.5.1 sys/attribs.hMacros are provided for many commonly used attributes in order to enhance user codereadability.__section__(s) Apply the section attribute with section name s.__unique_section__Apply the unique_section attribute.__ramfunc__Locate the attributed function in the RAM function codesection.__longramfunc__Locate the attributed function in the RAM function codesection and apply the longcall attribute.__longcall__Apply the longcall attribute.__ISR(v,ipl)Apply the interrupt attribute with priority level ipland the vector attribute with vector number v.__ISR_AT_VECTOR(v,ipl) Apply the interrupt attribute with priority level ipland the at_vector attribute with vector number v.2.5.2 sys/kmem.hSystem code may need to translate between virtual and physical addresses, as well asbetween kernel segment addresses. Macros are provided to make these translationseasier and to determine the segment an address is in.KVA_TO_PA(v)PA_TO_KVA0(pa)PA_TO_KVA1(pa)KVA0_TO_KVA1(v)KVA1_TO_KVA0(v)IS_KVA(v)IS_KVA0(v)IS_KVA1(v)IS_KVA01(v)Translate a kernel virtual address to a physical address.Translate a physical address to a KSEG0 virtual address.Translate a physical address to a KSEG1 virtual address.Translate a KSEG0 virtual address to a KSEG1 virtual address.Translate a KSEG1 virtual address to a KSEG0 virtual address.Evaluates to 1 if the address is a kernel segment virtual address,zero otherwise.Evaluate to 1 if the address is a KSEG0 virtual address, zerootherwise.Evaluate to 1 if the address is a KSEG1 virtual address, zerootherwise.Evaluate to 1 if the address is either a KSEG0 or a KSEG1 virtualaddress, zero otherwise.2.6 MULTILIBS2.6.1 What are Multilibs?With multilibs, target libraries are built multiple times with a permutated set of options.Multilibs are the resulting set of target libraries that are built with these options. Whenthe compiler shell is called to compile and link an application, the shell chooses theversion of the target library that has been built with the same options.DS51686A-page 44© 2007 Microchip Technology Inc.

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

Saved successfully!

Ooh no, something went wrong!