Move variable declarations in LimineMHDIns to top of function.

This commit is contained in:
TomAwezome 2022-10-11 22:09:57 -04:00 committed by GitHub
parent 6ba555ee8f
commit c5f3102558
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,8 @@ Bool LimineMHDIns(U8 drv_let)
CLimineStage2Header *limine_stage2 = limine + 0x1A4; CLimineStage2Header *limine_stage2 = limine + 0x1A4;
U16 limine_stage2_size = limine_size - BLK_SIZE; U16 limine_stage2_size = limine_size - BLK_SIZE;
U16 limine_stage2_size_aligned = limine_stage2_size + ((BLK_SIZE * 2) - limine_stage2_size % (BLK_SIZE * 2)); U16 limine_stage2_size_aligned = limine_stage2_size + ((BLK_SIZE * 2) - limine_stage2_size % (BLK_SIZE * 2));
CBlkDev *bd = Letter2BlkDev(drv_let);
CMasterBoot old_mbr, *new_mbr = limine;
if (limine_size == 0) if (limine_size == 0)
{ {
@ -29,9 +31,6 @@ Bool LimineMHDIns(U8 drv_let)
limine_stage2->location_a = BLK_SIZE; limine_stage2->location_a = BLK_SIZE;
limine_stage2->location_b = BLK_SIZE + limine_stage2->size_a; limine_stage2->location_b = BLK_SIZE + limine_stage2->size_a;
CBlkDev *bd = Letter2BlkDev(drv_let);
CMasterBoot old_mbr, *new_mbr = limine;
BlkDevLock(bd); BlkDevLock(bd);
AHCIAtaBlksRead(bd, &old_mbr, 0, 1); // read old MBR currently on disk AHCIAtaBlksRead(bd, &old_mbr, 0, 1); // read old MBR currently on disk