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