aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp51
-rw-r--r--src/core/hle/kernel/hle_ipc.h2
-rw-r--r--src/core/hle/kernel/shared_memory.cpp13
3 files changed, 53 insertions, 13 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index 6d16f71a7..25ba26f18 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -254,4 +254,55 @@ size_t HLERequestContext::GetWriteBufferSize() const {
return is_buffer_b ? BufferDescriptorB()[0].Size() : BufferDescriptorC()[0].Size();
}
+std::string HLERequestContext::Description() const {
+ if (!command_header) {
+ return "No command header available";
+ }
+ std::ostringstream s;
+ s << "IPC::CommandHeader: Type:" << static_cast<u32>(command_header->type.Value());
+ s << ", X(Pointer):" << command_header->num_buf_x_descriptors;
+ if (command_header->num_buf_x_descriptors) {
+ s << '[';
+ for (u64 i = 0; i < command_header->num_buf_x_descriptors; ++i) {
+ s << "0x" << std::hex << BufferDescriptorX()[i].Size();
+ if (i < command_header->num_buf_x_descriptors - 1)
+ s << ", ";
+ }
+ s << ']';
+ }
+ s << ", A(Send):" << command_header->num_buf_a_descriptors;
+ if (command_header->num_buf_a_descriptors) {
+ s << '[';
+ for (u64 i = 0; i < command_header->num_buf_a_descriptors; ++i) {
+ s << "0x" << std::hex << BufferDescriptorA()[i].Size();
+ if (i < command_header->num_buf_a_descriptors - 1)
+ s << ", ";
+ }
+ s << ']';
+ }
+ s << ", B(Receive):" << command_header->num_buf_b_descriptors;
+ if (command_header->num_buf_b_descriptors) {
+ s << '[';
+ for (u64 i = 0; i < command_header->num_buf_b_descriptors; ++i) {
+ s << "0x" << std::hex << BufferDescriptorB()[i].Size();
+ if (i < command_header->num_buf_b_descriptors - 1)
+ s << ", ";
+ }
+ s << ']';
+ }
+ s << ", C(ReceiveList):" << BufferDescriptorC().size();
+ if (!BufferDescriptorC().empty()) {
+ s << '[';
+ for (u64 i = 0; i < BufferDescriptorC().size(); ++i) {
+ s << "0x" << std::hex << BufferDescriptorC()[i].Size();
+ if (i < BufferDescriptorC().size() - 1)
+ s << ", ";
+ }
+ s << ']';
+ }
+ s << ", data_size:" << command_header->data_size.Value();
+
+ return s.str();
+}
+
} // namespace Kernel
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h
index 81e3489c8..b5631b773 100644
--- a/src/core/hle/kernel/hle_ipc.h
+++ b/src/core/hle/kernel/hle_ipc.h
@@ -202,6 +202,8 @@ public:
return domain_objects.size();
}
+ std::string Description() const;
+
private:
std::array<u32, IPC::COMMAND_BUFFER_LENGTH> cmd_buf;
SharedPtr<Kernel::ServerSession> server_session;
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp
index 835fc710b..d4505061e 100644
--- a/src/core/hle/kernel/shared_memory.cpp
+++ b/src/core/hle/kernel/shared_memory.cpp
@@ -111,13 +111,6 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
return ERR_INVALID_COMBINATION;
}
- // Heap-backed memory blocks can not be mapped with other_permissions = DontCare
- if (base_address != 0 && other_permissions == MemoryPermission::DontCare) {
- LOG_ERROR(Kernel, "cannot map id=%u, address=0x%llx name=%s, permissions don't match",
- GetObjectId(), address, name.c_str());
- return ERR_INVALID_COMBINATION;
- }
-
// Error out if the provided permissions are not compatible with what the creator process needs.
if (other_permissions != MemoryPermission::DontCare &&
static_cast<u32>(this->permissions) & ~static_cast<u32>(other_permissions)) {
@@ -126,12 +119,6 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
return ERR_WRONG_PERMISSION;
}
- // TODO(Subv): Check for the Shared Device Mem flag in the creator process.
- /*if (was_created_with_shared_device_mem && address != 0) {
- return ResultCode(ErrorDescription::InvalidCombination, ErrorModule::OS,
- ErrorSummary::InvalidArgument, ErrorLevel::Usage);
- }*/
-
// TODO(Subv): The same process that created a SharedMemory object
// can not map it in its own address space unless it was created with addr=0, result 0xD900182C.