Changes in kernel/generic/include/panic.h [f2f6636:9ac2013] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/panic.h
rf2f6636 r9ac2013 1 1 /* 2 * Copyright (c) 20 01-2004Jakub Jermar2 * Copyright (c) 2010 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 36 36 #define KERN_PANIC_H_ 37 37 38 #include < stacktrace.h>38 #include <typedefs.h> 39 39 #include <print.h> 40 40 41 #ifdef CONFIG_DEBUG 42 # define panic(format, ...) \ 43 do { \ 44 printf("Kernel panic in %s() at %s:%u.\n", \ 45 __func__, __FILE__, __LINE__); \ 46 stack_trace(); \ 47 panic_printf("Panic message: " format "\n", \ 48 ##__VA_ARGS__);\ 49 } while (0) 50 #else 51 # define panic(format, ...) \ 52 panic_printf("Kernel panic: " format "\n", ##__VA_ARGS__); 53 #endif 41 #define panic(fmt, ...) \ 42 panic_common(PANIC_OTHER, NULL, 0, 0, fmt, ##__VA_ARGS__) 54 43 55 extern void panic_printf(char *fmt, ...) __attribute__((noreturn)); 44 #define panic_assert(fmt, ...) \ 45 panic_common(PANIC_ASSERT, NULL, 0, 0, fmt, ##__VA_ARGS__) 46 47 #define panic_badtrap(istate, n, fmt, ...) \ 48 panic_common(PANIC_BADTRAP, istate, 0, n, fmt, ##__VA_ARGS__) 49 50 #define panic_memtrap(istate, access, addr, fmt, ...) \ 51 panic_common(PANIC_MEMTRAP, istate, access, addr, fmt, ##__VA_ARGS__) 52 53 typedef enum { 54 PANIC_OTHER, 55 PANIC_ASSERT, 56 PANIC_BADTRAP, 57 PANIC_MEMTRAP 58 } panic_category_t; 59 60 struct istate; 61 62 extern bool silent; 63 64 extern void panic_common(panic_category_t, struct istate *, int, 65 uintptr_t, const char *, ...) __attribute__ ((noreturn)) 66 PRINTF_ATTRIBUTE(5, 6); 56 67 57 68 #endif
Note:
See TracChangeset
for help on using the changeset viewer.