diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-01-01 18:31:11 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-01-01 18:31:11 -0500 |
commit | 7f343097712ebdd1f11953c867e208da899b4ba3 (patch) | |
tree | a2bee74e381ce87766c006975eb03b34ee47b213 /src/disk.c | |
parent | 964622410105c28c42378440ac3cb6d1a996da49 (diff) | |
download | seabios-hppa-7f343097712ebdd1f11953c867e208da899b4ba3.zip seabios-hppa-7f343097712ebdd1f11953c867e208da899b4ba3.tar.gz seabios-hppa-7f343097712ebdd1f11953c867e208da899b4ba3.tar.bz2 |
Switch to new stack when calling ATA function in 16bit mode.
This reduces stack usage (old dos programs don't provide much space).
Diffstat (limited to 'src/disk.c')
-rw-r--r-- | src/disk.c | 29 |
1 files changed, 20 insertions, 9 deletions
@@ -39,28 +39,39 @@ __disk_stub(const char *fname, int lineno, struct bregs *regs) #define DISK_STUB(regs) \ __disk_stub(__func__, __LINE__, (regs)) -static __always_inline int -send_disk_op(struct disk_op_s *op) +static int +__send_disk_op(struct disk_op_s *op_p, u16 op_s) { + struct disk_op_s dop; + memcpy_far(MAKE_FARPTR(GET_SEG(SS), &dop) + , MAKE_FARPTR(op_s, op_p) + , sizeof(dop)); + dprintf(DEBUG_HDL_13, "disk_op d=%d lba=%d buf=%p count=%d cmd=%d\n" - , op->driveid, (u32)op->lba, op->far_buffer - , op->count, op->command); + , dop.driveid, (u32)dop.lba, dop.far_buffer + , dop.count, dop.command); irq_enable(); int status; - if (op->command == CMD_CDEMU_READ) - status = cdrom_read_512(op); - else if (op->command == CMD_CDROM_READ) - status = cdrom_read(op); + if (dop.command == CMD_CDEMU_READ) + status = cdrom_read_512(&dop); + else if (dop.command == CMD_CDROM_READ) + status = cdrom_read(&dop); else - status = ata_cmd_data(op); + status = ata_cmd_data(&dop); irq_disable(); return status; } +static int +send_disk_op(struct disk_op_s *op) +{ + return stack_hop((u32)op, GET_SEG(SS), 0, __send_disk_op); +} + static void basic_access(struct bregs *regs, u8 device, u16 command) { |