diff --git a/kernel/src/arch/x86_64/disk/ATA.cpp b/kernel/src/arch/x86_64/disk/ATA.cpp index d82241d7..c0a8f551 100644 --- a/kernel/src/arch/x86_64/disk/ATA.cpp +++ b/kernel/src/arch/x86_64/disk/ATA.cpp @@ -7,6 +7,7 @@ #include "memory/MemoryManager.h" #include "thread/Clock.h" #include "thread/Scheduler.h" +#include #include #include #include @@ -517,9 +518,8 @@ namespace ATA m_is_lba48 = true; - // FIXME: This assumes the host machine is little-endian. - u32 last_lba = __builtin_bswap32(reply.last_lba); - u32 sector_size = __builtin_bswap32(reply.sector_size); + u32 last_lba = be32toh(reply.last_lba); + u32 sector_size = be32toh(reply.sector_size); m_block_count = last_lba + 1; m_block_size = sector_size;