diff --git a/kernel/src/arch/Timer.cpp b/kernel/src/arch/Timer.cpp index 9c0606db..75792e93 100644 --- a/kernel/src/arch/Timer.cpp +++ b/kernel/src/arch/Timer.cpp @@ -37,7 +37,7 @@ static int bcd_number_to_decimal(int num) return ((num >> 4) * 10) + (num & 0xf); } -static u64 bootloader_time_to_unix(u8 boottime[8]) +static u64 bootloader_time_to_unix(const u8 boottime[8]) { int year = bcd_number_to_decimal(boottime[0]) * 100 + bcd_number_to_decimal(boottime[1]); int month = bcd_number_to_decimal(boottime[2]); @@ -51,7 +51,7 @@ static u64 bootloader_time_to_unix(u8 boottime[8]) return broken_down_to_unix(year - 1900, make_yday(year, month) + (day - 1), hour, minute, second); } -extern BOOTBOOT bootboot; +extern const BOOTBOOT bootboot; namespace Timer { diff --git a/kernel/src/boot/Init.cpp b/kernel/src/boot/Init.cpp index c72f8aa4..11537b84 100644 --- a/kernel/src/boot/Init.cpp +++ b/kernel/src/boot/Init.cpp @@ -7,7 +7,7 @@ #include "video/Framebuffer.h" #include -extern BOOTBOOT bootboot; +extern const BOOTBOOT bootboot; void Init::check_magic() { diff --git a/kernel/src/memory/MemoryMap.cpp b/kernel/src/memory/MemoryMap.cpp index 7c1fcb80..5a97443a 100644 --- a/kernel/src/memory/MemoryMap.cpp +++ b/kernel/src/memory/MemoryMap.cpp @@ -1,8 +1,8 @@ #include "memory/MemoryMap.h" -extern BOOTBOOT bootboot; +extern const BOOTBOOT bootboot; -static MemoryMapEntry memory_map_entry_from_mmapent(MMapEnt* ent) +static MemoryMapEntry memory_map_entry_from_mmapent(const MMapEnt* ent) { MemoryMapEntry result; result.ptr = MMapEnt_Ptr(ent); @@ -23,7 +23,7 @@ void MemoryMapIterator::rewind() m_cur_ent = 0; } -Result MemoryMapIterator::at(usize index) +Result MemoryMapIterator::at(usize index) const { if (index >= m_mmap_entries) return err(ERANGE); return memory_map_entry_from_mmapent(m_base_ent + index); diff --git a/kernel/src/memory/MemoryMap.h b/kernel/src/memory/MemoryMap.h index 096bd2a7..26f86518 100644 --- a/kernel/src/memory/MemoryMap.h +++ b/kernel/src/memory/MemoryMap.h @@ -23,15 +23,15 @@ class MemoryMapIterator MemoryMapEntry highest(); - Result at(usize index); + Result at(usize index) const; - usize entries() + usize entries() const { return m_mmap_entries; } private: usize m_mmap_entries; - MMapEnt* m_base_ent; + const MMapEnt* m_base_ent; usize m_cur_ent; }; \ No newline at end of file diff --git a/kernel/src/video/Framebuffer.cpp b/kernel/src/video/Framebuffer.cpp index 8de99d62..8b28dbba 100644 --- a/kernel/src/video/Framebuffer.cpp +++ b/kernel/src/video/Framebuffer.cpp @@ -7,7 +7,7 @@ static u32 g_fb_width; static u32 g_fb_height; static u32 g_fb_scanline; -extern BOOTBOOT bootboot; +extern const BOOTBOOT bootboot; extern u8 fb[1]; namespace Framebuffer diff --git a/kernel/src/video/TextConsole.cpp b/kernel/src/video/TextConsole.cpp index 8384eec5..f6a55fa6 100644 --- a/kernel/src/video/TextConsole.cpp +++ b/kernel/src/video/TextConsole.cpp @@ -4,7 +4,7 @@ #include #include -extern BOOTBOOT bootboot; +extern const BOOTBOOT bootboot; #include "video/BuiltinFont.h"