physical_memory.h 696 B

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