[lug] pte_offset in a device driver isn't being found

Jonathan Corbet corbet-blug at lwn.net
Sat Jun 21 11:00:23 MDT 2003


> I'm trying to compile a driver that is using pte_offset().  Linux Device
> Drivers says that include asm/page.h and asm/pgtable.h for this.  I've
> added these (they were missing) but I still get "implicit declaration of
> function pte_offset" when I compile.  The object compiles okay, but I
> want to clean this last warning up before trying the driver out.

Good thinking - seeing as it's a macro, things will work poorly if you
don't have the definition around.  You'll not get your module to load.

The macro, for the x86 architecture (is that what you're on?) is defined in
asm-i386/pgtable.h.  It is inside an ifdef:

	#ifndef __ASSEMBLY__

	#endif

But that *shouldn't* be a problem.  Something to check, though.

> I'm including /usr/include and /usr/src/linux-<uname -r>/include in the
> header search path.

For kernel builds, you really shouldn't be getting anything from
/usr/include at all.  Take it out of the path, it can only cause trouble.

jon

Jonathan Corbet
Executive editor, LWN.net
corbet at lwn.net



More information about the LUG mailing list