use of stack in lcf file.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

use of stack in lcf file.

1,712件の閲覧回数
ash_aricent
Contributor I

Please help me. I am stuck with this for more than a month.

 

Here are some content of a standard lcf file.

 

.custom :
    {
        ___HEAP_START    = .;
        ___heap_addr    = ___HEAP_START;
        ___HEAP_END        = ___HEAP_START + ___heap_size;
        ___SP_END        = ___HEAP_END;
        ___SP_INIT        = ___SP_END + ___stack_size;
        ___free_mem     = ___SP_INIT;

        . = ALIGN (0x4);
    } >> userram

 

 

Where does RTOS/Compiler use this heap and stack ?

 

We are working with MCF520X mp.

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

949件の閲覧回数
CrasyCat
Specialist III

Hello

 

The startup code is initializing the stack according to the value of __SP_INIT in file CF_startup.c.

 

The heap is allocated in alloc.c according to settings of ___heap_addr.

 

CF_Startup.c is stored in {Install}\ColdFire_Support\Runtime\Runtime_ColdFire\Source

alloc.c can be found in {Install}\ColdFire_Support\msl\MSL_C\MSL_Common\Src

 

CrasyCat

0 件の賞賛
返信

949件の閲覧回数
ash_aricent
Contributor I

Let me explain my question.

 

Is it used for

 

a) Global variable

b) local variable

c) function calls

d) thread context switch

e) dynamic memory allocation

 

Consider that we are using some RTOS also.

0 件の賞賛
返信

949件の閲覧回数
CrasyCat
Specialist III

Hello

 

Basically and this is a standard way of operation for an ANSI C compiler

   - Heap is used for dynamic memory allocation

   - stack is used for function calls, local variables and parameters.

 

CrasyCat

0 件の賞賛
返信