Quality RTOS & Embedded Software

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




Loading

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

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.

Regards.

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?

Bill


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




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

Latest News

FreeRTOS kernel V10 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