2017-10-02 02:56:43 +00:00
|
|
|
// Copyright 2017 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-11-08 19:05:54 +00:00
|
|
|
#include <memory>
|
2018-11-08 18:53:20 +00:00
|
|
|
#include <vector>
|
2020-01-03 17:19:59 +00:00
|
|
|
#include <boost/serialization/vector.hpp>
|
2017-10-02 02:56:43 +00:00
|
|
|
#include "common/common_types.h"
|
2018-11-08 18:53:20 +00:00
|
|
|
#include "core/hle/ipc.h"
|
2017-10-02 02:56:43 +00:00
|
|
|
#include "core/hle/kernel/thread.h"
|
|
|
|
|
2019-02-01 17:32:49 +00:00
|
|
|
namespace Memory {
|
|
|
|
class MemorySystem;
|
|
|
|
}
|
|
|
|
|
2017-10-02 02:56:43 +00:00
|
|
|
namespace Kernel {
|
2018-11-08 18:53:20 +00:00
|
|
|
|
2019-07-22 12:19:03 +00:00
|
|
|
class KernelSystem;
|
|
|
|
|
2018-11-08 18:53:20 +00:00
|
|
|
struct MappedBufferContext {
|
|
|
|
IPC::MappedBufferPermissions permissions;
|
|
|
|
u32 size;
|
|
|
|
VAddr source_address;
|
|
|
|
VAddr target_address;
|
2018-11-08 19:05:54 +00:00
|
|
|
|
2020-01-03 17:19:59 +00:00
|
|
|
std::vector<u8> buffer;
|
|
|
|
std::vector<u8> reserve_buffer;
|
2019-12-23 11:41:07 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
template <class Archive>
|
2019-12-27 21:07:29 +00:00
|
|
|
void serialize(Archive& ar, const unsigned int file_version) {
|
|
|
|
ar& permissions;
|
|
|
|
ar& size;
|
|
|
|
ar& source_address;
|
|
|
|
ar& target_address;
|
2020-01-03 17:19:59 +00:00
|
|
|
ar& buffer;
|
|
|
|
ar& reserve_buffer;
|
2019-12-23 11:41:07 +00:00
|
|
|
}
|
|
|
|
friend class boost::serialization::access;
|
2018-11-08 18:53:20 +00:00
|
|
|
};
|
|
|
|
|
2017-10-02 02:56:43 +00:00
|
|
|
/// Performs IPC command buffer translation from one process to another.
|
2019-07-22 12:19:03 +00:00
|
|
|
ResultCode TranslateCommandBuffer(KernelSystem& system, Memory::MemorySystem& memory,
|
|
|
|
std::shared_ptr<Thread> src_thread,
|
2019-03-23 20:04:19 +00:00
|
|
|
std::shared_ptr<Thread> dst_thread, VAddr src_address,
|
2019-02-01 17:32:49 +00:00
|
|
|
VAddr dst_address,
|
2018-11-08 18:53:20 +00:00
|
|
|
std::vector<MappedBufferContext>& mapped_buffer_context,
|
|
|
|
bool reply);
|
2017-10-02 02:56:43 +00:00
|
|
|
} // namespace Kernel
|