Hi,

I am using BBB 3.8.13-bone47 and trying to write the driver for the 4 user 
LEDs.
I am cross-compiling my code on host with the linux-3.8.13 kernel headers(I 
have downloaded 3.8.13 from kernel.org and using inlcude/linux 's headers )

Here is the code i have develop. i want to blink the LEDs after insmod. and 
want to unloaded successfully.

############# LED_Driver.c ########################

#include <linux/init.h>
#include <linux/module.h>
#include<linux/kernel.h>

#define LED_CTR *(unsigned int*)0x4804c134
#define LED_PATT *(unsigned int*)0x4804c13c
MODULE_LICENSE("GPL");
//unsigned int LED_CTR=*(unsigned int*)0x4804c134;
//unsigned int LED_PATT=*(unsigned int*)0x4804c13c;
static int __init led_ins(void)
{
        int i;
        LED_CTR=0;
        LED_PATT=0x01e00000;
        for(i=0;i<100000;i++);
        LED_PATT=0;
        return 0;
}
static void __exit led_ex(void)
{
      printk("LED module unloaded successfully");
}
module_init(led_ins);
module_exit(led_ex);

###################################################

I am using gcc gnueabi cross-compiler installed by   ap-get install 
gcc-arm-linux-gnueabi 


COMMAND:
root@digesh:/home/digesh/Documents/Digesh' content# arm-linux-gnueabi-gcc 
-I /home/digesh/Downloads/linux-3.8.13/include/ -c LED_driver.c 

ERROR:
In file included from LED_driver.c:1:0:
/home/digesh/Downloads/linux-3.8.13/include/linux/init.h:255:13: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parse_early_param’
/home/digesh/Downloads/linux-3.8.13/include/linux/init.h:256:13: error: 
expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before 
‘parse_early_options’
In file included from 
/home/digesh/Downloads/linux-3.8.13/include/linux/kernel.h:6:0,
                 from 
/home/digesh/Downloads/linux-3.8.13/include/linux/cache.h:4,
                 from 
/home/digesh/Downloads/linux-3.8.13/include/linux/time.h:4,
                 from 
/home/digesh/Downloads/linux-3.8.13/include/linux/stat.h:18,
                 from 
/home/digesh/Downloads/linux-3.8.13/include/linux/module.h:10,
                 from LED_driver.c:2:
/home/digesh/Downloads/linux-3.8.13/include/linux/linkage.h:5:26: fatal 
error: asm/linkage.h: No such file or directory
compilation terminated.

my guess is the kernel headers though I am using the same kernel headers 
which match with the running kernel version.
I am trying to solve it but meanwhile I would appreciate if anybody can 
help me to resolve this issue.

Thank You!

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to