Deleted Added
full compact
subr_prf.c (15700) subr_prf.c (17677)
1/*-
2 * Copyright (c) 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94
1/*-
2 * Copyright (c) 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94
39 * $Id: subr_prf.c,v 1.36 1996/05/08 04:28:51 gpalmer Exp $
39 * $Id: subr_prf.c,v 1.37 1996/05/09 18:58:06 gpalmer Exp $
40 */
41
42#include "opt_ddb.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
40 */
41
42#include "opt_ddb.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/reboot.h>
47#include <sys/msgbuf.h>
48#include <sys/proc.h>
46#include <sys/msgbuf.h>
47#include <sys/proc.h>
49#include <sys/vnode.h>
50#include <sys/tty.h>
51#include <sys/tprintf.h>
52#include <sys/syslog.h>
53#include <sys/malloc.h>
48#include <sys/tty.h>
49#include <sys/tprintf.h>
50#include <sys/syslog.h>
51#include <sys/malloc.h>
54#include <sys/kernel.h>
55#include <sys/sysctl.h>
56#include <machine/cons.h>
57
58/*
59 * Note that stdarg.h and the ANSI style va_start macro is used for both
60 * ANSI and traditional C compilers.
61 */
62#include <machine/stdarg.h>
63
52#include <machine/cons.h>
53
54/*
55 * Note that stdarg.h and the ANSI style va_start macro is used for both
56 * ANSI and traditional C compilers.
57 */
58#include <machine/stdarg.h>
59
64#if defined(DDB)
65#ifdef DDB_UNATTENDED
66 static int debugger_on_panic = 0;
67#else
68 static int debugger_on_panic = 1;
69#endif
70
71SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW,
72 &debugger_on_panic, 0, "");
73#endif
74
75#define TOCONS 0x01
76#define TOTTY 0x02
77#define TOLOG 0x04
78
79struct tty *constty; /* pointer to console "window" tty */
80
81static void (*v_putc)(int) = cnputc; /* routine to putc on virtual console */
60#define TOCONS 0x01
61#define TOTTY 0x02
62#define TOLOG 0x04
63
64struct tty *constty; /* pointer to console "window" tty */
65
66static void (*v_putc)(int) = cnputc; /* routine to putc on virtual console */
82
83static void logpri __P((int level));
84static void msglogchar(int c, void *dummyarg);
85struct putchar_arg {int flags; struct tty *tty; };
86static void putchar __P((int ch, void *arg));
87static char *ksprintn __P((u_long num, int base, int *len));
88
89static int consintr = 1; /* Ok to handle console interrupts? */
90
91/*
67static void logpri __P((int level));
68static void msglogchar(int c, void *dummyarg);
69struct putchar_arg {int flags; struct tty *tty; };
70static void putchar __P((int ch, void *arg));
71static char *ksprintn __P((u_long num, int base, int *len));
72
73static int consintr = 1; /* Ok to handle console interrupts? */
74
75/*
92 * Variable panicstr contains argument to first call to panic; used as flag
93 * to indicate that the kernel has already called panic.
94 */
95const char *panicstr;
96
97/*
98 * Panic is called on unresolvable fatal errors. It prints "panic: mesg",
99 * and then reboots. If we are called twice, then we avoid trying to sync
100 * the disks as this often leads to recursive panics.
101 */
102#ifdef __GNUC__
103__dead /* panic() does not return */
104#endif
105void
106panic(const char *fmt, ...)
107{
108 int bootopt;
109 va_list ap;
110
111 bootopt = RB_AUTOBOOT | RB_DUMP;
112 if (panicstr)
113 bootopt |= RB_NOSYNC;
114 else
115 panicstr = fmt;
116
117 printf("panic: ");
118 va_start(ap, fmt);
119 vprintf(fmt, ap);
120 va_end(ap);
121 printf("\n");
122
123#if defined(DDB)
124 if (debugger_on_panic)
125 Debugger ("panic");
126#endif
127 boot(bootopt);
128}
129
130/*
131 * Warn that a system table is full.
132 */
133void
134tablefull(tab)
135 const char *tab;
136{
137
138 log(LOG_ERR, "%s: table is full\n", tab);

--- 524 unchanged lines hidden ---
76 * Warn that a system table is full.
77 */
78void
79tablefull(tab)
80 const char *tab;
81{
82
83 log(LOG_ERR, "%s: table is full\n", tab);

--- 524 unchanged lines hidden ---