Quality RTOS & Embedded Software

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


Loading

question to freertos implementation

Posted by pocketstargate on November 12, 2012
Hi!
Can someone explain me why "cli" is not at line 1? Couldn't it be that if it's not called in an isr there could be an interrupt at line 1 - 2 and then r0 isn't saved correct?

And I don't get why r1 has to be cleared?

RE: question to freertos implementation

Posted by pocketstargate on November 12, 2012
oops i forgot the link: http://www.freertos.org/implementation/a00016.html

RE: question to freertos implementation

Posted by Dave on November 12, 2012
Presumably because CLI will change the status register and you the status register cannot be changed until it has first been saved.

RE: question to freertos implementation

Posted by pocketstargate on November 12, 2012
Okay that is plausible, but there's still the chance that it may interrupt between line 1-2?
And why has r1 to be cleared? Just because the compiler generated code assumes something is a little vague reason.

RE: question to freertos implementation

Posted by Dave on November 12, 2012
“but there's still the chance that it may interrupt between line 1-2?”


From reading the explanation on the webpage you link to, it looks like if the function is entered through an interrupt then it can't get interrupted between lines 1 and 2, and if it is entered by a function call then it does not matter if it gets interrupted between lines 1 and 2 (any more than it matters that any function call gets interrupted).

I would have to look at the compiler documentation to know why R1 is cleared, but without doing that just assume the compiler expects it to be zero at some point.


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


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner