asmlinkage

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
crg

asmlinkage

Post 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.
carbonBased

RE:asmlinkage

Post 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
Post Reply