From 32eabd814843366632ea6f0cb984da170c60dc28 Mon Sep 17 00:00:00 2001 From: dbj Date: Wed, 2 Jan 2002 20:28:43 +0000 Subject: [PATCH] if pm_adb_op times out waiting for an interrupt, attempt to take an interrupt anyway, just in case. Otherwise, report the timout condition. This works around a problem in my ibook if a key is pressed after boot and before adb is configured, such as when booting with -d. --- sys/arch/macppc/dev/pm_direct.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sys/arch/macppc/dev/pm_direct.c b/sys/arch/macppc/dev/pm_direct.c index ea6470db6110..eb9f5c27f42e 100644 --- a/sys/arch/macppc/dev/pm_direct.c +++ b/sys/arch/macppc/dev/pm_direct.c @@ -1,4 +1,4 @@ -/* $NetBSD: pm_direct.c,v 1.16 2001/09/16 16:40:44 wiz Exp $ */ +/* $NetBSD: pm_direct.c,v 1.17 2002/01/02 20:28:43 dbj Exp $ */ /* * Copyright (C) 1997 Takashi Hamada @@ -1034,8 +1034,22 @@ pm_adb_op(buffer, compRout, data, command) #endif #endif if ((--timo) < 0) { - splx(s); - return 1; + /* Try to take an interrupt anyway, just in case. + * This has been observed to happen on my ibook + * when i press a key after boot and before adb + * is attached; For example, when booting with -d. + */ + pm_intr(); + if (adbWaiting) { + printf("pm_adb_op: timeout. command = 0x%x\n",command); + splx(s); + return 1; + } +#ifdef ADB_DEBUG + else { + printf("pm_adb_op: missed interrupt. cmd=0x%x\n",command); + } +#endif } }