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/disk.c | |
parent | 6aa673d53c580d90b09830db83a6b6778c020d9b (diff) | |
download | seabios-hppa-0560034c29ef99239b910524f027a4d708038197.zip seabios-hppa-0560034c29ef99239b910524f027a4d708038197.tar.gz seabios-hppa-0560034c29ef99239b910524f027a4d708038197.tar.bz2 |
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/disk.c')
-rw-r--r-- | src/disk.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -20,24 +20,25 @@ ****************************************************************/ void -__disk_ret(const char *fname, int lineno, struct bregs *regs, u8 code) +__disk_ret(struct bregs *regs, u32 linecode, const char *fname) { + u8 code = linecode; SET_BDA(disk_last_status, code); if (code) - __set_code_fail(fname, lineno, regs, code); + __set_code_fail(regs, linecode, fname); else set_code_success(regs); } static void -__disk_stub(const char *fname, int lineno, struct bregs *regs) +__disk_stub(struct bregs *regs, int lineno, const char *fname) { - __debug_stub(fname, lineno, regs); - __disk_ret(fname, lineno, regs, DISK_RET_SUCCESS); + __debug_stub(regs, lineno, fname); + __disk_ret(regs, DISK_RET_SUCCESS | (lineno << 8), fname); } -#define DISK_STUB(regs) \ - __disk_stub(__func__, __LINE__, (regs)) +#define DISK_STUB(regs) \ + __disk_stub((regs), __LINE__, __func__) static int __send_disk_op(struct disk_op_s *op_p, u16 op_s) |