[coreboot] __attribute__((stdcall)) vs. __attribute__((regparm(0)))

ron minnich rminnich at gmail.com
Thu Oct 16 17:48:43 CEST 2008

On Thu, Oct 16, 2008 at 8:45 AM, Myles Watson <mylesgw at gmail.com> wrote:
>> -----Original Message-----
>> From: ron minnich [mailto:rminnich at gmail.com]
>> Sent: Thursday, October 16, 2008 9:41 AM
>> To: Myles Watson
>> Cc: Segher Boessenkool; Carl-Daniel Hailfinger; Coreboot
>> Subject: Re: [coreboot] __attribute__((stdcall)) vs.
>> __attribute__((regparm(0)))
>> On Thu, Oct 16, 2008 at 7:58 AM, Myles Watson <mylesgw at gmail.com> wrote:
>> >
>> > The question is what attribute can be used to make those functions have
>> the
>> > normal calling convention when compiling with -mregparm=3.  We're using
>> > -mregparm=3 for speed reasons.
>> >
>> The simplest thing: put all the functions that need regparm=0 in one
>> file, compile that file with regparm=0
> There's a warning in the man pages for gcc that says that you have to
> compile all the functions (including libraries) with the same setting.

that's because they can not call each other otherwise if compiled with
different regparm settings.

biosint is only called from assembly, so it really doesn't matter. The
issue is that the assembly that calls biosint is written
with as "regparm=0", from long ago, and the rules got changed when we
set regparm=3.

Again, only functions called from assembly for vm86 mode need to be
compiled with regparm=0.


More information about the coreboot mailing list