On 3/28/07, Zhou Rui <[EMAIL PROTECTED]> wrote:
> Hi, all
>     I am trying to disable interrupt on a PPC405EP board. I have checked
> from the 405 maunual that once the EE bit of MSR is set to 0, the external
> interrupt will be disabled. So I write a simple test module for that:
>
> #ifndef MODULE
> #define MODULE
> #endif
>
> #ifndef __KERNEL__
> #define __KERNEL__
> #endif
>
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include <linux/types.h>
> #include <linux/errno.h>
>
> void hw_disable_irq (void) {
>         int c;
>         __asm__ __volatile__(
>                 "mfmsr %%r0; \
>                 wrteei 0; \
>                 mfmsr %0;":"=r"(c) : );
>
>         printk("%h\n",c);
> }
>
> int init_module(void)
> {
> }
>
> void cleanup_module(void)
> {
> }
>
> MODULE_LICENSE("GPL");
>
> When I insert this module, it seems nothing happens and there is no output
> of the varible "c". So would you like to tell me what the problem is here?
> Thank you very much.

Umm, because this modules doesn't do anything perhaps?  You've
declared init and cleanup routines, but there are two problems with
them.
1. You haven't used the module_init and module_exit macros to actually
register them as init/exit routines.
2. They're empty

There is no possible way for your hw_disable_irq() routine to get called.

Cheers,
g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
[EMAIL PROTECTED]
(403) 399-0195
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

Reply via email to