From: Joe deBlaquiere <jadb@redhat.com>
To: Tommy Reynolds <reynolds@redhat.com>
Cc: "Bloch, Jack" <Jack.Bloch@icn.siemens.com>, linux-kernel@vger.kernel.org
Subject: Re: Device driver question
Date: 15 May 2002 10:03:09 -0500 [thread overview]
Message-ID: <1021474990.1450.56.camel@uberdog> (raw)
In-Reply-To: <20020515083645.7320aefa.reynolds@redhat.com>
How about just write a driver that responds to the interrupt, and write
a program that does a blocking read from the driver. The driver read
routine stuff the program on a wait queue... until... interrupt occurs,
wake up the program, program does exec(/sbin/halt) ?
This could actually be made into a good demonstration of driver
programming in that you could hook the parport interrupt and do it with
any PC....
On Wed, 2002-05-15 at 08:36, Tommy Reynolds wrote:
> Uttered "Bloch, Jack" <Jack.Bloch@icn.siemens.com>, spoke thus:
>
> > I have a specific case where our HW can generate a
> > special interrupt. In this case I simply want the ISR to halt the system
> > (i.e. take the same action as if I typed halt from the command line). How
> > can I from within my device driver cause a halt? Please CC me specifically
> > on any replies.
>
> Check out the code for "sys_reboot" in "kernel/sys.c" for ideas on how to do
> this. I don't think you can invoke "sys_reboot" from inside an interrupt
> handler, but you could probably do the same thing by calling the service
> routines "sys_reboot" does.
>
> If that doesn't shut your machine down gracefully, then you might resort to
> "call_usermodehelper" in "kernel/kmod.c" to run "/sbin/shutdown -h now". You
> can't invoke "call_usermodehelper" from an interrupt top half, but it should
> work find from a tasklett.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Joe deBlaquiere
Red Hat, Inc.
voice : 256-217-0123
mobile: 256-527-5633
fax : 256-837-3839
jadb@redhat.com
next prev parent reply other threads:[~2002-05-15 15:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-15 13:17 Device driver question Bloch, Jack
2002-05-15 13:36 ` Tommy Reynolds
2002-05-15 15:03 ` Joe deBlaquiere [this message]
2002-05-15 15:13 ` Tommy Reynolds
2002-05-15 15:16 ` Tommy Reynolds
2002-05-16 0:18 ` jw schultz
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=1021474990.1450.56.camel@uberdog \
--to=jadb@redhat.com \
--cc=Jack.Bloch@icn.siemens.com \
--cc=linux-kernel@vger.kernel.org \
--cc=reynolds@redhat.com \
/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).