linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Grant Likely" <grant.likely@secretlab.ca>
To: "Zhou Rui" <vancasperz@yahoo.com.cn>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Try to Disable PPC Interrupt
Date: Wed, 28 Mar 2007 20:47:58 -0600	[thread overview]
Message-ID: <528646bc0703281947s5ab2e971y395abda5462e9870@mail.gmail.com> (raw)
In-Reply-To: <904550.26206.qm@web15609.mail.cnb.yahoo.com>

On 3/28/07, Zhou Rui <vancasperz@yahoo.com.cn> 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.
grant.likely@secretlab.ca
(403) 399-0195

  reply	other threads:[~2007-03-29  2:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-29  2:39 Try to Disable PPC Interrupt Zhou Rui
2007-03-29  2:47 ` Grant Likely [this message]
2007-03-29  4:20   ` Zhou Rui
2007-03-29 18:41     ` Kumar Gala
2007-03-29 19:23       ` Josh Boyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=528646bc0703281947s5ab2e971y395abda5462e9870@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=vancasperz@yahoo.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).