[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problem including <asm/timex.h> (linux-kernel-headers 2.6.17)



>> /usr/include/linux/seqlock.h:76: error: expected '=', ',', ';\
>> ', 'asm' or '__attribute__' before 'unsigned'
>> /usr/include/linux/seqlock.h:91: error: expected '=', ',', ';\
>> ', 'asm' or '__attribute__' before 'int'
> 
> This comes from the __always_inline that is not defined. To define it, include 
> linux/compiler.h
> Kernel headers tend to not include all headers for the things they use, you 
> magically have to find the right combination yourself.
> 

Thanks for your answer. This takes me one step further, which is this:

RTESys_MicroTime.c fast
In file included from /usr/include/linux/cpumask.h:86,
                 from /usr/include/asm-x86_64/processor.h:23,
                 from /usr/include/asm/processor.h:8,
                 from /usr/include/asm-x86_64/timex.h:14,
                 from /usr/include/asm/timex.h:8,
                 from RTESys_MicroTime.c:77:
/usr/include/linux/bitmap.h: In function 'bitmap_zero':
/usr/include/linux/bitmap.h:128: error: 'BITS_PER_LONG' undeclared \
(first use in this function)
/usr/include/linux/bitmap.h:128: error: (Each undeclared identifier is \


BITS_PER_LONG seems to be declared in asm/types.h (i.e.
asm-x86_64/types.h in my case) and looks like this:

/*
 * These aren't exported outside the kernel to avoid name space clashes
 */
#ifdef __KERNEL__

#define BITS_PER_LONG 64

#ifndef __ASSEMBLY__
....

The same is true for the macro DECLARE_BITMAP which is used in cpumask.h
and defined in linux/types.h.

So this brings me back to me original problem: are user-space
applications allowed/supposed to use these headers? And if so, how are
they to be used if the headers rely on __KERNEL__ to be defined?

Thanks once more for any help,

Martin.



Reply to: