diff options
author | Anton Kling <anton@kling.gg> | 2023-11-28 20:11:05 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2023-11-28 20:12:20 +0100 |
commit | d07fa25e04a19ccb9aa25bb6e2156d23d213db77 (patch) | |
tree | 25f2e4a6301f3ad7c5b158e74966a394862fdf39 /kernel/drivers/ata.c | |
parent | 636858dbbd48ed9f5073793b46740302aa202f43 (diff) |
Meta: Apply new clang-format rules to kernel
Diffstat (limited to 'kernel/drivers/ata.c')
-rw-r--r-- | kernel/drivers/ata.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/kernel/drivers/ata.c b/kernel/drivers/ata.c index 190cf5a..ee9e81b 100644 --- a/kernel/drivers/ata.c +++ b/kernel/drivers/ata.c @@ -105,8 +105,7 @@ int poll_status(void) { } // Instructions from: https://wiki.osdev.org/ATA_PIO_Mode#28_bit_PIO -void -setup_drive_for_command(u32 lba, u32 sector_count) { +void setup_drive_for_command(u32 lba, u32 sector_count) { // 1. Send 0xE0 for the "master" or 0xF0 for // the "slave", ORed with the highest 4 bits // of the LBA to port 0x1F6 @@ -139,8 +138,7 @@ void delayed_rep_outsw(size_t n, u16 port, volatile u8 *buffer) { } } -void ata_write_lba28(u32 lba, u32 sector_count, - volatile const u8 *buffer) { +void ata_write_lba28(u32 lba, u32 sector_count, volatile const u8 *buffer) { setup_drive_for_command(lba, sector_count); outb(io_base + COMMAND_PORT, WRITE_SECTORS); @@ -168,8 +166,7 @@ void ata_write_lba28(u32 lba, u32 sector_count, } // Instructions from: https://wiki.osdev.org/ATA_PIO_Mode#28_bit_PIO -void ata_read_lba28(u32 lba, u32 sector_count, - volatile void *address) { +void ata_read_lba28(u32 lba, u32 sector_count, volatile void *address) { // Step 1-6 is done in this function. setup_drive_for_command(lba, sector_count); @@ -227,8 +224,7 @@ void read_lba(u32 lba, void *address, size_t size, size_t offset) { } } -void write_lba(u32 lba, volatile void *address, size_t size, - size_t offset) { +void write_lba(u32 lba, volatile void *address, size_t size, size_t offset) { uintptr_t ptr = (uintptr_t)address; lba += offset / SECTOR_SIZE; offset = offset % SECTOR_SIZE; |