[ofa-general] Re: __always_inline macro usage
Gleb Natapov
glebn at voltaire.com
Tue Oct 23 01:40:05 PDT 2007
On Tue, Oct 23, 2007 at 10:43:16AM +0200, Jack Morgenstein wrote:
> On Tuesday 23 October 2007 10:28, Jack Morgenstein wrote:
> > On Tuesday 23 October 2007 09:23, Gleb Natapov wrote:
> > > And where is "#include <linux/compiler.h>" here?
> > >
> > Point taken. However, I checked on Red Hat Enterprise Linux 4 (update 5)
> > distributions. the macro "__always_inline" is not present there (see below).
> > They use "inline" or "__inline__" or "__inline" instead.
> >
> Correction.
>
> In Kernel space, the __always_inline macro is present (in file /lib/modules/<kernel>/source/linux/compiler.h.
>
> However, in user space, the file used is: /usr/include/linux/compiler.h:
> #ifndef __LINUX_COMPILER_H
> #define __LINUX_COMPILER_H
>
> #define likely(x) __builtin_expect((x),1)
> #define unlikely(x) __builtin_expect((x),0)
>
> #endif /* __LINUX_COMPILER_H */
>
> The __always_inline macro is not defined for userspace in RHEL4.
I am not sure those macros (and header) are meant to be used by userspace.
>
> Any ideas (other than just including a macro ourselves:
> #ifndef __always_inline
> #define __always_inline inline
> #endif
> )?
>
> - Jack
--
Gleb.
More information about the general
mailing list