From owner-acpi-jp@jp.FreeBSD.org Mon Dec 15 16:35:46 2003
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id hBF7Zkc03375;
	Mon, 15 Dec 2003 16:35:46 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from hermes.nixsys.be (postfix@hermes.nixsys.be [2001:ab8:2007:0:20c:6eff:fe4b:23f])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with ESMTP/inet6 id hBF7ZiM03370
	for <acpi-jp@jp.FreeBSD.org>; Mon, 15 Dec 2003 16:35:45 +0900 (JST)
	(envelope-from philip@nixsys.be)
Received: by hermes.nixsys.be (Postfix, from userid 1001)
	id E2F2F69; Mon, 15 Dec 2003 08:35:39 +0100 (CET)
From: Philip Paeps <philip+freebsd@paeps.cx>
To: acpi-jp@jp.FreeBSD.org
Message-ID: <20031215073539.GB685@hermes.nixsys.be>
Mail-Followup-To: acpi-jp@jp.FreeBSD.org
References: <20031212114100.GC659@hermes.nixsys.be> <20031212171121.M54374@root.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20031212171121.M54374@root.org>
X-Date-in-Rome: ante diem XVIII Kalendas Ianuarias MMDCCLVII ab Urbe Condida
X-PGP-Fingerprint: FA74 3C27 91A6 79D5 F6D3 FC53 BF4B D0E6 049D B879
X-Message-Flag: Get a proper mailclient!  Mutt: <http://www.mutt.org/>
User-Agent: Mutt/1.5.5.1i
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
Date: Mon, 15 Dec 2003 08:35:39 +0100
X-Sequence: acpi-jp 2906
Subject: [acpi-jp 2906] Re: [patch] Thermal ioctls?
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: philip+freebsd@paeps.cx
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+031213

On 2003-12-12 17:12:23 (-0800), Nate Lawson <nate@root.org> wrote:
> On Fri, 12 Dec 2003, Philip Paeps wrote:
> > Just a quick patch which others might find useful.
> >
> > I seem to remember that at some point, there were ioctls on /dev/acpi for the
> > thermal system.  Those appear to have gone missing at some point, or perhaps I
> > just imagined their presence :-)
> >
> > The attached patch adds some ioctls to acpi_thermal.  I also sorted the acpiio
> > header a bit differently, grouping related items together.
> >
> > Having ioctls in addition to sysctls probably makes it a bit easier to port
> > the heaps of Linux-specific thermal monitoring apps.  Just point to the right
> > ioctl as oppsed to implementing code to read out sysctls.
> 
> The idea is good but I'll have to rework the implementation.

Sure.  Let me know if I can help on the implementation.  I just needed some
quick ioctls :-)

[Aside: is there any reason for prefering sysctl over ioctl?  I have nothing
against either of them, but I notice sysctl getting very popular...]

One thing I did try implementation-wise was adding the possibility for more
security checks by modifying the acpi_register_ioctl function.  Seems simpler
to add an acpi_register_ioctl_write though, as most acpi bits currently only
seem to read information.

> Do you have a pointer to the ioctls Linux apps expect?  It would be nice to
> have source compatibility where possible.

I'll have a look around.  Many tools are also using /proc on Linux, which is
possibly my least favourite interface into the kernel *sigh*.  Then there's
also those that cheat via apm...

Source-compatibility with Linux is a bit like turning lead into gold at times,
or vice-versa *evil grin*

Time to grep source-trees.

 - Philip

-- 
Philip Paeps                                          Please don't CC me, I am
                                                       subscribed to the list.

  BOFH Excuse #193:
    Did you pay the new Support Fee?
