summaryrefslogtreecommitdiff
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorGravatar bunnei2014-05-20 18:13:25 -0400
committerGravatar bunnei2014-05-20 18:13:25 -0400
commit44336329eddd7dbe1f76144e9a1e95e5f76ed372 (patch)
tree49c103d52af50fe6ef451324f1c8aae6363d0468 /src/core/hle/service
parentapt: changed stubbed handle to be something other than 0xDEADBEEF (used as a ... (diff)
downloadyuzu-44336329eddd7dbe1f76144e9a1e95e5f76ed372.tar.gz
yuzu-44336329eddd7dbe1f76144e9a1e95e5f76ed372.tar.xz
yuzu-44336329eddd7dbe1f76144e9a1e95e5f76ed372.zip
- created a Kernel namespace
- cleaned up Kernel code a bit (moved stuff into namespace, fixed whitespace issues) - added handle types for all different CTROS handles
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/service.cpp4
-rw-r--r--src/core/hle/service/service.h12
2 files changed, 8 insertions, 8 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index b3e414e0f..08d0c43ff 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -34,7 +34,7 @@ Manager::~Manager() {
34 34
35/// Add a service to the manager (does not create it though) 35/// Add a service to the manager (does not create it though)
36void Manager::AddService(Interface* service) { 36void Manager::AddService(Interface* service) {
37 m_port_map[service->GetPortName()] = g_kernel_objects.Create(service); 37 m_port_map[service->GetPortName()] = Kernel::g_object_pool.Create(service);
38 m_services.push_back(service); 38 m_services.push_back(service);
39} 39}
40 40
@@ -48,7 +48,7 @@ void Manager::DeleteService(std::string port_name) {
48 48
49/// Get a Service Interface from its Handle 49/// Get a Service Interface from its Handle
50Interface* Manager::FetchFromHandle(Handle handle) { 50Interface* Manager::FetchFromHandle(Handle handle) {
51 return g_kernel_objects.GetFast<Interface>(handle); 51 return Kernel::g_object_pool.GetFast<Interface>(handle);
52} 52}
53 53
54/// Get a Service Interface from its port 54/// Get a Service Interface from its port
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index 450a439fe..f334dbcb8 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -36,15 +36,15 @@ inline static u32* GetCommandBuffer(const int offset=0) {
36class Manager; 36class Manager;
37 37
38/// Interface to a CTROS service 38/// Interface to a CTROS service
39class Interface : public KernelObject { 39class Interface : public Kernel::Object {
40 friend class Manager; 40 friend class Manager;
41public: 41public:
42 42
43 const char *GetName() { return GetPortName(); } 43 const char *GetName() { return GetPortName(); }
44 const char *GetTypeName() { return GetPortName(); } 44 const char *GetTypeName() { return GetPortName(); }
45 45
46 static KernelIDType GetStaticIDType() { return KERNEL_ID_TYPE_THREAD; } 46 static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Service; }
47 KernelIDType GetIDType() const { return KERNEL_ID_TYPE_THREAD; } 47 Kernel::HandleType GetHandleType() const { return Kernel::HandleType::Service; }
48 48
49 typedef void (*Function)(Interface*); 49 typedef void (*Function)(Interface*);
50 50
@@ -63,8 +63,8 @@ public:
63 } 63 }
64 64
65 /// Allocates a new handle for the service 65 /// Allocates a new handle for the service
66 Handle CreateHandle(KernelObject *obj) { 66 Handle CreateHandle(Kernel::Object *obj) {
67 Handle handle = g_kernel_objects.Create(obj); 67 Handle handle = Kernel::g_object_pool.Create(obj);
68 m_handles.push_back(handle); 68 m_handles.push_back(handle);
69 return handle; 69 return handle;
70 } 70 }
@@ -72,7 +72,7 @@ public:
72 /// Frees a handle from the service 72 /// Frees a handle from the service
73 template <class T> 73 template <class T>
74 void DeleteHandle(const Handle handle) { 74 void DeleteHandle(const Handle handle) {
75 g_kernel_objects.Destroy<T>(handle); 75 g_object_pool.Destroy<T>(handle);
76 m_handles.erase(std::remove(m_handles.begin(), m_handles.end(), handle), m_handles.end()); 76 m_handles.erase(std::remove(m_handles.begin(), m_handles.end(), handle), m_handles.end());
77 } 77 }
78 78