memory_pool.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2020 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_funcs.h"
  6. #include "common/common_types.h"
  7. #include "common/swap.h"
  8. namespace AudioCore {
  9. class ServerMemoryPoolInfo {
  10. public:
  11. ServerMemoryPoolInfo();
  12. ~ServerMemoryPoolInfo();
  13. enum class State : u32_le {
  14. Invalid = 0x0,
  15. Aquired = 0x1,
  16. RequestDetach = 0x2,
  17. Detached = 0x3,
  18. RequestAttach = 0x4,
  19. Attached = 0x5,
  20. Released = 0x6,
  21. };
  22. struct InParams {
  23. u64_le address{};
  24. u64_le size{};
  25. State state{};
  26. INSERT_PADDING_WORDS(3);
  27. };
  28. static_assert(sizeof(InParams) == 0x20, "InParams are an invalid size");
  29. struct OutParams {
  30. State state{};
  31. INSERT_PADDING_WORDS(3);
  32. };
  33. static_assert(sizeof(OutParams) == 0x10, "OutParams are an invalid size");
  34. bool Update(const InParams& in_params, OutParams& out_params);
  35. private:
  36. // There's another entry here which is the DSP address, however since we're not talking to the
  37. // DSP we can just use the same address provided by the guest without needing to remap
  38. u64_le cpu_address{};
  39. u64_le size{};
  40. bool used{};
  41. };
  42. } // namespace AudioCore