阅读:756回复:0
急啊,高手帮忙看看!!!!!!!!
static void blint_fiq_handler_setup(void)
+{ + void *fiqhandler_start; + unsigned int fiqhandler_length; + struct pt_regs regs; + extern unsigned char blint_fiq_handler_start, blint_fiq_handler_end; + + printk(\"FIQ: Setting up handler for battery low fast interrupt\\n\"); + + fiqhandler_start = &blint_fiq_handler_start; + fiqhandler_length = &blint_fiq_handler_end - &blint_fiq_handler_start; + + if (claim_fiq(&blint_fh)) { + printk(\"FIQ: Could not claim fast interrupt\\n\"); + return; + } + + set_fiq_handler(fiqhandler_start, fiqhandler_length); + set_fiq_regs(?s); + psionw_writel(1, BLEOI); + enable_fiq(IRQ_BLINT); +} ................................................................. ................................................................. +/* + * linux/arch/arm/lib/psionwblint.S + * + * Copyright (C) 2002 Tony Lindgren <tony@atomide.com> + * + * Modeled after Russel King\'s floppydma.S + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ #include <linux/linkage.h> +#include <asm/assembler.h> +#include <asm/hardware/psionw.h> + .text + + .global SYMBOL_NAME(extfiq_handler_end) +ENTRY(extfiq_handler_start) + mov r11, #0xdf000000 @ VBASE + mov r12, #\'E\' + strb r12, [r11, #0x700] @ UART2 + subs pc, lr, #4 @ return +SYMBOL_NAME(extfiq_handler_end): + + .global SYMBOL_NAME(blint_fiq_handler_end) +ENTRY(blint_fiq_handler_start) + mov r11, #0xdf000000 @ VBASE + str r11, [r11, #0x0410] @ write to BLEOI + + ldr r12, [r11, #0x0e08] @ load PCDR + bic r12, r12, #0x10 @ clear PCDR_LIGHT + str r12, [r11, #0x0e08] @ write PCDR + + mov r12, #\'B\' + strb r12, [r11, #0x700] @ UART2 + subs pc, lr, #4 @ return +SYMBOL_NAME(blint_fiq_handler_end): ..................................................... 第一个函数是申请FIQ,他会用到两个变量blint_fiq_handler_start,blint_fiq_handler_end 这两个变量没有定义 第二个函数是一个汇编程序,它里面包括了两个类型的FIQ,现在只看blint_fiq 它在用ENTRY(blint_fiq_handler_start)和SYMBOL_NAME(blint_fiq_handler_end)时,这两个变量需要赋值么,还是一旦调用了他们两个,他们就会变成有值的了,使得第一个函数调用它们时不用再对它们赋值了。那么第二个函数的作用是什么哪,没看懂它的源代码。在编译驱动时(第一个函数包含在驱动程序driver.c里面),第二个函数和驱动的关系是什么,要把它放在哪哪? 急啊!!在搞不出这个程序,老师就怒了,请高手帮忙看看!!! 跪谢!!!!! |
|