From 3cf53df36d1a1ac9504dccf0ac30933a6f6d66a0 Mon Sep 17 00:00:00 2001 From: tholo <> Date: Thu, 2 Jun 2005 20:09:38 +0000 Subject: [PATCH] Start on a basic ACPI framework -- does not do much more than read out the ACPI tables into kernel memory and attach ACPI and HPET timers currently. In order to test this code, enabling the devices in GENERIC as well as the ACPI_ENABLE option is needed. This code does not do any thermal control yet, so this should be done with care depending on the platform. In the tree so more people can contribute to making this more fully featured. Ok niklas@ grange@ tedu@ --- src/etc/MAKEDEV.common | 4 +++- src/etc/etc.amd64/MAKEDEV.md | 4 +++- src/etc/etc.i386/MAKEDEV.md | 4 +++- src/etc/mtree/4.4BSD.dist | 7 ++++++- src/etc/mtree/special | 4 +++- src/etc/rc | 6 +++++- src/etc/rc.conf | 3 ++- 7 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/etc/MAKEDEV.common b/src/etc/MAKEDEV.common index 724487b9..661ea719 100644 --- a/src/etc/MAKEDEV.common +++ b/src/etc/MAKEDEV.common @@ -1,4 +1,4 @@ -vers(a, {-$OpenBSD: MAKEDEV.common,v 1.17 2005/03/29 16:40:08 miod Exp $-})dnl +vers(a, {-$OpenBSD: MAKEDEV.common,v 1.18 2005/06/02 20:09:38 tholo Exp $-})dnl divert(1)dnl dnl dnl Common device definitions. @@ -125,6 +125,7 @@ target(all, pctr0)dnl target(all, pf)dnl twrget(all, cry, crypto)dnl target(all, apm)dnl +target(all, acpi)dnl twrget(all, tth, ttyh, 0, 1)dnl target(all, ttyA, 0, 1)dnl target(all, ttyB, 0, 1, 2, 3, 4, 5)dnl @@ -441,6 +442,7 @@ __devitem(scc, scc*, 82530 serial interface,scc)dnl __devtitle(spec, Special purpose devices)dnl _mkdev(apm, apm*, {-M apm c major_apm_c 0 644 M apmctl c major_apm_c 8 644-})dnl +_mkdev(acpi, acpi*, {-M acpi c major_acpi_c 0 644-})dnl __devitem(pctr, pctr*, PC Performance Tuning Register access device)dnl _mkdev(pctr, pctr, {-M pctr c major_pctr_c 0 644-})dnl __devitem(systrace, systrace*, System call tracing device)dnl diff --git a/src/etc/etc.amd64/MAKEDEV.md b/src/etc/etc.amd64/MAKEDEV.md index 9ba75562..9c8d2434 100644 --- a/src/etc/etc.amd64/MAKEDEV.md +++ b/src/etc/etc.amd64/MAKEDEV.md @@ -1,5 +1,5 @@ vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.10 2005/04/21 00:26:30 krw Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.11 2005/06/02 20:09:38 tholo Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2004 Todd T. Fries @@ -17,6 +17,7 @@ dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. dnl dnl +__devitem(acpi, acpi, Advanced Configuration and Power Interface)dnl _TITLE(make) _DEV(all) _DEV(ramdisk) @@ -64,6 +65,7 @@ _DEV(usb, 61) _DEV(uscan, 77) _TITLE(spec) dnl _DEV(apm, 21) +_DEV(acpi, 83) _DEV(au, 42) _DEV(bktr, 49) _DEV(bpf, 23) diff --git a/src/etc/etc.i386/MAKEDEV.md b/src/etc/etc.i386/MAKEDEV.md index 6c94753a..5844546a 100644 --- a/src/etc/etc.i386/MAKEDEV.md +++ b/src/etc/etc.i386/MAKEDEV.md @@ -1,5 +1,5 @@ vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.30 2005/04/21 00:26:30 krw Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.31 2005/06/02 20:09:38 tholo Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2004 Todd T. Fries @@ -18,6 +18,7 @@ dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. dnl dnl __devitem(apm, apm, Power management device)dnl +__devitem(acpi, acpi, Advanced Configuration and Power Interface)dnl __devitem(nvram, nvram, NVRAM access)dnl _mkdev(nvram, nvram, {-M nvram c major_nvram_c 0 440 kmem-})dnl _TITLE(make) @@ -67,6 +68,7 @@ _DEV(usb, 61) _DEV(uscan, 77) _TITLE(spec) _DEV(apm, 21) +_DEV(acpi, 85) _DEV(au, 42) _DEV(bktr, 49) _DEV(bpf, 23) diff --git a/src/etc/mtree/4.4BSD.dist b/src/etc/mtree/4.4BSD.dist index b1679b21..b91516d5 100644 --- a/src/etc/mtree/4.4BSD.dist +++ b/src/etc/mtree/4.4BSD.dist @@ -1,4 +1,4 @@ -# $OpenBSD: 4.4BSD.dist,v 1.174 2005/04/02 17:21:06 jmc Exp $ +# $OpenBSD: 4.4BSD.dist,v 1.175 2005/06/02 20:09:38 tholo Exp $ /set type=dir uname=root gname=wheel mode=0755 # . @@ -23,6 +23,11 @@ dev # ./etc etc +# ./etc/acpi +acpi +# ./etc/acpi +.. + # ./etc/afs afs # ./etc/afs diff --git a/src/etc/mtree/special b/src/etc/mtree/special index b08d4094..41ad7a0d 100644 --- a/src/etc/mtree/special +++ b/src/etc/mtree/special @@ -1,4 +1,4 @@ -# $OpenBSD: special,v 1.64 2005/02/19 11:56:54 henning Exp $ +# $OpenBSD: special,v 1.65 2005/06/02 20:09:38 tholo Exp $ # $NetBSD: special,v 1.4 1996/05/08 21:30:18 pk Exp $ # @(#)special 8.2 (Berkeley) 1/23/94 # @@ -16,6 +16,8 @@ mem type=char mode=0640 uname=root gname=kmem .. #dev etc type=dir mode=0755 uname=root gname=wheel +acpi type=dir mode=0755 uname=root gname=wheel ignore +.. #acpi bgpd.conf type=file mode=0600 uname=root gname=wheel crontab type=file mode=0644 uname=root gname=wheel optional csh.cshrc type=file mode=0644 uname=root gname=wheel diff --git a/src/etc/rc b/src/etc/rc index 6ad5c500..e3245baf 100644 --- a/src/etc/rc +++ b/src/etc/rc @@ -1,4 +1,4 @@ -# $OpenBSD: rc,v 1.267 2005/05/19 01:58:49 millert Exp $ +# $OpenBSD: rc,v 1.268 2005/06/02 20:09:38 tholo Exp $ # System startup script run by init on autoboot # or after single-user. @@ -713,6 +713,10 @@ if [ X"${apmd_flags}" != X"NO" -a -x /usr/sbin/apmd ]; then echo -n ' apmd'; /usr/sbin/apmd ${apmd_flags} fi +if [ X"${acpid_flags}" != X"NO" -a -x /usr/sbin/acpid ]; then + echo -n ' acpid'; /usr/sbin/acpid ${acpid_flags} +fi + if [ X"${sensorsd_flags}" != X"NO" ]; then echo -n ' sensorsd'; /usr/sbin/sensorsd ${sensorsd_flags} fi diff --git a/src/etc/rc.conf b/src/etc/rc.conf index 616abce7..5fc50a51 100644 --- a/src/etc/rc.conf +++ b/src/etc/rc.conf @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: rc.conf,v 1.105 2005/03/22 22:24:38 henning Exp $ +# $OpenBSD: rc.conf,v 1.106 2005/06/02 20:09:38 tholo Exp $ # set these to "NO" to turn them off. otherwise, they're used as flags routed_flags=NO # for normal use: "-q" @@ -19,6 +19,7 @@ ntpd_flags=NO # for normal use: "" isakmpd_flags=NO # for normal use: "" mopd_flags=NO # for normal use: "-a" apmd_flags=NO # for normal use: "" +acpid_flags=NO # for normal use: "" dhcpd_flags=NO # for normal use: "" rtadvd_flags=NO # for normal use: list of interfaces # be sure to set net.inet6.ip6.forwarding=1