Sign in

username:

password:



Not a member?

Search c6x



Search tips

Subscribe to c6x



c6x by Keywords

AD535 | BIOS | Booting | Bootloader | C621 | C6211 | C6415 | C671 | C6711 | C6711DSK | C6713 | CCS | Chassaing | COFF | DAT | DM64 | DM642 | DMA | DSK671 | DSK6711 | EDM | EDMA | EMIF | Emulator | EVM | EVM620 | FFT | FIR | GPIO | Halting | HPI | HWI | IDK | JTAG | LDB | LDH | LDW | Linker | LMS | LOG_printf | Matlab | McBSP | MEM_alloc | MIPS | PCI | PCM3003 | Pipeline | Profiling | QDM | Reset | ROM | RTDX | Sampling | SDRAM | Stack | TEB | THS1206 | TMS320C621 | TMS320C6416 | TMS320C6711 | TMS320C6713 | UART | Vector Table | XBUS | XDS560


Discussion Groups

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | TMS320C6x | RE: [infos_TI] Position of __STACK_SIZE symbol

Technical discussions about the TI C6000 DSPs (including the c62x, c64x and c67x DSPs).

  

Post a new Thread

RE: [infos_TI] Position of __STACK_SIZE symbol - Jean-Michel MERCIER - Mar 15 15:27:00 2002


> I think that __STACK_SIZE is the size of the stack, not its position in
memory.
> You could think of it as a compile time constant that doesn't exist anyway in
> the memory map. Look for the .stack section to see exactly where in the DSP's
> address space the stack has been located.

Your right
__STACK_SIZE is a pseudo-symbol that doesn't points anywhere.
The linker use it because it is the only means that they have to pass
information from the linker to the code that have already been compiled.

The same mecanism is used with the heap (__SYSMEM_SIZE).

The code can get the value by using somthing linke :

extern int _STACK_SIZE[];
// you must place only 1 underscore
// and use an extern array definition
and to get the size :
int StackSize = (int)(_STACK_SIZE);
// you do cast what the compiler think is an address (the base address of
// the _STACK_SIZE array but which in reality the stack size as imposed by the
linker Jean-Michel MERCIER




______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

RE: [infos_TI] Position of __STACK_SIZE symbol - C.W. - Mar 15 16:45:00 2002

At 04:27 PM 03/15/02 +0100, Jean-Michel MERCIER wrote:

> > I think that __STACK_SIZE is the size of the stack, not its position in
> memory.
> > You could think of it as a compile time constant that doesn't exist
> anyway in
> > the memory map. Look for the .stack section to see exactly where in the
> DSP's
> > address space the stack has been located.
>
>Your right
>__STACK_SIZE is a pseudo-symbol that doesn't points anywhere.
By which you mean _STACK_SIZE has a VALUE which is NOT AN ADDRESS, but
which is the SIZE of the allocated stack, right?

So while it appears to the original user that it's value is the same as the
address of their vector section, it's merely a coincidence. If they change
the size of the allocated stack (RTFM), the coincidence will no longer exist.

-W


______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )