summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/kernel.h3
-rw-r--r--src/core/hle/kernel/thread.cpp2
-rw-r--r--src/core/hle/service/service.h12
-rw-r--r--src/core/hle/service/srv.cpp2
-rw-r--r--src/core/hle/service/srv.h2
-rw-r--r--src/core/hle/syscall.h12
6 files changed, 19 insertions, 14 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 2608eecc9..d4bb28c72 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -6,7 +6,8 @@
6 6
7#include "common/common_types.h" 7#include "common/common_types.h"
8 8
9typedef s32 Handle; 9typedef u32 Handle;
10typedef s32 Result;
10 11
11enum KernelIDType { 12enum KernelIDType {
12 KERNEL_ID_TYPE_THREAD = 1, 13 KERNEL_ID_TYPE_THREAD = 1,
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index d0bc9c8d8..634218e8b 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -42,8 +42,6 @@ enum WaitType {
42 WAITTYPE_SYNCH, 42 WAITTYPE_SYNCH,
43}; 43};
44 44
45typedef s32 Handle;
46
47class Thread : public KernelObject { 45class Thread : public KernelObject {
48public: 46public:
49 47
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index b260a290a..026e3d5de 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -11,6 +11,8 @@
11#include "common/common.h" 11#include "common/common.h"
12#include "common/common_types.h" 12#include "common/common_types.h"
13#include "core/mem_map.h" 13#include "core/mem_map.h"
14
15#include "core/hle/kernel/kernel.h"
14#include "core/hle/syscall.h" 16#include "core/hle/syscall.h"
15 17
16//////////////////////////////////////////////////////////////////////////////////////////////////// 18////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -70,14 +72,14 @@ public:
70 } 72 }
71 73
72 /// Allocates a new handle for the service 74 /// Allocates a new handle for the service
73 Syscall::Handle NewHandle() { 75 Handle NewHandle() {
74 Syscall::Handle handle = (m_handles.size() << 16) | m_uid; 76 Handle handle = (m_handles.size() << 16) | m_uid;
75 m_handles.push_back(handle); 77 m_handles.push_back(handle);
76 return handle; 78 return handle;
77 } 79 }
78 80
79 /// Frees a handle from the service 81 /// Frees a handle from the service
80 void DeleteHandle(Syscall::Handle handle) { 82 void DeleteHandle(Handle handle) {
81 for(auto iter = m_handles.begin(); iter != m_handles.end(); ++iter) { 83 for(auto iter = m_handles.begin(); iter != m_handles.end(); ++iter) {
82 if(*iter == handle) { 84 if(*iter == handle) {
83 m_handles.erase(iter); 85 m_handles.erase(iter);
@@ -90,7 +92,7 @@ public:
90 * Called when svcSendSyncRequest is called, loads command buffer and executes comand 92 * Called when svcSendSyncRequest is called, loads command buffer and executes comand
91 * @return Return result of svcSendSyncRequest passed back to user app 93 * @return Return result of svcSendSyncRequest passed back to user app
92 */ 94 */
93 Syscall::Result Sync() { 95 Result Sync() {
94 u32* cmd_buff = GetCommandBuffer(); 96 u32* cmd_buff = GetCommandBuffer();
95 auto itr = m_functions.find(cmd_buff[0]); 97 auto itr = m_functions.find(cmd_buff[0]);
96 98
@@ -124,7 +126,7 @@ protected:
124private: 126private:
125 u32 m_uid; 127 u32 m_uid;
126 128
127 std::vector<Syscall::Handle> m_handles; 129 std::vector<Handle> m_handles;
128 std::map<u32, FunctionInfo> m_functions; 130 std::map<u32, FunctionInfo> m_functions;
129}; 131};
130 132
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp
index 303a943d4..a3d041176 100644
--- a/src/core/hle/service/srv.cpp
+++ b/src/core/hle/service/srv.cpp
@@ -23,7 +23,7 @@ void GetProcSemaphore(Service::Interface* self) {
23} 23}
24 24
25void GetServiceHandle(Service::Interface* self) { 25void GetServiceHandle(Service::Interface* self) {
26 Syscall::Result res = 0; 26 Result res = 0;
27 u32* cmd_buff = Service::GetCommandBuffer(); 27 u32* cmd_buff = Service::GetCommandBuffer();
28 28
29 std::string port_name = std::string((const char*)&cmd_buff[1], 0, Service::kMaxPortSize); 29 std::string port_name = std::string((const char*)&cmd_buff[1], 0, Service::kMaxPortSize);
diff --git a/src/core/hle/service/srv.h b/src/core/hle/service/srv.h
index 760c976b4..f465ebc06 100644
--- a/src/core/hle/service/srv.h
+++ b/src/core/hle/service/srv.h
@@ -30,7 +30,7 @@ public:
30 * Called when svcSendSyncRequest is called, loads command buffer and executes comand 30 * Called when svcSendSyncRequest is called, loads command buffer and executes comand
31 * @return Return result of svcSendSyncRequest passed back to user app 31 * @return Return result of svcSendSyncRequest passed back to user app
32 */ 32 */
33 Syscall::Result Sync(); 33 Result Sync();
34 34
35}; 35};
36 36
diff --git a/src/core/hle/syscall.h b/src/core/hle/syscall.h
index 17f190266..3da349ed5 100644
--- a/src/core/hle/syscall.h
+++ b/src/core/hle/syscall.h
@@ -7,7 +7,7 @@
7#include "common/common_types.h" 7#include "common/common_types.h"
8 8
9//////////////////////////////////////////////////////////////////////////////////////////////////// 9////////////////////////////////////////////////////////////////////////////////////////////////////
10// SVC structures 10// SVC types
11 11
12struct MemoryInfo { 12struct MemoryInfo {
13 u32 base_address; 13 u32 base_address;
@@ -31,14 +31,18 @@ struct ThreadContext {
31 u32 fpexc; 31 u32 fpexc;
32}; 32};
33 33
34enum ResetType {
35 RESETTYPE_ONESHOT,
36 RESETTYPE_STICKY,
37 RESETTYPE_PULSE,
38 RESETTYPE_MAX_BIT = (1u << 31),
39};
40
34//////////////////////////////////////////////////////////////////////////////////////////////////// 41////////////////////////////////////////////////////////////////////////////////////////////////////
35// Namespace Syscall 42// Namespace Syscall
36 43
37namespace Syscall { 44namespace Syscall {
38 45
39typedef u32 Handle;
40typedef s32 Result;
41
42void Register(); 46void Register();
43 47
44} // namespace 48} // namespace