]> git.saurik.com Git - apple/xnu.git/blame - osfmk/kern/debug.h
xnu-792.6.22.tar.gz
[apple/xnu.git] / osfmk / kern / debug.h
CommitLineData
1c79356b 1/*
91447636 2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
1c79356b
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
e5568f75
A
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
1c79356b 11 *
e5568f75
A
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1c79356b
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
e5568f75
A
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
1c79356b
A
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
9bccf70c 22
1c79356b
A
23#ifndef _KERN_DEBUG_H_
24#define _KERN_DEBUG_H_
25
91447636 26#include <sys/cdefs.h>
9bccf70c 27
91447636 28#ifdef KERNEL_PRIVATE
1c79356b
A
29
30extern unsigned int systemLogDiags;
31
32#ifdef MACH_KERNEL_PRIVATE
33
34extern unsigned int halt_in_debugger;
35
36extern unsigned int switch_debugger;
37
38extern unsigned int current_debugger;
39#define NO_CUR_DB 0x0
40#define KDP_CUR_DB 0x1
41#define KDB_CUR_DB 0x2
42
43extern unsigned int active_debugger;
44extern unsigned int debug_mode;
55e303ae 45extern unsigned int disableDebugOuput;
9bccf70c 46
55e303ae 47extern unsigned int panicDebugging;
9bccf70c 48extern unsigned int logPanicDataToScreen;
1c79356b
A
49
50extern int db_run_mode;
51
52/* modes the system may be running in */
53
54#define STEP_NONE 0
55#define STEP_ONCE 1
56#define STEP_RETURN 2
57#define STEP_CALLT 3
58#define STEP_CONTINUE 4
59#define STEP_INVISIBLE 5
60#define STEP_COUNT 6
61#define STEP_TRACE 7 /* Show all calls to functions and returns */
62
91447636
A
63extern const char *panicstr;
64extern volatile unsigned int nestedpanic;
1c79356b 65
9bccf70c
A
66extern char *debug_buf;
67extern char *debug_buf_ptr;
68extern unsigned int debug_buf_size;
69
70extern void debug_log_init(void);
71extern void debug_putc(char);
72
91447636
A
73extern void panic_init(void);
74
1c79356b
A
75#endif /* MACH_KERNEL_PRIVATE */
76
77#define DB_HALT 0x1
78#define DB_PRT 0x2
79#define DB_NMI 0x4
80#define DB_KPRT 0x8
81#define DB_KDB 0x10
82#define DB_SLOG 0x20
9bccf70c
A
83#define DB_ARP 0x40
84#define DB_KDP_BP_DIS 0x80
85#define DB_LOG_PI_SCRN 0x100
55e303ae 86#define DB_KDP_GETC_ENA 0x200
9bccf70c 87
55e303ae
A
88#define DB_KERN_DUMP_ON_PANIC 0x400 /* Trigger core dump on panic*/
89#define DB_KERN_DUMP_ON_NMI 0x800 /* Trigger core dump on NMI */
90#define DB_DBG_POST_CORE 0x1000 /*Wait in debugger after NMI core */
91#define DB_PANICLOG_DUMP 0x2000 /* Send paniclog on panic,not core*/
91447636
A
92
93#endif /* KERNEL_PRIVATE */
94
95__BEGIN_DECLS
96
97extern void panic(const char *string, ...);
98
99__END_DECLS
1c79356b
A
100
101#endif /* _KERN_DEBUG_H_ */