BAN/Kernel: Rework assertion/panic system

BAN/Assert.h does not need any includes meaning it can be included
anywhere without problems.
This commit is contained in:
2024-03-04 11:41:54 +02:00
parent 8141b9977d
commit 9c36d7c338
20 changed files with 96 additions and 75 deletions

View File

@@ -129,7 +129,7 @@ namespace Kernel
size_t file_offset = m_offset + (vaddr - m_vaddr);
size_t bytes = BAN::Math::min<size_t>(m_size - file_offset, PAGE_SIZE);
ASSERT_EQ(&PageTable::current(), &m_page_table);
ASSERT(&PageTable::current() == &m_page_table);
auto read_ret = m_inode->read(file_offset, BAN::ByteSpan((uint8_t*)vaddr, bytes));
if (read_ret.is_error())

View File

@@ -158,9 +158,9 @@ namespace Kernel
return;
// Verify no overflow
ASSERT_LTE(bytes, size());
ASSERT_LTE(offset, size());
ASSERT_LTE(offset, size() - bytes);
ASSERT(bytes <= size());
ASSERT(offset <= size());
ASSERT(offset <= size() - bytes);
if (&PageTable::current() == &m_page_table || &PageTable::kernel() == &m_page_table)
{