Changes in kernel/generic/include/panic.h [f651e80:9ac2013] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/panic.h
rf651e80 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 #ifdef CONFIG_DEBUG 39 # define panic(format, ...) \ 40 panic_printf("Kernel panic in %s() at %s:%u: " format "\n", \ 41 __func__, __FILE__, __LINE__, ##__VA_ARGS__); 42 #else 43 # define panic(format, ...) \ 44 panic_printf("Kernel panic: " format "\n", ##__VA_ARGS__); 45 #endif 38 #include <typedefs.h> 39 #include <print.h> 46 40 47 extern void panic_printf(char *fmt, ...) __attribute__((noreturn)); 41 #define panic(fmt, ...) \ 42 panic_common(PANIC_OTHER, NULL, 0, 0, fmt, ##__VA_ARGS__) 43 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); 48 67 49 68 #endif
Note:
See TracChangeset
for help on using the changeset viewer.