ARM Technical Support Knowledge Articles

USING SETJMP AND LONGJMP WITH CODE BANKING AND RTX51

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

Can the setjmp and longjmp functions be used in code banking programs and/or RTX51 programs?

ANSWER

The setjmp and longjmp functions may be used in code banking programs as long as the setjmp and longjmp target located within the same code bank or the common area. Problems arise when jumping from a code bank to the common area or when jumping from the common area to a code bank.

The same rules apply for RTX51 programs. Additionally, the setjmp and longjmp target must be located in the same task context. It is impossible to jump from one task to another since different tasks use different stacks.

It is not safe to use setjmp and longjmp with RTX51 Tiny since this operating system performs dynamic stack swapping.

MORE INFORMATION

Article last edited on: 2005-07-18 18:26:51

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential