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 Use RTC on PB.
details: https://anonhg.NetBSD.org/src/rev/54f0f9a7e19f
branches: trunk
changeset: 473930:54f0f9a7e19f
user: tsubai <tsubai%NetBSD.org@localhost>
date: Tue Jun 22 11:29:11 1999 +0000
description:
Use RTC on PB.
diffstat:
sys/arch/macppc/dev/adb_direct.c | 23 +++++++----------------
sys/arch/macppc/dev/pm_direct.c | 19 ++++++++++++++++---
2 files changed, 23 insertions(+), 19 deletions(-)
diffs (96 lines):
diff -r 4b82c57a23ec -r 54f0f9a7e19f sys/arch/macppc/dev/adb_direct.c
--- a/sys/arch/macppc/dev/adb_direct.c Tue Jun 22 06:57:00 1999 +0000
+++ b/sys/arch/macppc/dev/adb_direct.c Tue Jun 22 11:29:11 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adb_direct.c,v 1.9 1999/01/12 10:38:00 tsubai Exp $ */
+/* $NetBSD: adb_direct.c,v 1.10 1999/06/22 11:29:11 tsubai Exp $ */
/* From: adb_direct.c 2.02 4/18/97 jpw */
@@ -1866,7 +1866,7 @@
case ADB_HW_PB:
pm_read_date_time(time);
- return -1;
+ return 0;
case ADB_HW_CUDA:
output[0] = 0x02; /* 2 byte message */
@@ -1918,9 +1918,12 @@
return 0;
+ case ADB_HW_PB:
+ pm_set_date_time(time);
+ return 0;
+
case ADB_HW_II:
case ADB_HW_IISI:
- case ADB_HW_PB:
case ADB_HW_UNKNOWN:
default:
return -1;
@@ -2131,18 +2134,6 @@
case ADB_HW_PB:
pm_adb_restart();
- return;
+ while (1); /* not return */
}
}
-
-void
-powermac_restart()
-{
- adb_restart();
-}
-
-void
-powermac_powerdown()
-{
- adb_poweroff();
-}
diff -r 4b82c57a23ec -r 54f0f9a7e19f sys/arch/macppc/dev/pm_direct.c
--- a/sys/arch/macppc/dev/pm_direct.c Tue Jun 22 06:57:00 1999 +0000
+++ b/sys/arch/macppc/dev/pm_direct.c Tue Jun 22 11:29:11 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pm_direct.c,v 1.3 1998/12/07 17:17:14 tsubai Exp $ */
+/* $NetBSD: pm_direct.c,v 1.4 1999/06/22 11:29:11 tsubai Exp $ */
/*
* Copyright (C) 1997 Takashi Hamada
@@ -1165,7 +1165,7 @@
{
PMData p;
- p.command = 0xd0; /* reset CPU */
+ p.command = PMU_RESET_CPU;
p.num_data = 0;
p.s_buf = p.data;
p.r_buf = p.data;
@@ -1178,7 +1178,7 @@
{
PMData p;
- p.command = 0x38; /* read time */
+ p.command = PMU_READ_RTC;
p.num_data = 0;
p.s_buf = p.data;
p.r_buf = p.data;
@@ -1186,3 +1186,16 @@
bcopy(p.data, time, 4);
}
+
+void
+pm_set_date_time(time)
+ u_long time;
+{
+ PMData p;
+
+ p.command = PMU_SET_RTC;
+ p.num_data = 4;
+ p.s_buf = p.r_buf = p.data;
+ bcopy(&time, p.data, 4);
+ pmgrop(&p);
+}
Home |
Main Index |
Thread Index |
Old Index