diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-01-02 13:10:58 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-01-02 13:10:58 -0500 |
commit | 0560034c29ef99239b910524f027a4d708038197 (patch) | |
tree | a6bd69a83ef16e7a247c4bacea0cebd0291b1da5 /src/output.c | |
parent | 6aa673d53c580d90b09830db83a6b6778c020d9b (diff) | |
download | seabios-0560034c29ef99239b910524f027a4d708038197.tar.gz |
Improve set_code_fail/floppy_ret/disk_ret code generation.
Encode lineno and return code into one u32 parameter. This reduces
the number of functions arguments to 3 - which gcc does a better
job of scheduling.
Also, consistently place *regs parameter in the first arg.
Diffstat (limited to 'src/output.c')
-rw-r--r-- | src/output.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/output.c b/src/output.c index 6a56d456..356f2e5d 100644 --- a/src/output.c +++ b/src/output.c @@ -271,6 +271,7 @@ dump_regs(struct bregs *regs) , regs->ds, regs->es, regs->ip, regs->cs, regs->flags, regs); } +// Report entry to an Interrupt Service Routine (ISR). void __debug_isr(const char *fname) { @@ -280,30 +281,38 @@ __debug_isr(const char *fname) // Function called on handler startup. void -__debug_enter(const char *fname, struct bregs *regs) +__debug_enter(struct bregs *regs, const char *fname) { dprintf(1, "enter %s:\n", fname); dump_regs(regs); } +// Send debugging output info. void -__debug_stub(const char *fname, int lineno, struct bregs *regs) +__debug_stub(struct bregs *regs, int lineno, const char *fname) { dprintf(1, "stub %s:%d:\n", fname, lineno); dump_regs(regs); } +// Report on a handler returning a failure notification to the caller. void -__set_fail(const char *fname, int lineno, struct bregs *regs) +__set_fail(struct bregs *regs, int lineno, const char *fname) { dprintf(1, "fail %s:%d:\n", fname, lineno); dump_regs(regs); set_fail_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. void -__set_code_fail(const char *fname, int lineno, struct bregs *regs, u8 code) +__set_code_fail(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); |