[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: F2 get power and date off (Re: iBook/sleep ?)



ようやく最近の PowerBook で ADB をそれなりに動かすことができました。
以下のパッチでどうでしょうか。また、その状態で F2 を連打すると落ちる
などの症状が再現できるでしょうか。従来機種で悪影響が出ないかどうかの
確認も歓迎します。

# 例によって delay 足しただけなんだけど。:-)

diff -c sys/arch/macppc/dev/adb.c sys/arch/macppc/dev/adb.c
*** sys/arch/macppc/dev/adb.c	Tue Dec 19 11:50:11 2000
--- sys/arch/macppc/dev/adb.c	Thu Mar 29 21:12:28 2001
***************
*** 125,130 ****
--- 125,131 ----
  	ADBReInit();
  
  	intr_establish(ca->ca_intr[0], IST_LEVEL, IPL_HIGH, adb_intr, sc);
+ 	intr_establish(47, IST_LEVEL, IPL_HIGH, adb_intr, sc);
  
  #ifdef ADB_DEBUG
  	if (adb_debug)
diff -c sys/arch/macppc/dev/adb_direct.c sys/arch/macppc/dev/adb_direct.c
*** sys/arch/macppc/dev/adb_direct.c	Tue Dec 19 11:50:11 2000
--- sys/arch/macppc/dev/adb_direct.c	Thu Mar 29 21:01:56 2001
***************
*** 1281,1286 ****
--- 1281,1287 ----
  
  	/* send an ADB reset first */
  	adb_op_sync((Ptr)0, (Ptr)0, (Ptr)0, (short)0x00);
+ 	delay(200000);
  
  	/*
  	 * Probe for ADB devices. Probe devices 1-15 quickly to determine
diff -c sys/arch/macppc/dev/pm_direct.c sys/arch/macppc/dev/pm_direct.c
*** sys/arch/macppc/dev/pm_direct.c	Thu Mar  1 03:49:29 2001
--- sys/arch/macppc/dev/pm_direct.c	Thu Mar 29 21:05:12 2001
***************
*** 979,985 ****
  	int i;
  	int s;
  	int rval;
! 	int delay;
  	PMData pmdata;
  	struct adbCommand packet;
  
--- 979,985 ----
  	int i;
  	int s;
  	int rval;
! 	int timo;
  	PMData pmdata;
  	struct adbCommand packet;
  
***************
*** 1040,1052 ****
  		return 1;
  	}
  
  	adbWaiting = 1;
  	adbWaitingCmd = command;
  
  	PM_VIA_INTR_ENABLE();
  
  	/* wait until the PM interrupt is occured */
! 	delay = 0x80000;
  	while (adbWaiting == 1) {
  		if (read_via_reg(VIA1, vIFR) & 0x14)
  			pm_intr();
--- 1040,1054 ----
  		return 1;
  	}
  
+ 	delay(10000);
+ 
  	adbWaiting = 1;
  	adbWaitingCmd = command;
  
  	PM_VIA_INTR_ENABLE();
  
  	/* wait until the PM interrupt is occured */
! 	timo = 0x80000;
  	while (adbWaiting == 1) {
  		if (read_via_reg(VIA1, vIFR) & 0x14)
  			pm_intr();
***************
*** 1057,1063 ****
  			(void)intr_dispatch(0x70);
  #endif
  #endif
! 		if ((--delay) < 0) {
  			splx(s);
  			return 1;
  		}
--- 1059,1065 ----
  			(void)intr_dispatch(0x70);
  #endif
  #endif
! 		if ((--timo) < 0) {
  			splx(s);
  			return 1;
  		}