diff options
Diffstat (limited to 'src/core/hle/service')
| -rw-r--r-- | src/core/hle/service/fs/archive.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/service.h | 50 | ||||
| -rw-r--r-- | src/core/hle/service/srv.cpp | 3 |
3 files changed, 30 insertions, 31 deletions
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index e40483c72..a9f457726 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp | |||
| @@ -25,9 +25,9 @@ | |||
| 25 | #include "core/hle/hle.h" | 25 | #include "core/hle/hle.h" |
| 26 | #include "core/hle/kernel/client_session.h" | 26 | #include "core/hle/kernel/client_session.h" |
| 27 | #include "core/hle/result.h" | 27 | #include "core/hle/result.h" |
| 28 | #include "core/hle/service/service.h" | ||
| 29 | #include "core/hle/service/fs/archive.h" | 28 | #include "core/hle/service/fs/archive.h" |
| 30 | #include "core/hle/service/fs/fs_user.h" | 29 | #include "core/hle/service/fs/fs_user.h" |
| 30 | #include "core/hle/service/service.h" | ||
| 31 | #include "core/memory.h" | 31 | #include "core/memory.h" |
| 32 | 32 | ||
| 33 | // Specializes std::hash for ArchiveIdCode, so that we can use it in std::unordered_map. | 33 | // 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 | |||
| 97 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 97 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 98 | FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]); | 98 | FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]); |
| 99 | switch (cmd) { | 99 | switch (cmd) { |
| 100 | |||
| 100 | // Read from file... | 101 | // Read from file... |
| 101 | case FileCommand::Read: { | 102 | case FileCommand::Read: { |
| 102 | u64 offset = cmd_buff[1] | ((u64)cmd_buff[2]) << 32; | 103 | u64 offset = cmd_buff[1] | ((u64)cmd_buff[2]) << 32; |
| @@ -170,8 +171,7 @@ ResultCode File::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> serv | |||
| 170 | break; | 171 | break; |
| 171 | } | 172 | } |
| 172 | 173 | ||
| 173 | case FileCommand::OpenLinkFile: | 174 | case FileCommand::OpenLinkFile: { |
| 174 | { | ||
| 175 | LOG_WARNING(Service_FS, "(STUBBED) File command OpenLinkFile %s", GetName().c_str()); | 175 | LOG_WARNING(Service_FS, "(STUBBED) File command OpenLinkFile %s", GetName().c_str()); |
| 176 | auto sessions = Kernel::ServerSession::CreateSessionPair(GetName(), shared_from_this()); | 176 | auto sessions = Kernel::ServerSession::CreateSessionPair(GetName(), shared_from_this()); |
| 177 | cmd_buff[3] = Kernel::g_handle_table.Create(std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions)).ValueOr(INVALID_HANDLE); | 177 | 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 | |||
| 195 | LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); | 195 | LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); |
| 196 | ResultCode error = UnimplementedFunction(ErrorModule::FS); | 196 | ResultCode error = UnimplementedFunction(ErrorModule::FS); |
| 197 | cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. | 197 | cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. |
| 198 | return RESULT_SUCCESS; | 198 | return error; |
| 199 | } | 199 | } |
| 200 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | 200 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error |
| 201 | return RESULT_SUCCESS; | 201 | return RESULT_SUCCESS; |
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index dd268f39c..931512339 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h | |||
| @@ -50,23 +50,23 @@ enum DescriptorType : u32 { | |||
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | /** | 52 | /** |
| 53 | * @brief Creates a command header to be used for IPC | 53 | * @brief Creates a command header to be used for IPC |
| 54 | * @param command_id ID of the command to create a header for. | 54 | * @param command_id ID of the command to create a header for. |
| 55 | * @param normal_params Size of the normal parameters in words. Up to 63. | 55 | * @param normal_params Size of the normal parameters in words. Up to 63. |
| 56 | * @param translate_params_size Size of the translate parameters in words. Up to 63. | 56 | * @param translate_params_size Size of the translate parameters in words. Up to 63. |
| 57 | * @return The created IPC header. | 57 | * @return The created IPC header. |
| 58 | * | 58 | * |
| 59 | * Normal parameters are sent directly to the process while the translate parameters might go | 59 | * Normal parameters are sent directly to the process while the translate parameters might go |
| 60 | * through modifications and checks by the kernel. | 60 | * through modifications and checks by the kernel. |
| 61 | * The translate parameters are described by headers generated with the IPC::*Desc functions. | 61 | * The translate parameters are described by headers generated with the IPC::*Desc functions. |
| 62 | * | 62 | * |
| 63 | * @note While #normal_params is equivalent to the number of normal parameters, | 63 | * @note While #normal_params is equivalent to the number of normal parameters, |
| 64 | * #translate_params_size includes the size occupied by the translate parameters headers. | 64 | * #translate_params_size includes the size occupied by the translate parameters headers. |
| 65 | */ | 65 | */ |
| 66 | constexpr u32 MakeHeader(u16 command_id, unsigned int normal_params, | 66 | constexpr u32 MakeHeader(u16 command_id, unsigned int normal_params, |
| 67 | unsigned int translate_params_size) { | 67 | unsigned int translate_params_size) { |
| 68 | return (u32(command_id) << 16) | ((u32(normal_params) & 0x3F) << 6) | | 68 | return (u32(command_id) << 16) | ((u32(normal_params) & 0x3F) << 6) | |
| 69 | (u32(translate_params_size) & 0x3F); | 69 | (u32(translate_params_size) & 0x3F); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | union Header { | 72 | union Header { |
| @@ -77,7 +77,7 @@ union Header { | |||
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | inline Header ParseHeader(u32 header) { | 79 | inline Header ParseHeader(u32 header) { |
| 80 | return{ header }; | 80 | return {header}; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | constexpr u32 MoveHandleDesc(u32 num_handles = 1) { | 83 | constexpr u32 MoveHandleDesc(u32 num_handles = 1) { |
| @@ -111,19 +111,19 @@ union StaticBufferDescInfo { | |||
| 111 | }; | 111 | }; |
| 112 | 112 | ||
| 113 | inline StaticBufferDescInfo ParseStaticBufferDesc(const u32 desc) { | 113 | inline StaticBufferDescInfo ParseStaticBufferDesc(const u32 desc) { |
| 114 | return{ desc }; | 114 | return {desc}; |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | /** | 117 | /** |
| 118 | * @brief Creates a header describing a buffer to be sent over PXI. | 118 | * @brief Creates a header describing a buffer to be sent over PXI. |
| 119 | * @param size Size of the buffer. Max 0x00FFFFFF. | 119 | * @param size Size of the buffer. Max 0x00FFFFFF. |
| 120 | * @param buffer_id The Id of the buffer. Max 0xF. | 120 | * @param buffer_id The Id of the buffer. Max 0xF. |
| 121 | * @param is_read_only true if the buffer is read-only. If false, the buffer is considered to have | 121 | * @param is_read_only true if the buffer is read-only. If false, the buffer is considered to have |
| 122 | * read-write access. | 122 | * read-write access. |
| 123 | * @return The created PXI buffer header. | 123 | * @return The created PXI buffer header. |
| 124 | * | 124 | * |
| 125 | * The next value is a phys-address of a table located in the BASE memregion. | 125 | * The next value is a phys-address of a table located in the BASE memregion. |
| 126 | */ | 126 | */ |
| 127 | inline u32 PXIBufferDesc(u32 size, unsigned buffer_id, bool is_read_only) { | 127 | inline u32 PXIBufferDesc(u32 size, unsigned buffer_id, bool is_read_only) { |
| 128 | u32 type = PXIBuffer; | 128 | u32 type = PXIBuffer; |
| 129 | if (is_read_only) | 129 | if (is_read_only) |
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index 6731afc22..d228e3523 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp | |||
| @@ -6,11 +6,10 @@ | |||
| 6 | 6 | ||
| 7 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 8 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
| 9 | #include "core/hle/service/srv.h" | ||
| 10 | #include "core/hle/kernel/client_session.h" | 9 | #include "core/hle/kernel/client_session.h" |
| 10 | #include "core/hle/kernel/server_session.h" | ||
| 11 | #include "core/hle/kernel/event.h" | 11 | #include "core/hle/kernel/event.h" |
| 12 | #include "core/hle/service/srv.h" | 12 | #include "core/hle/service/srv.h" |
| 13 | #include "core/hle/kernel/server_session.h" | ||
| 14 | 13 | ||
| 15 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 14 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 16 | // Namespace SRV | 15 | // Namespace SRV |