fixing minor bugs with single unit compilation in gcc with flags on

This commit is contained in:
2025-05-16 01:08:12 -07:00
parent 50efcc13fe
commit 49361a98be
19 changed files with 109 additions and 12 deletions

View File

@@ -1,14 +1,21 @@
#include "memmap.h"
uint32_t get_memory_map(memory_map_entry_t *map, uint32_t max_entries) {
// Fill with dummy values for now
map[0].base_addr = 0x00000000;
map[0].length = 0x0009FC00;
map[0].type = 1;
uint32_t count = 0;
map[1].base_addr = 0x00100000;
map[1].length = 0x1FF00000;
map[1].type = 1;
if (max_entries >= 1) {
map[count].base_addr = 0x00000000;
map[count].length = 0x0009FC00;
map[count].type = 1;
count++;
}
return 2; // 2 regions
}
if (max_entries >= 2) {
map[count].base_addr = 0x00100000;
map[count].length = 0x1FF00000;
map[count].type = 1;
count++;
}
return count;
}