Changeset 06737a0 in mainline
- Timestamp:
- 2010-06-25T04:22:36Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a043e39
- Parents:
- 5c8de00
- Location:
- kernel
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
r5c8de00 r06737a0 201 201 generic/src/debug/symtab.c \ 202 202 generic/src/debug/stacktrace.c \ 203 generic/src/debug/panic.c \ 203 204 generic/src/interrupt/interrupt.c \ 204 205 generic/src/main/main.c \ -
kernel/generic/include/debug.h
r5c8de00 r06737a0 55 55 do { \ 56 56 if (!(expr)) \ 57 panic ("Assertion failed (%s)", #expr); \57 panic_assert("%s", #expr); \ 58 58 } while (0) 59 59 … … 72 72 do { \ 73 73 if (!(expr)) \ 74 panic ("Assertion failed (%s, %s)", #expr, msg); \74 panic_assert("%s, %s", #expr, msg); \ 75 75 } while (0) 76 76 -
kernel/generic/include/panic.h
r5c8de00 r06737a0 1 1 /* 2 * Copyright (c) 20 01-2004Jakub Jermar2 * Copyright (c) 2010 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 37 37 38 38 #include <typedefs.h> 39 #include <stacktrace.h>40 #include <print.h>41 39 42 #ifdef CONFIG_DEBUG 40 #define panic(fmt, ...) \ 41 panic_common(PANIC_OTHER, NULL, 0, 0, fmt, ##__VA_ARGS__) 43 42 44 #define panic(format, ...) \ 45 do { \ 46 silent = false; \ 47 printf("Kernel panic in %s() at %s:%u\n", \ 48 __func__, __FILE__, __LINE__); \ 49 stack_trace(); \ 50 panic_printf("Panic message: " format "\n", \ 51 ##__VA_ARGS__);\ 52 } while (0) 43 #define panic_assert(fmt, ...) \ 44 panic_common(PANIC_ASSERT, NULL, 0, 0, fmt, ##__VA_ARGS__) 53 45 54 #else /* CONFIG_DEBUG */ 46 #define panic_badtrap(istate, n, fmt, ...) \ 47 panic_common(PANIC_BADTRAP, istate, 0, n, fmt, ##__VA_ARGS__) 55 48 56 #define panic(format, ...) \ 57 do { \ 58 silent = false; \ 59 panic_printf("Kernel panic: " format "\n", ##__VA_ARGS__); \ 60 stack_trace(); \ 61 } while (0) 49 #define panic_memtrap(istate, access, addr, fmt, ...) \ 50 panic_common(PANIC_MEMTRAP, istate, access, addr, fmt, ##__VA_ARGS__) 62 51 63 #endif /* CONFIG_DEBUG */ 52 typedef enum { 53 PANIC_OTHER, 54 PANIC_ASSERT, 55 PANIC_BADTRAP, 56 PANIC_MEMTRAP 57 } panic_category_t; 58 59 struct istate; 64 60 65 61 extern bool silent; 66 62 67 extern void panic_printf(const char *fmt, ...) __attribute__((noreturn)); 63 extern void panic_common(panic_category_t, struct istate *, int, 64 uintptr_t, const char *, ...) __attribute__ ((noreturn)); 68 65 69 66 #endif
Note:
See TracChangeset
for help on using the changeset viewer.