6

I am trying to compile a driver. Version of my kernel is 3.2.0-27-generic.

I left only includes that I need:

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/dmi.h>

These headers are found. But when I try to compile I get error that asm/cache.h file is not found. When I dug dipper I found that there is no such folder as "asm", but asm-generic and it contains required headers.

It's structure of folder with headers: Why was it renamed? Because of it I can't compile another drivers. If I rename "asm-geneic "to "asm" it will lead to other missing headers. What's wrong here?

Tebe
  • 3,176
  • 8
  • 40
  • 60

1 Answers1

4

asm/cache.h is architecture dependent, there are different asm directory for different architectures

arch/powerpc/include/asm/
arch/x86/include/asm/
arch/arm/include/asm
[...]

You can't rename include/asm-generic to include/asm because your problem is that you can't reach the architecture asm folder. Try to check your .config file or set manually the ARCH variable.

Federico
  • 3,782
  • 32
  • 46
  • ah, I got. I added new path /usr/src/linux-headers-3.2.0-27/arch/x86//include. It works. My architecture is x86. But I got new errors like this http://img6.imagebanana.com/img/vqfu6vpy/01375431072012_001.png . Could you offer some cure or how? I did nothing, I only included headers. – Tebe Jul 30 '12 at 22:39
  • You don't need to include anything, it should work automatically. Try to look this example [link](http://www.cyberciti.biz/tips/compiling-linux-kernel-module.html). – Federico Aug 03 '12 at 14:57