citra-emu
/
citra-canary
Archived
1
0
Fork 0

Fixed the rebase mistakes.

This commit is contained in:
Subv 2016-11-30 23:28:31 -05:00
parent 009b15b3aa
commit 2eceee3a4c
11 changed files with 76 additions and 83 deletions

View File

@ -8,7 +8,6 @@
#include "core/hle/kernel/event.h" #include "core/hle/kernel/event.h"
#include "core/hle/kernel/mutex.h" #include "core/hle/kernel/mutex.h"
#include "core/hle/kernel/semaphore.h" #include "core/hle/kernel/semaphore.h"
#include "core/hle/kernel/session.h"
#include "core/hle/kernel/thread.h" #include "core/hle/kernel/thread.h"
#include "core/hle/kernel/timer.h" #include "core/hle/kernel/timer.h"

View File

@ -7,7 +7,6 @@
#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/server_port.h" #include "core/hle/kernel/server_port.h"
#include "core/hle/kernel/server_session.h" #include "core/hle/kernel/server_session.h"
#include "core/hle/service/service.h"
namespace Kernel { namespace Kernel {

View File

@ -5,14 +5,9 @@
#pragma once #pragma once
#include <string> #include <string>
#include <memory>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/kernel.h"
namespace Service {
class Interface;
}
namespace Kernel { namespace Kernel {
class ServerPort; class ServerPort;
@ -21,6 +16,17 @@ class ServerSession;
class ClientPort final : public Object { class ClientPort final : public Object {
public: public:
friend class ServerPort; friend class ServerPort;
std::string GetTypeName() const override {
return "ClientPort";
}
std::string GetName() const override {
return name;
}
static const HandleType HANDLE_TYPE = HandleType::ClientPort;
HandleType GetHandleType() const override {
return HANDLE_TYPE;
}
/** /**
* Adds the specified server session to the queue of pending sessions of the associated ServerPort * Adds the specified server session to the queue of pending sessions of the associated ServerPort
@ -28,14 +34,6 @@ public:
*/ */
void AddWaitingSession(SharedPtr<ServerSession> server_session); void AddWaitingSession(SharedPtr<ServerSession> server_session);
std::string GetTypeName() const override { return "ClientPort"; }
std::string GetName() const override { return name; }
static const HandleType HANDLE_TYPE = HandleType::ClientPort;
HandleType GetHandleType() const override {
return HANDLE_TYPE;
}
SharedPtr<ServerPort> server_port; ///< ServerPort associated with this client port. SharedPtr<ServerPort> server_port; ///< ServerPort associated with this client port.
u32 max_sessions; ///< Maximum number of simultaneous sessions the port can have u32 max_sessions; ///< Maximum number of simultaneous sessions the port can have
u32 active_sessions; ///< Number of currently open sessions to this port u32 active_sessions; ///< Number of currently open sessions to this port

View File

@ -4,11 +4,8 @@
#include "common/assert.h" #include "common/assert.h"
#include "core/hle/kernel/client_port.h"
#include "core/hle/kernel/client_session.h" #include "core/hle/kernel/client_session.h"
#include "core/hle/kernel/server_session.h" #include "core/hle/kernel/server_session.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/service.h"
namespace Kernel { namespace Kernel {

View File

@ -11,13 +11,8 @@
#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/kernel.h"
namespace Service {
class Interface;
}
namespace Kernel { namespace Kernel {
class ClientPort;
class ServerSession; class ServerSession;
class ClientSession final : public Object { class ClientSession final : public Object {
@ -30,11 +25,17 @@ public:
*/ */
static ResultVal<SharedPtr<ClientSession>> Create(SharedPtr<ServerSession> server_session, std::string name = "Unknown"); static ResultVal<SharedPtr<ClientSession>> Create(SharedPtr<ServerSession> server_session, std::string name = "Unknown");
std::string GetTypeName() const override { return "ClientSession"; } std::string GetTypeName() const override {
std::string GetName() const override { return name; } return "ClientSession";
}
std::string GetName() const override {
return name;
}
static const HandleType HANDLE_TYPE = HandleType::ClientSession; static const HandleType HANDLE_TYPE = HandleType::ClientSession;
HandleType GetHandleType() const override { return HANDLE_TYPE; } HandleType GetHandleType() const override {
return HANDLE_TYPE;
}
/** /**
* Handle a SyncRequest from the emulated application. * Handle a SyncRequest from the emulated application.

View File

@ -31,24 +31,22 @@ enum KernelHandle : Handle {
}; };
enum class HandleType : u32 { enum class HandleType : u32 {
Unknown = 0, Unknown,
Event,
Mutex,
Event = 3, SharedMemory,
Mutex = 4, Redirection,
SharedMemory = 5, Thread,
Redirection = 6, Process,
Thread = 7, AddressArbiter,
Process = 8, Semaphore,
AddressArbiter = 9, Timer,
Semaphore = 10, ResourceLimit,
Timer = 11, CodeSet,
ResourceLimit = 12, ClientPort,
CodeSet = 13, ServerPort,
ClientPort = 14, ClientSession,
ServerPort = 15, ServerSession,
ClientSession = 16,
ServerSession = 17,
}; };
enum { enum {

View File

@ -4,7 +4,6 @@
#include <tuple> #include <tuple>
#include "core/hle/kernel/client_port.h"
#include "core/hle/kernel/client_session.h" #include "core/hle/kernel/client_session.h"
#include "core/hle/kernel/server_session.h" #include "core/hle/kernel/server_session.h"
#include "core/hle/kernel/thread.h" #include "core/hle/kernel/thread.h"

View File

@ -16,7 +16,6 @@
namespace Kernel { namespace Kernel {
class ClientSession; class ClientSession;
class ClientPort;
/** /**
* Kernel object representing the server endpoint of an IPC session. Sessions are the basic CTR-OS * Kernel object representing the server endpoint of an IPC session. Sessions are the basic CTR-OS
@ -44,10 +43,14 @@ public:
*/ */
static ResultVal<SharedPtr<ServerSession>> Create(std::string name = "Unknown", std::shared_ptr<Service::SessionRequestHandler> hle_handler = nullptr); static ResultVal<SharedPtr<ServerSession>> Create(std::string name = "Unknown", std::shared_ptr<Service::SessionRequestHandler> hle_handler = nullptr);
std::string GetTypeName() const override { return "ServerSession"; } std::string GetTypeName() const override {
return "ServerSession";
}
static const HandleType HANDLE_TYPE = HandleType::ServerSession; static const HandleType HANDLE_TYPE = HandleType::ServerSession;
HandleType GetHandleType() const override { return HANDLE_TYPE; } HandleType GetHandleType() const override {
return HANDLE_TYPE;
}
/** /**
* Creates a pair of ServerSession and an associated ClientSession. * Creates a pair of ServerSession and an associated ClientSession.

View File

@ -25,9 +25,9 @@
#include "core/hle/hle.h" #include "core/hle/hle.h"
#include "core/hle/kernel/client_session.h" #include "core/hle/kernel/client_session.h"
#include "core/hle/result.h" #include "core/hle/result.h"
#include "core/hle/service/service.h"
#include "core/hle/service/fs/archive.h" #include "core/hle/service/fs/archive.h"
#include "core/hle/service/fs/fs_user.h" #include "core/hle/service/fs/fs_user.h"
#include "core/hle/service/service.h"
#include "core/memory.h" #include "core/memory.h"
// Specializes std::hash for ArchiveIdCode, so that we can use it in std::unordered_map. // Specializes std::hash for ArchiveIdCode, so that we can use it in std::unordered_map.
@ -97,6 +97,7 @@ ResultCode File::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> serv
u32* cmd_buff = Kernel::GetCommandBuffer(); u32* cmd_buff = Kernel::GetCommandBuffer();
FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]); FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]);
switch (cmd) { switch (cmd) {
// Read from file... // Read from file...
case FileCommand::Read: { case FileCommand::Read: {
u64 offset = cmd_buff[1] | ((u64)cmd_buff[2]) << 32; u64 offset = cmd_buff[1] | ((u64)cmd_buff[2]) << 32;
@ -170,8 +171,7 @@ ResultCode File::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> serv
break; break;
} }
case FileCommand::OpenLinkFile: case FileCommand::OpenLinkFile: {
{
LOG_WARNING(Service_FS, "(STUBBED) File command OpenLinkFile %s", GetName().c_str()); LOG_WARNING(Service_FS, "(STUBBED) File command OpenLinkFile %s", GetName().c_str());
auto sessions = Kernel::ServerSession::CreateSessionPair(GetName(), shared_from_this()); auto sessions = Kernel::ServerSession::CreateSessionPair(GetName(), shared_from_this());
cmd_buff[3] = Kernel::g_handle_table.Create(std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions)).ValueOr(INVALID_HANDLE); cmd_buff[3] = Kernel::g_handle_table.Create(std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions)).ValueOr(INVALID_HANDLE);
@ -195,7 +195,7 @@ ResultCode File::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> serv
LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd);
ResultCode error = UnimplementedFunction(ErrorModule::FS); ResultCode error = UnimplementedFunction(ErrorModule::FS);
cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that.
return RESULT_SUCCESS; return error;
} }
cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[1] = RESULT_SUCCESS.raw; // No error
return RESULT_SUCCESS; return RESULT_SUCCESS;

View File

@ -6,11 +6,10 @@
#include "common/common_types.h" #include "common/common_types.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/hle/service/srv.h"
#include "core/hle/kernel/client_session.h" #include "core/hle/kernel/client_session.h"
#include "core/hle/kernel/server_session.h"
#include "core/hle/kernel/event.h" #include "core/hle/kernel/event.h"
#include "core/hle/service/srv.h" #include "core/hle/service/srv.h"
#include "core/hle/kernel/server_session.h"
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace SRV // Namespace SRV