Kernel: Add some sanity assertions/functions

This commit is contained in:
Bananymous 2023-09-29 02:03:19 +03:00
parent c11e84b248
commit 603fc200e6
2 changed files with 2 additions and 0 deletions

View File

@ -19,6 +19,7 @@ namespace Kernel::PCI
class BarRegion class BarRegion
{ {
BAN_NON_COPYABLE(BarRegion); BAN_NON_COPYABLE(BarRegion);
BAN_NON_MOVABLE(BarRegion);
public: public:
static BAN::ErrorOr<BAN::UniqPtr<BarRegion>> create(PCI::Device&, uint8_t bar_num); static BAN::ErrorOr<BAN::UniqPtr<BarRegion>> create(PCI::Device&, uint8_t bar_num);

View File

@ -119,6 +119,7 @@ namespace Kernel
BAN::ErrorOr<BAN::UniqPtr<VirtualRange>> VirtualRange::clone(PageTable& page_table) BAN::ErrorOr<BAN::UniqPtr<VirtualRange>> VirtualRange::clone(PageTable& page_table)
{ {
ASSERT(&PageTable::current() == &m_page_table); ASSERT(&PageTable::current() == &m_page_table);
ASSERT(&m_page_table != &page_table);
auto result = TRY(create_to_vaddr(page_table, vaddr(), size(), flags(), m_preallocated)); auto result = TRY(create_to_vaddr(page_table, vaddr(), size(), flags(), m_preallocated));