aboutsummaryrefslogtreecommitdiff
path: root/src/output.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-12-13 13:04:17 -0500
committerKevin O'Connor <kevin@koconnor.net>2009-12-13 13:04:17 -0500
commitdfefeb543866eb74e0668fdec1fe496bb9ffb860 (patch)
tree0d1ce9d969dcc293c5e4094c85d9b7b21981d793 /src/output.c
parentd43e1788502dc99d46bb634424ac70137874f517 (diff)
downloadseabios-hppa-dfefeb543866eb74e0668fdec1fe496bb9ffb860.zip
seabios-hppa-dfefeb543866eb74e0668fdec1fe496bb9ffb860.tar.gz
seabios-hppa-dfefeb543866eb74e0668fdec1fe496bb9ffb860.tar.bz2
Distinguish between debug reports for unimplemented vs invalid calls.
Don't use "fail" in the debug output - as this confuses users. When reporting on an invalid parameter - use the word "invalid". When reporting on an unimplemented call - state it is unimplemented. Add separate debug levels for unimplemented vs invalid calls. Also, increase the debug level of several entry points.
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c62
1 files changed, 49 insertions, 13 deletions
diff --git a/src/output.c b/src/output.c
index 7e91bfe..e49010d 100644
--- a/src/output.c
+++ b/src/output.c
@@ -463,25 +463,61 @@ __debug_stub(struct bregs *regs, int lineno, const char *fname)
dump_regs(regs);
}
-// Report on a handler returning a failure notification to the caller.
+// Report on an invalid parameter.
void
-__set_fail(struct bregs *regs, int lineno, const char *fname)
+__warn_invalid(struct bregs *regs, int lineno, const char *fname)
{
- dprintf(1, "fail %s:%d:\n", fname, lineno);
- dump_regs(regs);
- set_fail_silent(regs);
+ if (CONFIG_DEBUG_LEVEL >= DEBUG_invalid) {
+ dprintf(1, "invalid %s:%d:\n", fname, lineno);
+ dump_regs(regs);
+ }
+}
+
+// Report on an unimplemented feature.
+void
+__warn_unimplemented(struct bregs *regs, int lineno, const char *fname)
+{
+ if (CONFIG_DEBUG_LEVEL >= DEBUG_unimplemented) {
+ dprintf(1, "unimplemented %s:%d:\n", fname, lineno);
+ dump_regs(regs);
+ }
+}
+
+// Report a handler reporting an invalid parameter to the caller.
+void
+__set_invalid(struct bregs *regs, int lineno, const char *fname)
+{
+ __warn_invalid(regs, lineno, fname);
+ set_invalid_silent(regs);
}
-// Report on a handler returning a failure code to the caller. Note,
-// the lineno and return code are encoded in the same parameter as gcc
-// does a better job of scheduling function calls when there are 3 or
-// less parameters.
+// Report a call of an unimplemented function.
void
-__set_code_fail(struct bregs *regs, u32 linecode, const char *fname)
+__set_unimplemented(struct bregs *regs, int lineno, const char *fname)
+{
+ __warn_unimplemented(regs, lineno, fname);
+ set_invalid_silent(regs);
+}
+
+// Report a handler reporting an invalid parameter code to the
+// caller. Note, the lineno and return code are encoded in the same
+// parameter as gcc does a better job of scheduling function calls
+// when there are 3 or less parameters.
+void
+__set_code_invalid(struct bregs *regs, u32 linecode, const char *fname)
{
u8 code = linecode;
u32 lineno = linecode >> 8;
- dprintf(1, "fail %s:%d(%x):\n", fname, lineno, code);
- dump_regs(regs);
- set_code_fail_silent(regs, code);
+ __warn_invalid(regs, lineno, fname);
+ set_code_invalid_silent(regs, code);
+}
+
+// Report a call of an unimplemented function.
+void
+__set_code_unimplemented(struct bregs *regs, u32 linecode, const char *fname)
+{
+ u8 code = linecode;
+ u32 lineno = linecode >> 8;
+ __warn_unimplemented(regs, lineno, fname);
+ set_code_invalid_silent(regs, code);
}