aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-02-14 13:07:54 -0500
committerKevin O'Connor <kevin@koconnor.net>2010-02-14 13:07:54 -0500
commitcfdc13f37f3fa3c7d8c11848f58cfc18a98e37a4 (patch)
tree9d3ac5adba05c12b6ad3af1d9e2e6fbf57fe6ded /src/util.h
parent8bbc79c435c896ad0107725fa77c7aeb860af625 (diff)
downloadseabios-hppa-cfdc13f37f3fa3c7d8c11848f58cfc18a98e37a4.zip
seabios-hppa-cfdc13f37f3fa3c7d8c11848f58cfc18a98e37a4.tar.gz
seabios-hppa-cfdc13f37f3fa3c7d8c11848f58cfc18a98e37a4.tar.bz2
Introduce standard warnings for allocation failures and timeouts.
There is no need for custom warnings for many common failures. Introduce a common warning which is consistent and more visible.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h38
1 files changed, 32 insertions, 6 deletions
diff --git a/src/util.h b/src/util.h
index 429590c..4228904 100644
--- a/src/util.h
+++ b/src/util.h
@@ -203,17 +203,28 @@ void panic(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2))) __noreturn;
void printf(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
-void __dprintf(const char *fmt, ...)
- __attribute__ ((format (printf, 1, 2)));
int snprintf(char *str, size_t size, const char *fmt, ...)
__attribute__ ((format (printf, 3, 4)));
+void __dprintf(const char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
+void __debug_enter(struct bregs *regs, const char *fname);
+void __debug_isr(const char *fname);
+void __debug_stub(struct bregs *regs, int lineno, const char *fname);
+void __warn_invalid(struct bregs *regs, int lineno, const char *fname);
+void __warn_unimplemented(struct bregs *regs, int lineno, const char *fname);
+void __warn_noalloc(int lineno, const char *fname);
+void __warn_timeout(int lineno, const char *fname);
+void __set_invalid(struct bregs *regs, int lineno, const char *fname);
+void __set_unimplemented(struct bregs *regs, int lineno, const char *fname);
+void __set_code_invalid(struct bregs *regs, u32 linecode, const char *fname);
+void __set_code_unimplemented(struct bregs *regs, u32 linecode
+ , const char *fname);
+void hexdump(const void *d, int len);
+
#define dprintf(lvl, fmt, args...) do { \
if (CONFIG_DEBUG_LEVEL && (lvl) <= CONFIG_DEBUG_LEVEL) \
__dprintf((fmt) , ##args ); \
} while (0)
-void __debug_enter(struct bregs *regs, const char *fname);
-void __debug_stub(struct bregs *regs, int lineno, const char *fname);
-void __debug_isr(const char *fname);
#define debug_enter(regs, lvl) do { \
if ((lvl) && (lvl) <= CONFIG_DEBUG_LEVEL) \
__debug_enter((regs), __func__); \
@@ -224,7 +235,22 @@ void __debug_isr(const char *fname);
} while (0)
#define debug_stub(regs) \
__debug_stub((regs), __LINE__, __func__)
-void hexdump(const void *d, int len);
+#define warn_invalid(regs) \
+ __warn_invalid((regs), __LINE__, __func__)
+#define warn_unimplemented(regs) \
+ __warn_unimplemented((regs), __LINE__, __func__)
+#define warn_noalloc() \
+ __warn_noalloc(__LINE__, __func__)
+#define warn_timeout() \
+ __warn_timeout(__LINE__, __func__)
+#define set_invalid(regs) \
+ __set_invalid((regs), __LINE__, __func__)
+#define set_code_invalid(regs, code) \
+ __set_code_invalid((regs), (code) | (__LINE__ << 8), __func__)
+#define set_unimplemented(regs) \
+ __set_unimplemented((regs), __LINE__, __func__)
+#define set_code_unimplemented(regs, code) \
+ __set_code_unimplemented((regs), (code) | (__LINE__ << 8), __func__)
// kbd.c
void kbd_setup(void);