public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* possible mistake in linux kernel header file -- kernel: 2.6.16.29 file: mod_devicetable.h
@ 2007-03-28  3:28 smitchel
  0 siblings, 0 replies; 2+ messages in thread
From: smitchel @ 2007-03-28  3:28 UTC (permalink / raw)
  To: linux-kernel

I am not sure where to post this, maybe you can direct me what to do, if 
anything.

We have two computers running slackware for amd64 version 11.0.
Tonight we compiled mplayer on each of the systems.

On the first, everything compiled fine--it has a core 2 duo cpu and is 
running a stock kernel off the install DVD for slackware-amd64.
it is kernel 2.6.16.29.

On the second it would not compile, and it has dual opteron 250 cpus and 
is running a kernel that we compiled to add some things to
for sound, etc.   This was from a kernel source that we downloaded a few 
days ago.
it is kernel 2.6.16.29--same as first machine.

The error is stopping in the file /usr/include/linux/mod_devicetable.h.

It appears that there are 4 extra lines that have been added to the  
mod_devicetable.h that was part of the kernel source that we downloaded.
They are in the first screenful of the file:

#ifdef __KERNEL__
#include <linux/types.h>
typedef unsigned long kernel_ulong_t;
#endif

They are not in the same file in the kernel source from the slackware 
amd-64 install DVD. (<linux/types.h> included somewhere else?)

Googling we found:
__KERNEL__ is defined for programs that run in kernel mode instead of 
user programs (whatever that means).

A few lines later in mod_devicetable.h it uses the type kernel_ulong_t 
(in the same file--what if the ifdef path is not taken?)

We thought that for the header file to be self-consistent, the typedef 
statement should be defined in either case (__Kernel__ defined or not).
So we copied that line out of the ifdef to just below it.
Well that got rid of the type undefined error that occured during make.

We still got a bunch of errors, mostly every word in the 
mod_devicetable.h was individually "not understood" after the 
ifdef-endif lines.

Not wanting to break something somewhere else by defining __KERNEL__ 
when we don't even understand what it does...we copied the
include statement for <linux/types.h> after the endif, so basically both 
lines inside the ifdef are executed all the time.

Now it compiles fine.

Could this be a bug in a kernel header file?  It has to be. if you don't 
have __KERNEL__ defined, then the header file is broken because it uses
the type kernel_ulong_t just a few lines later.

Steve Mitchell
Byrel Mitchell
smitchel@bnin.net



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: possible mistake in linux kernel header file -- kernel: 2.6.16.29 file: mod_devicetable.h
       [not found] <fa.oyzxCetQPxeJg2D2eekG0Gighs4@ifi.uio.no>
@ 2007-03-28 23:09 ` Robert Hancock
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Hancock @ 2007-03-28 23:09 UTC (permalink / raw)
  To: smitchel; +Cc: linux-kernel

smitchel wrote:
> I am not sure where to post this, maybe you can direct me what to do, if 
> anything.
> 
> We have two computers running slackware for amd64 version 11.0.
> Tonight we compiled mplayer on each of the systems.
> 
> On the first, everything compiled fine--it has a core 2 duo cpu and is 
> running a stock kernel off the install DVD for slackware-amd64.
> it is kernel 2.6.16.29.
> 
> On the second it would not compile, and it has dual opteron 250 cpus and 
> is running a kernel that we compiled to add some things to
> for sound, etc.   This was from a kernel source that we downloaded a few 
> days ago.
> it is kernel 2.6.16.29--same as first machine.
> 
> The error is stopping in the file /usr/include/linux/mod_devicetable.h.
> 
> It appears that there are 4 extra lines that have been added to the  
> mod_devicetable.h that was part of the kernel source that we downloaded.
> They are in the first screenful of the file:
> 
> #ifdef __KERNEL__
> #include <linux/types.h>
> typedef unsigned long kernel_ulong_t;
> #endif
> 
> They are not in the same file in the kernel source from the slackware 
> amd-64 install DVD. (<linux/types.h> included somewhere else?)
> 
> Googling we found:
> __KERNEL__ is defined for programs that run in kernel mode instead of 
> user programs (whatever that means).
> 
> A few lines later in mod_devicetable.h it uses the type kernel_ulong_t 
> (in the same file--what if the ifdef path is not taken?)

These compile errors are from compiling mplayer? Something is not right 
here, it shouldn't be including that header file at all - and I'm not 
sure how anything in /usr/include could be ending up trying to do so.

__KERNEL__ is only supposed to be defined when building the kernel 
itself. Current kernels (not sure if 2.6.16 had this though) have a 
process which generates header files suitable for userspace from the 
kernel's header files and strips out everything inside #ifdef __KERNEL__.

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-28 23:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fa.oyzxCetQPxeJg2D2eekG0Gighs4@ifi.uio.no>
2007-03-28 23:09 ` possible mistake in linux kernel header file -- kernel: 2.6.16.29 file: mod_devicetable.h Robert Hancock
2007-03-28  3:28 smitchel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox