diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.h | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index d87be72d6..d68ea5b1e 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h | |||
| @@ -199,7 +199,7 @@ public: | |||
| 199 | ~HLERequestContext(); | 199 | ~HLERequestContext(); |
| 200 | 200 | ||
| 201 | /// Returns a pointer to the IPC command buffer for this request. | 201 | /// Returns a pointer to the IPC command buffer for this request. |
| 202 | u32* CommandBuffer() { | 202 | [[nodiscard]] u32* CommandBuffer() { |
| 203 | return cmd_buf.data(); | 203 | return cmd_buf.data(); |
| 204 | } | 204 | } |
| 205 | 205 | ||
| @@ -207,7 +207,7 @@ public: | |||
| 207 | * Returns the session through which this request was made. This can be used as a map key to | 207 | * Returns the session through which this request was made. This can be used as a map key to |
| 208 | * access per-client data on services. | 208 | * access per-client data on services. |
| 209 | */ | 209 | */ |
| 210 | Kernel::KServerSession* Session() { | 210 | [[nodiscard]] Kernel::KServerSession* Session() { |
| 211 | return server_session; | 211 | return server_session; |
| 212 | } | 212 | } |
| 213 | 213 | ||
| @@ -217,61 +217,61 @@ public: | |||
| 217 | /// Writes data from this context back to the requesting process/thread. | 217 | /// Writes data from this context back to the requesting process/thread. |
| 218 | Result WriteToOutgoingCommandBuffer(KThread& requesting_thread); | 218 | Result WriteToOutgoingCommandBuffer(KThread& requesting_thread); |
| 219 | 219 | ||
| 220 | u32_le GetHipcCommand() const { | 220 | [[nodiscard]] u32_le GetHipcCommand() const { |
| 221 | return command; | 221 | return command; |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | u32_le GetTipcCommand() const { | 224 | [[nodiscard]] u32_le GetTipcCommand() const { |
| 225 | return static_cast<u32_le>(command_header->type.Value()) - | 225 | return static_cast<u32_le>(command_header->type.Value()) - |
| 226 | static_cast<u32_le>(IPC::CommandType::TIPC_CommandRegion); | 226 | static_cast<u32_le>(IPC::CommandType::TIPC_CommandRegion); |
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | u32_le GetCommand() const { | 229 | [[nodiscard]] u32_le GetCommand() const { |
| 230 | return command_header->IsTipc() ? GetTipcCommand() : GetHipcCommand(); | 230 | return command_header->IsTipc() ? GetTipcCommand() : GetHipcCommand(); |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | bool IsTipc() const { | 233 | [[nodiscard]] bool IsTipc() const { |
| 234 | return command_header->IsTipc(); | 234 | return command_header->IsTipc(); |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | IPC::CommandType GetCommandType() const { | 237 | [[nodiscard]] IPC::CommandType GetCommandType() const { |
| 238 | return command_header->type; | 238 | return command_header->type; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | u64 GetPID() const { | 241 | [[nodiscard]] u64 GetPID() const { |
| 242 | return pid; | 242 | return pid; |
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | u32 GetDataPayloadOffset() const { | 245 | [[nodiscard]] u32 GetDataPayloadOffset() const { |
| 246 | return data_payload_offset; | 246 | return data_payload_offset; |
| 247 | } | 247 | } |
| 248 | 248 | ||
| 249 | const std::vector<IPC::BufferDescriptorX>& BufferDescriptorX() const { | 249 | [[nodiscard]] const std::vector<IPC::BufferDescriptorX>& BufferDescriptorX() const { |
| 250 | return buffer_x_desciptors; | 250 | return buffer_x_desciptors; |
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | const std::vector<IPC::BufferDescriptorABW>& BufferDescriptorA() const { | 253 | [[nodiscard]] const std::vector<IPC::BufferDescriptorABW>& BufferDescriptorA() const { |
| 254 | return buffer_a_desciptors; | 254 | return buffer_a_desciptors; |
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | const std::vector<IPC::BufferDescriptorABW>& BufferDescriptorB() const { | 257 | [[nodiscard]] const std::vector<IPC::BufferDescriptorABW>& BufferDescriptorB() const { |
| 258 | return buffer_b_desciptors; | 258 | return buffer_b_desciptors; |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | const std::vector<IPC::BufferDescriptorC>& BufferDescriptorC() const { | 261 | [[nodiscard]] const std::vector<IPC::BufferDescriptorC>& BufferDescriptorC() const { |
| 262 | return buffer_c_desciptors; | 262 | return buffer_c_desciptors; |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | const IPC::DomainMessageHeader& GetDomainMessageHeader() const { | 265 | [[nodiscard]] const IPC::DomainMessageHeader& GetDomainMessageHeader() const { |
| 266 | return domain_message_header.value(); | 266 | return domain_message_header.value(); |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | bool HasDomainMessageHeader() const { | 269 | [[nodiscard]] bool HasDomainMessageHeader() const { |
| 270 | return domain_message_header.has_value(); | 270 | return domain_message_header.has_value(); |
| 271 | } | 271 | } |
| 272 | 272 | ||
| 273 | /// Helper function to read a buffer using the appropriate buffer descriptor | 273 | /// Helper function to read a buffer using the appropriate buffer descriptor |
| 274 | std::vector<u8> ReadBuffer(std::size_t buffer_index = 0) const; | 274 | [[nodiscard]] std::vector<u8> ReadBuffer(std::size_t buffer_index = 0) const; |
| 275 | 275 | ||
| 276 | /// Helper function to write a buffer using the appropriate buffer descriptor | 276 | /// Helper function to write a buffer using the appropriate buffer descriptor |
| 277 | std::size_t WriteBuffer(const void* buffer, std::size_t size, | 277 | std::size_t WriteBuffer(const void* buffer, std::size_t size, |
| @@ -308,22 +308,22 @@ public: | |||
| 308 | } | 308 | } |
| 309 | 309 | ||
| 310 | /// Helper function to get the size of the input buffer | 310 | /// Helper function to get the size of the input buffer |
| 311 | std::size_t GetReadBufferSize(std::size_t buffer_index = 0) const; | 311 | [[nodiscard]] std::size_t GetReadBufferSize(std::size_t buffer_index = 0) const; |
| 312 | 312 | ||
| 313 | /// Helper function to get the size of the output buffer | 313 | /// Helper function to get the size of the output buffer |
| 314 | std::size_t GetWriteBufferSize(std::size_t buffer_index = 0) const; | 314 | [[nodiscard]] std::size_t GetWriteBufferSize(std::size_t buffer_index = 0) const; |
| 315 | 315 | ||
| 316 | /// Helper function to test whether the input buffer at buffer_index can be read | 316 | /// Helper function to test whether the input buffer at buffer_index can be read |
| 317 | bool CanReadBuffer(std::size_t buffer_index = 0) const; | 317 | [[nodiscard]] bool CanReadBuffer(std::size_t buffer_index = 0) const; |
| 318 | 318 | ||
| 319 | /// Helper function to test whether the output buffer at buffer_index can be written | 319 | /// Helper function to test whether the output buffer at buffer_index can be written |
| 320 | bool CanWriteBuffer(std::size_t buffer_index = 0) const; | 320 | [[nodiscard]] bool CanWriteBuffer(std::size_t buffer_index = 0) const; |
| 321 | 321 | ||
| 322 | Handle GetCopyHandle(std::size_t index) const { | 322 | [[nodiscard]] Handle GetCopyHandle(std::size_t index) const { |
| 323 | return incoming_copy_handles.at(index); | 323 | return incoming_copy_handles.at(index); |
| 324 | } | 324 | } |
| 325 | 325 | ||
| 326 | Handle GetMoveHandle(std::size_t index) const { | 326 | [[nodiscard]] Handle GetMoveHandle(std::size_t index) const { |
| 327 | return incoming_move_handles.at(index); | 327 | return incoming_move_handles.at(index); |
| 328 | } | 328 | } |
| 329 | 329 | ||
| @@ -348,13 +348,13 @@ public: | |||
| 348 | manager = manager_; | 348 | manager = manager_; |
| 349 | } | 349 | } |
| 350 | 350 | ||
| 351 | std::string Description() const; | 351 | [[nodiscard]] std::string Description() const; |
| 352 | 352 | ||
| 353 | KThread& GetThread() { | 353 | [[nodiscard]] KThread& GetThread() { |
| 354 | return *thread; | 354 | return *thread; |
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | std::shared_ptr<SessionRequestManager> GetManager() const { | 357 | [[nodiscard]] std::shared_ptr<SessionRequestManager> GetManager() const { |
| 358 | return manager.lock(); | 358 | return manager.lock(); |
| 359 | } | 359 | } |
| 360 | 360 | ||