core: hle: kernel: k_page_buffer: Add KPageBufferSlabHeap.

This commit is contained in:
bunnei 2022-10-29 13:46:39 -07:00
parent 0897f4f96c
commit f76b4417e6
1 changed files with 11 additions and 3 deletions

View File

@ -11,6 +11,16 @@
namespace Kernel { namespace Kernel {
class KernelCore;
class KPageBufferSlabHeap : protected impl::KSlabHeapImpl {
public:
static constexpr size_t BufferSize = PageSize;
public:
void Initialize(Core::System& system);
};
class KPageBuffer final : public KSlabAllocated<KPageBuffer> { class KPageBuffer final : public KSlabAllocated<KPageBuffer> {
public: public:
explicit KPageBuffer(KernelCore&) {} explicit KPageBuffer(KernelCore&) {}
@ -21,8 +31,6 @@ public:
private: private:
[[maybe_unused]] alignas(PageSize) std::array<u8, PageSize> m_buffer{}; [[maybe_unused]] alignas(PageSize) std::array<u8, PageSize> m_buffer{};
}; };
static_assert(sizeof(KPageBuffer) == KPageBufferSlabHeap::BufferSize);
static_assert(sizeof(KPageBuffer) == PageSize);
static_assert(alignof(KPageBuffer) == PageSize);
} // namespace Kernel } // namespace Kernel