diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2013-10-02 21:28:08 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2013-10-14 21:37:56 -0400 |
commit | 7c80bb83d9a154a19df75c48a8b42bfb4904a2e4 (patch) | |
tree | 9e66c77f7954942d1bef368e108b6fc410997ad6 /src/block.c | |
parent | 7acaa3cf7decd77542bf3b2ea8aac20a7a6522e9 (diff) | |
download | seabios-7c80bb83d9a154a19df75c48a8b42bfb4904a2e4.tar.gz |
Run ahci code entirely in 32bit mode.
The ahci driver needs to jump into 32bit mode in order to access
portions of the ahci controllers PCI config space. Instead of jumping
into 32bit mode just to toggle the ahci registers, jump into 32bit
mode for all of the driver interactions. This shrinks the size of the
overall code and can lead to further cleanups.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/block.c')
-rw-r--r-- | src/block.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/block.c b/src/block.c index 55d15d20..a41e662a 100644 --- a/src/block.c +++ b/src/block.c @@ -333,7 +333,7 @@ process_scsi_op(struct disk_op_s *op) } } -static int +int VISIBLE32FLAT process_atapi_op(struct disk_op_s *op) { switch (op->command) { @@ -363,10 +363,17 @@ process_op(struct disk_op_s *op) case DTYPE_VIRTIO_BLK: return process_virtio_blk_op(op); case DTYPE_AHCI: - return process_ahci_op(op); + op->drive_g = (void*)op->drive_g + BUILD_BIOS_ADDR; + extern void _cfunc32flat_process_ahci_op(void); + return call32(_cfunc32flat_process_ahci_op + , (u32)MAKE_FLATPTR(GET_SEG(SS), op), DISK_RET_EPARAM); case DTYPE_ATA_ATAPI: - case DTYPE_AHCI_ATAPI: return process_atapi_op(op); + case DTYPE_AHCI_ATAPI: + op->drive_g = (void*)op->drive_g + BUILD_BIOS_ADDR; + extern void _cfunc32flat_process_atapi_op(void); + return call32(_cfunc32flat_process_atapi_op + , (u32)MAKE_FLATPTR(GET_SEG(SS), op), DISK_RET_EPARAM); case DTYPE_USB: case DTYPE_UAS: case DTYPE_VIRTIO_SCSI: |