我正在编写一个接收mpc8308(PowerPC)板中断的内核模块。当我为Ubuntu和我当前版本的内核编写代码时,它适用于键盘中断,但是当我为mpc8308板(2.6.29.6内核)构建它时,我想用insmod
将其加载到内核中命令我收到错误:
insmod: cannot insert './intrpt.ko': Function not implemented
我的代码是:
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#define DRIVER_AUTHOR "AVM"
#define DRIVER_DESC "A sample driver"
static irqreturn_t irq_handler(int irq, void *dev_id, struct pt_regs *regs)
{
printk(KERN_ALERT "Hello Interrupt world.\n");
return IRQ_HANDLED;
}
/*
* Initialize the module − register the IRQ handler
*/
int init_module()
{
free_irq(1, NULL);
return request_irq(1, irq_handler, IRQF_SHARED, "test_keyboard_irq_handler",
(void *)(irq_handler));
}
/*
* Cleanup
*/
void cleanup_module()
{
free_irq(1, NULL);
}
MODULE_LICENSE("GPL");
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_SUPPORTED_DEVICE("testdevice");
和modinfo ./intrpt.ko
的输出是:
filename: ./intrpt.ko
description: A sample driver
author:
license: GPL
depends:
vermagic: 2.6.29.6-rt23 mod_unload