busybox/src/include/platform.h
/* FAST_FUNC is a qualifier which (possibly) makes function call faster * and/or smaller by using modified ABI. It is usually only needed * on non-static, busybox internal functions. Recent versions of gcc * optimize statics automatically. FAST_FUNC on static is required * only if you need to match a function pointer's type */#if __GNUC_PREREQ(3,0) && defined(i386) /* || defined(__x86_64__)? *//* stdcall makes callee to pop arguments from stack, not caller */# define FAST_FUNC __attribute__((regparm(3),stdcall))/* #elif ... - add your favorite arch today! */#else# define FAST_FUNC#endif
busybox中經常有這種聲明:再看FAST_FUNC屬性函數的定義格式:
在gcc編譯器中
__attribute__((regparm(3),stdcall))的含義是:
regparm (number)
On the Intel 386, the regparm attribute causes the compiler to pass up to number integer arguments in registers EAX, EDX, and ECX instead of on the stack. Functions that take a variable number of arguments will continue to be passed all of their arguments on the stack. stdcall On the Intel 386, the stdcall attribute causes the compiler to assume that the called function will pop off the stack space used to pass arguments, unless it takes a variable number of arguments.