转载地址:http://www.cnblogs.com/TaigaCon/archive/2012/11/03/2752614.html
内核版本:2.6.39
错误:
error:implicit declaration of function 'request_irq'
error:implicit declaration of function 'free_irq'
解决方法:
#include <linux/interrupt.h>
错误:
error: 'IRQT_BOTHEDGE' undeclared (first use in this function)
解决方法:
#define __IRQT_FALEDGE IRQ_TYPE_EDGE_FALLING
#define __IRQT_RISEDGE IRQ_TYPE_EDGE_RISING
#define __IRQT_LOWLVL IRQ_TYPE_LEVEL_LOW
#define __IRQT_HIGHLVL IRQ_TYPE_LEVEL_HIGH
#define IRQT_NOEDGE (0)
#define IRQT_RISING (__IRQT_RISEDGE)
#define IRQT_FALLING (__IRQT_FALEDGE)
#define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE)
#define IRQT_LOW (__IRQT_LOWLVL)
#define IRQT_HIGH (__IRQT_HIGHLVL)
#define IRQT_PROBE IRQ_TYPE_PROBE
错误:
error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
error: implicit declaration of function 'signal_pending'
error: implicit declaration of function 'schedule'
解决方法:
#include <linux/sched.h>
错误:
error:implicit declaration of function 's3c2410_gpio_getpin'
解决方法:
#include <linux/gpio.h>
另外还有其他的一些问题解决方法可以参考:
asm/arch/regs-gpio.h: No such file or directory:
解决方法:
#include <mach/regs-gpio.h>
class_create报错:
解决方法:
static struct class *seconddrv_class;
static struct class_device *seconddrv_class_dev;
seconddrv_class = class_create(THIS_MODULE, "second_drv");
//class_device_create ======> device_create
seconddrv_class_dev = device_create(seconddrv_class, NULL, MKDEV(major, 0), NULL, "buttons");
// class_device_unregister ======> device_unregister
device_unregister(seconddrv_class_dev);
本文针对Linux内核2.6.39中出现的中断相关错误进行了解决方案的总结,包括如何正确声明和使用中断处理函数、定义中断触发类型、处理任务状态检查等常见问题。
6万+

被折叠的 条评论
为什么被折叠?



