Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

__inline, ARM7 and IAR compiler

Posted by mike on December 11, 2007
Hello All

I am using the IAR ewarm (4.42a) with freeRTOS 4.5.0 at present, and am looking into using some __inline functions.

I find that portmacro.h for the IAR compiler and at91sam7s includes #define inline in Compiler specifics, so that I still don't get inlining even with #define __inline inline added.

If I comment out the #define in portmacros.h the compiler objects to two basic functions:vTaskSwitchContext and vTaskIncrementSwitch, both apparently because they are declared as __inline in the header file, and defined in the source file the same way, which the IAR compiler doesn't seem able to cope with.

To keep rolling on I have commented out the __inline tags, but this doesn't seem the correct way forward.

Do these functions need to be __inline? Is inlining significant in gaining speed of operation?

Any thoughts welcomed

Mike Newsome

Hitek Power Ltd, England

RE: __inline, ARM7 and IAR compiler

Posted by Richard on December 11, 2007
The inline thing is a legacy from one of the first ports and is a PITA now. It should be removed.

The #define in portmacro.h is to prevent the problem you are finding when you comment it out. The order in which the include files are listed should be such that the #define does not effect other include files (it comes after), but will your own code. The library files provided by atmel make heavy use of inlines, but these should work correctly the way things are at the moment.

Regards.


RE: __inline, ARM7 and IAR compiler

Posted by mike on December 11, 2007
Thanks, Richard

I wanted to make use if a bit of inlining for speed, and was starting to play around with it.

I have commented out the bits in question while I play, and will decide later!

While I understand the concept of in line code, it seems that IAR at least _may_ not inline it, and in this case would put a copy of the function in every module that calls it!

There is also a #pragma inline, but I feel the keyword is more useful - it can be #defined away!

Many thanks

Mike Newsome


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists