Browse Source
- renamed hle_syscall to just syscall
- renamed hle_syscall to just syscall
- added service.h as an initial service interfacepull/15/merge
7 changed files with 157 additions and 106 deletions
-
5src/core/core.vcxproj
-
12src/core/core.vcxproj.filters
-
4src/core/hle/hle.cpp
-
37src/core/hle/hle_syscall.h
-
60src/core/hle/service/service.h
-
126src/core/hle/syscall.cpp
-
19src/core/hle/syscall.h
@ -1,37 +0,0 @@ |
|||||
// Copyright 2014 Citra Emulator Project |
|
||||
// Licensed under GPLv2 |
|
||||
// Refer to the license.txt file included. |
|
||||
|
|
||||
#pragma once |
|
||||
|
|
||||
#include "common/common_types.h" |
|
||||
|
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////// |
|
||||
|
|
||||
//template <class T> |
|
||||
//class KernelObject { |
|
||||
//public: |
|
||||
// virtual ~KernelObject() {} |
|
||||
// |
|
||||
// T GetNative() const { |
|
||||
// return m_native; |
|
||||
// } |
|
||||
// |
|
||||
// void SetNative(const T& native) { |
|
||||
// m_native = native; |
|
||||
// } |
|
||||
// |
|
||||
// virtual const char *GetTypeName() {return "[BAD KERNEL OBJECT TYPE]";} |
|
||||
// virtual const char *GetName() {return "[UNKNOWN KERNEL OBJECT]";} |
|
||||
// |
|
||||
//private: |
|
||||
// T m_native; |
|
||||
//}; |
|
||||
|
|
||||
//class Handle : public KernelObject<u32> { |
|
||||
// const char* GetTypeName() { |
|
||||
// return "Handle"; |
|
||||
// } |
|
||||
//}; |
|
||||
|
|
||||
void Register_Syscall(); |
|
||||
@ -0,0 +1,60 @@ |
|||||
|
// Copyright 2014 Citra Emulator Project |
||||
|
// Licensed under GPLv2 |
||||
|
// Refer to the license.txt file included. |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include <string> |
||||
|
|
||||
|
#include "common/common_types.h" |
||||
|
#include "core/hle/syscall.h" |
||||
|
|
||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////// |
||||
|
// Namespace Service |
||||
|
|
||||
|
namespace Service { |
||||
|
|
||||
|
typedef s32 NativeUID; |
||||
|
|
||||
|
/// Interface to a CTROS service |
||||
|
class Interface { |
||||
|
public: |
||||
|
|
||||
|
virtual ~Interface() { |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Gets the UID for the serice |
||||
|
* @return UID of service in native format |
||||
|
*/ |
||||
|
NativeUID GetUID() const { |
||||
|
return (NativeUID)m_uid; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Gets the string name used by CTROS for a service |
||||
|
* @return String name of service |
||||
|
*/ |
||||
|
virtual std::string GetName() { |
||||
|
return "[UNKNOWN SERVICE NAME]"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Gets the string name used by CTROS for a service |
||||
|
* @return Port name of service |
||||
|
*/ |
||||
|
virtual std::string GetPort() { |
||||
|
return "[UNKNOWN SERVICE PORT]"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Called when svcSendSyncRequest is called, loads command buffer and executes comand |
||||
|
* @return Return result of svcSendSyncRequest passed back to user app |
||||
|
*/ |
||||
|
virtual Syscall::Result Sync() = 0; |
||||
|
|
||||
|
private: |
||||
|
u32 m_uid; |
||||
|
}; |
||||
|
|
||||
|
} // namespace |
||||
@ -0,0 +1,19 @@ |
|||||
|
// Copyright 2014 Citra Emulator Project |
||||
|
// Licensed under GPLv2 |
||||
|
// Refer to the license.txt file included. |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "common/common_types.h" |
||||
|
|
||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////// |
||||
|
// Namespace Syscall |
||||
|
|
||||
|
namespace Syscall { |
||||
|
|
||||
|
typedef u32 Handle; |
||||
|
typedef s32 Result; |
||||
|
|
||||
|
void Register(); |
||||
|
|
||||
|
} // namespace |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue