diff options
| author | 2014-05-16 23:21:03 -0700 | |
|---|---|---|
| committer | 2014-05-16 23:21:03 -0700 | |
| commit | b8c8d0903ec9be4c7d580464480a0136277be803 (patch) | |
| tree | 9280a9f01e1312d0d8aed493282ae65d2384963c /src/core/hle | |
| parent | Added FindGLEW to cmake-modules (diff) | |
| parent | Merge pull request #17 from bunnei/arm-vfp (diff) | |
| download | yuzu-b8c8d0903ec9be4c7d580464480a0136277be803.tar.gz yuzu-b8c8d0903ec9be4c7d580464480a0136277be803.tar.xz yuzu-b8c8d0903ec9be4c7d580464480a0136277be803.zip | |
Merge remote-tracking branch 'upstream/master' into issue-7-fix
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/config_mem.cpp | 70 | ||||
| -rw-r--r-- | src/core/hle/config_mem.h | 21 | ||||
| -rw-r--r-- | src/core/hle/coprocessor.cpp | 34 | ||||
| -rw-r--r-- | src/core/hle/coprocessor.h (renamed from src/core/hle/mrc.h) | 8 | ||||
| -rw-r--r-- | src/core/hle/function_wrappers.h | 32 | ||||
| -rw-r--r-- | src/core/hle/hle.cpp | 47 | ||||
| -rw-r--r-- | src/core/hle/hle.h | 21 | ||||
| -rw-r--r-- | src/core/hle/mrc.cpp | 64 | ||||
| -rw-r--r-- | src/core/hle/service/apt.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/gsp.cpp | 71 | ||||
| -rw-r--r-- | src/core/hle/service/service.h | 12 | ||||
| -rw-r--r-- | src/core/hle/service/srv.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/syscall.cpp | 301 |
13 files changed, 403 insertions, 282 deletions
diff --git a/src/core/hle/config_mem.cpp b/src/core/hle/config_mem.cpp new file mode 100644 index 000000000..48aa878cc --- /dev/null +++ b/src/core/hle/config_mem.cpp | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "common/common_types.h" | ||
| 6 | #include "common/log.h" | ||
| 7 | |||
| 8 | #include "core/hle/config_mem.h" | ||
| 9 | |||
| 10 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 11 | |||
| 12 | namespace ConfigMem { | ||
| 13 | |||
| 14 | enum { | ||
| 15 | KERNEL_VERSIONREVISION = 0x1FF80001, | ||
| 16 | KERNEL_VERSIONMINOR = 0x1FF80002, | ||
| 17 | KERNEL_VERSIONMAJOR = 0x1FF80003, | ||
| 18 | UPDATEFLAG = 0x1FF80004, | ||
| 19 | NSTID = 0x1FF80008, | ||
| 20 | SYSCOREVER = 0x1FF80010, | ||
| 21 | UNITINFO = 0x1FF80014, | ||
| 22 | KERNEL_CTRSDKVERSION = 0x1FF80018, | ||
| 23 | APPMEMTYPE = 0x1FF80030, | ||
| 24 | APPMEMALLOC = 0x1FF80040, | ||
| 25 | FIRM_VERSIONREVISION = 0x1FF80061, | ||
| 26 | FIRM_VERSIONMINOR = 0x1FF80062, | ||
| 27 | FIRM_VERSIONMAJOR = 0x1FF80063, | ||
| 28 | FIRM_SYSCOREVER = 0x1FF80064, | ||
| 29 | FIRM_CTRSDKVERSION = 0x1FF80068, | ||
| 30 | }; | ||
| 31 | |||
| 32 | template <typename T> | ||
| 33 | inline void Read(T &var, const u32 addr) { | ||
| 34 | switch (addr) { | ||
| 35 | |||
| 36 | // Bit 0 set for Retail | ||
| 37 | case UNITINFO: | ||
| 38 | var = 0x00000001; | ||
| 39 | break; | ||
| 40 | |||
| 41 | // Set app memory size to 64MB? | ||
| 42 | case APPMEMALLOC: | ||
| 43 | var = 0x04000000; | ||
| 44 | break; | ||
| 45 | |||
| 46 | // Unknown - normally set to: 0x08000000 - (APPMEMALLOC + *0x1FF80048) | ||
| 47 | // (Total FCRAM size - APPMEMALLOC - *0x1FF80048) | ||
| 48 | case 0x1FF80044: | ||
| 49 | var = 0x08000000 - (0x04000000 + 0x1400000); | ||
| 50 | break; | ||
| 51 | |||
| 52 | // Unknown - normally set to: 0x1400000 (20MB) | ||
| 53 | case 0x1FF80048: | ||
| 54 | var = 0x1400000; | ||
| 55 | break; | ||
| 56 | |||
| 57 | default: | ||
| 58 | ERROR_LOG(HLE, "unknown ConfigMem::Read%d @ 0x%08X", sizeof(var) * 8, addr); | ||
| 59 | } | ||
| 60 | } | ||
| 61 | |||
| 62 | // Explicitly instantiate template functions because we aren't defining this in the header: | ||
| 63 | |||
| 64 | template void Read<u64>(u64 &var, const u32 addr); | ||
| 65 | template void Read<u32>(u32 &var, const u32 addr); | ||
| 66 | template void Read<u16>(u16 &var, const u32 addr); | ||
| 67 | template void Read<u8>(u8 &var, const u32 addr); | ||
| 68 | |||
| 69 | |||
| 70 | } // namespace | ||
diff --git a/src/core/hle/config_mem.h b/src/core/hle/config_mem.h new file mode 100644 index 000000000..da396a3e6 --- /dev/null +++ b/src/core/hle/config_mem.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | // Configuration memory stores various hardware/kernel configuration settings. This memory page is | ||
| 8 | // read-only for ARM11 processes. I'm guessing this would normally be written to by the firmware/ | ||
| 9 | // bootrom. Because we're not emulating this, and essentially just "stubbing" the functionality, I'm | ||
| 10 | // putting this as a subset of HLE for now. | ||
| 11 | |||
| 12 | #include "common/common_types.h" | ||
| 13 | |||
| 14 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 15 | |||
| 16 | namespace ConfigMem { | ||
| 17 | |||
| 18 | template <typename T> | ||
| 19 | inline void Read(T &var, const u32 addr); | ||
| 20 | |||
| 21 | } // namespace | ||
diff --git a/src/core/hle/coprocessor.cpp b/src/core/hle/coprocessor.cpp new file mode 100644 index 000000000..39674ee64 --- /dev/null +++ b/src/core/hle/coprocessor.cpp | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/coprocessor.h" | ||
| 6 | #include "core/hle/hle.h" | ||
| 7 | #include "core/mem_map.h" | ||
| 8 | #include "core/core.h" | ||
| 9 | |||
| 10 | namespace HLE { | ||
| 11 | |||
| 12 | /// Returns the coprocessor (in this case, syscore) command buffer pointer | ||
| 13 | Addr GetThreadCommandBuffer() { | ||
| 14 | // Called on insruction: mrc p15, 0, r0, c13, c0, 3 | ||
| 15 | return Memory::KERNEL_MEMORY_VADDR; | ||
| 16 | } | ||
| 17 | |||
| 18 | /// Call an MRC (move to ARM register from coprocessor) instruction in HLE | ||
| 19 | s32 CallMRC(u32 instruction) { | ||
| 20 | CoprocessorOperation operation = (CoprocessorOperation)((instruction >> 20) & 0xFF); | ||
| 21 | |||
| 22 | switch (operation) { | ||
| 23 | |||
| 24 | case CALL_GET_THREAD_COMMAND_BUFFER: | ||
| 25 | return GetThreadCommandBuffer(); | ||
| 26 | |||
| 27 | default: | ||
| 28 | //DEBUG_LOG(OSHLE, "unknown MRC call 0x%08X", instruction); | ||
| 29 | break; | ||
| 30 | } | ||
| 31 | return -1; | ||
| 32 | } | ||
| 33 | |||
| 34 | } // namespace | ||
diff --git a/src/core/hle/mrc.h b/src/core/hle/coprocessor.h index d6b9f162f..b08d6f3ee 100644 --- a/src/core/hle/mrc.h +++ b/src/core/hle/coprocessor.h | |||
| @@ -8,13 +8,13 @@ | |||
| 8 | 8 | ||
| 9 | namespace HLE { | 9 | namespace HLE { |
| 10 | 10 | ||
| 11 | /// MRC operations (ARM register from coprocessor), decoded as instr[20:27] | 11 | /// Coprocessor operations |
| 12 | enum ARM11_MRC_OPERATION { | 12 | enum CoprocessorOperation { |
| 13 | DATA_SYNCHRONIZATION_BARRIER = 0xE0, | 13 | DATA_SYNCHRONIZATION_BARRIER = 0xE0, |
| 14 | CALL_GET_THREAD_COMMAND_BUFFER = 0xE1, | 14 | CALL_GET_THREAD_COMMAND_BUFFER = 0xE1, |
| 15 | }; | 15 | }; |
| 16 | 16 | ||
| 17 | /// Call an MRC operation in HLE | 17 | /// Call an MRC (move to ARM register from coprocessor) instruction in HLE |
| 18 | u32 CallMRC(ARM11_MRC_OPERATION operation); | 18 | s32 CallMRC(u32 instruction); |
| 19 | 19 | ||
| 20 | } // namespace | 20 | } // namespace |
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h index cab772004..d934eafb4 100644 --- a/src/core/hle/function_wrappers.h +++ b/src/core/hle/function_wrappers.h | |||
| @@ -143,8 +143,8 @@ template<int func(u32, u32, u32, u32, u32)> void WrapI_UUUUU() { | |||
| 143 | RETURN(retval); | 143 | RETURN(retval); |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | template<int func()> void WrapI_V() { | 146 | template<int func(void*)> void WrapI_V() { |
| 147 | int retval = func(); | 147 | u32 retval = func(Memory::GetPointer(PARAM(0))); |
| 148 | RETURN(retval); | 148 | RETURN(retval); |
| 149 | } | 149 | } |
| 150 | 150 | ||
| @@ -623,6 +623,10 @@ template<u32 func(const char *, const char *)> void WrapU_CC() { | |||
| 623 | RETURN(retval); | 623 | RETURN(retval); |
| 624 | } | 624 | } |
| 625 | 625 | ||
| 626 | template<void func(const char*)> void WrapV_C() { | ||
| 627 | func(Memory::GetCharPointer(PARAM(0))); | ||
| 628 | } | ||
| 629 | |||
| 626 | template<void func(const char *, int)> void WrapV_CI() { | 630 | template<void func(const char *, int)> void WrapV_CI() { |
| 627 | func(Memory::GetCharPointer(PARAM(0)), PARAM(1)); | 631 | func(Memory::GetCharPointer(PARAM(0)), PARAM(1)); |
| 628 | } | 632 | } |
| @@ -701,18 +705,28 @@ template <int func(int, const char *, int)> void WrapI_ICI() { | |||
| 701 | } | 705 | } |
| 702 | 706 | ||
| 703 | template<int func(int, void *, void *, void *, void *, u32, int)> void WrapI_IVVVVUI(){ | 707 | template<int func(int, void *, void *, void *, void *, u32, int)> void WrapI_IVVVVUI(){ |
| 704 | u32 retval = func(PARAM(0), Memory::GetPointer(PARAM(1)), Memory::GetPointer(PARAM(2)), Memory::GetPointer(PARAM(3)), Memory::GetPointer(PARAM(4)), PARAM(5), PARAM(6) ); | 708 | u32 retval = func(PARAM(0), Memory::GetPointer(PARAM(1)), Memory::GetPointer(PARAM(2)), Memory::GetPointer(PARAM(3)), Memory::GetPointer(PARAM(4)), PARAM(5), PARAM(6) ); |
| 705 | RETURN(retval); | 709 | RETURN(retval); |
| 706 | } | 710 | } |
| 707 | 711 | ||
| 708 | template<int func(int, const char *, u32, void *, int, int, int)> void WrapI_ICUVIII(){ | 712 | template<int func(int, const char *, u32, void *, int, int, int)> void WrapI_ICUVIII(){ |
| 709 | u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), Memory::GetPointer(PARAM(3)), PARAM(4), PARAM(5), PARAM(6)); | 713 | u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), Memory::GetPointer(PARAM(3)), PARAM(4), PARAM(5), PARAM(6)); |
| 710 | RETURN(retval); | 714 | RETURN(retval); |
| 711 | } | 715 | } |
| 712 | 716 | ||
| 713 | template<int func(void *, u32, u32, u32, u32, u32)> void WrapI_VUUUUU(){ | 717 | template<int func(void*, u32)> void WrapI_VU(){ |
| 714 | u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5)); | 718 | u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1)); |
| 715 | RETURN(retval); | 719 | RETURN(retval); |
| 720 | } | ||
| 721 | |||
| 722 | template<int func(void*, u32, void*, int)> void WrapI_VUVI(){ | ||
| 723 | u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1), Memory::GetPointer(PARAM(2)), PARAM(3)); | ||
| 724 | RETURN(retval); | ||
| 725 | } | ||
| 726 | |||
| 727 | template<int func(void*, u32, u32, u32, u32, u32)> void WrapI_VUUUUU(){ | ||
| 728 | u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5)); | ||
| 729 | RETURN(retval); | ||
| 716 | } | 730 | } |
| 717 | 731 | ||
| 718 | template<int func(u32, s64)> void WrapI_US64() { | 732 | template<int func(u32, s64)> void WrapI_US64() { |
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp index aae9a3943..be151665b 100644 --- a/src/core/hle/hle.cpp +++ b/src/core/hle/hle.cpp | |||
| @@ -15,49 +15,6 @@ namespace HLE { | |||
| 15 | 15 | ||
| 16 | static std::vector<ModuleDef> g_module_db; | 16 | static std::vector<ModuleDef> g_module_db; |
| 17 | 17 | ||
| 18 | u8* g_command_buffer = NULL; ///< Command buffer used for sharing between appcore and syscore | ||
| 19 | |||
| 20 | // Read from memory used by CTROS HLE functions | ||
| 21 | template <typename T> | ||
| 22 | inline void Read(T &var, const u32 addr) { | ||
| 23 | if (addr >= HLE::CMD_BUFFER_ADDR && addr < HLE::CMD_BUFFER_ADDR_END) { | ||
| 24 | var = *((const T*)&g_command_buffer[addr & CMD_BUFFER_MASK]); | ||
| 25 | } else { | ||
| 26 | ERROR_LOG(HLE, "unknown read from address %08X", addr); | ||
| 27 | } | ||
| 28 | } | ||
| 29 | |||
| 30 | // Write to memory used by CTROS HLE functions | ||
| 31 | template <typename T> | ||
| 32 | inline void Write(u32 addr, const T data) { | ||
| 33 | if (addr >= HLE::CMD_BUFFER_ADDR && addr < HLE::CMD_BUFFER_ADDR_END) { | ||
| 34 | *(T*)&g_command_buffer[addr & CMD_BUFFER_MASK] = data; | ||
| 35 | } else { | ||
| 36 | ERROR_LOG(HLE, "unknown write to address %08X", addr); | ||
| 37 | } | ||
| 38 | } | ||
| 39 | |||
| 40 | u8 *GetPointer(const u32 addr) { | ||
| 41 | if (addr >= HLE::CMD_BUFFER_ADDR && addr < HLE::CMD_BUFFER_ADDR_END) { | ||
| 42 | return g_command_buffer + (addr & CMD_BUFFER_MASK); | ||
| 43 | } else { | ||
| 44 | ERROR_LOG(HLE, "unknown pointer from address %08X", addr); | ||
| 45 | return 0; | ||
| 46 | } | ||
| 47 | } | ||
| 48 | |||
| 49 | // Explicitly instantiate template functions because we aren't defining this in the header: | ||
| 50 | |||
| 51 | template void Read<u64>(u64 &var, const u32 addr); | ||
| 52 | template void Read<u32>(u32 &var, const u32 addr); | ||
| 53 | template void Read<u16>(u16 &var, const u32 addr); | ||
| 54 | template void Read<u8>(u8 &var, const u32 addr); | ||
| 55 | |||
| 56 | template void Write<u64>(u32 addr, const u64 data); | ||
| 57 | template void Write<u32>(u32 addr, const u32 data); | ||
| 58 | template void Write<u16>(u32 addr, const u16 data); | ||
| 59 | template void Write<u8>(u32 addr, const u8 data); | ||
| 60 | |||
| 61 | const FunctionDef* GetSyscallInfo(u32 opcode) { | 18 | const FunctionDef* GetSyscallInfo(u32 opcode) { |
| 62 | u32 func_num = opcode & 0xFFFFFF; // 8 bits | 19 | u32 func_num = opcode & 0xFFFFFF; // 8 bits |
| 63 | if (func_num > 0xFF) { | 20 | if (func_num > 0xFF) { |
| @@ -91,8 +48,6 @@ void RegisterAllModules() { | |||
| 91 | 48 | ||
| 92 | void Init() { | 49 | void Init() { |
| 93 | Service::Init(); | 50 | Service::Init(); |
| 94 | |||
| 95 | g_command_buffer = new u8[CMD_BUFFER_SIZE]; | ||
| 96 | 51 | ||
| 97 | RegisterAllModules(); | 52 | RegisterAllModules(); |
| 98 | 53 | ||
| @@ -102,8 +57,6 @@ void Init() { | |||
| 102 | void Shutdown() { | 57 | void Shutdown() { |
| 103 | Service::Shutdown(); | 58 | Service::Shutdown(); |
| 104 | 59 | ||
| 105 | delete g_command_buffer; | ||
| 106 | |||
| 107 | g_module_db.clear(); | 60 | g_module_db.clear(); |
| 108 | 61 | ||
| 109 | NOTICE_LOG(HLE, "shutdown OK"); | 62 | NOTICE_LOG(HLE, "shutdown OK"); |
diff --git a/src/core/hle/hle.h b/src/core/hle/hle.h index 907e2d741..42f37e29c 100644 --- a/src/core/hle/hle.h +++ b/src/core/hle/hle.h | |||
| @@ -17,13 +17,6 @@ | |||
| 17 | 17 | ||
| 18 | namespace HLE { | 18 | namespace HLE { |
| 19 | 19 | ||
| 20 | enum { | ||
| 21 | CMD_BUFFER_ADDR = 0xA0010000, ///< Totally arbitrary unused address space | ||
| 22 | CMD_BUFFER_SIZE = 0x10000, | ||
| 23 | CMD_BUFFER_MASK = (CMD_BUFFER_SIZE - 1), | ||
| 24 | CMD_BUFFER_ADDR_END = (CMD_BUFFER_ADDR + CMD_BUFFER_SIZE), | ||
| 25 | }; | ||
| 26 | |||
| 27 | typedef u32 Addr; | 20 | typedef u32 Addr; |
| 28 | typedef void (*Func)(); | 21 | typedef void (*Func)(); |
| 29 | 22 | ||
| @@ -39,20 +32,6 @@ struct ModuleDef { | |||
| 39 | const FunctionDef* func_table; | 32 | const FunctionDef* func_table; |
| 40 | }; | 33 | }; |
| 41 | 34 | ||
| 42 | // Read from memory used by CTROS HLE functions | ||
| 43 | template <typename T> | ||
| 44 | inline void Read(T &var, const u32 addr); | ||
| 45 | |||
| 46 | // Write to memory used by CTROS HLE functions | ||
| 47 | template <typename T> | ||
| 48 | inline void Write(u32 addr, const T data); | ||
| 49 | |||
| 50 | u8* GetPointer(const u32 Address); | ||
| 51 | |||
| 52 | inline const char* GetCharPointer(const u32 address) { | ||
| 53 | return (const char *)GetPointer(address); | ||
| 54 | } | ||
| 55 | |||
| 56 | void RegisterModule(std::string name, int num_functions, const FunctionDef *func_table); | 35 | void RegisterModule(std::string name, int num_functions, const FunctionDef *func_table); |
| 57 | 36 | ||
| 58 | void CallSyscall(u32 opcode); | 37 | void CallSyscall(u32 opcode); |
diff --git a/src/core/hle/mrc.cpp b/src/core/hle/mrc.cpp deleted file mode 100644 index 5223be7c9..000000000 --- a/src/core/hle/mrc.cpp +++ /dev/null | |||
| @@ -1,64 +0,0 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/mrc.h" | ||
| 6 | #include "core/hle/hle.h" | ||
| 7 | #include "core/mem_map.h" | ||
| 8 | #include "core/core.h" | ||
| 9 | |||
| 10 | namespace HLE { | ||
| 11 | |||
| 12 | enum { | ||
| 13 | CMD_GX_REQUEST_DMA = 0x00000000, | ||
| 14 | }; | ||
| 15 | |||
| 16 | /// Data synchronization barrier | ||
| 17 | u32 DataSynchronizationBarrier(u32* command_buffer) { | ||
| 18 | u32 command = command_buffer[0]; | ||
| 19 | |||
| 20 | switch (command) { | ||
| 21 | |||
| 22 | case CMD_GX_REQUEST_DMA: | ||
| 23 | { | ||
| 24 | u32* src = (u32*)Memory::GetPointer(command_buffer[1]); | ||
| 25 | u32* dst = (u32*)Memory::GetPointer(command_buffer[2]); | ||
| 26 | u32 size = command_buffer[3]; | ||
| 27 | memcpy(dst, src, size); | ||
| 28 | } | ||
| 29 | break; | ||
| 30 | |||
| 31 | default: | ||
| 32 | ERROR_LOG(OSHLE, "MRC::DataSynchronizationBarrier unknown command 0x%08X", command); | ||
| 33 | return -1; | ||
| 34 | } | ||
| 35 | |||
| 36 | return 0; | ||
| 37 | } | ||
| 38 | |||
| 39 | /// Returns the coprocessor (in this case, syscore) command buffer pointer | ||
| 40 | Addr GetThreadCommandBuffer() { | ||
| 41 | // Called on insruction: mrc p15, 0, r0, c13, c0, 3 | ||
| 42 | // Returns an address in OSHLE memory for the CPU to read/write to | ||
| 43 | RETURN(CMD_BUFFER_ADDR); | ||
| 44 | return CMD_BUFFER_ADDR; | ||
| 45 | } | ||
| 46 | |||
| 47 | /// Call an MRC operation in HLE | ||
| 48 | u32 CallMRC(ARM11_MRC_OPERATION operation) { | ||
| 49 | switch (operation) { | ||
| 50 | |||
| 51 | case DATA_SYNCHRONIZATION_BARRIER: | ||
| 52 | return DataSynchronizationBarrier((u32*)Memory::GetPointer(PARAM(0))); | ||
| 53 | |||
| 54 | case CALL_GET_THREAD_COMMAND_BUFFER: | ||
| 55 | return GetThreadCommandBuffer(); | ||
| 56 | |||
| 57 | default: | ||
| 58 | ERROR_LOG(OSHLE, "unimplemented MRC operation 0x%02X", operation); | ||
| 59 | break; | ||
| 60 | } | ||
| 61 | return -1; | ||
| 62 | } | ||
| 63 | |||
| 64 | } // namespace | ||
diff --git a/src/core/hle/service/apt.cpp b/src/core/hle/service/apt.cpp index 4a1e8c992..709ac5493 100644 --- a/src/core/hle/service/apt.cpp +++ b/src/core/hle/service/apt.cpp | |||
| @@ -18,7 +18,7 @@ void Initialize(Service::Interface* self) { | |||
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | void GetLockHandle(Service::Interface* self) { | 20 | void GetLockHandle(Service::Interface* self) { |
| 21 | u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + Service::kCommandHeaderOffset); | 21 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 22 | cmd_buff[5] = 0x00000000; // TODO: This should be an actual mutex handle | 22 | cmd_buff[5] = 0x00000000; // TODO: This should be an actual mutex handle |
| 23 | } | 23 | } |
| 24 | 24 | ||
diff --git a/src/core/hle/service/gsp.cpp b/src/core/hle/service/gsp.cpp index 88c1f1a0f..12c7dabcd 100644 --- a/src/core/hle/service/gsp.cpp +++ b/src/core/hle/service/gsp.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | #include "common/log.h" | 6 | #include "common/log.h" |
| 7 | #include "common/bit_field.h" | ||
| 7 | 8 | ||
| 8 | #include "core/mem_map.h" | 9 | #include "core/mem_map.h" |
| 9 | #include "core/hle/hle.h" | 10 | #include "core/hle/hle.h" |
| @@ -12,10 +13,51 @@ | |||
| 12 | #include "core/hw/lcd.h" | 13 | #include "core/hw/lcd.h" |
| 13 | 14 | ||
| 14 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 15 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 16 | |||
| 17 | /// GSP shared memory GX command buffer header | ||
| 18 | union GX_CmdBufferHeader { | ||
| 19 | u32 hex; | ||
| 20 | |||
| 21 | // Current command index. This index is updated by GSP module after loading the command data, | ||
| 22 | // right before the command is processed. When this index is updated by GSP module, the total | ||
| 23 | // commands field is decreased by one as well. | ||
| 24 | BitField<0,8,u32> index; | ||
| 25 | |||
| 26 | // Total commands to process, must not be value 0 when GSP module handles commands. This must be | ||
| 27 | // <=15 when writing a command to shared memory. This is incremented by the application when | ||
| 28 | // writing a command to shared memory, after increasing this value TriggerCmdReqQueue is only | ||
| 29 | // used if this field is value 1. | ||
| 30 | BitField<8,8,u32> number_commands; | ||
| 31 | |||
| 32 | }; | ||
| 33 | |||
| 34 | /// Gets the address of the start (header) of a command buffer in GSP shared memory | ||
| 35 | static inline u32 GX_GetCmdBufferAddress(u32 thread_id) { | ||
| 36 | return (0x10002000 + 0x800 + (thread_id * 0x200)); | ||
| 37 | } | ||
| 38 | |||
| 39 | /// Gets a pointer to the start (header) of a command buffer in GSP shared memory | ||
| 40 | static inline u8* GX_GetCmdBufferPointer(u32 thread_id, u32 offset=0) { | ||
| 41 | return Memory::GetPointer(GX_GetCmdBufferAddress(thread_id) + offset); | ||
| 42 | } | ||
| 43 | |||
| 44 | /// Finishes execution of a GSP command | ||
| 45 | void GX_FinishCommand(u32 thread_id) { | ||
| 46 | GX_CmdBufferHeader* header = (GX_CmdBufferHeader*)GX_GetCmdBufferPointer(thread_id); | ||
| 47 | header->number_commands = header->number_commands - 1; | ||
| 48 | } | ||
| 49 | |||
| 50 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 15 | // Namespace GSP_GPU | 51 | // Namespace GSP_GPU |
| 16 | 52 | ||
| 17 | namespace GSP_GPU { | 53 | namespace GSP_GPU { |
| 18 | 54 | ||
| 55 | u32 g_thread_id = 0; | ||
| 56 | |||
| 57 | enum { | ||
| 58 | CMD_GX_REQUEST_DMA = 0x00000000, | ||
| 59 | }; | ||
| 60 | |||
| 19 | enum { | 61 | enum { |
| 20 | REG_FRAMEBUFFER_1 = 0x00400468, | 62 | REG_FRAMEBUFFER_1 = 0x00400468, |
| 21 | REG_FRAMEBUFFER_2 = 0x00400494, | 63 | REG_FRAMEBUFFER_2 = 0x00400494, |
| @@ -26,7 +68,7 @@ void ReadHWRegs(Service::Interface* self) { | |||
| 26 | static const u32 framebuffer_1[] = {LCD::PADDR_VRAM_TOP_LEFT_FRAME1, LCD::PADDR_VRAM_TOP_RIGHT_FRAME1}; | 68 | static const u32 framebuffer_1[] = {LCD::PADDR_VRAM_TOP_LEFT_FRAME1, LCD::PADDR_VRAM_TOP_RIGHT_FRAME1}; |
| 27 | static const u32 framebuffer_2[] = {LCD::PADDR_VRAM_TOP_LEFT_FRAME2, LCD::PADDR_VRAM_TOP_RIGHT_FRAME2}; | 69 | static const u32 framebuffer_2[] = {LCD::PADDR_VRAM_TOP_LEFT_FRAME2, LCD::PADDR_VRAM_TOP_RIGHT_FRAME2}; |
| 28 | 70 | ||
| 29 | u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + Service::kCommandHeaderOffset); | 71 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 30 | u32 reg_addr = cmd_buff[1]; | 72 | u32 reg_addr = cmd_buff[1]; |
| 31 | u32 size = cmd_buff[2]; | 73 | u32 size = cmd_buff[2]; |
| 32 | u32* dst = (u32*)Memory::GetPointer(cmd_buff[0x41]); | 74 | u32* dst = (u32*)Memory::GetPointer(cmd_buff[0x41]); |
| @@ -50,18 +92,37 @@ void ReadHWRegs(Service::Interface* self) { | |||
| 50 | break; | 92 | break; |
| 51 | 93 | ||
| 52 | default: | 94 | default: |
| 53 | ERROR_LOG(OSHLE, "GSP_GPU::ReadHWRegs unknown register read at address %08X", reg_addr); | 95 | ERROR_LOG(GSP, "ReadHWRegs unknown register read at address %08X", reg_addr); |
| 54 | } | 96 | } |
| 55 | 97 | ||
| 56 | } | 98 | } |
| 57 | 99 | ||
| 58 | void RegisterInterruptRelayQueue(Service::Interface* self) { | 100 | void RegisterInterruptRelayQueue(Service::Interface* self) { |
| 59 | u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + Service::kCommandHeaderOffset); | 101 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 60 | u32 flags = cmd_buff[1]; | 102 | u32 flags = cmd_buff[1]; |
| 61 | u32 event_handle = cmd_buff[3]; // TODO(bunnei): Implement event handling | 103 | u32 event_handle = cmd_buff[3]; // TODO(bunnei): Implement event handling |
| 104 | |||
| 105 | cmd_buff[2] = g_thread_id; // ThreadID | ||
| 62 | cmd_buff[4] = self->NewHandle(); | 106 | cmd_buff[4] = self->NewHandle(); |
| 107 | } | ||
| 108 | |||
| 109 | /// This triggers handling of the GX command written to the command buffer in shared memory. | ||
| 110 | void TriggerCmdReqQueue(Service::Interface* self) { | ||
| 111 | GX_CmdBufferHeader* header = (GX_CmdBufferHeader*)GX_GetCmdBufferPointer(g_thread_id); | ||
| 112 | u32* cmd_buff = (u32*)GX_GetCmdBufferPointer(g_thread_id, 0x20 + (header->index * 0x20)); | ||
| 63 | 113 | ||
| 64 | return; | 114 | switch (cmd_buff[0]) { |
| 115 | |||
| 116 | // GX request DMA - typically used for copying memory from GSP heap to VRAM | ||
| 117 | case CMD_GX_REQUEST_DMA: | ||
| 118 | memcpy(Memory::GetPointer(cmd_buff[2]), Memory::GetPointer(cmd_buff[1]), cmd_buff[3]); | ||
| 119 | break; | ||
| 120 | |||
| 121 | default: | ||
| 122 | ERROR_LOG(GSP, "TriggerCmdReqQueue unknown command 0x%08X", cmd_buff[0]); | ||
| 123 | } | ||
| 124 | |||
| 125 | GX_FinishCommand(g_thread_id); | ||
| 65 | } | 126 | } |
| 66 | 127 | ||
| 67 | const Interface::FunctionInfo FunctionTable[] = { | 128 | const Interface::FunctionInfo FunctionTable[] = { |
| @@ -76,7 +137,7 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 76 | {0x00090082, NULL, "InvalidateDataCache"}, | 137 | {0x00090082, NULL, "InvalidateDataCache"}, |
| 77 | {0x000A0044, NULL, "RegisterInterruptEvents"}, | 138 | {0x000A0044, NULL, "RegisterInterruptEvents"}, |
| 78 | {0x000B0040, NULL, "SetLcdForceBlack"}, | 139 | {0x000B0040, NULL, "SetLcdForceBlack"}, |
| 79 | {0x000C0000, NULL, "TriggerCmdReqQueue"}, | 140 | {0x000C0000, TriggerCmdReqQueue, "TriggerCmdReqQueue"}, |
| 80 | {0x000D0140, NULL, "SetDisplayTransfer"}, | 141 | {0x000D0140, NULL, "SetDisplayTransfer"}, |
| 81 | {0x000E0180, NULL, "SetTextureCopy"}, | 142 | {0x000E0180, NULL, "SetTextureCopy"}, |
| 82 | {0x000F0200, NULL, "SetMemoryFill"}, | 143 | {0x000F0200, NULL, "SetMemoryFill"}, |
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index b79dc9458..b260a290a 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | 10 | ||
| 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/hle/syscall.h" | 14 | #include "core/hle/syscall.h" |
| 14 | 15 | ||
| 15 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 16 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| @@ -22,6 +23,15 @@ typedef s32 NativeUID; ///< Native handle for a service | |||
| 22 | static const int kMaxPortSize = 0x08; ///< Maximum size of a port name (8 characters) | 23 | static const int kMaxPortSize = 0x08; ///< Maximum size of a port name (8 characters) |
| 23 | static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header | 24 | static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header |
| 24 | 25 | ||
| 26 | /** | ||
| 27 | * Returns a pointer to the command buffer in kernel memory | ||
| 28 | * @param offset Optional offset into command buffer | ||
| 29 | * @return Pointer to command buffer | ||
| 30 | */ | ||
| 31 | inline static u32* GetCommandBuffer(const int offset=0) { | ||
| 32 | return (u32*)Memory::GetPointer(Memory::KERNEL_MEMORY_VADDR + kCommandHeaderOffset + offset); | ||
| 33 | } | ||
| 34 | |||
| 25 | class Manager; | 35 | class Manager; |
| 26 | 36 | ||
| 27 | /// Interface to a CTROS service | 37 | /// Interface to a CTROS service |
| @@ -81,7 +91,7 @@ public: | |||
| 81 | * @return Return result of svcSendSyncRequest passed back to user app | 91 | * @return Return result of svcSendSyncRequest passed back to user app |
| 82 | */ | 92 | */ |
| 83 | Syscall::Result Sync() { | 93 | Syscall::Result Sync() { |
| 84 | u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + kCommandHeaderOffset); | 94 | u32* cmd_buff = GetCommandBuffer(); |
| 85 | auto itr = m_functions.find(cmd_buff[0]); | 95 | auto itr = m_functions.find(cmd_buff[0]); |
| 86 | 96 | ||
| 87 | if (itr == m_functions.end()) { | 97 | if (itr == m_functions.end()) { |
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index 9437868c5..071741444 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp | |||
| @@ -18,7 +18,7 @@ void Initialize(Service::Interface* self) { | |||
| 18 | 18 | ||
| 19 | void GetServiceHandle(Service::Interface* self) { | 19 | void GetServiceHandle(Service::Interface* self) { |
| 20 | Syscall::Result res = 0; | 20 | Syscall::Result res = 0; |
| 21 | u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + Service::kCommandHeaderOffset); | 21 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 22 | 22 | ||
| 23 | std::string port_name = std::string((const char*)&cmd_buff[1], 0, Service::kMaxPortSize); | 23 | std::string port_name = std::string((const char*)&cmd_buff[1], 0, Service::kMaxPortSize); |
| 24 | Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); | 24 | Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); |
diff --git a/src/core/hle/syscall.cpp b/src/core/hle/syscall.cpp index df6412743..d47df6038 100644 --- a/src/core/hle/syscall.cpp +++ b/src/core/hle/syscall.cpp | |||
| @@ -29,6 +29,9 @@ enum MapMemoryPermission { | |||
| 29 | Result ControlMemory(u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) { | 29 | Result ControlMemory(u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) { |
| 30 | u32 virtual_address = 0x00000000; | 30 | u32 virtual_address = 0x00000000; |
| 31 | 31 | ||
| 32 | DEBUG_LOG(SVC, "ControlMemory called operation=0x%08X, addr0=0x%08X, addr1=0x%08X, size=%08X, permissions=0x%08X", | ||
| 33 | operation, addr0, addr1, size, permissions); | ||
| 34 | |||
| 32 | switch (operation) { | 35 | switch (operation) { |
| 33 | 36 | ||
| 34 | // Map normal heap memory | 37 | // Map normal heap memory |
| @@ -43,16 +46,18 @@ Result ControlMemory(u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissi | |||
| 43 | 46 | ||
| 44 | // Unknown ControlMemory operation | 47 | // Unknown ControlMemory operation |
| 45 | default: | 48 | default: |
| 46 | ERROR_LOG(OSHLE, "Unknown ControlMemory operation %08X", operation); | 49 | ERROR_LOG(SVC, "ControlMemory unknown operation=0x%08X", operation); |
| 47 | } | 50 | } |
| 48 | 51 | ||
| 49 | Core::g_app_core->SetReg(1, virtual_address); | 52 | Core::g_app_core->SetReg(1, virtual_address); |
| 53 | |||
| 50 | return 0; | 54 | return 0; |
| 51 | } | 55 | } |
| 52 | 56 | ||
| 53 | /// Maps a memory block to specified address | 57 | /// Maps a memory block to specified address |
| 54 | Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission) { | 58 | Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherpermission) { |
| 55 | int x = 0; | 59 | DEBUG_LOG(SVC, "MapMemoryBlock called memblock=0x08X, addr=0x%08X, mypermissions=0x%08X, otherpermission=%d", |
| 60 | memblock, addr, mypermissions, otherpermission); | ||
| 56 | switch (mypermissions) { | 61 | switch (mypermissions) { |
| 57 | case MEMORY_PERMISSION_NORMAL: | 62 | case MEMORY_PERMISSION_NORMAL: |
| 58 | case MEMORY_PERMISSION_NORMAL + 1: | 63 | case MEMORY_PERMISSION_NORMAL + 1: |
| @@ -60,20 +65,23 @@ Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherper | |||
| 60 | Memory::MapBlock_Shared(memblock, addr, mypermissions); | 65 | Memory::MapBlock_Shared(memblock, addr, mypermissions); |
| 61 | break; | 66 | break; |
| 62 | default: | 67 | default: |
| 63 | ERROR_LOG(OSHLE, "Unknown MapMemoryBlock permissions %08X", mypermissions); | 68 | ERROR_LOG(OSHLE, "MapMemoryBlock unknown permissions=0x%08X", mypermissions); |
| 64 | } | 69 | } |
| 65 | return 0; | 70 | return 0; |
| 66 | } | 71 | } |
| 67 | 72 | ||
| 68 | /// Connect to an OS service given the port name, returns the handle to the port to out | 73 | /// Connect to an OS service given the port name, returns the handle to the port to out |
| 69 | Result ConnectToPort(void* out, const char* port_name) { | 74 | Result ConnectToPort(void* out, const char* port_name) { |
| 75 | |||
| 70 | Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); | 76 | Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); |
| 71 | Core::g_app_core->SetReg(1, service->GetUID()); | 77 | Core::g_app_core->SetReg(1, service->GetUID()); |
| 78 | DEBUG_LOG(SVC, "ConnectToPort called port_name=%s", port_name); | ||
| 72 | return 0; | 79 | return 0; |
| 73 | } | 80 | } |
| 74 | 81 | ||
| 75 | /// Synchronize to an OS service | 82 | /// Synchronize to an OS service |
| 76 | Result SendSyncRequest(Handle session) { | 83 | Result SendSyncRequest(Handle session) { |
| 84 | DEBUG_LOG(SVC, "SendSyncRequest called session=0x%08X"); | ||
| 77 | Service::Interface* service = Service::g_manager->FetchFromUID(session); | 85 | Service::Interface* service = Service::g_manager->FetchFromUID(session); |
| 78 | service->Sync(); | 86 | service->Sync(); |
| 79 | return 0; | 87 | return 0; |
| @@ -82,142 +90,177 @@ Result SendSyncRequest(Handle session) { | |||
| 82 | /// Close a handle | 90 | /// Close a handle |
| 83 | Result CloseHandle(Handle handle) { | 91 | Result CloseHandle(Handle handle) { |
| 84 | // ImplementMe | 92 | // ImplementMe |
| 93 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) CloseHandle called handle=0x%08X", handle); | ||
| 85 | return 0; | 94 | return 0; |
| 86 | } | 95 | } |
| 87 | 96 | ||
| 88 | /// Wait for a handle to synchronize, timeout after the specified nanoseconds | 97 | /// Wait for a handle to synchronize, timeout after the specified nanoseconds |
| 89 | Result WaitSynchronization1(Handle handle, s64 nanoseconds) { | 98 | Result WaitSynchronization1(Handle handle, s64 nanoseconds) { |
| 90 | // ImplementMe | 99 | // ImplementMe |
| 100 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) WaitSynchronization1 called handle=0x%08X, nanoseconds=%d", | ||
| 101 | handle, nanoseconds); | ||
| 102 | return 0; | ||
| 103 | } | ||
| 104 | |||
| 105 | /// Create an address arbiter (to allocate access to shared resources) | ||
| 106 | Result CreateAddressArbiter(void* arbiter) { | ||
| 107 | // ImplementMe | ||
| 108 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateAddressArbiter called"); | ||
| 109 | Core::g_app_core->SetReg(1, 0xDEADBEEF); | ||
| 110 | return 0; | ||
| 111 | } | ||
| 112 | |||
| 113 | /// Used to output a message on a debug hardware unit - does nothing on a retail unit | ||
| 114 | void OutputDebugString(const char* string) { | ||
| 115 | NOTICE_LOG(SVC, "## OSDEBUG: %08X %s", Core::g_app_core->GetPC(), string); | ||
| 116 | } | ||
| 117 | |||
| 118 | /// Get resource limit | ||
| 119 | Result GetResourceLimit(void* resource_limit, Handle process) { | ||
| 120 | // With regards to proceess values: | ||
| 121 | // 0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for | ||
| 122 | // the current KThread. | ||
| 123 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) GetResourceLimit called process=0x%08X", process); | ||
| 124 | Core::g_app_core->SetReg(1, 0xDEADBEEF); | ||
| 125 | return 0; | ||
| 126 | } | ||
| 127 | |||
| 128 | /// Get resource limit current values | ||
| 129 | Result GetResourceLimitCurrentValues(void* _values, Handle resource_limit, void* names, s32 name_count) { | ||
| 130 | //s64* values = (s64*)_values; | ||
| 131 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) GetResourceLimitCurrentValues called resource_limit=%08X, names=%s, name_count=%d", | ||
| 132 | resource_limit, names, name_count); | ||
| 133 | Memory::Write32(Core::g_app_core->GetReg(0), 0); // Normmatt: Set used memory to 0 for now | ||
| 91 | return 0; | 134 | return 0; |
| 92 | } | 135 | } |
| 93 | 136 | ||
| 94 | const HLE::FunctionDef Syscall_Table[] = { | 137 | const HLE::FunctionDef Syscall_Table[] = { |
| 95 | {0x00, NULL, "Unknown"}, | 138 | {0x00, NULL, "Unknown"}, |
| 96 | {0x01, WrapI_UUUUU<ControlMemory>, "ControlMemory"}, | 139 | {0x01, WrapI_UUUUU<ControlMemory>, "ControlMemory"}, |
| 97 | {0x02, NULL, "QueryMemory"}, | 140 | {0x02, NULL, "QueryMemory"}, |
| 98 | {0x03, NULL, "ExitProcess"}, | 141 | {0x03, NULL, "ExitProcess"}, |
| 99 | {0x04, NULL, "GetProcessAffinityMask"}, | 142 | {0x04, NULL, "GetProcessAffinityMask"}, |
| 100 | {0x05, NULL, "SetProcessAffinityMask"}, | 143 | {0x05, NULL, "SetProcessAffinityMask"}, |
| 101 | {0x06, NULL, "GetProcessIdealProcessor"}, | 144 | {0x06, NULL, "GetProcessIdealProcessor"}, |
| 102 | {0x07, NULL, "SetProcessIdealProcessor"}, | 145 | {0x07, NULL, "SetProcessIdealProcessor"}, |
| 103 | {0x08, NULL, "CreateThread"}, | 146 | {0x08, NULL, "CreateThread"}, |
| 104 | {0x09, NULL, "ExitThread"}, | 147 | {0x09, NULL, "ExitThread"}, |
| 105 | {0x0A, NULL, "SleepThread"}, | 148 | {0x0A, NULL, "SleepThread"}, |
| 106 | {0x0B, NULL, "GetThreadPriority"}, | 149 | {0x0B, NULL, "GetThreadPriority"}, |
| 107 | {0x0C, NULL, "SetThreadPriority"}, | 150 | {0x0C, NULL, "SetThreadPriority"}, |
| 108 | {0x0D, NULL, "GetThreadAffinityMask"}, | 151 | {0x0D, NULL, "GetThreadAffinityMask"}, |
| 109 | {0x0E, NULL, "SetThreadAffinityMask"}, | 152 | {0x0E, NULL, "SetThreadAffinityMask"}, |
| 110 | {0x0F, NULL, "GetThreadIdealProcessor"}, | 153 | {0x0F, NULL, "GetThreadIdealProcessor"}, |
| 111 | {0x10, NULL, "SetThreadIdealProcessor"}, | 154 | {0x10, NULL, "SetThreadIdealProcessor"}, |
| 112 | {0x11, NULL, "GetCurrentProcessorNumber"}, | 155 | {0x11, NULL, "GetCurrentProcessorNumber"}, |
| 113 | {0x12, NULL, "Run"}, | 156 | {0x12, NULL, "Run"}, |
| 114 | {0x13, NULL, "CreateMutex"}, | 157 | {0x13, NULL, "CreateMutex"}, |
| 115 | {0x14, NULL, "ReleaseMutex"}, | 158 | {0x14, NULL, "ReleaseMutex"}, |
| 116 | {0x15, NULL, "CreateSemaphore"}, | 159 | {0x15, NULL, "CreateSemaphore"}, |
| 117 | {0x16, NULL, "ReleaseSemaphore"}, | 160 | {0x16, NULL, "ReleaseSemaphore"}, |
| 118 | {0x17, NULL, "CreateEvent"}, | 161 | {0x17, NULL, "CreateEvent"}, |
| 119 | {0x18, NULL, "SignalEvent"}, | 162 | {0x18, NULL, "SignalEvent"}, |
| 120 | {0x19, NULL, "ClearEvent"}, | 163 | {0x19, NULL, "ClearEvent"}, |
| 121 | {0x1A, NULL, "CreateTimer"}, | 164 | {0x1A, NULL, "CreateTimer"}, |
| 122 | {0x1B, NULL, "SetTimer"}, | 165 | {0x1B, NULL, "SetTimer"}, |
| 123 | {0x1C, NULL, "CancelTimer"}, | 166 | {0x1C, NULL, "CancelTimer"}, |
| 124 | {0x1D, NULL, "ClearTimer"}, | 167 | {0x1D, NULL, "ClearTimer"}, |
| 125 | {0x1E, NULL, "CreateMemoryBlock"}, | 168 | {0x1E, NULL, "CreateMemoryBlock"}, |
| 126 | {0x1F, WrapI_UUUU<MapMemoryBlock>, "MapMemoryBlock"}, | 169 | {0x1F, WrapI_UUUU<MapMemoryBlock>, "MapMemoryBlock"}, |
| 127 | {0x20, NULL, "UnmapMemoryBlock"}, | 170 | {0x20, NULL, "UnmapMemoryBlock"}, |
| 128 | {0x21, NULL, "CreateAddressArbiter"}, | 171 | {0x21, WrapI_V<CreateAddressArbiter>, "CreateAddressArbiter"}, |
| 129 | {0x22, NULL, "ArbitrateAddress"}, | 172 | {0x22, NULL, "ArbitrateAddress"}, |
| 130 | {0x23, WrapI_U<CloseHandle>, "CloseHandle"}, | 173 | {0x23, WrapI_U<CloseHandle>, "CloseHandle"}, |
| 131 | {0x24, WrapI_US64<WaitSynchronization1>, "WaitSynchronization1"}, | 174 | {0x24, WrapI_US64<WaitSynchronization1>, "WaitSynchronization1"}, |
| 132 | {0x25, NULL, "WaitSynchronizationN"}, | 175 | {0x25, NULL, "WaitSynchronizationN"}, |
| 133 | {0x26, NULL, "SignalAndWait"}, | 176 | {0x26, NULL, "SignalAndWait"}, |
| 134 | {0x27, NULL, "DuplicateHandle"}, | 177 | {0x27, NULL, "DuplicateHandle"}, |
| 135 | {0x28, NULL, "GetSystemTick"}, | 178 | {0x28, NULL, "GetSystemTick"}, |
| 136 | {0x29, NULL, "GetHandleInfo"}, | 179 | {0x29, NULL, "GetHandleInfo"}, |
| 137 | {0x2A, NULL, "GetSystemInfo"}, | 180 | {0x2A, NULL, "GetSystemInfo"}, |
| 138 | {0x2B, NULL, "GetProcessInfo"}, | 181 | {0x2B, NULL, "GetProcessInfo"}, |
| 139 | {0x2C, NULL, "GetThreadInfo"}, | 182 | {0x2C, NULL, "GetThreadInfo"}, |
| 140 | {0x2D, WrapI_VC<ConnectToPort>, "ConnectToPort"}, | 183 | {0x2D, WrapI_VC<ConnectToPort>, "ConnectToPort"}, |
| 141 | {0x2E, NULL, "SendSyncRequest1"}, | 184 | {0x2E, NULL, "SendSyncRequest1"}, |
| 142 | {0x2F, NULL, "SendSyncRequest2"}, | 185 | {0x2F, NULL, "SendSyncRequest2"}, |
| 143 | {0x30, NULL, "SendSyncRequest3"}, | 186 | {0x30, NULL, "SendSyncRequest3"}, |
| 144 | {0x31, NULL, "SendSyncRequest4"}, | 187 | {0x31, NULL, "SendSyncRequest4"}, |
| 145 | {0x32, WrapI_U<SendSyncRequest>, "SendSyncRequest"}, | 188 | {0x32, WrapI_U<SendSyncRequest>, "SendSyncRequest"}, |
| 146 | {0x33, NULL, "OpenProcess"}, | 189 | {0x33, NULL, "OpenProcess"}, |
| 147 | {0x34, NULL, "OpenThread"}, | 190 | {0x34, NULL, "OpenThread"}, |
| 148 | {0x35, NULL, "GetProcessId"}, | 191 | {0x35, NULL, "GetProcessId"}, |
| 149 | {0x36, NULL, "GetProcessIdOfThread"}, | 192 | {0x36, NULL, "GetProcessIdOfThread"}, |
| 150 | {0x37, NULL, "GetThreadId"}, | 193 | {0x37, NULL, "GetThreadId"}, |
| 151 | {0x38, NULL, "GetResourceLimit"}, | 194 | {0x38, WrapI_VU<GetResourceLimit>, "GetResourceLimit"}, |
| 152 | {0x39, NULL, "GetResourceLimitLimitValues"}, | 195 | {0x39, NULL, "GetResourceLimitLimitValues"}, |
| 153 | {0x3A, NULL, "GetResourceLimitCurrentValues"}, | 196 | {0x3A, WrapI_VUVI<GetResourceLimitCurrentValues>, "GetResourceLimitCurrentValues"}, |
| 154 | {0x3B, NULL, "GetThreadContext"}, | 197 | {0x3B, NULL, "GetThreadContext"}, |
| 155 | {0x3C, NULL, "Break"}, | 198 | {0x3C, NULL, "Break"}, |
| 156 | {0x3D, NULL, "OutputDebugString"}, | 199 | {0x3D, WrapV_C<OutputDebugString>, "OutputDebugString"}, |
| 157 | {0x3E, NULL, "ControlPerformanceCounter"}, | 200 | {0x3E, NULL, "ControlPerformanceCounter"}, |
| 158 | {0x3F, NULL, "Unknown"}, | 201 | {0x3F, NULL, "Unknown"}, |
| 159 | {0x40, NULL, "Unknown"}, | 202 | {0x40, NULL, "Unknown"}, |
| 160 | {0x41, NULL, "Unknown"}, | 203 | {0x41, NULL, "Unknown"}, |
| 161 | {0x42, NULL, "Unknown"}, | 204 | {0x42, NULL, "Unknown"}, |
| 162 | {0x43, NULL, "Unknown"}, | 205 | {0x43, NULL, "Unknown"}, |
| 163 | {0x44, NULL, "Unknown"}, | 206 | {0x44, NULL, "Unknown"}, |
| 164 | {0x45, NULL, "Unknown"}, | 207 | {0x45, NULL, "Unknown"}, |
| 165 | {0x46, NULL, "Unknown"}, | 208 | {0x46, NULL, "Unknown"}, |
| 166 | {0x47, NULL, "CreatePort"}, | 209 | {0x47, NULL, "CreatePort"}, |
| 167 | {0x48, NULL, "CreateSessionToPort"}, | 210 | {0x48, NULL, "CreateSessionToPort"}, |
| 168 | {0x49, NULL, "CreateSession"}, | 211 | {0x49, NULL, "CreateSession"}, |
| 169 | {0x4A, NULL, "AcceptSession"}, | 212 | {0x4A, NULL, "AcceptSession"}, |
| 170 | {0x4B, NULL, "ReplyAndReceive1"}, | 213 | {0x4B, NULL, "ReplyAndReceive1"}, |
| 171 | {0x4C, NULL, "ReplyAndReceive2"}, | 214 | {0x4C, NULL, "ReplyAndReceive2"}, |
| 172 | {0x4D, NULL, "ReplyAndReceive3"}, | 215 | {0x4D, NULL, "ReplyAndReceive3"}, |
| 173 | {0x4E, NULL, "ReplyAndReceive4"}, | 216 | {0x4E, NULL, "ReplyAndReceive4"}, |
| 174 | {0x4F, NULL, "ReplyAndReceive"}, | 217 | {0x4F, NULL, "ReplyAndReceive"}, |
| 175 | {0x50, NULL, "BindInterrupt"}, | 218 | {0x50, NULL, "BindInterrupt"}, |
| 176 | {0x51, NULL, "UnbindInterrupt"}, | 219 | {0x51, NULL, "UnbindInterrupt"}, |
| 177 | {0x52, NULL, "InvalidateProcessDataCache"}, | 220 | {0x52, NULL, "InvalidateProcessDataCache"}, |
| 178 | {0x53, NULL, "StoreProcessDataCache"}, | 221 | {0x53, NULL, "StoreProcessDataCache"}, |
| 179 | {0x54, NULL, "FlushProcessDataCache"}, | 222 | {0x54, NULL, "FlushProcessDataCache"}, |
| 180 | {0x55, NULL, "StartInterProcessDma"}, | 223 | {0x55, NULL, "StartInterProcessDma"}, |
| 181 | {0x56, NULL, "StopDma"}, | 224 | {0x56, NULL, "StopDma"}, |
| 182 | {0x57, NULL, "GetDmaState"}, | 225 | {0x57, NULL, "GetDmaState"}, |
| 183 | {0x58, NULL, "RestartDma"}, | 226 | {0x58, NULL, "RestartDma"}, |
| 184 | {0x59, NULL, "Unknown"}, | 227 | {0x59, NULL, "Unknown"}, |
| 185 | {0x5A, NULL, "Unknown"}, | 228 | {0x5A, NULL, "Unknown"}, |
| 186 | {0x5B, NULL, "Unknown"}, | 229 | {0x5B, NULL, "Unknown"}, |
| 187 | {0x5C, NULL, "Unknown"}, | 230 | {0x5C, NULL, "Unknown"}, |
| 188 | {0x5D, NULL, "Unknown"}, | 231 | {0x5D, NULL, "Unknown"}, |
| 189 | {0x5E, NULL, "Unknown"}, | 232 | {0x5E, NULL, "Unknown"}, |
| 190 | {0x5F, NULL, "Unknown"}, | 233 | {0x5F, NULL, "Unknown"}, |
| 191 | {0x60, NULL, "DebugActiveProcess"}, | 234 | {0x60, NULL, "DebugActiveProcess"}, |
| 192 | {0x61, NULL, "BreakDebugProcess"}, | 235 | {0x61, NULL, "BreakDebugProcess"}, |
| 193 | {0x62, NULL, "TerminateDebugProcess"}, | 236 | {0x62, NULL, "TerminateDebugProcess"}, |
| 194 | {0x63, NULL, "GetProcessDebugEvent"}, | 237 | {0x63, NULL, "GetProcessDebugEvent"}, |
| 195 | {0x64, NULL, "ContinueDebugEvent"}, | 238 | {0x64, NULL, "ContinueDebugEvent"}, |
| 196 | {0x65, NULL, "GetProcessList"}, | 239 | {0x65, NULL, "GetProcessList"}, |
| 197 | {0x66, NULL, "GetThreadList"}, | 240 | {0x66, NULL, "GetThreadList"}, |
| 198 | {0x67, NULL, "GetDebugThreadContext"}, | 241 | {0x67, NULL, "GetDebugThreadContext"}, |
| 199 | {0x68, NULL, "SetDebugThreadContext"}, | 242 | {0x68, NULL, "SetDebugThreadContext"}, |
| 200 | {0x69, NULL, "QueryDebugProcessMemory"}, | 243 | {0x69, NULL, "QueryDebugProcessMemory"}, |
| 201 | {0x6A, NULL, "ReadProcessMemory"}, | 244 | {0x6A, NULL, "ReadProcessMemory"}, |
| 202 | {0x6B, NULL, "WriteProcessMemory"}, | 245 | {0x6B, NULL, "WriteProcessMemory"}, |
| 203 | {0x6C, NULL, "SetHardwareBreakPoint"}, | 246 | {0x6C, NULL, "SetHardwareBreakPoint"}, |
| 204 | {0x6D, NULL, "GetDebugThreadParam"}, | 247 | {0x6D, NULL, "GetDebugThreadParam"}, |
| 205 | {0x6E, NULL, "Unknown"}, | 248 | {0x6E, NULL, "Unknown"}, |
| 206 | {0x6F, NULL, "Unknown"}, | 249 | {0x6F, NULL, "Unknown"}, |
| 207 | {0x70, NULL, "ControlProcessMemory"}, | 250 | {0x70, NULL, "ControlProcessMemory"}, |
| 208 | {0x71, NULL, "MapProcessMemory"}, | 251 | {0x71, NULL, "MapProcessMemory"}, |
| 209 | {0x72, NULL, "UnmapProcessMemory"}, | 252 | {0x72, NULL, "UnmapProcessMemory"}, |
| 210 | {0x73, NULL, "Unknown"}, | 253 | {0x73, NULL, "Unknown"}, |
| 211 | {0x74, NULL, "Unknown"}, | 254 | {0x74, NULL, "Unknown"}, |
| 212 | {0x75, NULL, "Unknown"}, | 255 | {0x75, NULL, "Unknown"}, |
| 213 | {0x76, NULL, "TerminateProcess"}, | 256 | {0x76, NULL, "TerminateProcess"}, |
| 214 | {0x77, NULL, "Unknown"}, | 257 | {0x77, NULL, "Unknown"}, |
| 215 | {0x78, NULL, "CreateResourceLimit"}, | 258 | {0x78, NULL, "CreateResourceLimit"}, |
| 216 | {0x79, NULL, "Unknown"}, | 259 | {0x79, NULL, "Unknown"}, |
| 217 | {0x7A, NULL, "Unknown"}, | 260 | {0x7A, NULL, "Unknown"}, |
| 218 | {0x7B, NULL, "Unknown"}, | 261 | {0x7B, NULL, "Unknown"}, |
| 219 | {0x7C, NULL, "KernelSetState"}, | 262 | {0x7C, NULL, "KernelSetState"}, |
| 220 | {0x7D, NULL, "QueryProcessMemory"}, | 263 | {0x7D, NULL, "QueryProcessMemory"}, |
| 221 | }; | 264 | }; |
| 222 | 265 | ||
| 223 | void Register() { | 266 | void Register() { |