Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/adb - call Debugger() from adbkbd_keys() instead of ...



details:   https://anonhg.NetBSD.org/src/rev/b34d4a6980d2
branches:  trunk
changeset: 451825:b34d4a6980d2
user:      macallan <macallan%NetBSD.org@localhost>
date:      Thu Jun 06 20:59:58 2019 +0000

description:
- call Debugger() from adbkbd_keys() instead of the task queue
- add options ADBKBD_POWER_DDB to enable DDB-on-Power by default

diffstat:

 sys/dev/adb/adb_kbd.c |  31 ++++++++++++++++---------------
 sys/dev/adb/files.adb |   4 ++--
 2 files changed, 18 insertions(+), 17 deletions(-)

diffs (86 lines):

diff -r a03c31af0a4e -r b34d4a6980d2 sys/dev/adb/adb_kbd.c
--- a/sys/dev/adb/adb_kbd.c     Thu Jun 06 20:55:43 2019 +0000
+++ b/sys/dev/adb/adb_kbd.c     Thu Jun 06 20:59:58 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: adb_kbd.c,v 1.27 2017/10/28 04:53:55 riastradh Exp $   */
+/*     $NetBSD: adb_kbd.c,v 1.28 2019/06/06 20:59:58 macallan Exp $    */
 
 /*
  * Copyright (C) 1998  Colin Wood
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.27 2017/10/28 04:53:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.28 2019/06/06 20:59:58 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -232,7 +232,11 @@
        sc->sc_power = 0xffff;
        sc->sc_timestamp = 0;
        sc->sc_emul_usb = FALSE;
+#ifdef ADBKBD_POWER_DDB
+       sc->sc_power_dbg = TRUE;
+#else
        sc->sc_power_dbg = FALSE;
+#endif
 
        aprint_normal(" addr %d: ", sc->sc_adbdev->current_addr);
 
@@ -463,8 +467,12 @@
                     (sc->sc_power_button_delay == 0)) {
 
                        /* power button, report to sysmon */
-                       sc->sc_pe = k1;
-                       sysmon_task_queue_sched(0, adbkbd_powerbutton, sc);
+                       if (sc->sc_power_dbg) {
+                               Debugger();
+                       } else {
+                               sc->sc_pe = k1;
+                               sysmon_task_queue_sched(0, adbkbd_powerbutton, sc);
+                       }
                }
        } else {
 
@@ -479,17 +487,10 @@
 {
        struct adbkbd_softc *sc = cookie;
 
-       if (sc->sc_power_dbg) {
-#ifdef DDB
-               Debugger();
-#else
-               printf("kernel is not compiled with DDB support\n");
-#endif
-       } else {
-               sysmon_pswitch_event(&sc->sc_sm_pbutton, 
-                   ADBK_PRESS(sc->sc_pe) ? PSWITCH_EVENT_PRESSED :
-                   PSWITCH_EVENT_RELEASED);
-       }
+       sysmon_pswitch_event(&sc->sc_sm_pbutton, 
+           ADBK_PRESS(sc->sc_pe) ? PSWITCH_EVENT_PRESSED :
+           PSWITCH_EVENT_RELEASED);
+
 }
 
 static inline void
diff -r a03c31af0a4e -r b34d4a6980d2 sys/dev/adb/files.adb
--- a/sys/dev/adb/files.adb     Thu Jun 06 20:55:43 2019 +0000
+++ b/sys/dev/adb/files.adb     Thu Jun 06 20:59:58 2019 +0000
@@ -1,5 +1,5 @@
 # 
-#      $NetBSD: files.adb,v 1.7 2012/08/30 01:27:44 macallan Exp $
+#      $NetBSD: files.adb,v 1.8 2019/06/06 20:59:58 macallan Exp $
 #
 # Apple Desktop Bus protocol and drivers
 
@@ -7,7 +7,7 @@
 defflag        adbdebug.h      ADBKBD_DEBUG
 defflag        adbdebug.h      ADBMS_DEBUG
 defflag        adbdebug.h      ADBBT_DEBUG
-defflag adbdebug.h     ADBKBD_POWER_PANIC
+defflag adbdebug.h     ADBKBD_POWER_DDB
 
 define adb_bus {}
 



Home | Main Index | Thread Index | Old Index