国产毛片a精品毛-国产毛片黄片-国产毛片久久国产-国产毛片久久精品-青娱乐极品在线-青娱乐精品

電子工程網(wǎng)

標題: linux2.6下的設備驅動問題 [打印本頁]

作者: chengnokia    時間: 2009-4-24 14:49
標題: linux2.6下的設備驅動問題
這是C文件

#include
#include
MODULE_LICENSE("Dual BSD/GPL");

static int hello_init(void)
{
        printk(KERN_ALERT "hello,world\n");
        return 0;
}

static void hello_exit(void)
{
        printk(KERN_ALERT "Goodbye,cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);
~                           


下面是makefile

CC =/usr/local/arm/bin/arm-linux-gcc
KERNELDIR=/home/work/linux2.6
CFLAGS =-D__KERNEL__ -DMODULE -I$(KERNELDIR)/include -O -Wall

hello.hello.c

        $(CC)$(CFLAGS)  -g -c $<

clean:



這時報錯:

/usr/local/arm/bin/arm-linux-gcc -D__KERNEL__ -DMODULE -I/home/work/linux2.6/include -O -Wall  -g -c hello.c   
In file included from /home/work/linux2.6/include/asm/hardware.h:16,
                 from /home/work/linux2.6/include/asm/arch/memory.h:24,
                 from /home/work/linux2.6/include/asm/memory.h:27,
                 from /home/work/linux2.6/include/asm/system.h:6,
                 from /home/work/linux2.6/include/asm/bitops.h:23,
                 from /home/work/linux2.6/include/linux/bitops.h:9,
                 from /home/work/linux2.6/include/linux/thread_info.h:20,
                 from /home/work/linux2.6/include/linux/preempt.h:9,
                 from /home/work/linux2.6/include/linux/spinlock.h:49,
                 from /home/work/linux2.6/include/linux/module.h:9,
                 from hello.c:2:
/home/work/linux2.6/include/asm/arch/hardware.h:30:2: #error "Unsupported AT91 processor"
In file included from /home/work/linux2.6/include/linux/bitops.h:9,
                 from /home/work/linux2.6/include/linux/thread_info.h:20,
                 from /home/work/linux2.6/include/linux/preempt.h:9,
                 from /home/work/linux2.6/include/linux/spinlock.h:49,
                 from /home/work/linux2.6/include/linux/module.h:9,
                 from hello.c:2:
/home/work/linux2.6/include/asm/bitops.h: In function `____atomic_set_bit':
/home/work/linux2.6/include/asm/bitops.h:40: warning: implicit declaration of function `local_irq_save'
/home/work/linux2.6/include/asm/bitops.h:42: warning: implicit declaration of function `local_irq_restore'
In file included from /home/work/linux2.6/include/linux/kobject.h:25,
                 from /home/work/linux2.6/include/linux/module.h:17,
                 from hello.c:2:
/home/work/linux2.6/include/linux/rwsem.h:24:65: asm/rwsem.h: No such file or directory
In file included from /home/work/linux2.6/include/linux/module.h:17,
                 from hello.c:2:
/home/work/linux2.6/include/linux/kobject.h: At top level:
/home/work/linux2.6/include/linux/kobject.h:178: error: field `rwsem' has incomplete type
In file included from /home/work/linux2.6/include/linux/memory_hotplug.h:7,
                 from /home/work/linux2.6/include/linux/mmzone.h:463,
                 from /home/work/linux2.6/include/linux/gfp.h:4,
                 from /home/work/linux2.6/include/linux/slab.h:14,
                 from /home/work/linux2.6/include/linux/percpu.h:5,
                 from /home/work/linux2.6/include/asm-generic/local.h:4,
                 from /home/work/linux2.6/include/asm/local.h:1,
                 from /home/work/linux2.6/include/linux/module.h:19,
                 from hello.c:2:
/home/work/linux2.6/include/linux/notifier.h:62: error: field `rwsem' has incomplete type
In file included from /home/work/linux2.6/include/asm/io.h:76,
                 from /home/work/linux2.6/include/asm/arch/irqs.h:24,
                 from /home/work/linux2.6/include/asm/irq.h:4,
                 from /home/work/linux2.6/include/asm/hardirq.h:6,
                 from /home/work/linux2.6/include/linux/hardirq.h:7,
                 from /home/work/linux2.6/include/asm-generic/local.h:5,
                 from /home/work/linux2.6/include/asm/local.h:1,
                 from /home/work/linux2.6/include/linux/module.h:19,
                 from hello.c:2:
/home/work/linux2.6/include/asm/arch/io.h: In function `at91_sys_read':
/home/work/linux2.6/include/asm/arch/io.h:36: error: `AT91_BASE_SYS' undeclared (first use in this function)
/home/work/linux2.6/include/asm/arch/io.h:36: error: (Each undeclared identifier is reported only once
/home/work/linux2.6/include/asm/arch/io.h:36: error: for each function it appears in.)
/home/work/linux2.6/include/asm/arch/io.h: In function `at91_sys_write':
/home/work/linux2.6/include/asm/arch/io.h:43: error: `AT91_BASE_SYS' undeclared (first use in this function)
make: *** [hello.o] 錯誤 1



到底是什么原因,版主和朋友們能不能幫個忙,謝謝了
作者: 阿南    時間: 2009-4-24 17:32
回復1樓chengnokia


#error "Unsupported AT91 processor"

樓主使用的處理器是AT91系列的嗎?最好是找一個支持該處理器或開發(fā)板的Linux整個包,自己移植太累了
作者: 老郭    時間: 2009-4-24 19:06
謝謝阿南!!
作者: 阿南    時間: 2009-4-27 12:01
老郭客氣
應該的,嘿嘿




歡迎光臨 電子工程網(wǎng) (http://m.qingdxww.cn/) Powered by Discuz! X3.4
主站蜘蛛池模板: 一本色道久久88| 性色aⅴ闺蜜一区二区三区| 特a级片| 18未满不能进的福利社| 国产三级级在线电影| 男男肉肉互插腐文| 在线伦理电影网| 日本国产一区| 伊人网免费视频| 亚洲午夜久久久久久91| 成人免费观看www视频| 特黄大片aaaaa毛片| 亚洲午夜高清| 日日夜夜狠狠操| 亚洲阿v天堂| jiucao在线观看精品| 思思久久99热只有频精品66| 色诱久久av| 日本不卡一区二区三区在线观看 | 天天干天天做天天射| 五月色婷婷久久综合| 3344永久在线观看视频免费| 欧美派对xxxhdparty| 亚洲国产成人久久综合碰| 日本人成大片在线| 中国一级做a爰片久久毛片| 97豆奶视频国产| 色欲人妻AAAAAAA无码| 性感一级毛片| 日韩高清不卡| 亚洲 欧美 成人| 国产一区二区三区影院| 伊人热人久久中文字幕| 青草视频app| 在线观看视频中文字幕| 御宅屋在线阅读| 欧美午夜精品久久久久久浪潮| 香蕉久久久久久狠狠色| 日韩欧美无线在码| 亚洲国产成人精品| 花蝴蝶在线观看免费中文版高清|