diff options
| author | 2018-04-04 16:50:12 -0400 | |
|---|---|---|
| committer | 2018-04-04 16:50:12 -0400 | |
| commit | 20bd26dc7d322cc6409c9e09ee6c8908658d3bbd (patch) | |
| tree | c7a28e58e2b7cba62faa6e6989dc240f28f021c9 /src/core/hle/kernel | |
| parent | Merge pull request #306 from daniellimws/new-fmt-macros (diff) | |
| parent | svc: Stub out SetThreadActivity, GetThreadContext. (diff) | |
| download | yuzu-20bd26dc7d322cc6409c9e09ee6c8908658d3bbd.tar.gz yuzu-20bd26dc7d322cc6409c9e09ee6c8908658d3bbd.tar.xz yuzu-20bd26dc7d322cc6409c9e09ee6c8908658d3bbd.zip | |
Merge pull request #308 from bunnei/misc-fixes-2
Implement and stub several SVC/VI/Audio/Friend/etc. funcs
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/shared_memory.cpp | 12 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 16 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc_wrap.h | 5 |
3 files changed, 19 insertions, 14 deletions
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index 88230bdd9..bc99993c8 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp | |||
| @@ -120,18 +120,6 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi | |||
| 120 | return ERR_WRONG_PERMISSION; | 120 | return ERR_WRONG_PERMISSION; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | // TODO(Subv): The same process that created a SharedMemory object | ||
| 124 | // can not map it in its own address space unless it was created with addr=0, result 0xD900182C. | ||
| 125 | |||
| 126 | if (address != 0) { | ||
| 127 | // TODO(shinyquagsire23): Check for virtual/mappable memory here too? | ||
| 128 | if (address >= Memory::HEAP_VADDR && address < Memory::HEAP_VADDR_END) { | ||
| 129 | LOG_ERROR(Kernel, "cannot map id=%u, address=0x%lx name=%s, invalid address", | ||
| 130 | GetObjectId(), address, name.c_str()); | ||
| 131 | return ERR_INVALID_ADDRESS; | ||
| 132 | } | ||
| 133 | } | ||
| 134 | |||
| 135 | VAddr target_address = address; | 123 | VAddr target_address = address; |
| 136 | 124 | ||
| 137 | if (base_address == 0 && target_address == 0) { | 125 | if (base_address == 0 && target_address == 0) { |
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 171bbd956..36ea23cd9 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -371,6 +371,18 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) | |||
| 371 | return RESULT_SUCCESS; | 371 | return RESULT_SUCCESS; |
| 372 | } | 372 | } |
| 373 | 373 | ||
| 374 | /// Sets the thread activity | ||
| 375 | static ResultCode SetThreadActivity(Handle handle, u32 unknown) { | ||
| 376 | LOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x%08X, unknown=0x%08X", handle, unknown); | ||
| 377 | return RESULT_SUCCESS; | ||
| 378 | } | ||
| 379 | |||
| 380 | /// Gets the thread context | ||
| 381 | static ResultCode GetThreadContext(Handle handle, VAddr addr) { | ||
| 382 | LOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x%08X, addr=0x%" PRIx64, handle, addr); | ||
| 383 | return RESULT_SUCCESS; | ||
| 384 | } | ||
| 385 | |||
| 374 | /// Gets the priority for the specified thread | 386 | /// Gets the priority for the specified thread |
| 375 | static ResultCode GetThreadPriority(u32* priority, Handle handle) { | 387 | static ResultCode GetThreadPriority(u32* priority, Handle handle) { |
| 376 | const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(handle); | 388 | const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(handle); |
| @@ -853,8 +865,8 @@ static const FunctionDef SVC_Table[] = { | |||
| 853 | {0x2F, nullptr, "GetLastThreadInfo"}, | 865 | {0x2F, nullptr, "GetLastThreadInfo"}, |
| 854 | {0x30, nullptr, "GetResourceLimitLimitValue"}, | 866 | {0x30, nullptr, "GetResourceLimitLimitValue"}, |
| 855 | {0x31, nullptr, "GetResourceLimitCurrentValue"}, | 867 | {0x31, nullptr, "GetResourceLimitCurrentValue"}, |
| 856 | {0x32, nullptr, "SetThreadActivity"}, | 868 | {0x32, SvcWrap<SetThreadActivity>, "SetThreadActivity"}, |
| 857 | {0x33, nullptr, "GetThreadContext"}, | 869 | {0x33, SvcWrap<GetThreadContext>, "GetThreadContext"}, |
| 858 | {0x34, nullptr, "Unknown"}, | 870 | {0x34, nullptr, "Unknown"}, |
| 859 | {0x35, nullptr, "Unknown"}, | 871 | {0x35, nullptr, "Unknown"}, |
| 860 | {0x36, nullptr, "Unknown"}, | 872 | {0x36, nullptr, "Unknown"}, |
diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h index 5da4f5269..c86ad3e04 100644 --- a/src/core/hle/kernel/svc_wrap.h +++ b/src/core/hle/kernel/svc_wrap.h | |||
| @@ -70,6 +70,11 @@ void SvcWrap() { | |||
| 70 | FuncReturn(retval); | 70 | FuncReturn(retval); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | template <ResultCode func(u32, u64)> | ||
| 74 | void SvcWrap() { | ||
| 75 | FuncReturn(func((u32)(PARAM(0) & 0xFFFFFFFF), PARAM(1)).raw); | ||
| 76 | } | ||
| 77 | |||
| 73 | template <ResultCode func(u32, u32, u64)> | 78 | template <ResultCode func(u32, u32, u64)> |
| 74 | void SvcWrap() { | 79 | void SvcWrap() { |
| 75 | FuncReturn(func((u32)(PARAM(0) & 0xFFFFFFFF), (u32)(PARAM(1) & 0xFFFFFFFF), PARAM(2)).raw); | 80 | FuncReturn(func((u32)(PARAM(0) & 0xFFFFFFFF), (u32)(PARAM(1) & 0xFFFFFFFF), PARAM(2)).raw); |