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