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

FreeRTOS 4.0.4, GCC: Inlining

Posted by Thomas K.-H. Nittel on July 19, 2006
Hi,

when the module FreeRTOSV4.0.4\FreeRTOS\Source\portable\GCC\ARM7_AT91SAM7S\portISR.c is compiled with arm-elf-gcc 4.1.0 the following warning appears
...
Source/portable/GCC/ARM7_AT91SAM7S/portISR.c -o portISR.o
../../Source/FreeRTOS_4.0.4/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c: In function 'vPreemptiveTick':
../../Source/FreeRTOS_4.0.4/Source/include/task.h:832: warning: inlining failed in call to 'vTaskIncrementTick': function body not available
../../Source/FreeRTOS_4.0.4/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c:144: warning: called from here

Obviously inlining doesn't work with GCC.

gcc.pdf, page 216 recommends to put the function definition in a header file with the keywords inline and extern.
If 'vTaskIncrementTick' is put as 'extern inline void vTaskIncrementTick( void )' in 'task.h' inlining will work with GCC, too. Of cause some declarations of variables, functions and macros of 'tasks.c' are addtionally necessary in 'task.h'.

I found the above mentioned document at http://www.gnuarm.org/. Its title is 'Using the GNU Compiler Collection' for GCC 3.3.2 and dated from 20. December 2002. A newer version doesn't seem to be available.

The compiler command which I used is
arm-elf-gcc -c -I../../Source/Demo -I../../Source/FreeRTOS_4.0.4/Source/include -I../../Source/FreeRTOS_4.0.4/Source/portable/GCC/ARM7_AT91SAM7S -I../../Source/Utilities -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wno-strict-aliasing -Winline -D THUMB_INTERWORK -D SAM7_GCC -mthumb-interwork -mcpu=arm7tdmi -MMD -finline-limit=1000 -Os ../../Source/FreeRTOS_4.0.4/Source/portable/GCC/ARM7_AT91SAM7S/portISR.c -o portISR.o

Best regards

Thomas

RE: FreeRTOS 4.0.4, GCC: Inlining

Posted by Nobody/Anonymous on July 19, 2006
The inline is a legacy thing. Most portmacro.h files include the lilne

#define inline

to remove it from the code and prevent any warnings.

RE: FreeRTOS 4.0.4, GCC: Inlining

Posted by Thomas K.-H. Nittel on July 19, 2006
Hi,
of cause warnings can be avoided this way. But I want my code to be inlined so that the function call overhead is spared. For an example see my posting 'RE: FreeRTOS 4.0.4, AT91SAM7X256, Timertick
2006-07-19 14:05'
Regards
Thomas


[ 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