Make all refs to the bootboot structure const
This commit is contained in:
parent
54ce511f1d
commit
58ecf11424
@ -37,7 +37,7 @@ static int bcd_number_to_decimal(int num)
|
|||||||
return ((num >> 4) * 10) + (num & 0xf);
|
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 year = bcd_number_to_decimal(boottime[0]) * 100 + bcd_number_to_decimal(boottime[1]);
|
||||||
int month = bcd_number_to_decimal(boottime[2]);
|
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);
|
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
|
namespace Timer
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "video/Framebuffer.h"
|
#include "video/Framebuffer.h"
|
||||||
#include <luna/String.h>
|
#include <luna/String.h>
|
||||||
|
|
||||||
extern BOOTBOOT bootboot;
|
extern const BOOTBOOT bootboot;
|
||||||
|
|
||||||
void Init::check_magic()
|
void Init::check_magic()
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#include "memory/MemoryMap.h"
|
#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;
|
MemoryMapEntry result;
|
||||||
result.ptr = MMapEnt_Ptr(ent);
|
result.ptr = MMapEnt_Ptr(ent);
|
||||||
@ -23,7 +23,7 @@ void MemoryMapIterator::rewind()
|
|||||||
m_cur_ent = 0;
|
m_cur_ent = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<MemoryMapEntry> MemoryMapIterator::at(usize index)
|
Result<MemoryMapEntry> MemoryMapIterator::at(usize index) const
|
||||||
{
|
{
|
||||||
if (index >= m_mmap_entries) return err(ERANGE);
|
if (index >= m_mmap_entries) return err(ERANGE);
|
||||||
return memory_map_entry_from_mmapent(m_base_ent + index);
|
return memory_map_entry_from_mmapent(m_base_ent + index);
|
||||||
|
@ -23,15 +23,15 @@ class MemoryMapIterator
|
|||||||
|
|
||||||
MemoryMapEntry highest();
|
MemoryMapEntry highest();
|
||||||
|
|
||||||
Result<MemoryMapEntry> at(usize index);
|
Result<MemoryMapEntry> at(usize index) const;
|
||||||
|
|
||||||
usize entries()
|
usize entries() const
|
||||||
{
|
{
|
||||||
return m_mmap_entries;
|
return m_mmap_entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
usize m_mmap_entries;
|
usize m_mmap_entries;
|
||||||
MMapEnt* m_base_ent;
|
const MMapEnt* m_base_ent;
|
||||||
usize m_cur_ent;
|
usize m_cur_ent;
|
||||||
};
|
};
|
@ -7,7 +7,7 @@ static u32 g_fb_width;
|
|||||||
static u32 g_fb_height;
|
static u32 g_fb_height;
|
||||||
static u32 g_fb_scanline;
|
static u32 g_fb_scanline;
|
||||||
|
|
||||||
extern BOOTBOOT bootboot;
|
extern const BOOTBOOT bootboot;
|
||||||
extern u8 fb[1];
|
extern u8 fb[1];
|
||||||
|
|
||||||
namespace Framebuffer
|
namespace Framebuffer
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <luna/Format.h>
|
#include <luna/Format.h>
|
||||||
#include <luna/String.h>
|
#include <luna/String.h>
|
||||||
|
|
||||||
extern BOOTBOOT bootboot;
|
extern const BOOTBOOT bootboot;
|
||||||
|
|
||||||
#include "video/BuiltinFont.h"
|
#include "video/BuiltinFont.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user