x86 procedure calling convention.

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

 



Hi All,

Pardon my naive question, I am newbe in x86 (32bit) architecture and I
got hard time to find info on x86 procedure convention with GCC.

The doc I found so far say that with __attribute__((fastcall)) it is
possible to pass up to 2 long into regs ecx, edx.

Yet looking at linux kernel code I got this on a piece of code.

disass crash_kexec
0xc049a8c0 crash_kexec:
....
0x00000000c049a922         movl   kexec_crash_image,%eax
0x00000000c049a927         calll  machine_kexec

The C code shows
void crash_kexec(struct pt_regs *regs)
{...
                        machine_kexec(kexec_crash_image);
 }

and machine_kexec() prolog shows
0xc042c2a0 machine_kexec:
0x00000000c042c2a0         pushl  %ebp
0x00000000c042c2a1         pushl  %edi
0x00000000c042c2a2         pushl  %esi
0x00000000c042c2a3         pushl  %ebx
0x00000000c042c2a4         movl   %eax,%ebx
0x00000000c042c2a6         subl   $0x2c,%esp

With a save of eax (suposedly args0) into a callee save.

So my question, does GCC under some circumstance does pass args0 into rax ?

Thanx in advance
Cheers,
Phi


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux