aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/kernel/thread.cpp8
-rw-r--r--src/core/hle/service/am/am.cpp9
-rw-r--r--src/core/hle/service/am/am.h13
-rw-r--r--src/core/hle/service/am/am_app.cpp14
-rw-r--r--src/core/hle/service/cfg/cfg_s.cpp4
-rw-r--r--src/core/hle/service/fs/fs_user.cpp12
-rw-r--r--src/core/hle/svc.cpp7
-rw-r--r--src/core/hle/svc.h2
8 files changed, 56 insertions, 13 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 64166ab9..8b49fc7d 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -217,6 +217,14 @@ static void SwitchContext(Thread* new_thread) {
new_thread->context.pc -= thumb_mode ? 2 : 4;
}
+ // Clean up the thread's wait_objects, they'll be restored if needed during
+ // the svcWaitSynchronization call
+ for (int i = 0; i < new_thread->wait_objects.size(); ++i) {
+ SharedPtr<WaitObject> object = new_thread->wait_objects[i];
+ object->RemoveWaitingThread(new_thread);
+ }
+ new_thread->wait_objects.clear();
+
ready_queue.remove(new_thread->current_priority, new_thread);
new_thread->status = THREADSTATUS_RUNNING;
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 57dc1ece..7332478f 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -38,6 +38,15 @@ void GetTitleIDList(Service::Interface* self) {
LOG_WARNING(Service_AM, "(STUBBED) Requested %u titles from media type %u", num_titles, media_type);
}
+void GetNumContentInfos(Service::Interface* self) {
+ u32* cmd_buff = Kernel::GetCommandBuffer();
+
+ cmd_buff[1] = RESULT_SUCCESS.raw;
+ cmd_buff[2] = 1; // Number of content infos plus one
+
+ LOG_WARNING(Service_AM, "(STUBBED) called");
+}
+
void Init() {
using namespace Kernel;
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 063b8bd0..0b78f539 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -37,6 +37,19 @@ void TitleIDListGetTotal(Service::Interface* self);
*/
void GetTitleIDList(Service::Interface* self);
+/**
+ * AM::GetNumContentInfos service function
+ * Inputs:
+ * 0 : Command header (0x100100C0)
+ * 1 : Unknown
+ * 2 : Unknown
+ * 3 : Unknown
+ * Outputs:
+ * 1 : Result, 0 on success, otherwise error code
+ * 2 : Number of content infos plus one
+ */
+void GetNumContentInfos(Service::Interface* self);
+
/// Initialize AM service
void Init();
diff --git a/src/core/hle/service/am/am_app.cpp b/src/core/hle/service/am/am_app.cpp
index c6fc81bc..f40a87cb 100644
--- a/src/core/hle/service/am/am_app.cpp
+++ b/src/core/hle/service/am/am_app.cpp
@@ -9,11 +9,19 @@
namespace Service {
namespace AM {
-// Empty arrays are illegal -- commented out until an entry is added.
-//const Interface::FunctionInfo FunctionTable[] = { };
+const Interface::FunctionInfo FunctionTable[] = {
+ {0x100100C0, GetNumContentInfos, "GetNumContentInfos"},
+ {0x10020104, nullptr, "FindContentInfos"},
+ {0x10030142, nullptr, "ListContentInfos"},
+ {0x10040102, nullptr, "DeleteContents"},
+ {0x10050084, nullptr, "GetDataTitleInfos"},
+ {0x10070102, nullptr, "ListDataTitleTicketInfos"},
+ {0x100900C0, nullptr, "IsDataTitleInUse"},
+ {0x100A0000, nullptr, "IsExternalTitleDatabaseInitialized"},
+};
AM_APP_Interface::AM_APP_Interface() {
- //Register(FunctionTable);
+ Register(FunctionTable);
}
} // namespace AM
diff --git a/src/core/hle/service/cfg/cfg_s.cpp b/src/core/hle/service/cfg/cfg_s.cpp
index af4adba8..a329514a 100644
--- a/src/core/hle/service/cfg/cfg_s.cpp
+++ b/src/core/hle/service/cfg/cfg_s.cpp
@@ -11,7 +11,9 @@ namespace CFG {
const Interface::FunctionInfo FunctionTable[] = {
{0x00010082, GetConfigInfoBlk2, "GetConfigInfoBlk2"},
- {0x00020000, nullptr, "SecureInfoGetRegion"},
+ {0x00020000, SecureInfoGetRegion, "SecureInfoGetRegion"},
+ {0x00030040, GenHashConsoleUnique, "GenHashConsoleUnique"},
+ {0x00050000, GetSystemModel, "GetSystemModel"},
{0x04010082, GetConfigInfoBlk8, "GetConfigInfoBlk8"},
{0x04020082, nullptr, "SetConfigInfoBlk4"},
{0x04030000, UpdateConfigNANDSavegame, "UpdateConfigNANDSavegame"},
diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp
index 0ad44e55..ae52083f 100644
--- a/src/core/hle/service/fs/fs_user.cpp
+++ b/src/core/hle/service/fs/fs_user.cpp
@@ -115,7 +115,8 @@ static void OpenFileDirectly(Service::Interface* self) {
ResultVal<ArchiveHandle> archive_handle = OpenArchive(archive_id, archive_path);
if (archive_handle.Failed()) {
- LOG_ERROR(Service_FS, "failed to get a handle for archive");
+ LOG_ERROR(Service_FS, "failed to get a handle for archive archive_id=0x%08X archive_path=%s",
+ archive_id, archive_path.DebugStr().c_str());
cmd_buff[1] = archive_handle.Code().raw;
cmd_buff[3] = 0;
return;
@@ -128,7 +129,8 @@ static void OpenFileDirectly(Service::Interface* self) {
cmd_buff[3] = Kernel::g_handle_table.Create(*file_res).MoveFrom();
} else {
cmd_buff[3] = 0;
- LOG_ERROR(Service_FS, "failed to get a handle for file %s", file_path.DebugStr().c_str());
+ LOG_ERROR(Service_FS, "failed to get a handle for file %s mode=%u attributes=%d",
+ file_path.DebugStr().c_str(), mode.hex, attributes);
}
}
@@ -347,7 +349,8 @@ static void OpenDirectory(Service::Interface* self) {
if (dir_res.Succeeded()) {
cmd_buff[3] = Kernel::g_handle_table.Create(*dir_res).MoveFrom();
} else {
- LOG_ERROR(Service_FS, "failed to get a handle for directory");
+ LOG_ERROR(Service_FS, "failed to get a handle for directory type=%d size=%d data=%s",
+ dirname_type, dirname_size, dir_path.DebugStr().c_str());
}
}
@@ -382,7 +385,8 @@ static void OpenArchive(Service::Interface* self) {
cmd_buff[3] = (*handle >> 32) & 0xFFFFFFFF;
} else {
cmd_buff[2] = cmd_buff[3] = 0;
- LOG_ERROR(Service_FS, "failed to get a handle for archive");
+ LOG_ERROR(Service_FS, "failed to get a handle for archive archive_id=0x%08X archive_path=%s",
+ archive_id, archive_path.DebugStr().c_str());
}
}
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 802ecc52..bdede964 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -833,8 +833,7 @@ static const FunctionDef SVC_Table[] = {
Common::Profiling::TimingCategory profiler_svc("SVC Calls");
-static const FunctionDef* GetSVCInfo(u32 opcode) {
- u32 func_num = opcode & 0xFFFFFF; // 8 bits
+static const FunctionDef* GetSVCInfo(u32 func_num) {
if (func_num >= ARRAY_SIZE(SVC_Table)) {
LOG_ERROR(Kernel_SVC, "unknown svc=0x%02X", func_num);
return nullptr;
@@ -842,10 +841,10 @@ static const FunctionDef* GetSVCInfo(u32 opcode) {
return &SVC_Table[func_num];
}
-void CallSVC(u32 opcode) {
+void CallSVC(u32 immediate) {
Common::Profiling::ScopeTimer timer_svc(profiler_svc);
- const FunctionDef *info = GetSVCInfo(opcode);
+ const FunctionDef* info = GetSVCInfo(immediate);
if (info) {
if (info->func) {
info->func();
diff --git a/src/core/hle/svc.h b/src/core/hle/svc.h
index 4389aa73..12de9ffb 100644
--- a/src/core/hle/svc.h
+++ b/src/core/hle/svc.h
@@ -41,6 +41,6 @@ enum ArbitrationType {
namespace SVC {
-void CallSVC(u32 opcode);
+void CallSVC(u32 immediate);
} // namespace