diff options
| author | dbj <dbj@NetBSD.org> | 2002-01-02 20:28:43 +0000 |
|---|---|---|
| committer | dbj <dbj@NetBSD.org> | 2002-01-02 20:28:43 +0000 |
| commit | 32eabd814843366632ea6f0cb984da170c60dc28 (patch) | |
| tree | 281cd58f9bee8c63b4050f51877ca33604e0d46a /sys/arch/macppc | |
| parent | 539d8cbd301bf6f0960f6fbf0a93e786ab6f4665 (diff) | |
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.
Diffstat (limited to 'sys/arch/macppc')
| -rw-r--r-- | sys/arch/macppc/dev/pm_direct.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/arch/macppc/dev/pm_direct.c b/sys/arch/macppc/dev/pm_direct.c index ea6470db611..eb9f5c27f42 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 } } |
