upgrade multiboot2 header
This commit is contained in:
@@ -7,24 +7,6 @@
|
||||
#include "panic.h"
|
||||
#include "util.h"
|
||||
|
||||
static void *multiboot_find_tag(uptr multiboot_info, u32 type) {
|
||||
uptr next = multiboot_info + 8;
|
||||
|
||||
while (true) {
|
||||
multiboot_tag *tag = (multiboot_tag*)next;
|
||||
|
||||
if (tag->type == MULTIBOOT_TAG_TYPE_END) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (tag->type == type) {
|
||||
return tag;
|
||||
}
|
||||
|
||||
next = align_up(next + tag->size, MULTIBOOT_TAG_ALIGN);
|
||||
}
|
||||
}
|
||||
|
||||
#define MAX_REGIONS 64
|
||||
|
||||
typedef struct {
|
||||
@@ -39,7 +21,7 @@ static memory_region memory_regions[MAX_REGIONS] = {0};
|
||||
static size_t memory_region_count = 0;
|
||||
|
||||
static void find_memory_regions(uptr multiboot_info) {
|
||||
multiboot_tag_mmap *tag = multiboot_find_tag(multiboot_info, MULTIBOOT_TAG_TYPE_MMAP);
|
||||
multiboot_tag_mmap *tag = multiboot_get_mmap(multiboot_info);
|
||||
if (tag == NULL) {
|
||||
boot_panic("Multiboot did not provide mmap tag");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user