[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] Stack alignment (was Re: libgem16: vs_color)



Le Tue, 19 Jan 2010 10:40:47 +0100
Vincent Rivière <vincent.riviere@freesbee.fr> a écrit:

> 
> Helmut Karlowski wrote:
> > It gets the stack from the kernel. I changed to the trunk-MiNT (ozk-MiNT 
> > does also) and everything is even. The ozk-XaAES now detects 
> > pixel-format also. So it's all up to using the right kernel (or a fixed 
> > fvdi).
> 
> Congratulations for this investigation.
> 
> Of course, as everyone says, an odd stack is totally unacceptable. It 
> crashes on 68000 and ColdFire, and is slow on 68020+.
> 
> I would like to know an additional thing.
> Does MiNT really provide XaAES an odd stack at the beginning, or does 
> the stack become odd later ?

Maybe the startup code is faulty and/or the generated program header.

Most programs use basepage size (256) + TEXT length + DATA length + BSS
length + stack size to do the original Mshrink, and set the stack at
the end of this Mshrink()ed block.

It's obvious that you could end with an odd pointer if either section
has an odd length, not counting the fact that aligning the stack on 4
byte boundaries will help performance.

-- 
Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Spécialité: Développement, jeux