diff options
Diffstat (limited to 'include/linux/kdb.h')
| -rw-r--r-- | include/linux/kdb.h | 43 | 
1 files changed, 21 insertions, 22 deletions
diff --git a/include/linux/kdb.h b/include/linux/kdb.h index aadff7cc2b8..290db1269c4 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h @@ -13,10 +13,18 @@   * Copyright (C) 2009 Jason Wessel <jason.wessel@windriver.com>   */ +typedef enum { +	KDB_REPEAT_NONE = 0,	/* Do not repeat this command */ +	KDB_REPEAT_NO_ARGS,	/* Repeat the command without arguments */ +	KDB_REPEAT_WITH_ARGS,	/* Repeat the command including its arguments */ +} kdb_repeat_t; + +typedef int (*kdb_func_t)(int, const char **); +  #ifdef	CONFIG_KGDB_KDB  #include <linux/init.h>  #include <linux/sched.h> -#include <asm/atomic.h> +#include <linux/atomic.h>  #define KDB_POLL_FUNC_MAX	5  extern int kdb_poll_idx; @@ -32,14 +40,6 @@ extern atomic_t kdb_event;  #define KDB_MAXARGS    16 /* Maximum number of arguments to a function  */ -typedef enum { -	KDB_REPEAT_NONE = 0,	/* Do not repeat this command */ -	KDB_REPEAT_NO_ARGS,	/* Repeat the command without arguments */ -	KDB_REPEAT_WITH_ARGS,	/* Repeat the command including its arguments */ -} kdb_repeat_t; - -typedef int (*kdb_func_t)(int, const char **); -  /* KDB return codes from a command or internal kdb function */  #define KDB_NOTFOUND	(-1)  #define KDB_ARGCOUNT	(-2) @@ -75,8 +75,6 @@ extern const char *kdb_diemsg;  #define KDB_FLAG_CATASTROPHIC	(1 << 1) /* A catastrophic event has occurred */  #define KDB_FLAG_CMD_INTERRUPT	(1 << 2) /* Previous command was interrupted */  #define KDB_FLAG_NOIPI		(1 << 3) /* Do not send IPIs */ -#define KDB_FLAG_ONLY_DO_DUMP	(1 << 4) /* Only do a dump, used when -					  * kdb is off */  #define KDB_FLAG_NO_CONSOLE	(1 << 5) /* No console is available,  					  * kdb is disabled */  #define KDB_FLAG_NO_VT_CONSOLE	(1 << 6) /* No VT console is available, do @@ -111,15 +109,13 @@ typedef enum {  	KDB_REASON_RECURSE,	/* Recursive entry to kdb;  				 * regs probably valid */  	KDB_REASON_SSTEP,	/* Single Step trap. - regs valid */ +	KDB_REASON_SYSTEM_NMI,	/* In NMI due to SYSTEM cmd; regs valid */  } kdb_reason_t;  extern int kdb_trap_printk; -extern int vkdb_printf(const char *fmt, va_list args) -	    __attribute__ ((format (printf, 1, 0))); -extern int kdb_printf(const char *, ...) -	    __attribute__ ((format (printf, 1, 2))); -typedef int (*kdb_printf_t)(const char *, ...) -	     __attribute__ ((format (printf, 1, 2))); +extern __printf(1, 0) int vkdb_printf(const char *fmt, va_list args); +extern __printf(1, 2) int kdb_printf(const char *, ...); +typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...);  extern void kdb_init(int level); @@ -154,11 +150,14 @@ extern int kdb_register_repeat(char *, kdb_func_t, char *, char *,  			       short, kdb_repeat_t);  extern int kdb_unregister(char *);  #else /* ! CONFIG_KGDB_KDB */ -#define kdb_printf(...) -#define kdb_init(x) -#define kdb_register(...) -#define kdb_register_repeat(...) -#define kdb_uregister(x) +static inline __printf(1, 2) int kdb_printf(const char *fmt, ...) { return 0; } +static inline void kdb_init(int level) {} +static inline int kdb_register(char *cmd, kdb_func_t func, char *usage, +			       char *help, short minlen) { return 0; } +static inline int kdb_register_repeat(char *cmd, kdb_func_t func, char *usage, +				      char *help, short minlen, +				      kdb_repeat_t repeat) { return 0; } +static inline int kdb_unregister(char *cmd) { return 0; }  #endif	/* CONFIG_KGDB_KDB */  enum {  	KDB_NOT_INITIALIZED,  | 
