dcons_os.c (174898) | dcons_os.c (178766) |
---|---|
1/*- 2 * Copyright (C) 2003,2004 3 * Hidetoshi Shimokawa. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * | 1/*- 2 * Copyright (C) 2003,2004 3 * Hidetoshi Shimokawa. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * |
34 * $FreeBSD: head/sys/dev/dcons/dcons_os.c 174898 2007-12-25 17:52:02Z rwatson $ | 34 * $FreeBSD: head/sys/dev/dcons/dcons_os.c 178766 2008-05-04 23:29:38Z peter $ |
35 */ 36 37#include <sys/param.h> 38#if __FreeBSD_version >= 502122 39#include <sys/kdb.h> 40#include <gdb/gdb.h> 41#endif 42#include <sys/kernel.h> --- 150 unchanged lines hidden (view full) --- 193 194extern struct gdb_dbgport *gdb_cur; 195#endif 196 197#if (defined(GDB) || defined(DDB)) && defined(ALT_BREAK_TO_DEBUGGER) 198static int 199dcons_check_break(struct dcons_softc *dc, int c) 200{ | 35 */ 36 37#include <sys/param.h> 38#if __FreeBSD_version >= 502122 39#include <sys/kdb.h> 40#include <gdb/gdb.h> 41#endif 42#include <sys/kernel.h> --- 150 unchanged lines hidden (view full) --- 193 194extern struct gdb_dbgport *gdb_cur; 195#endif 196 197#if (defined(GDB) || defined(DDB)) && defined(ALT_BREAK_TO_DEBUGGER) 198static int 199dcons_check_break(struct dcons_softc *dc, int c) 200{ |
201#if __FreeBSD_version >= 502122 202 int kdb_brk; 203#endif |
|
201 if (c < 0) 202 return (c); 203 204#if __FreeBSD_version >= 502122 | 204 if (c < 0) 205 return (c); 206 207#if __FreeBSD_version >= 502122 |
205 if (kdb_alt_break(c, &dc->brk_state)) { 206 if ((dc->flags & DC_GDB) != 0) { | 208 if ((kdb_brk = kdb_alt_break(c, &dc->brk_state)) != 0) { 209 switch (kdb_brk) { 210 case KDB_REQ_DEBUGGER: 211 212 if ((dc->flags & DC_GDB) != 0) { |
207#ifdef GDB | 213#ifdef GDB |
208 if (gdb_cur == &dcons_gdb_dbgport) { 209 kdb_dbbe_select("gdb"); 210 kdb_enter(KDB_WHY_BREAK, 211 "Break sequence on dcons gdb port"); 212 } | 214 if (gdb_cur == &dcons_gdb_dbgport) { 215 kdb_dbbe_select("gdb"); 216 kdb_enter(KDB_WHY_BREAK, 217 "Break sequence on dcons gdb port"); 218 } |
213#endif | 219#endif |
214 } else 215 kdb_enter(KDB_WHY_BREAK, 216 "Break sequence on dcons console port"); | 220 } else 221 kdb_enter(KDB_WHY_BREAK, 222 "Break sequence on dcons console port"); 223 break; 224 case KDB_REQ_PANIC: 225 kdb_panic("Panic sequence on dcons console port"); 226 break; 227 case KDB_REQ_BREAK: 228 kdb_reboot(); 229 break; 230 } |
217 } 218#else 219 switch (dc->brk_state) { 220 case STATE1: 221 if (c == KEY_TILDE) 222 dc->brk_state = STATE2; 223 else 224 dc->brk_state = STATE0; --- 541 unchanged lines hidden --- | 231 } 232#else 233 switch (dc->brk_state) { 234 case STATE1: 235 if (c == KEY_TILDE) 236 dc->brk_state = STATE2; 237 else 238 dc->brk_state = STATE0; --- 541 unchanged lines hidden --- |