physical_memory.h 715 B

123456789101112131415161718192021222324
  1. // Copyright 2019 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <vector>
  6. #include "common/alignment.h"
  7. namespace Kernel {
  8. // This encapsulation serves 2 purposes:
  9. // - First, to encapsulate host physical memory under a single type and set an
  10. // standard for managing it.
  11. // - Second to ensure all host backing memory used is aligned to 256 bytes due
  12. // to strict alignment restrictions on GPU memory.
  13. using PhysicalMemoryVector = std::vector<u8, Common::AlignmentAllocator<u8, 256>>;
  14. class PhysicalMemory final : public PhysicalMemoryVector {
  15. using PhysicalMemoryVector::PhysicalMemoryVector;
  16. };
  17. } // namespace Kernel