[coreboot] __attribute__((stdcall)) vs. __attribute__((regparm(0)))
Carl-Daniel Hailfinger
c-d.hailfinger.devel.2006 at gmx.net
Thu Oct 16 15:12:44 CEST 2008
[taking in Segher as gcc expert]
On 16.10.2008 14:53, Myles Watson wrote:
> On Wed, Oct 15, 2008 at 5:44 PM, Carl-Daniel Hailfinger wrote:
>
>> On 16.10.2008 01:13, Peter Stuge wrote:
>>
>>> ron minnich wrote:
>>>
>>>> Myles, try setting -mregparm=0 and see if life is better.
>>>>
>>>>
>>> Good find.
>>>
>>>
>> __attribute__((stdcall)) will do this for you.
>>
> It doesn't work for me. I tried it in various places, but it doesn't change
> the way the parameters are handled.
>
> void __attribute__ ((stdcall)) callbiosint(void)
> __attribute__ ((stdcall)) void callbiosint(void)
> void callbiosint(void) __attribute__ ((stdcall))
>
> biosint: INT# 0x18
> biosint: eax 0x2e ebx 0x10000 ecx 0xfe4 edx 0xcf11c
> biosint: ebp 0xc0000000 esp 0xd0000 edi 0x1a esi 0x0
> biosint: ip 0x1022 cs 0xf flags 0x2067
> BIOSINT: Unsupport int #0x18
>
What about __attribute__((regparm(0))) ?
The gcc documentation is not clear on this, but a call made this way
should take all of its arguments from the stack.
Segher: How do regparm(0) and stdcall differ for i386?
Regards,
Carl-Daniel
--
http://www.hailfinger.org/
More information about the coreboot
mailing list