Files
eden/src/common/page_table.cpp
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
746 B
C++
Raw Normal View History

// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2019-03-02 15:20:28 -05:00
#include "common/page_table.h"
#include "common/scope_exit.h"
2019-03-02 15:20:28 -05:00
namespace Common {
PageTable::PageTable() = default;
2019-03-02 15:20:28 -05:00
2020-11-17 19:58:41 -05:00
PageTable::~PageTable() noexcept = default;
2019-03-02 15:20:28 -05:00
void PageTable::Resize(std::size_t address_space_width_in_bits, std::size_t page_bits) {
auto const num_page_table_entries = 1ULL << (address_space_width_in_bits - page_bits);
entries.ResizeAndClear(num_page_table_entries);
current_address_space_width_in_bits = address_space_width_in_bits;
current_page_bits = page_bits;
2019-03-02 15:20:28 -05:00
}
} // namespace Common