Changeset c621f4aa in mainline for kernel/generic/include/panic.h
- Timestamp:
- 2010-07-25T10:11:13Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 377cce8
- Parents:
- 24a2517 (diff), a2da43c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
kernel/generic/include/panic.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/panic.h
r24a2517 rc621f4aa 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> 39 #include <print.h> 38 #include <typedefs.h> 40 39 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 40 #define panic(fmt, ...) \ 41 panic_common(PANIC_OTHER, NULL, 0, 0, fmt, ##__VA_ARGS__) 54 42 55 extern void panic_printf(char *fmt, ...) __attribute__((noreturn)); 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; 60 61 extern bool silent; 62 63 extern void panic_common(panic_category_t, struct istate *, int, 64 uintptr_t, const char *, ...) __attribute__ ((noreturn)); 56 65 57 66 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
