Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


vPortEnableInterruptsFromThumb use

Posted by Bill Florac on March 3, 2008
Im confused as to use of the function vPortDisableInterruptsFromThumb()[see: portDISABLE_INTERRUPTS]. It does not appear to result in any different code then vPortEnterCritical()[see: portENTER_CRITICAL]. Both functions disable interrupts and both are contained in the portISR.c code. All the code here is defined as ARM and it seems the GCC compiler correct puts it in and out of THUMB mode when these are called.

RE: vPortEnableInterruptsFromThumb use

Posted by Richard on March 3, 2008
When compiling your entire application in ARM mode it is more efficient to disable/enable interrupts using an inline macro, but this macro uses ARM instructions. When compiling your code in THUMB mode you cannot use the macro (as it contains ARM instructions) so instead a function call is used. When using ARM/THUMB interworking the compiler will ensure you switch to ARM mode on entry to the function, so the function is compiled to ARM mode. It is called "FromThumb", but compiled to ARM, with the compiler taking care of the switching.


RE: vPortEnableInterruptsFromThumb use

Posted by Bill Florac on March 4, 2008
It seems odd that the "FromThumb" version is only called once. Elsewhere, the other version is called. So if one compiles with Thumb/Interworking off but in THUMB mode, shouldn't the "FromThumb" always be called?


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

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

Meet us at Embedded World. Hall 3A-525.

Hear from Richard Barry at Embedded World. Feb 28, 16:00, Hall 4-428.

Video: Watch James Gosling & Richard Barry at re:Invent, Las Vegas 2017.

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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

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

OpenRTOS and SafeRTOS