Don't clear the .bss section anymore, call the wut init functions only once, except the devop one

This commit is contained in:
Maschell 2020-06-03 19:33:09 +02:00
parent 2b517b5699
commit 42866ffbac
3 changed files with 6 additions and 6 deletions

View File

@ -157,6 +157,9 @@ void PluginManagement::callInitHooks(plugin_information_t *pluginInformation) {
CallHook(pluginInformation, WUPS_LOADER_HOOK_INIT_KERNEL); CallHook(pluginInformation, WUPS_LOADER_HOOK_INIT_KERNEL);
CallHook(pluginInformation, WUPS_LOADER_HOOK_INIT_OVERLAY); CallHook(pluginInformation, WUPS_LOADER_HOOK_INIT_OVERLAY);
CallHook(pluginInformation, WUPS_LOADER_HOOK_INIT_PLUGIN); CallHook(pluginInformation, WUPS_LOADER_HOOK_INIT_PLUGIN);
CallHook(pluginInformation, WUPS_LOADER_HOOK_INIT_WUT_MALLOC);
CallHook(pluginInformation, WUPS_LOADER_HOOK_INIT_WUT_NEWLIB);
CallHook(pluginInformation, WUPS_LOADER_HOOK_INIT_WUT_STDCPP);
DEBUG_FUNCTION_LINE("Done calling init hooks"); DEBUG_FUNCTION_LINE("Done calling init hooks");
} }
@ -168,11 +171,8 @@ void PluginManagement::PatchFunctionsAndCallHooks(plugin_information_t *gPluginI
DCFlushRange((void *) 0x00800000, 0x00800000); DCFlushRange((void *) 0x00800000, 0x00800000);
ICInvalidateRange((void *) 0x00800000, 0x00800000); ICInvalidateRange((void *) 0x00800000, 0x00800000);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_DEVOPTAB);
for (int32_t plugin_index = 0; plugin_index < gPluginInformation->number_used_plugins; plugin_index++) { for (int32_t plugin_index = 0; plugin_index < gPluginInformation->number_used_plugins; plugin_index++) {
CallHookEx(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_MALLOC, plugin_index);
CallHookEx(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_NEWLIB, plugin_index);
CallHookEx(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_STDCPP, plugin_index);
CallHookEx(gPluginInformation, WUPS_LOADER_HOOK_INIT_WUT_DEVOPTAB, plugin_index);
CallHookEx(gPluginInformation, WUPS_LOADER_HOOK_APPLICATION_START, plugin_index); CallHookEx(gPluginInformation, WUPS_LOADER_HOOK_APPLICATION_START, plugin_index);
new_PatchInvidualMethodHooks(&(gPluginInformation->plugin_data[plugin_index].info)); new_PatchInvidualMethodHooks(&(gPluginInformation->plugin_data[plugin_index].info));
CallHookEx(gPluginInformation, WUPS_LOADER_HOOK_FUNCTIONS_PATCHED, plugin_index); CallHookEx(gPluginInformation, WUPS_LOADER_HOOK_FUNCTIONS_PATCHED, plugin_index);

View File

@ -140,7 +140,7 @@ WUMS_APPLICATION_STARTS() {
if (pluginDataHeap != NULL) { if (pluginDataHeap != NULL) {
std::vector<PluginContainer> plugins = PluginContainerPersistence::loadPlugins(gPluginInformation); std::vector<PluginContainer> plugins = PluginContainerPersistence::loadPlugins(gPluginInformation);
PluginManagement::doRelocations(plugins, gPluginInformation->trampolines, DYN_LINK_TRAMPOLIN_LIST_LENGTH); PluginManagement::doRelocations(plugins, gPluginInformation->trampolines, DYN_LINK_TRAMPOLIN_LIST_LENGTH);
PluginManagement::memsetBSS(plugins); // PluginManagement::memsetBSS(plugins);
DCFlushRange((void *) 0x00800000, 0x00800000); DCFlushRange((void *) 0x00800000, 0x00800000);
ICInvalidateRange((void *) 0x00800000, 0x00800000); ICInvalidateRange((void *) 0x00800000, 0x00800000);

View File

@ -266,7 +266,7 @@ DECL(uint32_t, OSReceiveMessage, OSMessageQueue *queue, OSMessage *message, uint
CallHook(gPluginInformation, WUPS_LOADER_HOOK_ACQUIRED_FOREGROUND); CallHook(gPluginInformation, WUPS_LOADER_HOOK_ACQUIRED_FOREGROUND);
} else if (message->args[0] == 0xD1E0D1E0) { } else if (message->args[0] == 0xD1E0D1E0) {
CallHook(gPluginInformation, WUPS_LOADER_HOOK_APPLICATION_END); CallHook(gPluginInformation, WUPS_LOADER_HOOK_APPLICATION_END);
//CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_DEVOPTAB); CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_DEVOPTAB);
//gInBackground = false; //gInBackground = false;
//DCFlushRange(&gInBackground,4); //DCFlushRange(&gInBackground,4);
//unmount_sd_fat("sd"); //unmount_sd_fat("sd");