Changeset c621f4aa in mainline for kernel/generic/include/panic.h


Ignore:
Timestamp:
2010-07-25T10:11:13Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
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.
Message:

Merge with mainline.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/panic.h

    r24a2517 rc621f4aa  
    11/*
    2  * Copyright (c) 2001-2004 Jakub Jermar
     2 * Copyright (c) 2010 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
     
    3636#define KERN_PANIC_H_
    3737
    38 #include <stacktrace.h>
    39 #include <print.h>
     38#include <typedefs.h>
    4039
    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__)
    5442
    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
     52typedef enum {
     53        PANIC_OTHER,
     54        PANIC_ASSERT,
     55        PANIC_BADTRAP,
     56        PANIC_MEMTRAP
     57} panic_category_t;
     58
     59struct istate;
     60
     61extern bool silent;
     62
     63extern void panic_common(panic_category_t, struct istate *, int,
     64    uintptr_t, const char *, ...) __attribute__ ((noreturn));
    5665
    5766#endif
Note: See TracChangeset for help on using the changeset viewer.