core: Apply static to local functions

This commit is contained in:
Lioncash 2015-02-13 10:40:07 -05:00
parent c44d75787b
commit 0c6434c379
11 changed files with 252 additions and 245 deletions

View file

@ -22,7 +22,7 @@ static std::vector<ModuleDef> g_module_db;
bool g_reschedule = false; ///< If true, immediately reschedules the CPU to a new thread
const FunctionDef* GetSVCInfo(u32 opcode) {
static const FunctionDef* GetSVCInfo(u32 opcode) {
u32 func_num = opcode & 0xFFFFFF; // 8 bits
if (func_num > 0xFF) {
LOG_ERROR(Kernel_SVC,"unknown svc=0x%02X", func_num);
@ -63,7 +63,7 @@ void RegisterModule(std::string name, int num_functions, const FunctionDef* func
g_module_db.push_back(module);
}
void RegisterAllModules() {
static void RegisterAllModules() {
SVC::Register();
}

View file

@ -17,7 +17,7 @@ namespace AC_U {
* 1 : Result of function, 0 on success, otherwise error code
* 2 : Output connection type, 0 = none, 1 = Old3DS Internet, 2 = New3DS Internet.
*/
void GetWifiStatus(Service::Interface* self) {
static void GetWifiStatus(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
// TODO(purpasmart96): This function is only a stub,

View file

@ -160,7 +160,7 @@ void GetAppletManInfo(Service::Interface* self) {
* 1 : Result of function, 0 on success, otherwise error code
* 2 : Output, 0 = not registered, 1 = registered.
*/
void IsRegistered(Service::Interface* self) {
static void IsRegistered(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 app_id = cmd_buff[1];
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
@ -191,7 +191,7 @@ void InquireNotification(Service::Interface* self) {
* 0 : Return Header
* 1 : Result of function, 0 on success, otherwise error code
*/
void SendParameter(Service::Interface* self) {
static void SendParameter(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 src_app_id = cmd_buff[1];
u32 dst_app_id = cmd_buff[2];
@ -291,7 +291,7 @@ void GlanceParameter(Service::Interface* self) {
* 2 : Status flag, 0 = failure due to no parameter data being available, or the above enabled
* fields don't match the fields in NS state. 1 = success.
*/
void CancelParameter(Service::Interface* self) {
static void CancelParameter(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 flag1 = cmd_buff[1];
u32 unk = cmd_buff[2];
@ -367,7 +367,7 @@ void GetSharedFont(Service::Interface* self) {
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
void SetAppCpuTimeLimit(Service::Interface* self) {
static void SetAppCpuTimeLimit(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 value = cmd_buff[1];
u32 percent = cmd_buff[2];
@ -390,7 +390,7 @@ void SetAppCpuTimeLimit(Service::Interface* self) {
* 1 : Result of function, 0 on success, otherwise error code
* 2 : System core CPU time percentage
*/
void GetAppCpuTimeLimit(Service::Interface* self) {
static void GetAppCpuTimeLimit(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 value = cmd_buff[1];

View file

@ -34,7 +34,7 @@ void SignalInterrupt() {
* 1 : Result of function, 0 on success, otherwise error code
* 2 : (inaddr << 1) + 0x1FF40000 (where 0x1FF00000 is the DSP RAM address)
*/
void ConvertProcessAddressFromDspDram(Service::Interface* self) {
static void ConvertProcessAddressFromDspDram(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 addr = cmd_buff[1];
@ -57,7 +57,7 @@ void ConvertProcessAddressFromDspDram(Service::Interface* self) {
* 1 : Result of function, 0 on success, otherwise error code
* 2 : Component loaded, 0 on not loaded, 1 on loaded
*/
void LoadComponent(Service::Interface* self) {
static void LoadComponent(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
cmd_buff[1] = 0; // No error
@ -74,7 +74,7 @@ void LoadComponent(Service::Interface* self) {
* 1 : Result of function, 0 on success, otherwise error code
* 3 : Semaphore event handle
*/
void GetSemaphoreEventHandle(Service::Interface* self) {
static void GetSemaphoreEventHandle(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
@ -92,7 +92,7 @@ void GetSemaphoreEventHandle(Service::Interface* self) {
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
void RegisterInterruptEvents(Service::Interface* self) {
static void RegisterInterruptEvents(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
auto evt = Kernel::g_handle_table.Get<Kernel::Event>(cmd_buff[4]);
@ -116,7 +116,7 @@ void RegisterInterruptEvents(Service::Interface* self) {
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
void WriteReg0x10(Service::Interface* self) {
static void WriteReg0x10(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
SignalInterrupt();
@ -137,7 +137,7 @@ void WriteReg0x10(Service::Interface* self) {
* 0 : Return header
* 1 : Result of function, 0 on success, otherwise error code
*/
void WriteProcessPipe(Service::Interface* self) {
static void WriteProcessPipe(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 number = cmd_buff[1];
@ -162,7 +162,7 @@ void WriteProcessPipe(Service::Interface* self) {
* 1 : Result of function, 0 on success, otherwise error code
* 2 : Number of bytes read from pipe
*/
void ReadPipeIfPossible(Service::Interface* self) {
static void ReadPipeIfPossible(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 size = cmd_buff[3] & 0xFFFF;// Lower 16 bits are size
@ -200,7 +200,7 @@ void ReadPipeIfPossible(Service::Interface* self) {
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
void SetSemaphoreMask(Service::Interface* self) {
static void SetSemaphoreMask(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 mask = cmd_buff[1];
@ -219,7 +219,7 @@ void SetSemaphoreMask(Service::Interface* self) {
* 2 : The headphone status response, 0 = Not using headphones?,
* 1 = using headphones?
*/
void GetHeadphoneStatus(Service::Interface* self) {
static void GetHeadphoneStatus(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
cmd_buff[1] = RESULT_SUCCESS.raw; // No error

View file

@ -7,6 +7,7 @@
#include "core/core.h"
#include "core/mem_map.h"
#include "core/hle/config_mem.h"
#include "core/hle/shared_page.h"
////////////////////////////////////////////////////////////////////////////////////////////////////