From 3fedbb6e1f849c5e0a4033d68201d60c2fc48121 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 6 Jul 2024 23:37:11 +0300 Subject: core bringup + various warnings + dbg_fdt() is apparently broken, possibly due to UB or something, but it causes some issues with optimizations enabled. Remove it temporarily --- include/kmi/lock.h | 2 +- include/kmi/mem.h | 4 ++++ include/kmi/orphanage.h | 2 +- include/libfdt.h | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/kmi/lock.h b/include/kmi/lock.h index f24413c..192eb34 100644 --- a/include/kmi/lock.h +++ b/include/kmi/lock.h @@ -22,7 +22,7 @@ * * \todo irq contexts? */ -typedef atomic_int spinlock_t; +typedef int spinlock_t; #include diff --git a/include/kmi/mem.h b/include/kmi/mem.h index f2b7b74..d3c4da2 100644 --- a/include/kmi/mem.h +++ b/include/kmi/mem.h @@ -224,6 +224,8 @@ void set_ram_base(pm_t base); /** @param size Set RAM size. */ void set_ram_size(size_t size); +void set_load_addr(pm_t addr); + /** * Get RAM base address. * Very much assumes set_ram_base() has been called beforehand. @@ -241,6 +243,8 @@ pm_t get_ram_base(); */ size_t get_ram_size(); +pm_t get_load_addr(); + /** Base page size. */ #define BASE_PAGE_SIZE (order_size(BASE_PAGE)) diff --git a/include/kmi/orphanage.h b/include/kmi/orphanage.h index db5a617..98756c2 100644 --- a/include/kmi/orphanage.h +++ b/include/kmi/orphanage.h @@ -2,7 +2,7 @@ /* Copyright 2024, Kim Kuparinen < kimi.h.kuparinen@gmail.com > */ #ifndef KMI_ORPHANAGE_H -#define KMI_OPRHANAGE_H +#define KMI_ORPHANAGE_H /** * @file orphanage.h diff --git a/include/libfdt.h b/include/libfdt.h index c603840..c1d6a4e 100644 --- a/include/libfdt.h +++ b/include/libfdt.h @@ -99,7 +99,7 @@ void __dbg_fdt(const void *fdt, int node_offset, int depth); static inline fdt64_t fdt_load_reg_addr(struct cell_info ci, const void *p, size_t i) { - hard_assert(ci.addr_cells == 2 || ci.addr_cells == 1, 0); + catastrophic_assert(ci.addr_cells == 2 || ci.addr_cells == 1); size_t offset = i * (ci.addr_cells + ci.size_cells) * sizeof(fdt32_t); char *addr = ((char *)p) + 0; return fdt_load_int_ptr(ci.addr_cells, addr + offset); -- cgit v1.3