kernel/ATA: Avoid assuming endianness
This commit is contained in:
parent
31c36b9b83
commit
c97876bba0
@ -7,6 +7,7 @@
|
||||
#include "memory/MemoryManager.h"
|
||||
#include "thread/Clock.h"
|
||||
#include "thread/Scheduler.h"
|
||||
#include <endian.h>
|
||||
#include <luna/Alignment.h>
|
||||
#include <luna/Buffer.h>
|
||||
#include <luna/CType.h>
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user