Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/macppc/dev Enable soft poweroff on PowerBook.
details: https://anonhg.NetBSD.org/src/rev/10d32a205455
branches: trunk
changeset: 474557:10d32a205455
user: tsubai <tsubai%NetBSD.org@localhost>
date: Sun Jul 11 16:59:31 1999 +0000
description:
Enable soft poweroff on PowerBook.
diffstat:
sys/arch/macppc/dev/adb_direct.c | 9 +++++++--
sys/arch/macppc/dev/pm_direct.c | 15 ++++++++++++++-
sys/arch/macppc/dev/pm_direct.h | 3 ++-
3 files changed, 23 insertions(+), 4 deletions(-)
diffs (76 lines):
diff -r 88935bd3c391 -r 10d32a205455 sys/arch/macppc/dev/adb_direct.c
--- a/sys/arch/macppc/dev/adb_direct.c Sun Jul 11 14:12:21 1999 +0000
+++ b/sys/arch/macppc/dev/adb_direct.c Sun Jul 11 16:59:31 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adb_direct.c,v 1.10 1999/06/22 11:29:11 tsubai Exp $ */
+/* $NetBSD: adb_direct.c,v 1.11 1999/07/11 16:59:31 tsubai Exp $ */
/* From: adb_direct.c 2.02 4/18/97 jpw */
@@ -1624,6 +1624,7 @@
return;
case ADB_HW_PB:
+ adbSoftPower = 1;
pm_setup_adb();
return;
@@ -1957,7 +1958,11 @@
return 0;
case ADB_HW_PB:
- return -1;
+ pm_adb_poweroff();
+
+ for (;;); /* wait for power off */
+
+ return 0;
case ADB_HW_CUDA:
output[0] = 0x02; /* 2 byte message */
diff -r 88935bd3c391 -r 10d32a205455 sys/arch/macppc/dev/pm_direct.c
--- a/sys/arch/macppc/dev/pm_direct.c Sun Jul 11 14:12:21 1999 +0000
+++ b/sys/arch/macppc/dev/pm_direct.c Sun Jul 11 16:59:31 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pm_direct.c,v 1.5 1999/06/22 13:12:11 tsubai Exp $ */
+/* $NetBSD: pm_direct.c,v 1.6 1999/07/11 16:59:31 tsubai Exp $ */
/*
* Copyright (C) 1997 Takashi Hamada
@@ -1173,6 +1173,19 @@
}
void
+pm_adb_poweroff()
+{
+ PMData p;
+
+ p.command = PMU_POWER_OFF;
+ p.num_data = 4;
+ p.s_buf = p.data;
+ p.r_buf = p.data;
+ strcpy(p.data, "MATT");
+ pmgrop(&p);
+}
+
+void
pm_read_date_time(time)
u_long *time;
{
diff -r 88935bd3c391 -r 10d32a205455 sys/arch/macppc/dev/pm_direct.h
--- a/sys/arch/macppc/dev/pm_direct.h Sun Jul 11 14:12:21 1999 +0000
+++ b/sys/arch/macppc/dev/pm_direct.h Sun Jul 11 16:59:31 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pm_direct.h,v 1.3 1999/06/22 13:12:11 tsubai Exp $ */
+/* $NetBSD: pm_direct.h,v 1.4 1999/07/11 16:59:31 tsubai Exp $ */
/*
* Copyright (C) 1997 Takashi Hamada
@@ -46,6 +46,7 @@
int pmgrop __P((PMData *));
void pm_adb_restart __P((void));
+void pm_adb_poweroff __P((void));
void pm_read_date_time __P((u_long *));
void pm_set_date_time __P((u_long));
int pm_read_nvram __P((int));
Home |
Main Index |
Thread Index |
Old Index