X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/2236410f4582ab45ae8c384dd6eeeef5d10aab15..d1b1c8d9119229dbeed06cd252917e54a1cb77f6:/lunaix-os/kernel/block/blkpart_gpt.c diff --git a/lunaix-os/kernel/block/blkpart_gpt.c b/lunaix-os/kernel/block/blkpart_gpt.c index 033fa0a..e9770ce 100644 --- a/lunaix-os/kernel/block/blkpart_gpt.c +++ b/lunaix-os/kernel/block/blkpart_gpt.c @@ -5,7 +5,9 @@ #include #include -#include +#include + +#include #define GPT_BLKSIZE 512 #define LBA2OFF(lba) ((lba) * GPT_BLKSIZE) @@ -46,9 +48,8 @@ blkpart_parse(struct device* master, struct gpt_header* header) } // Convert UEFI's 512B LB representation into local LBA range. - u64_t slba_local = - (ent->start_lba * GPT_BLKSIZE) / (u64_t)bdev->blk_size; - u64_t elba_local = (ent->end_lba * GPT_BLKSIZE) / (u64_t)bdev->blk_size; + u64_t slba_local = udiv64(ent->start_lba * GPT_BLKSIZE, bdev->blk_size); + u64_t elba_local = udiv64(ent->end_lba * GPT_BLKSIZE, bdev->blk_size); kprintf("%s: guid part#%d: %d..%d", bdev->bdev_id,