mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-22 02:45:07 -04:00
kern: implement enough of KPageTable to initialize a thread
This commit is contained in:
parent
c6d1579265
commit
8c93eb5712
31 changed files with 1475 additions and 270 deletions
|
@ -27,7 +27,7 @@ namespace ams::kern {
|
|||
KVirtualAddress address;
|
||||
size_t num_pages;
|
||||
public:
|
||||
constexpr KBlockInfo() : address(), num_pages() { /* ... */ }
|
||||
constexpr KBlockInfo() : util::IntrusiveListBaseNode<KBlockInfo>(), address(), num_pages() { /* ... */ }
|
||||
|
||||
constexpr void Initialize(KVirtualAddress addr, size_t np) {
|
||||
this->address = addr;
|
||||
|
@ -82,9 +82,9 @@ namespace ams::kern {
|
|||
BlockInfoList block_list;
|
||||
KBlockInfoManager *manager;
|
||||
public:
|
||||
KPageGroup() : block_list(), manager() { /* ... */ }
|
||||
explicit KPageGroup(KBlockInfoManager *m) : block_list(), manager(m) { /* ... */ }
|
||||
~KPageGroup() { this->Finalize(); }
|
||||
|
||||
void Initialize(KBlockInfoManager *m);
|
||||
void Finalize();
|
||||
|
||||
iterator begin() const { return this->block_list.begin(); }
|
||||
|
@ -107,4 +107,14 @@ namespace ams::kern {
|
|||
}
|
||||
};
|
||||
|
||||
class KScopedPageGroup {
|
||||
private:
|
||||
KPageGroup *group;
|
||||
public:
|
||||
explicit ALWAYS_INLINE KScopedPageGroup(KPageGroup *gp) : group(gp) { group->Open(); }
|
||||
explicit ALWAYS_INLINE KScopedPageGroup(KPageGroup &gp) : KScopedPageGroup(std::addressof(gp)) { /* ... */ }
|
||||
ALWAYS_INLINE ~KScopedPageGroup() { group->Close(); }
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue