2020-04-19 23:04:05 +02:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
2020-03-27 20:36:02 +01:00
|
|
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
|
|
|
|
2020-01-24 23:04:16 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
|
2020-02-17 20:11:59 +01:00
|
|
|
namespace skyline::service::audio::IAudioRenderer {
|
2020-01-24 23:04:16 +01:00
|
|
|
enum class MemoryPoolState : u32 {
|
2020-08-21 15:28:47 +02:00
|
|
|
Invalid = 0,
|
|
|
|
Unknown = 1,
|
|
|
|
RequestDetach = 2,
|
|
|
|
Detached = 3,
|
|
|
|
RequestAttach = 4,
|
|
|
|
Attached = 5,
|
|
|
|
Released = 6,
|
2020-01-24 23:04:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct MemoryPoolIn {
|
2020-08-21 15:28:47 +02:00
|
|
|
u64 address;
|
|
|
|
u64 size;
|
|
|
|
MemoryPoolState state;
|
2020-01-24 23:04:16 +01:00
|
|
|
u32 _unk0_;
|
|
|
|
u64 _unk1_;
|
|
|
|
};
|
|
|
|
static_assert(sizeof(MemoryPoolIn) == 0x20);
|
|
|
|
|
|
|
|
struct MemoryPoolOut {
|
2020-09-26 07:17:57 +02:00
|
|
|
MemoryPoolState state{MemoryPoolState::Detached};
|
2020-01-24 23:04:16 +01:00
|
|
|
u32 _unk0_;
|
|
|
|
u64 _unk1_;
|
|
|
|
};
|
|
|
|
static_assert(sizeof(MemoryPoolOut) == 0x10);
|
|
|
|
|
|
|
|
/**
|
2020-09-28 12:05:17 +02:00
|
|
|
* @brief The MemoryPool class stores the state of a memory pool
|
|
|
|
*/
|
2020-01-24 23:04:16 +01:00
|
|
|
class MemoryPool {
|
|
|
|
public:
|
2020-08-21 15:28:47 +02:00
|
|
|
MemoryPoolOut output{};
|
2020-01-24 23:04:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Processes the input memory pool data from the guest and sets internal data based off it
|
|
|
|
* @param input The input data struct from guest
|
|
|
|
*/
|
|
|
|
void ProcessInput(const MemoryPoolIn &input);
|
|
|
|
};
|
|
|
|
}
|