Skip to contentSkip to conversation

fastcall and asmlinkage in x86

Adeos-main Jan Kiszka 2 participants 2 messages Dec 28, 2007

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi Philippe,

most of the code in arch/x86/ipipe_*.c can be pushed into some ipipe-common.c, reducing the patch size by 10-20k and improving code maintainability.

But one thing is currently blocking a copy&paste move: a lot of functions that are declared fastcall on 32 bit are asmlinkage on 64 bit. As both asmlinkage and fastcall are meaningless on 64 bit, can we safely switch to fastcall? Or even better, could we drop that redundant declarations totally, given that everything is fastcall on 32 bit anyway (unless its marked asmlinkage)?

Thanks,
Jan

#1 lore raw
Quoted 8 lines · Jan Kiszka

Hi Philippe,

most of the code in arch/x86/ipipe_*.c can be pushed into some ipipe-common.c, reducing the patch size by 10-20k and improving code maintainability.

But one thing is currently blocking a copy&paste move: a lot of functions that are declared fastcall on 32 bit are asmlinkage on 64 bit.

2.4/x86 legacy that survived.

Quoted 2 lines

As both asmlinkage and fastcall are meaningless on 64 bit, can we safely switch to fastcall?

Yes.

Or even better, could we drop that redundant

Quoted 3 lines

declarations totally, given that everything is fastcall on 32 bit anyway (unless its marked asmlinkage)?

I see -mregparm=3 unconditionally set in arch/x86/Makefile_32, so this should work. Looking at some assembly call sites (exception handling/diversion) tends to confirm this; AFAIR we should not have any regparm(0) code anywhere. Well, if we still do have some, you will be the first to know...

Signature · 1 line
Philippe.