Deleted Added
full compact
mambo_console.c (214348) mambo_console.c (225203)
1/*-
2 * Copyright (C) 2008 by Nathan Whitehorn. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 9 unchanged lines hidden (view full) ---

18 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
19 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include <sys/cdefs.h>
1/*-
2 * Copyright (C) 2008 by Nathan Whitehorn. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 9 unchanged lines hidden (view full) ---

18 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
19 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include <sys/cdefs.h>
26__FBSDID("$FreeBSD: head/sys/powerpc/mambo/mambo_console.c 214348 2010-10-25 15:41:12Z nwhitehorn $");
26__FBSDID("$FreeBSD: head/sys/powerpc/mambo/mambo_console.c 225203 2011-08-26 21:46:36Z rwatson $");
27
28#include "opt_comconsole.h"
29
30#include <sys/param.h>
31#include <sys/kdb.h>
32#include <sys/kernel.h>
33#include <sys/priv.h>
34#include <sys/systm.h>

--- 20 unchanged lines hidden (view full) ---

55 .tsw_flags = TF_NOPREFIX,
56 .tsw_outwakeup = mambotty_outwakeup,
57};
58
59static int polltime;
60static struct callout mambo_callout;
61static struct tty *tp = NULL;
62
27
28#include "opt_comconsole.h"
29
30#include <sys/param.h>
31#include <sys/kdb.h>
32#include <sys/kernel.h>
33#include <sys/priv.h>
34#include <sys/systm.h>

--- 20 unchanged lines hidden (view full) ---

55 .tsw_flags = TF_NOPREFIX,
56 .tsw_outwakeup = mambotty_outwakeup,
57};
58
59static int polltime;
60static struct callout mambo_callout;
61static struct tty *tp = NULL;
62
63#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER)
63#if defined(KDB)
64static int alt_break_state;
65#endif
66
67static void mambo_timeout(void *);
68
69static cn_probe_t mambo_cnprobe;
70static cn_init_t mambo_cninit;
71static cn_term_t mambo_cnterm;

--- 79 unchanged lines hidden (view full) ---

151static int
152mambo_cngetc(struct consdev *cp)
153{
154 int ch;
155
156 ch = mambocall(MAMBO_CONSOLE_READ);
157
158 if (ch > 0 && ch < 0xff) {
64static int alt_break_state;
65#endif
66
67static void mambo_timeout(void *);
68
69static cn_probe_t mambo_cnprobe;
70static cn_init_t mambo_cninit;
71static cn_term_t mambo_cnterm;

--- 79 unchanged lines hidden (view full) ---

151static int
152mambo_cngetc(struct consdev *cp)
153{
154 int ch;
155
156 ch = mambocall(MAMBO_CONSOLE_READ);
157
158 if (ch > 0 && ch < 0xff) {
159#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER)
160 int kdb_brk;
161
162 if ((kdb_brk = kdb_alt_break(ch, &alt_break_state)) != 0) {
163 switch (kdb_brk) {
164 case KDB_REQ_DEBUGGER:
165 kdb_enter(KDB_WHY_BREAK,
166 "Break sequence on console");
167 break;
168 case KDB_REQ_PANIC:
169 kdb_panic("Panic sequence on console");
170 break;
171 case KDB_REQ_REBOOT:
172 kdb_reboot();
173 break;
174
175 }
176 }
159#if defined(KDB)
160 kdb_alt_break(ch, &alt_break_state);
177#endif
178 return (ch);
179 }
180
181 return (-1);
182}
183
184static void
185mambo_cnputc(struct consdev *cp, int c)
186{
187 char cbuf;
188
189 cbuf = c;
190 mambocall(MAMBO_CONSOLE_WRITE, &cbuf, 1UL, 1UL);
191}
161#endif
162 return (ch);
163 }
164
165 return (-1);
166}
167
168static void
169mambo_cnputc(struct consdev *cp, int c)
170{
171 char cbuf;
172
173 cbuf = c;
174 mambocall(MAMBO_CONSOLE_WRITE, &cbuf, 1UL, 1UL);
175}