diff options
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/coprocessor.h | 20 | ||||
-rw-r--r-- | src/core/hle/kernel/address_arbiter.cpp | 8 | ||||
-rw-r--r-- | src/core/hle/kernel/archive.cpp | 30 | ||||
-rw-r--r-- | src/core/hle/kernel/event.cpp | 8 | ||||
-rw-r--r-- | src/core/hle/kernel/mutex.cpp | 10 | ||||
-rw-r--r-- | src/core/hle/kernel/shared_memory.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 8 | ||||
-rw-r--r-- | src/core/hle/service/apt.h | 2 | ||||
-rw-r--r-- | src/core/hle/service/fs.cpp | 15 | ||||
-rw-r--r-- | src/core/hle/service/fs.h | 2 | ||||
-rw-r--r-- | src/core/hle/service/gsp.h | 2 | ||||
-rw-r--r-- | src/core/hle/service/hid.h | 2 | ||||
-rw-r--r-- | src/core/hle/service/ndm.h | 2 | ||||
-rw-r--r-- | src/core/hle/service/service.h | 10 | ||||
-rw-r--r-- | src/core/hle/service/srv.h | 2 |
15 files changed, 53 insertions, 74 deletions
diff --git a/src/core/hle/coprocessor.h b/src/core/hle/coprocessor.h deleted file mode 100644 index b08d6f3ee..000000000 --- a/src/core/hle/coprocessor.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 -// Refer to the license.txt file included. - -#pragma once - -#include "common/common_types.h" - -namespace HLE { - -/// Coprocessor operations -enum CoprocessorOperation { - DATA_SYNCHRONIZATION_BARRIER = 0xE0, - CALL_GET_THREAD_COMMAND_BUFFER = 0xE1, -}; - -/// Call an MRC (move to ARM register from coprocessor) instruction in HLE -s32 CallMRC(u32 instruction); - -} // namespace diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 174d4cd6e..2b21657da 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -17,11 +17,11 @@ namespace Kernel { class AddressArbiter : public Object { public: - std::string GetTypeName() const { return "Arbiter"; } - std::string GetName() const { return name; } + std::string GetTypeName() const override { return "Arbiter"; } + std::string GetName() const override { return name; } static Kernel::HandleType GetStaticHandleType() { return HandleType::AddressArbiter; } - Kernel::HandleType GetHandleType() const { return HandleType::AddressArbiter; } + Kernel::HandleType GetHandleType() const override { return HandleType::AddressArbiter; } std::string name; ///< Name of address arbiter object (optional) @@ -30,7 +30,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result WaitSynchronization(bool* wait) { + Result WaitSynchronization(bool* wait) override { // TODO(bunnei): ImplementMe ERROR_LOG(OSHLE, "(UNIMPLEMENTED)"); return 0; diff --git a/src/core/hle/kernel/archive.cpp b/src/core/hle/kernel/archive.cpp index 86aba7489..09b4e75a5 100644 --- a/src/core/hle/kernel/archive.cpp +++ b/src/core/hle/kernel/archive.cpp @@ -42,11 +42,11 @@ enum class DirectoryCommand : u32 { class Archive : public Object { public: - std::string GetTypeName() const { return "Archive"; } - std::string GetName() const { return name; } + std::string GetTypeName() const override { return "Archive"; } + std::string GetName() const override { return name; } static Kernel::HandleType GetStaticHandleType() { return HandleType::Archive; } - Kernel::HandleType GetHandleType() const { return HandleType::Archive; } + Kernel::HandleType GetHandleType() const override { return HandleType::Archive; } std::string name; ///< Name of archive (optional) FileSys::Archive* backend; ///< Archive backend interface @@ -56,7 +56,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result SyncRequest(bool* wait) { + Result SyncRequest(bool* wait) override { u32* cmd_buff = Service::GetCommandBuffer(); FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]); @@ -119,7 +119,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result WaitSynchronization(bool* wait) { + Result WaitSynchronization(bool* wait) override { // TODO(bunnei): ImplementMe ERROR_LOG(OSHLE, "(UNIMPLEMENTED)"); return 0; @@ -128,11 +128,11 @@ public: class File : public Object { public: - std::string GetTypeName() const { return "File"; } - std::string GetName() const { return path; } + std::string GetTypeName() const override { return "File"; } + std::string GetName() const override { return path; } static Kernel::HandleType GetStaticHandleType() { return HandleType::File; } - Kernel::HandleType GetHandleType() const { return HandleType::File; } + Kernel::HandleType GetHandleType() const override { return HandleType::File; } std::string path; ///< Path of the file std::unique_ptr<FileSys::File> backend; ///< File backend interface @@ -142,7 +142,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result SyncRequest(bool* wait) { + Result SyncRequest(bool* wait) override { u32* cmd_buff = Service::GetCommandBuffer(); FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]); switch (cmd) { @@ -211,7 +211,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result WaitSynchronization(bool* wait) { + Result WaitSynchronization(bool* wait) override { // TODO(bunnei): ImplementMe ERROR_LOG(OSHLE, "(UNIMPLEMENTED)"); return 0; @@ -220,11 +220,11 @@ public: class Directory : public Object { public: - std::string GetTypeName() const { return "Directory"; } - std::string GetName() const { return path; } + std::string GetTypeName() const override { return "Directory"; } + std::string GetName() const override { return path; } static Kernel::HandleType GetStaticHandleType() { return HandleType::Directory; } - Kernel::HandleType GetHandleType() const { return HandleType::Directory; } + Kernel::HandleType GetHandleType() const override { return HandleType::Directory; } std::string path; ///< Path of the directory std::unique_ptr<FileSys::Directory> backend; ///< File backend interface @@ -234,7 +234,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result SyncRequest(bool* wait) { + Result SyncRequest(bool* wait) override { u32* cmd_buff = Service::GetCommandBuffer(); DirectoryCommand cmd = static_cast<DirectoryCommand>(cmd_buff[0]); switch (cmd) { @@ -274,7 +274,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result WaitSynchronization(bool* wait) { + Result WaitSynchronization(bool* wait) override { // TODO(bunnei): ImplementMe ERROR_LOG(OSHLE, "(UNIMPLEMENTED)"); return 0; diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index 64f6a9649..45ed79be8 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp @@ -16,11 +16,11 @@ namespace Kernel { class Event : public Object { public: - std::string GetTypeName() const { return "Event"; } - std::string GetName() const { return name; } + std::string GetTypeName() const override { return "Event"; } + std::string GetName() const override { return name; } static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Event; } - Kernel::HandleType GetHandleType() const { return Kernel::HandleType::Event; } + Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Event; } ResetType intitial_reset_type; ///< ResetType specified at Event initialization ResetType reset_type; ///< Current ResetType @@ -35,7 +35,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result WaitSynchronization(bool* wait) { + Result WaitSynchronization(bool* wait) override { *wait = locked; if (locked) { Handle thread = GetCurrentThreadHandle(); diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index 5d7d65dd9..fcfd061ac 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp @@ -15,11 +15,11 @@ namespace Kernel { class Mutex : public Object { public: - std::string GetTypeName() const { return "Mutex"; } - std::string GetName() const { return name; } + std::string GetTypeName() const override { return "Mutex"; } + std::string GetName() const override { return name; } static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Mutex; } - Kernel::HandleType GetHandleType() const { return Kernel::HandleType::Mutex; } + Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Mutex; } bool initial_locked; ///< Initial lock state when mutex was created bool locked; ///< Current locked state @@ -32,7 +32,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result SyncRequest(bool* wait) { + Result SyncRequest(bool* wait) override { // TODO(bunnei): ImplementMe locked = true; return 0; @@ -43,7 +43,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result WaitSynchronization(bool* wait) { + Result WaitSynchronization(bool* wait) override { // TODO(bunnei): ImplementMe *wait = locked; diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index 2a6a483a1..6bd5e2728 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp @@ -11,17 +11,17 @@ namespace Kernel { class SharedMemory : public Object { public: - std::string GetTypeName() const { return "SharedMemory"; } + std::string GetTypeName() const override { return "SharedMemory"; } static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::SharedMemory; } - Kernel::HandleType GetHandleType() const { return Kernel::HandleType::SharedMemory; } + Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::SharedMemory; } /** * Wait for kernel object to synchronize * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result WaitSynchronization(bool* wait) { + Result WaitSynchronization(bool* wait) override { // TODO(bunnei): ImplementMe ERROR_LOG(OSHLE, "(UNIMPLEMENTED)"); return 0; diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 33c0b2a47..e15590c49 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -21,11 +21,11 @@ namespace Kernel { class Thread : public Kernel::Object { public: - std::string GetName() const { return name; } - std::string GetTypeName() const { return "Thread"; } + std::string GetName() const override { return name; } + std::string GetTypeName() const override { return "Thread"; } static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Thread; } - Kernel::HandleType GetHandleType() const { return Kernel::HandleType::Thread; } + Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Thread; } inline bool IsRunning() const { return (status & THREADSTATUS_RUNNING) != 0; } inline bool IsStopped() const { return (status & THREADSTATUS_DORMANT) != 0; } @@ -38,7 +38,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result WaitSynchronization(bool* wait) { + Result WaitSynchronization(bool* wait) override { if (status != THREADSTATUS_DORMANT) { Handle thread = GetCurrentThreadHandle(); if (std::find(waiting_threads.begin(), waiting_threads.end(), thread) == waiting_threads.end()) { diff --git a/src/core/hle/service/apt.h b/src/core/hle/service/apt.h index 4c7dd07e7..5af39e085 100644 --- a/src/core/hle/service/apt.h +++ b/src/core/hle/service/apt.h @@ -29,7 +29,7 @@ public: * Gets the string port name used by CTROS for the service * @return Port name of service */ - std::string GetPortName() const { + std::string GetPortName() const override { return "APT:U"; } }; diff --git a/src/core/hle/service/fs.cpp b/src/core/hle/service/fs.cpp index 8469d9840..662c4f247 100644 --- a/src/core/hle/service/fs.cpp +++ b/src/core/hle/service/fs.cpp @@ -83,7 +83,7 @@ void OpenFileDirectly(Service::Interface* self) { auto archive_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[2]); LowPathType archive_type = static_cast<LowPathType>(cmd_buff[3]); u32 archive_size = cmd_buff[4]; - LowPathType type = static_cast<LowPathType>(cmd_buff[5]); + LowPathType file_type = static_cast<LowPathType>(cmd_buff[5]); u32 size = cmd_buff[6]; FileSys::Mode mode; mode.hex = cmd_buff[7]; u32 attributes = cmd_buff[8]; // TODO(Link Mauve): do something with those attributes. @@ -96,19 +96,13 @@ void OpenFileDirectly(Service::Interface* self) { return; } - if (type != LowPathType::Char) { - ERROR_LOG(KERNEL, "file LowPath type other than char is currently unsupported"); - cmd_buff[1] = -1; - return; - } - std::string archive_name = GetStringFromCmdBuff(archive_pointer, archive_size); std::string file_name = GetStringFromCmdBuff(pointer, size); DEBUG_LOG(KERNEL, "archive_type=%d archive_size=%d archive_data=%s" "file_type=%d file_size=%d file_mode=%d file_attrs=%d file_data=%s", archive_type, archive_size, archive_name.c_str(), - type, size, mode, attributes, file_name.c_str()); + file_type, size, mode, attributes, file_name.c_str()); // TODO(Link Mauve): check if we should even get a handle for the archive, and don't leak it. Handle archive_handle = Kernel::OpenArchive(archive_id); @@ -123,6 +117,11 @@ void OpenFileDirectly(Service::Interface* self) { return; } + if (file_type != LowPathType::Char) { + WARN_LOG(KERNEL, "file LowPath type other than char is currently unsupported; returning archive handle instead"); + return; + } + Handle handle = Kernel::OpenFileFromArchive(archive_handle, file_name, mode); if (handle) { cmd_buff[1] = 0; diff --git a/src/core/hle/service/fs.h b/src/core/hle/service/fs.h index 36f3697d3..005382540 100644 --- a/src/core/hle/service/fs.h +++ b/src/core/hle/service/fs.h @@ -23,7 +23,7 @@ public: * Gets the string port name used by CTROS for the service * @return Port name of service */ - std::string GetPortName() const { + std::string GetPortName() const override { return "fs:USER"; } }; diff --git a/src/core/hle/service/gsp.h b/src/core/hle/service/gsp.h index a09d59dbb..177ce8da6 100644 --- a/src/core/hle/service/gsp.h +++ b/src/core/hle/service/gsp.h @@ -167,7 +167,7 @@ public: * Gets the string port name used by CTROS for the service * @return Port name of service */ - std::string GetPortName() const { + std::string GetPortName() const override { return "gsp::Gpu"; } diff --git a/src/core/hle/service/hid.h b/src/core/hle/service/hid.h index a077e25cd..9f6c4d5ed 100644 --- a/src/core/hle/service/hid.h +++ b/src/core/hle/service/hid.h @@ -111,7 +111,7 @@ public: * Gets the string port name used by CTROS for the service * @return Port name of service */ - std::string GetPortName() const { + std::string GetPortName() const override { return "hid:USER"; } diff --git a/src/core/hle/service/ndm.h b/src/core/hle/service/ndm.h index d5ec28f5b..2ca9fcf22 100644 --- a/src/core/hle/service/ndm.h +++ b/src/core/hle/service/ndm.h @@ -24,7 +24,7 @@ public: * Gets the string port name used by CTROS for the service * @return Port name of service */ - std::string GetPortName() const { + std::string GetPortName() const override { return "ndm:u"; } diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index c0e803bda..2f5a866c9 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -39,11 +39,11 @@ class Interface : public Kernel::Object { friend class Manager; public: - std::string GetName() const { return GetPortName(); } - std::string GetTypeName() const { return GetPortName(); } + std::string GetName() const override { return GetPortName(); } + std::string GetTypeName() const override { return GetPortName(); } static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Service; } - Kernel::HandleType GetHandleType() const { return Kernel::HandleType::Service; } + Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Service; } typedef void (*Function)(Interface*); @@ -80,7 +80,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result SyncRequest(bool* wait) { + Result SyncRequest(bool* wait) override { u32* cmd_buff = GetCommandBuffer(); auto itr = m_functions.find(cmd_buff[0]); @@ -113,7 +113,7 @@ public: * @param wait Boolean wait set if current thread should wait as a result of sync operation * @return Result of operation, 0 on success, otherwise error code */ - Result WaitSynchronization(bool* wait) { + Result WaitSynchronization(bool* wait) override { // TODO(bunnei): ImplementMe ERROR_LOG(OSHLE, "unimplemented function"); return 0; diff --git a/src/core/hle/service/srv.h b/src/core/hle/service/srv.h index 9451472de..6d5fe5048 100644 --- a/src/core/hle/service/srv.h +++ b/src/core/hle/service/srv.h @@ -22,7 +22,7 @@ public: * Gets the string name used by CTROS for the service * @return Port name of service */ - std::string GetPortName() const { + std::string GetPortName() const override { return "srv:"; } |