summaryrefslogtreecommitdiffstats
path: root/usr.sbin/acpi/acpiconf
diff options
context:
space:
mode:
authoriwasaki <iwasaki@FreeBSD.org>2000-11-08 02:37:00 +0000
committeriwasaki <iwasaki@FreeBSD.org>2000-11-08 02:37:00 +0000
commit52b8cca66d1473b3f9c986248f265074dba5f66f (patch)
tree3355fd7058a4982b675fbb91dc939969e0b64468 /usr.sbin/acpi/acpiconf
parente896acb121e523a9e7c636c6a97c2dff1ba38105 (diff)
downloadFreeBSD-src-52b8cca66d1473b3f9c986248f265074dba5f66f.zip
FreeBSD-src-52b8cca66d1473b3f9c986248f265074dba5f66f.tar.gz
Remove dependence on old acpi driver from acpi userland tools.
- acpiconf Replace include files from old acpi driver to acpica driver. New sleep type `4b' had been added (S4BIOS) for `-s' option. Of course this has no effect because driver doesn't support it for now :-) - acpidump All needed structs in sys/dev/acpi/*.h had been merged into local header file. No changes on its usage.
Diffstat (limited to 'usr.sbin/acpi/acpiconf')
-rw-r--r--usr.sbin/acpi/acpiconf/acpiconf.c46
1 files changed, 38 insertions, 8 deletions
diff --git a/usr.sbin/acpi/acpiconf/acpiconf.c b/usr.sbin/acpi/acpiconf/acpiconf.c
index d4fac94..fd873bf 100644
--- a/usr.sbin/acpi/acpiconf/acpiconf.c
+++ b/usr.sbin/acpi/acpiconf/acpiconf.c
@@ -35,8 +35,10 @@
#include <sys/ioctl.h>
#include <unistd.h>
-#include <dev/acpi/acpiio.h>
-#include <dev/acpi/acpireg.h>
+#include <dev/acpica/acpiio.h>
+
+#include <contrib/dev/acpica/Subsystem/Include/acgcc.h>
+#include <contrib/dev/acpica/Subsystem/Include/actypes.h>
#define ACPIDEV "/dev/acpi"
@@ -74,30 +76,58 @@ acpi_sleep(int sleep_type)
return (0);
}
+static void
+usage(const char* prog)
+{
+ printf("usage: %s [-deh] [-s [1|2|3|4|4b|5]]\n", prog);
+ exit(0);
+}
+
int
main(int argc, char *argv[])
{
- char c;
+ char c, *prog;
int sleep_type;
+ prog = argv[0];
sleep_type = -1;
- while ((c = getopt(argc, argv, "eds:")) != -1) {
+ while ((c = getopt(argc, argv, "dehs:")) != -1) {
switch (c) {
+ case 'd':
+ acpi_enable_disable(ACPIIO_DISABLE);
+ break;
+
case 'e':
acpi_enable_disable(ACPIIO_ENABLE);
break;
- case 'd':
- acpi_enable_disable(ACPIIO_DISABLE);
+ case 'h':
+ usage(prog);
break;
case 's':
- sleep_type = *optarg - '0';
- if (sleep_type < ACPI_S_STATE_S0 || sleep_type > ACPI_S_STATE_S5) {
+ sleep_type = optarg[0] - '0';
+ if (sleep_type < 0 || sleep_type > 5) {
fprintf(stderr, "%s: invalid sleep type (%d)\n",
argv[0], sleep_type);
return -1;
}
+
+ /* convert sleep type value to ACPICA format */
+ switch (sleep_type) {
+ case 4:
+ if (optarg[1] == 'b') {
+ sleep_type = ACPI_STATE_S4BIOS;
+ }
+ break;
+
+ case 5:
+ sleep_type = ACPI_STATE_S5;
+ break;
+
+ default:
+ break;
+ }
break;
default:
argc -= optind;
OpenPOWER on IntegriCloud