#include #include #include #include #include #include #include #define GIC_FPGA_BASE 72 #define TIMER_OFFSET 3 #define TIMER_IRQ_NUM TIMER_OFFSET + GIC_FPGA_BASE #define TIMER_0_BASE 0x0 #define LED_PIO_BASE 0x3000 #define DIPSW_PIO_BASE 0x4000 #define BUTTON_PIO_BASE 0x5000 /*handler*/ static irqreturn_t FPGA_timer_irq_handler(int irq,void* dev_id) { pr_info("the timer irq is running...\n"); return IRQ_HANDLED; } /*init*/ static int __init main_init(void) { int value; value = request_irq(TIMER_OFFSET,FPGA_timer_irq_handler,IRQF_SHARED,"timer_irq",(void*)FPGA_timer_irq_handler); if(value) { pr_info("ERROR : Request IRQ handler Failed,return value %d\n",value); return value; } pr_info("Request IRQ succeeded!\n"); return value; } /*exit*/ static void __exit main_exit(void) { free_irq(TIMER_OFFSET,(void*)FPGA_timer_irq_handler); pr_debug("clean the mess up\n"); } /*module defination*/ module_init(main_init); module_exit(main_exit); /*module information*/ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Chun"); MODULE_DESCRIPTION("This is a module for request timer 50us as 75 GIC interrupt");