hocclk: format code
use clang format file provided for optimal formatting
This commit is contained in:
1 parent
c6a8884c14
commit
88bfa9a4ec
118 files changed
+7111
-9615
No files matched your search
@@ -27,115 +27,106 @@
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <malloc.h>
|
||||
|
||||
#include <switch.h>
|
||||
|
||||
#include "board/board.hpp"
|
||||
#include "file/config.hpp"
|
||||
#include "file/errors.hpp"
|
||||
#include "file/file_utils.hpp"
|
||||
#include "board/board.hpp"
|
||||
#include "hos/process_management.hpp"
|
||||
#include "mgr/clock_manager.hpp"
|
||||
#include "ipc/ipc_service.hpp"
|
||||
#include "file/config.hpp"
|
||||
#include "mgr/clock_manager.hpp"
|
||||
|
||||
|
||||
#define INNER_HEAP_SIZE 0x40000
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void virtmemSetup(void);
|
||||
extern "C" {
|
||||
void virtmemSetup(void);
|
||||
|
||||
extern std::uint32_t __start__;
|
||||
extern std::uint32_t __start__;
|
||||
|
||||
std::uint32_t __nx_applet_type = AppletType_None;
|
||||
TimeServiceType __nx_time_service_type = TimeServiceType_System;
|
||||
std::uint32_t __nx_fs_num_sessions = 1;
|
||||
u32 __nx_nv_transfermem_size = 0x8000;
|
||||
size_t nx_inner_heap_size = INNER_HEAP_SIZE;
|
||||
char nx_inner_heap[INNER_HEAP_SIZE];
|
||||
NvServiceType __nx_nv_service_type = NvServiceType_Factory;
|
||||
std::uint32_t __nx_applet_type = AppletType_None;
|
||||
TimeServiceType __nx_time_service_type = TimeServiceType_System;
|
||||
std::uint32_t __nx_fs_num_sessions = 1;
|
||||
u32 __nx_nv_transfermem_size = 0x8000;
|
||||
size_t nx_inner_heap_size = INNER_HEAP_SIZE;
|
||||
char nx_inner_heap[INNER_HEAP_SIZE];
|
||||
NvServiceType __nx_nv_service_type = NvServiceType_Factory;
|
||||
|
||||
// Ty to MasaGratoR for this!
|
||||
// This is done to save some space as they have no practical use in our case
|
||||
void* __real___cxa_throw(void *thrown_exception, void *pvar, void (*dest)(void *));
|
||||
void* __real__Unwind_Resume();
|
||||
void* __real___gxx_personality_v0();
|
||||
// Ty to MasaGratoR for this!
|
||||
// This is done to save some space as they have no practical use in our case
|
||||
void *__real___cxa_throw(void *thrown_exception, void *pvar, void (*dest)(void *));
|
||||
void *__real__Unwind_Resume();
|
||||
void *__real___gxx_personality_v0();
|
||||
|
||||
void __wrap___cxa_throw(void *thrown_exception, void *pvar, void (*dest)(void *)) {
|
||||
abort();
|
||||
}
|
||||
|
||||
void __wrap__Unwind_Resume() {
|
||||
return;
|
||||
}
|
||||
|
||||
void __wrap___gxx_personality_v0() {
|
||||
return;
|
||||
}
|
||||
|
||||
void __libnx_initheap(void)
|
||||
{
|
||||
void* addr = nx_inner_heap;
|
||||
size_t size = nx_inner_heap_size;
|
||||
|
||||
/* Newlib Heap Management */
|
||||
extern char* fake_heap_start;
|
||||
extern char* fake_heap_end;
|
||||
|
||||
fake_heap_start = (char*)addr;
|
||||
fake_heap_end = (char*)addr + size;
|
||||
|
||||
virtmemSetup();
|
||||
}
|
||||
|
||||
void __appInit(void)
|
||||
{
|
||||
if (R_FAILED(smInitialize()))
|
||||
{
|
||||
fatalThrow(MAKERESULT(Module_Libnx, LibnxError_InitFail_SM));
|
||||
}
|
||||
|
||||
Result rc = setsysInitialize();
|
||||
if (R_SUCCEEDED(rc))
|
||||
{
|
||||
SetSysFirmwareVersion fw;
|
||||
rc = setsysGetFirmwareVersion(&fw);
|
||||
if (R_SUCCEEDED(rc))
|
||||
hosversionSet(MAKEHOSVERSION(fw.major, fw.minor, fw.micro));
|
||||
setsysExit();
|
||||
}
|
||||
|
||||
// rc = fanInitialize();
|
||||
// if (R_FAILED(rc))
|
||||
// diagAbortWithResult(MAKERESULT(Module_Libnx, LibnxError_ShouldNotHappen));
|
||||
|
||||
rc = i2cInitialize();
|
||||
if (R_FAILED(rc))
|
||||
diagAbortWithResult(MAKERESULT(Module_Libnx, LibnxError_ShouldNotHappen));
|
||||
|
||||
}
|
||||
|
||||
void __appExit(void)
|
||||
{
|
||||
// CloseFanControllerThread();
|
||||
// fanExit();
|
||||
i2cExit();
|
||||
setsysExit();
|
||||
fsdevUnmountAll();
|
||||
fsExit();
|
||||
smExit();
|
||||
}
|
||||
void __wrap___cxa_throw(void *thrown_exception, void *pvar, void (*dest)(void *)) {
|
||||
abort();
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
Result rc = fileUtils::Initialize();
|
||||
void __wrap__Unwind_Resume() {
|
||||
return;
|
||||
}
|
||||
|
||||
void __wrap___gxx_personality_v0() {
|
||||
return;
|
||||
}
|
||||
|
||||
void __libnx_initheap(void) {
|
||||
void *addr = nx_inner_heap;
|
||||
size_t size = nx_inner_heap_size;
|
||||
|
||||
/* Newlib Heap Management */
|
||||
extern char *fake_heap_start;
|
||||
extern char *fake_heap_end;
|
||||
|
||||
fake_heap_start = (char *)addr;
|
||||
fake_heap_end = (char *)addr + size;
|
||||
|
||||
virtmemSetup();
|
||||
}
|
||||
|
||||
void __appInit(void) {
|
||||
if (R_FAILED(smInitialize())) {
|
||||
fatalThrow(MAKERESULT(Module_Libnx, LibnxError_InitFail_SM));
|
||||
}
|
||||
|
||||
Result rc = setsysInitialize();
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
SetSysFirmwareVersion fw;
|
||||
rc = setsysGetFirmwareVersion(&fw);
|
||||
if (R_SUCCEEDED(rc))
|
||||
hosversionSet(MAKEHOSVERSION(fw.major, fw.minor, fw.micro));
|
||||
setsysExit();
|
||||
}
|
||||
|
||||
// rc = fanInitialize();
|
||||
// if (R_FAILED(rc))
|
||||
// diagAbortWithResult(MAKERESULT(Module_Libnx, LibnxError_ShouldNotHappen));
|
||||
|
||||
rc = i2cInitialize();
|
||||
if (R_FAILED(rc))
|
||||
{
|
||||
diagAbortWithResult(MAKERESULT(Module_Libnx, LibnxError_ShouldNotHappen));
|
||||
}
|
||||
|
||||
void __appExit(void) {
|
||||
// CloseFanControllerThread();
|
||||
// fanExit();
|
||||
i2cExit();
|
||||
setsysExit();
|
||||
fsdevUnmountAll();
|
||||
fsExit();
|
||||
smExit();
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
Result rc = fileUtils::Initialize();
|
||||
if (R_FAILED(rc)) {
|
||||
fatalThrow(rc);
|
||||
return 1;
|
||||
}
|
||||
config::Initialize();
|
||||
config::Refresh(); // Get config from file
|
||||
config::Refresh(); // Get config from file
|
||||
|
||||
board::Initialize();
|
||||
processManagement::Initialize();
|
||||
@@ -145,7 +136,6 @@ int main(int argc, char** argv)
|
||||
clockManager::Initialize();
|
||||
ipcService::Initialize();
|
||||
|
||||
|
||||
clockManager::SetRunning(true);
|
||||
config::SetEnabled(true);
|
||||
ipcService::SetRunning(true);
|
||||
@@ -154,8 +144,7 @@ int main(int argc, char** argv)
|
||||
// InitFanController(table);
|
||||
// StartFanControllerThread();
|
||||
|
||||
while (clockManager::Running())
|
||||
{
|
||||
while (clockManager::Running()) {
|
||||
clockManager::Tick();
|
||||
clockManager::WaitForNextTick();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user