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