Page 1 of 1

asmlinkage

Posted: Fri Aug 23, 2002 11:00 pm
by crg
anybody could tell me what registers are used in such a function?

#define asmlinkage __attribute__((__regparm__(3)))

eax, ecx, edx? in which order?

thx.

RE:asmlinkage

Posted: Fri Aug 23, 2002 11:00 pm
by carbonBased
I _believe_ the registers are used in the following order:

long ebx,long ecx,long edx,
long esi, long edi, long ebp, long eax, long ds,
long es, long fs, long gs, long orig_eax,
long eip,long cs,long eflags,long esp,long ss

Which means the first three are what you're looking for.

I'm grabbing this from the parameter list of "asmlinkage int sys_iopl()" in Linux.  So... It's more or less an educated guess.

If you wanna know for sure, why not just write a procedure using "asmlinkage", call it in a test file, and look at the code GCC produces (gcc -S).

Jeff