public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John Fremlin <chief@bandits.org>
To: "Grover, Andrew" <andrew.grover@intel.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-pm-devel@sourceforge.net>
Subject: Re: simple userspace pm interface
Date: 08 May 2001 13:21:30 +0100	[thread overview]
Message-ID: <m23dagyqt1.fsf@boreas.yi.org.> (raw)
In-Reply-To: <4148FEAAD879D311AC5700A0C969E89006CDDE25@orsmsx35.jf.intel.com>
In-Reply-To: <4148FEAAD879D311AC5700A0C969E89006CDDE25@orsmsx35.jf.intel.com>

"Grover, Andrew" <andrew.grover@intel.com> writes:

[...]

> - It's probably easier to put the "event" file in proc, instead of
> dev. This is what the acpi interface does, and eliminates the mknod
> step.

Is this kernel policy? I mean, you could apply the same argument to
all device nodes ;-)

> - perhaps rename boxevent() to event() or sys_event()?

Event is a bit generic, and sys_event is vague. I agree that boxevent
is not a pretty name, but it gives a vague suggestion of
hardwareness. hwevent looks ugly - what do people think?

> - Consider putting the subsystem/class identifier first
> - Consider hiding the source of the event. For example, we shouldn't care
> that the power button press was generated by APM or MIPS64, because we're
> going to take the same action, regardless.

The suggested action is given as the first word. The second word is
the subsystem, in order to avoid namespace collisions: you could have
two different PM systems active on your machine at different times,
(e.g. ACPI and APM) and this lets you distinguish between them. You
could think of it as the first word being the suggested action and the
rest being a description.

> I'd encourage you to take a look at the ACPI code that does
> something similar (in 2.4.4ac4 or greater, or grab the code from the
> website at
> http://developer.intel.com/technology/iapc/acpi/downloads.htm .)
> Specifically, grep -r for bm_osl_generate_event(). Modifying that
> code to be more general-purpose could possibly meet ACPI's needs as
> well as everyone else's.

ACPI_STATUS bm_osl_generate_event (
       BM_HANDLE               device_handle,
       char                    *device_type,
       char                    *device_instance,
       u32                     event_type,
       u32                     event_data)
{

The function could quickly be converted to boxevent without thinking

sprintf(buffer,"device %s instance %s says %x: %x",
        device_type,device_instance,event_type,event_data);
boxevent(BOXEVENT_NOTIFY,"ACPI",buffer);

this would provide all of the current functionality available from
ACPI (ATM the code does sprintf(str, "%s %s %08x %08x\n") to the
userspace reader) but boxevent also handles poll, short reads, and
event floods, etc.

Some one who knows about ACPI could change the BOXEVENT_NOTIFY to a
better suggestion based on event_type or something.

[...]

-- 

	http://ape.n3.net

  reply	other threads:[~2001-05-08 12:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-08  0:33 simple userspace pm interface Grover, Andrew
2001-05-08 12:21 ` John Fremlin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-05-07 19:14 John Fremlin

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=m23dagyqt1.fsf@boreas.yi.org. \
    --to=chief@bandits.org \
    --cc=andrew.grover@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm-devel@sourceforge.net \
    /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