summaryrefslogtreecommitdiffstats
path: root/src/core/hle/svc.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2016-12-16 06:37:38 +0100
committerbunnei <bunneidev@gmail.com>2016-12-22 05:48:13 +0100
commit4fc8b8229ed1d9ea9d20faee7059c898265db6cf (patch)
tree45095e416393473fe9721c60edd9a220b2e44dd4 /src/core/hle/svc.cpp
parentcore: Consolidate core and system state, remove system module & cleanups. (diff)
downloadyuzu-4fc8b8229ed1d9ea9d20faee7059c898265db6cf.tar
yuzu-4fc8b8229ed1d9ea9d20faee7059c898265db6cf.tar.gz
yuzu-4fc8b8229ed1d9ea9d20faee7059c898265db6cf.tar.bz2
yuzu-4fc8b8229ed1d9ea9d20faee7059c898265db6cf.tar.lz
yuzu-4fc8b8229ed1d9ea9d20faee7059c898265db6cf.tar.xz
yuzu-4fc8b8229ed1d9ea9d20faee7059c898265db6cf.tar.zst
yuzu-4fc8b8229ed1d9ea9d20faee7059c898265db6cf.zip
Diffstat (limited to 'src/core/hle/svc.cpp')
-rw-r--r--src/core/hle/svc.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index b20f2aaa4..5a52525c6 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -166,7 +166,7 @@ static ResultCode ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 add
}
/// Maps a memory block to specified address
-static ResultCode MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) {
+static ResultCode MapMemoryBlock(Kernel::Handle handle, u32 addr, u32 permissions, u32 other_permissions) {
using Kernel::SharedMemory;
using Kernel::MemoryPermission;
@@ -198,7 +198,7 @@ static ResultCode MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 o
ErrorSummary::InvalidArgument, ErrorLevel::Usage);
}
-static ResultCode UnmapMemoryBlock(Handle handle, u32 addr) {
+static ResultCode UnmapMemoryBlock(Kernel::Handle handle, u32 addr) {
using Kernel::SharedMemory;
LOG_TRACE(Kernel_SVC, "called memblock=0x%08X, addr=0x%08X", handle, addr);
@@ -213,7 +213,7 @@ static ResultCode UnmapMemoryBlock(Handle handle, u32 addr) {
}
/// Connect to an OS service given the port name, returns the handle to the port to out
-static ResultCode ConnectToPort(Handle* out_handle, const char* port_name) {
+static ResultCode ConnectToPort(Kernel::Handle* out_handle, const char* port_name) {
if (port_name == nullptr)
return ERR_NOT_FOUND;
if (std::strlen(port_name) > 11)
@@ -238,7 +238,7 @@ static ResultCode ConnectToPort(Handle* out_handle, const char* port_name) {
}
/// Makes a blocking IPC call to an OS service.
-static ResultCode SendSyncRequest(Handle handle) {
+static ResultCode SendSyncRequest(Kernel::Handle handle) {
SharedPtr<Kernel::ClientSession> session =
Kernel::g_handle_table.Get<Kernel::ClientSession>(handle);
if (session == nullptr) {
@@ -253,13 +253,13 @@ static ResultCode SendSyncRequest(Handle handle) {
}
/// Close a handle
-static ResultCode CloseHandle(Handle handle) {
+static ResultCode CloseHandle(Kernel::Handle handle) {
LOG_TRACE(Kernel_SVC, "Closing handle 0x%08X", handle);
return Kernel::g_handle_table.Close(handle);
}
/// Wait for a handle to synchronize, timeout after the specified nanoseconds
-static ResultCode WaitSynchronization1(Handle handle, s64 nano_seconds) {
+static ResultCode WaitSynchronization1(Kernel::Handle handle, s64 nano_seconds) {
auto object = Kernel::g_handle_table.GetWaitObject(handle);
Kernel::Thread* thread = Kernel::GetCurrentThread();
@@ -295,7 +295,7 @@ static ResultCode WaitSynchronization1(Handle handle, s64 nano_seconds) {
}
/// Wait for the given handles to synchronize, timeout after the specified nanoseconds
-static ResultCode WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count, bool wait_all,
+static ResultCode WaitSynchronizationN(s32* out, Kernel::Handle* handles, s32 handle_count, bool wait_all,
s64 nano_seconds) {
Kernel::Thread* thread = Kernel::GetCurrentThread();
@@ -423,7 +423,7 @@ static ResultCode WaitSynchronizationN(s32* out, Handle* handles, s32 handle_cou
}
/// Create an address arbiter (to allocate access to shared resources)
-static ResultCode CreateAddressArbiter(Handle* out_handle) {
+static ResultCode CreateAddressArbiter(Kernel::Handle* out_handle) {
using Kernel::AddressArbiter;
SharedPtr<AddressArbiter> arbiter = AddressArbiter::Create();
@@ -433,7 +433,7 @@ static ResultCode CreateAddressArbiter(Handle* out_handle) {
}
/// Arbitrate address
-static ResultCode ArbitrateAddress(Handle handle, u32 address, u32 type, u32 value,
+static ResultCode ArbitrateAddress(Kernel::Handle handle, u32 address, u32 type, u32 value,
s64 nanoseconds) {
using Kernel::AddressArbiter;
@@ -476,7 +476,7 @@ static void OutputDebugString(const char* string) {
}
/// Get resource limit
-static ResultCode GetResourceLimit(Handle* resource_limit, Handle process_handle) {
+static ResultCode GetResourceLimit(Kernel::Handle* resource_limit, Kernel::Handle process_handle) {
LOG_TRACE(Kernel_SVC, "called process=0x%08X", process_handle);
SharedPtr<Kernel::Process> process =
@@ -490,7 +490,7 @@ static ResultCode GetResourceLimit(Handle* resource_limit, Handle process_handle
}
/// Get resource limit current values
-static ResultCode GetResourceLimitCurrentValues(s64* values, Handle resource_limit_handle,
+static ResultCode GetResourceLimitCurrentValues(s64* values, Kernel::Handle resource_limit_handle,
u32* names, u32 name_count) {
LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%p, name_count=%d",
resource_limit_handle, names, name_count);
@@ -507,7 +507,7 @@ static ResultCode GetResourceLimitCurrentValues(s64* values, Handle resource_lim
}
/// Get resource limit max values
-static ResultCode GetResourceLimitLimitValues(s64* values, Handle resource_limit_handle, u32* names,
+static ResultCode GetResourceLimitLimitValues(s64* values, Kernel::Handle resource_limit_handle, u32* names,
u32 name_count) {
LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%p, name_count=%d",
resource_limit_handle, names, name_count);
@@ -524,7 +524,7 @@ static ResultCode GetResourceLimitLimitValues(s64* values, Handle resource_limit
}
/// Creates a new thread
-static ResultCode CreateThread(Handle* out_handle, s32 priority, u32 entry_point, u32 arg,
+static ResultCode CreateThread(Kernel::Handle* out_handle, s32 priority, u32 entry_point, u32 arg,
u32 stack_top, s32 processor_id) {
using Kernel::Thread;
@@ -588,7 +588,7 @@ static void ExitThread() {
}
/// Gets the priority for the specified thread
-static ResultCode GetThreadPriority(s32* priority, Handle handle) {
+static ResultCode GetThreadPriority(s32* priority, Kernel::Handle handle) {
const SharedPtr<Kernel::Thread> thread = Kernel::g_handle_table.Get<Kernel::Thread>(handle);
if (thread == nullptr)
return ERR_INVALID_HANDLE;
@@ -598,7 +598,7 @@ static ResultCode GetThreadPriority(s32* priority, Handle handle) {
}
/// Sets the priority for the specified thread
-static ResultCode SetThreadPriority(Handle handle, s32 priority) {
+static ResultCode SetThreadPriority(Kernel::Handle handle, s32 priority) {
SharedPtr<Kernel::Thread> thread = Kernel::g_handle_table.Get<Kernel::Thread>(handle);
if (thread == nullptr)
return ERR_INVALID_HANDLE;
@@ -608,7 +608,7 @@ static ResultCode SetThreadPriority(Handle handle, s32 priority) {
}
/// Create a mutex
-static ResultCode CreateMutex(Handle* out_handle, u32 initial_locked) {
+static ResultCode CreateMutex(Kernel::Handle* out_handle, u32 initial_locked) {
using Kernel::Mutex;
SharedPtr<Mutex> mutex = Mutex::Create(initial_locked != 0);
@@ -622,7 +622,7 @@ static ResultCode CreateMutex(Handle* out_handle, u32 initial_locked) {
}
/// Release a mutex
-static ResultCode ReleaseMutex(Handle handle) {
+static ResultCode ReleaseMutex(Kernel::Handle handle) {
using Kernel::Mutex;
LOG_TRACE(Kernel_SVC, "called handle=0x%08X", handle);
@@ -637,7 +637,7 @@ static ResultCode ReleaseMutex(Handle handle) {
}
/// Get the ID of the specified process
-static ResultCode GetProcessId(u32* process_id, Handle process_handle) {
+static ResultCode GetProcessId(u32* process_id, Kernel::Handle process_handle) {
LOG_TRACE(Kernel_SVC, "called process=0x%08X", process_handle);
const SharedPtr<Kernel::Process> process =
@@ -650,7 +650,7 @@ static ResultCode GetProcessId(u32* process_id, Handle process_handle) {
}
/// Get the ID of the process that owns the specified thread
-static ResultCode GetProcessIdOfThread(u32* process_id, Handle thread_handle) {
+static ResultCode GetProcessIdOfThread(u32* process_id, Kernel::Handle thread_handle) {
LOG_TRACE(Kernel_SVC, "called thread=0x%08X", thread_handle);
const SharedPtr<Kernel::Thread> thread =
@@ -667,7 +667,7 @@ static ResultCode GetProcessIdOfThread(u32* process_id, Handle thread_handle) {
}
/// Get the ID for the specified thread.
-static ResultCode GetThreadId(u32* thread_id, Handle handle) {
+static ResultCode GetThreadId(u32* thread_id, Kernel::Handle handle) {
LOG_TRACE(Kernel_SVC, "called thread=0x%08X", handle);
const SharedPtr<Kernel::Thread> thread = Kernel::g_handle_table.Get<Kernel::Thread>(handle);
@@ -679,7 +679,7 @@ static ResultCode GetThreadId(u32* thread_id, Handle handle) {
}
/// Creates a semaphore
-static ResultCode CreateSemaphore(Handle* out_handle, s32 initial_count, s32 max_count) {
+static ResultCode CreateSemaphore(Kernel::Handle* out_handle, s32 initial_count, s32 max_count) {
using Kernel::Semaphore;
CASCADE_RESULT(SharedPtr<Semaphore> semaphore, Semaphore::Create(initial_count, max_count));
@@ -692,7 +692,7 @@ static ResultCode CreateSemaphore(Handle* out_handle, s32 initial_count, s32 max
}
/// Releases a certain number of slots in a semaphore
-static ResultCode ReleaseSemaphore(s32* count, Handle handle, s32 release_count) {
+static ResultCode ReleaseSemaphore(s32* count, Kernel::Handle handle, s32 release_count) {
using Kernel::Semaphore;
LOG_TRACE(Kernel_SVC, "called release_count=%d, handle=0x%08X", release_count, handle);
@@ -708,7 +708,7 @@ static ResultCode ReleaseSemaphore(s32* count, Handle handle, s32 release_count)
/// Query process memory
static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* page_info,
- Handle process_handle, u32 addr) {
+ Kernel::Handle process_handle, u32 addr) {
using Kernel::Process;
Kernel::SharedPtr<Process> process = Kernel::g_handle_table.Get<Process>(process_handle);
if (process == nullptr)
@@ -736,7 +736,7 @@ static ResultCode QueryMemory(MemoryInfo* memory_info, PageInfo* page_info, u32
}
/// Create an event
-static ResultCode CreateEvent(Handle* out_handle, u32 reset_type) {
+static ResultCode CreateEvent(Kernel::Handle* out_handle, u32 reset_type) {
using Kernel::Event;
SharedPtr<Event> evt = Event::Create(static_cast<Kernel::ResetType>(reset_type));
@@ -749,14 +749,14 @@ static ResultCode CreateEvent(Handle* out_handle, u32 reset_type) {
}
/// Duplicates a kernel handle
-static ResultCode DuplicateHandle(Handle* out, Handle handle) {
+static ResultCode DuplicateHandle(Kernel::Handle* out, Kernel::Handle handle) {
CASCADE_RESULT(*out, Kernel::g_handle_table.Duplicate(handle));
LOG_TRACE(Kernel_SVC, "duplicated 0x%08X to 0x%08X", handle, *out);
return RESULT_SUCCESS;
}
/// Signals an event
-static ResultCode SignalEvent(Handle handle) {
+static ResultCode SignalEvent(Kernel::Handle handle) {
using Kernel::Event;
LOG_TRACE(Kernel_SVC, "called event=0x%08X", handle);
@@ -770,7 +770,7 @@ static ResultCode SignalEvent(Handle handle) {
}
/// Clears an event
-static ResultCode ClearEvent(Handle handle) {
+static ResultCode ClearEvent(Kernel::Handle handle) {
using Kernel::Event;
LOG_TRACE(Kernel_SVC, "called event=0x%08X", handle);
@@ -783,7 +783,7 @@ static ResultCode ClearEvent(Handle handle) {
}
/// Creates a timer
-static ResultCode CreateTimer(Handle* out_handle, u32 reset_type) {
+static ResultCode CreateTimer(Kernel::Handle* out_handle, u32 reset_type) {
using Kernel::Timer;
SharedPtr<Timer> timer = Timer::Create(static_cast<Kernel::ResetType>(reset_type));
@@ -796,7 +796,7 @@ static ResultCode CreateTimer(Handle* out_handle, u32 reset_type) {
}
/// Clears a timer
-static ResultCode ClearTimer(Handle handle) {
+static ResultCode ClearTimer(Kernel::Handle handle) {
using Kernel::Timer;
LOG_TRACE(Kernel_SVC, "called timer=0x%08X", handle);
@@ -810,7 +810,7 @@ static ResultCode ClearTimer(Handle handle) {
}
/// Starts a timer
-static ResultCode SetTimer(Handle handle, s64 initial, s64 interval) {
+static ResultCode SetTimer(Kernel::Handle handle, s64 initial, s64 interval) {
using Kernel::Timer;
LOG_TRACE(Kernel_SVC, "called timer=0x%08X", handle);
@@ -825,7 +825,7 @@ static ResultCode SetTimer(Handle handle, s64 initial, s64 interval) {
}
/// Cancels a timer
-static ResultCode CancelTimer(Handle handle) {
+static ResultCode CancelTimer(Kernel::Handle handle) {
using Kernel::Timer;
LOG_TRACE(Kernel_SVC, "called timer=0x%08X", handle);
@@ -860,7 +860,7 @@ static s64 GetSystemTick() {
}
/// Creates a memory block at the specified address with the specified permissions and size
-static ResultCode CreateMemoryBlock(Handle* out_handle, u32 addr, u32 size, u32 my_permission,
+static ResultCode CreateMemoryBlock(Kernel::Handle* out_handle, u32 addr, u32 size, u32 my_permission,
u32 other_permission) {
using Kernel::SharedMemory;
@@ -912,7 +912,7 @@ static ResultCode CreateMemoryBlock(Handle* out_handle, u32 addr, u32 size, u32
return RESULT_SUCCESS;
}
-static ResultCode CreatePort(Handle* server_port, Handle* client_port, const char* name,
+static ResultCode CreatePort(Kernel::Handle* server_port, Kernel::Handle* client_port, const char* name,
u32 max_sessions) {
// TODO(Subv): Implement named ports.
ASSERT_MSG(name == nullptr, "Named ports are currently unimplemented");
@@ -978,7 +978,7 @@ static ResultCode GetSystemInfo(s64* out, u32 type, s32 param) {
return RESULT_SUCCESS;
}
-static ResultCode GetProcessInfo(s64* out, Handle process_handle, u32 type) {
+static ResultCode GetProcessInfo(s64* out, Kernel::Handle process_handle, u32 type) {
LOG_TRACE(Kernel_SVC, "called process=0x%08X type=%u", process_handle, type);
using Kernel::Process;
@@ -1185,7 +1185,7 @@ void CallSVC(u32 immediate) {
if (info->func) {
info->func();
// TODO(Subv): Not all service functions should cause a reschedule in all cases.
- HLE::Reschedule(__func__);
+ Core::System::GetInstance().PrepareReschedule();
} else {
LOG_ERROR(Kernel_SVC, "unimplemented SVC function %s(..)", info->name);
}