diff options
| author | 2014-11-17 22:55:50 -0500 | |
|---|---|---|
| committer | 2014-11-17 22:55:50 -0500 | |
| commit | 745b0219c5dae25d65f18ef13fd5dfd9ca23b671 (patch) | |
| tree | b9d4c36dce32830efd873ccacd25864d22f0e655 /src/core/hle/service | |
| parent | Merge pull request #192 from bunnei/fs-fix-paths (diff) | |
| parent | core: Mark some hle functions as static (diff) | |
| download | yuzu-745b0219c5dae25d65f18ef13fd5dfd9ca23b671.tar.gz yuzu-745b0219c5dae25d65f18ef13fd5dfd9ca23b671.tar.xz yuzu-745b0219c5dae25d65f18ef13fd5dfd9ca23b671.zip | |
Merge pull request #200 from lioncash/statics
core: Mark some hle functions as static
Diffstat (limited to 'src/core/hle/service')
| -rw-r--r-- | src/core/hle/service/fs_user.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/service/gsp_gpu.cpp | 16 | ||||
| -rw-r--r-- | src/core/hle/service/hid_user.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/srv.cpp | 6 |
4 files changed, 20 insertions, 20 deletions
diff --git a/src/core/hle/service/fs_user.cpp b/src/core/hle/service/fs_user.cpp index 8d8f0a201..06d3f5656 100644 --- a/src/core/hle/service/fs_user.cpp +++ b/src/core/hle/service/fs_user.cpp | |||
| @@ -18,7 +18,7 @@ namespace FS_User { | |||
| 18 | // puts all the sections of the http://3dbrew.org/wiki/Error_codes to something non-zero, to make | 18 | // puts all the sections of the http://3dbrew.org/wiki/Error_codes to something non-zero, to make |
| 19 | // sure we don't mislead the application into thinking something worked. | 19 | // sure we don't mislead the application into thinking something worked. |
| 20 | 20 | ||
| 21 | void Initialize(Service::Interface* self) { | 21 | static void Initialize(Service::Interface* self) { |
| 22 | u32* cmd_buff = Service::GetCommandBuffer(); | 22 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 23 | 23 | ||
| 24 | // TODO(Link Mauve): check the behavior when cmd_buff[1] isn't 32, as per | 24 | // TODO(Link Mauve): check the behavior when cmd_buff[1] isn't 32, as per |
| @@ -44,7 +44,7 @@ void Initialize(Service::Interface* self) { | |||
| 44 | * 1 : Result of function, 0 on success, otherwise error code | 44 | * 1 : Result of function, 0 on success, otherwise error code |
| 45 | * 3 : File handle | 45 | * 3 : File handle |
| 46 | */ | 46 | */ |
| 47 | void OpenFile(Service::Interface* self) { | 47 | static void OpenFile(Service::Interface* self) { |
| 48 | u32* cmd_buff = Service::GetCommandBuffer(); | 48 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 49 | 49 | ||
| 50 | // TODO(Link Mauve): cmd_buff[2], aka archive handle lower word, isn't used according to | 50 | // TODO(Link Mauve): cmd_buff[2], aka archive handle lower word, isn't used according to |
| @@ -91,7 +91,7 @@ void OpenFile(Service::Interface* self) { | |||
| 91 | * 1 : Result of function, 0 on success, otherwise error code | 91 | * 1 : Result of function, 0 on success, otherwise error code |
| 92 | * 3 : File handle | 92 | * 3 : File handle |
| 93 | */ | 93 | */ |
| 94 | void OpenFileDirectly(Service::Interface* self) { | 94 | static void OpenFileDirectly(Service::Interface* self) { |
| 95 | u32* cmd_buff = Service::GetCommandBuffer(); | 95 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 96 | 96 | ||
| 97 | auto archive_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[2]); | 97 | auto archive_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[2]); |
| @@ -148,7 +148,7 @@ void OpenFileDirectly(Service::Interface* self) { | |||
| 148 | * Outputs: | 148 | * Outputs: |
| 149 | * 1 : Result of function, 0 on success, otherwise error code | 149 | * 1 : Result of function, 0 on success, otherwise error code |
| 150 | */ | 150 | */ |
| 151 | void CreateDirectory(Service::Interface* self) { | 151 | static void CreateDirectory(Service::Interface* self) { |
| 152 | u32* cmd_buff = Service::GetCommandBuffer(); | 152 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 153 | 153 | ||
| 154 | // TODO: cmd_buff[2], aka archive handle lower word, isn't used according to | 154 | // TODO: cmd_buff[2], aka archive handle lower word, isn't used according to |
| @@ -177,7 +177,7 @@ void CreateDirectory(Service::Interface* self) { | |||
| 177 | DEBUG_LOG(KERNEL, "called"); | 177 | DEBUG_LOG(KERNEL, "called"); |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | void OpenDirectory(Service::Interface* self) { | 180 | static void OpenDirectory(Service::Interface* self) { |
| 181 | u32* cmd_buff = Service::GetCommandBuffer(); | 181 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 182 | 182 | ||
| 183 | // TODO(Link Mauve): cmd_buff[2], aka archive handle lower word, isn't used according to | 183 | // TODO(Link Mauve): cmd_buff[2], aka archive handle lower word, isn't used according to |
| @@ -227,7 +227,7 @@ void OpenDirectory(Service::Interface* self) { | |||
| 227 | * 2 : Archive handle lower word (unused) | 227 | * 2 : Archive handle lower word (unused) |
| 228 | * 3 : Archive handle upper word (same as file handle) | 228 | * 3 : Archive handle upper word (same as file handle) |
| 229 | */ | 229 | */ |
| 230 | void OpenArchive(Service::Interface* self) { | 230 | static void OpenArchive(Service::Interface* self) { |
| 231 | u32* cmd_buff = Service::GetCommandBuffer(); | 231 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 232 | 232 | ||
| 233 | auto archive_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[1]); | 233 | auto archive_id = static_cast<FileSys::Archive::IdCode>(cmd_buff[1]); |
| @@ -264,7 +264,7 @@ void OpenArchive(Service::Interface* self) { | |||
| 264 | * 1 : Result of function, 0 on success, otherwise error code | 264 | * 1 : Result of function, 0 on success, otherwise error code |
| 265 | * 2 : Whether the Sdmc could be detected | 265 | * 2 : Whether the Sdmc could be detected |
| 266 | */ | 266 | */ |
| 267 | void IsSdmcDetected(Service::Interface* self) { | 267 | static void IsSdmcDetected(Service::Interface* self) { |
| 268 | u32* cmd_buff = Service::GetCommandBuffer(); | 268 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 269 | 269 | ||
| 270 | cmd_buff[1] = 0; | 270 | cmd_buff[1] = 0; |
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp index 6119e6300..66daded94 100644 --- a/src/core/hle/service/gsp_gpu.cpp +++ b/src/core/hle/service/gsp_gpu.cpp | |||
| @@ -52,7 +52,7 @@ static inline InterruptRelayQueue* GetInterruptRelayQueue(u32 thread_id) { | |||
| 52 | sizeof(InterruptRelayQueue) * thread_id); | 52 | sizeof(InterruptRelayQueue) * thread_id); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | void WriteHWRegs(u32 base_address, u32 size_in_bytes, const u32* data) { | 55 | static void WriteHWRegs(u32 base_address, u32 size_in_bytes, const u32* data) { |
| 56 | // TODO: Return proper error codes | 56 | // TODO: Return proper error codes |
| 57 | if (base_address + size_in_bytes >= 0x420000) { | 57 | if (base_address + size_in_bytes >= 0x420000) { |
| 58 | ERROR_LOG(GPU, "Write address out of range! (address=0x%08x, size=0x%08x)", | 58 | ERROR_LOG(GPU, "Write address out of range! (address=0x%08x, size=0x%08x)", |
| @@ -76,7 +76,7 @@ void WriteHWRegs(u32 base_address, u32 size_in_bytes, const u32* data) { | |||
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | /// Write a GSP GPU hardware register | 78 | /// Write a GSP GPU hardware register |
| 79 | void WriteHWRegs(Service::Interface* self) { | 79 | static void WriteHWRegs(Service::Interface* self) { |
| 80 | u32* cmd_buff = Service::GetCommandBuffer(); | 80 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 81 | u32 reg_addr = cmd_buff[1]; | 81 | u32 reg_addr = cmd_buff[1]; |
| 82 | u32 size = cmd_buff[2]; | 82 | u32 size = cmd_buff[2]; |
| @@ -87,7 +87,7 @@ void WriteHWRegs(Service::Interface* self) { | |||
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | /// Read a GSP GPU hardware register | 89 | /// Read a GSP GPU hardware register |
| 90 | void ReadHWRegs(Service::Interface* self) { | 90 | static void ReadHWRegs(Service::Interface* self) { |
| 91 | u32* cmd_buff = Service::GetCommandBuffer(); | 91 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 92 | u32 reg_addr = cmd_buff[1]; | 92 | u32 reg_addr = cmd_buff[1]; |
| 93 | u32 size = cmd_buff[2]; | 93 | u32 size = cmd_buff[2]; |
| @@ -115,7 +115,7 @@ void ReadHWRegs(Service::Interface* self) { | |||
| 115 | } | 115 | } |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | void SetBufferSwap(u32 screen_id, const FrameBufferInfo& info) { | 118 | static void SetBufferSwap(u32 screen_id, const FrameBufferInfo& info) { |
| 119 | u32 base_address = 0x400000; | 119 | u32 base_address = 0x400000; |
| 120 | if (info.active_fb == 0) { | 120 | if (info.active_fb == 0) { |
| 121 | WriteHWRegs(base_address + 4 * GPU_REG_INDEX(framebuffer_config[screen_id].address_left1), 4, &info.address_left); | 121 | WriteHWRegs(base_address + 4 * GPU_REG_INDEX(framebuffer_config[screen_id].address_left1), 4, &info.address_left); |
| @@ -140,7 +140,7 @@ void SetBufferSwap(u32 screen_id, const FrameBufferInfo& info) { | |||
| 140 | * Outputs: | 140 | * Outputs: |
| 141 | * 1: Result code | 141 | * 1: Result code |
| 142 | */ | 142 | */ |
| 143 | void SetBufferSwap(Service::Interface* self) { | 143 | static void SetBufferSwap(Service::Interface* self) { |
| 144 | u32* cmd_buff = Service::GetCommandBuffer(); | 144 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 145 | u32 screen_id = cmd_buff[1]; | 145 | u32 screen_id = cmd_buff[1]; |
| 146 | FrameBufferInfo* fb_info = (FrameBufferInfo*)&cmd_buff[2]; | 146 | FrameBufferInfo* fb_info = (FrameBufferInfo*)&cmd_buff[2]; |
| @@ -159,7 +159,7 @@ void SetBufferSwap(Service::Interface* self) { | |||
| 159 | * 2 : Thread index into GSP command buffer | 159 | * 2 : Thread index into GSP command buffer |
| 160 | * 4 : Handle to GSP shared memory | 160 | * 4 : Handle to GSP shared memory |
| 161 | */ | 161 | */ |
| 162 | void RegisterInterruptRelayQueue(Service::Interface* self) { | 162 | static void RegisterInterruptRelayQueue(Service::Interface* self) { |
| 163 | u32* cmd_buff = Service::GetCommandBuffer(); | 163 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 164 | u32 flags = cmd_buff[1]; | 164 | u32 flags = cmd_buff[1]; |
| 165 | g_interrupt_event = cmd_buff[3]; | 165 | g_interrupt_event = cmd_buff[3]; |
| @@ -202,7 +202,7 @@ void SignalInterrupt(InterruptId interrupt_id) { | |||
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | /// Executes the next GSP command | 204 | /// Executes the next GSP command |
| 205 | void ExecuteCommand(const Command& command, u32 thread_id) { | 205 | static void ExecuteCommand(const Command& command, u32 thread_id) { |
| 206 | // Utility function to convert register ID to address | 206 | // Utility function to convert register ID to address |
| 207 | auto WriteGPURegister = [](u32 id, u32 data) { | 207 | auto WriteGPURegister = [](u32 id, u32 data) { |
| 208 | GPU::Write<u32>(0x1EF00000 + 4 * id, data); | 208 | GPU::Write<u32>(0x1EF00000 + 4 * id, data); |
| @@ -308,7 +308,7 @@ void ExecuteCommand(const Command& command, u32 thread_id) { | |||
| 308 | } | 308 | } |
| 309 | 309 | ||
| 310 | /// This triggers handling of the GX command written to the command buffer in shared memory. | 310 | /// This triggers handling of the GX command written to the command buffer in shared memory. |
| 311 | void TriggerCmdReqQueue(Service::Interface* self) { | 311 | static void TriggerCmdReqQueue(Service::Interface* self) { |
| 312 | 312 | ||
| 313 | // Iterate through each thread's command queue... | 313 | // Iterate through each thread's command queue... |
| 314 | for (unsigned thread_id = 0; thread_id < 0x4; ++thread_id) { | 314 | for (unsigned thread_id = 0; thread_id < 0x4; ++thread_id) { |
diff --git a/src/core/hle/service/hid_user.cpp b/src/core/hle/service/hid_user.cpp index 0eb32ba4a..5f6bf1eff 100644 --- a/src/core/hle/service/hid_user.cpp +++ b/src/core/hle/service/hid_user.cpp | |||
| @@ -47,7 +47,7 @@ static inline PadData* GetPadData() { | |||
| 47 | * | 47 | * |
| 48 | * Indicate the circle pad is pushed completely to the edge in 1 of 8 directions. | 48 | * Indicate the circle pad is pushed completely to the edge in 1 of 8 directions. |
| 49 | */ | 49 | */ |
| 50 | void UpdateNextCirclePadState() { | 50 | static void UpdateNextCirclePadState() { |
| 51 | static const s16 max_value = 0x9C; | 51 | static const s16 max_value = 0x9C; |
| 52 | next_circle_x = next_state.circle_left ? -max_value : 0x0; | 52 | next_circle_x = next_state.circle_left ? -max_value : 0x0; |
| 53 | next_circle_x += next_state.circle_right ? max_value : 0x0; | 53 | next_circle_x += next_state.circle_right ? max_value : 0x0; |
| @@ -155,7 +155,7 @@ void PadUpdateComplete() { | |||
| 155 | * 7 : Gyroscope event | 155 | * 7 : Gyroscope event |
| 156 | * 8 : Event signaled by HID_User | 156 | * 8 : Event signaled by HID_User |
| 157 | */ | 157 | */ |
| 158 | void GetIPCHandles(Service::Interface* self) { | 158 | static void GetIPCHandles(Service::Interface* self) { |
| 159 | u32* cmd_buff = Service::GetCommandBuffer(); | 159 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 160 | 160 | ||
| 161 | cmd_buff[1] = 0; // No error | 161 | cmd_buff[1] = 0; // No error |
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index 6c02a43d9..420f53f8f 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp | |||
| @@ -13,7 +13,7 @@ namespace SRV { | |||
| 13 | 13 | ||
| 14 | Handle g_event_handle = 0; | 14 | Handle g_event_handle = 0; |
| 15 | 15 | ||
| 16 | void Initialize(Service::Interface* self) { | 16 | static void Initialize(Service::Interface* self) { |
| 17 | DEBUG_LOG(OSHLE, "called"); | 17 | DEBUG_LOG(OSHLE, "called"); |
| 18 | 18 | ||
| 19 | u32* cmd_buff = Service::GetCommandBuffer(); | 19 | u32* cmd_buff = Service::GetCommandBuffer(); |
| @@ -21,7 +21,7 @@ void Initialize(Service::Interface* self) { | |||
| 21 | cmd_buff[1] = 0; // No error | 21 | cmd_buff[1] = 0; // No error |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | void GetProcSemaphore(Service::Interface* self) { | 24 | static void GetProcSemaphore(Service::Interface* self) { |
| 25 | DEBUG_LOG(OSHLE, "called"); | 25 | DEBUG_LOG(OSHLE, "called"); |
| 26 | 26 | ||
| 27 | u32* cmd_buff = Service::GetCommandBuffer(); | 27 | u32* cmd_buff = Service::GetCommandBuffer(); |
| @@ -34,7 +34,7 @@ void GetProcSemaphore(Service::Interface* self) { | |||
| 34 | cmd_buff[3] = g_event_handle; | 34 | cmd_buff[3] = g_event_handle; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | void GetServiceHandle(Service::Interface* self) { | 37 | static void GetServiceHandle(Service::Interface* self) { |
| 38 | Result res = 0; | 38 | Result res = 0; |
| 39 | u32* cmd_buff = Service::GetCommandBuffer(); | 39 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 40 | 40 | ||