mirror of
https://github.com/wiiu-env/homebrew_launcher.git
synced 2024-11-24 05:39:18 +01:00
fixed random hang due to inline assembly
This commit is contained in:
parent
e33c9894f1
commit
1602ad7f7d
@ -20,6 +20,7 @@
|
||||
#include "fs/DirList.h"
|
||||
#include "fs/fs_utils.h"
|
||||
#include "utils/HomebrewXML.h"
|
||||
#include "utils/utils.h"
|
||||
#include "Application.h"
|
||||
|
||||
HomebrewLaunchWindow::HomebrewLaunchWindow(const std::string & launchPath, GuiImageData * iconImgData)
|
||||
@ -166,8 +167,7 @@ void HomebrewLaunchWindow::OnFileLoadFinish(GuiElement *element, const std::stri
|
||||
|
||||
if(result > 0)
|
||||
{
|
||||
u32 ApplicationMemoryEnd;
|
||||
asm volatile("lis %0, __CODE_END@h; ori %0, %0, __CODE_END@l" : "=r" (ApplicationMemoryEnd));
|
||||
u32 ApplicationMemoryEnd = getApplicationEndAddr();
|
||||
|
||||
ELF_DATA_ADDR = ApplicationMemoryEnd;
|
||||
ELF_DATA_SIZE = result;
|
||||
@ -181,8 +181,7 @@ void HomebrewLaunchWindow::OnLoadButtonClick(GuiButton *button, const GuiControl
|
||||
backBtn.setState(GuiElement::STATE_DISABLED);
|
||||
loadBtn.setState(GuiElement::STATE_DISABLED);
|
||||
|
||||
u32 ApplicationMemoryEnd;
|
||||
asm volatile("lis %0, __CODE_END@h; ori %0, %0, __CODE_END@l" : "=r" (ApplicationMemoryEnd));
|
||||
u32 ApplicationMemoryEnd = getApplicationEndAddr();
|
||||
|
||||
HomebrewLoader * loader = HomebrewLoader::loadToMemoryAsync(homebrewLaunchPath, (unsigned char*)ApplicationMemoryEnd);
|
||||
loader->setEffect(EFFECT_FADE, 15, 255);
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "fs/fs_utils.h"
|
||||
#include "system/AsyncDeleter.h"
|
||||
#include "utils/HomebrewXML.h"
|
||||
#include "utils/utils.h"
|
||||
#include "HomebrewLaunchWindow.h"
|
||||
|
||||
#define DEFAULT_WIILOAD_PORT 4299
|
||||
@ -328,8 +329,7 @@ void HomebrewWindow::OnTcpReceiveFinish(GuiElement *element, u32 ip, int result)
|
||||
|
||||
if(result > 0)
|
||||
{
|
||||
u32 ApplicationMemoryEnd;
|
||||
asm volatile("lis %0, __CODE_END@h; ori %0, %0, __CODE_END@l" : "=r" (ApplicationMemoryEnd));
|
||||
u32 ApplicationMemoryEnd = getApplicationEndAddr();
|
||||
|
||||
ELF_DATA_ADDR = ApplicationMemoryEnd;
|
||||
ELF_DATA_SIZE = result;
|
||||
|
@ -24,8 +24,7 @@ TcpReceiver::TcpReceiver(int port)
|
||||
height = progressWindow.getHeight();
|
||||
append(&progressWindow);
|
||||
|
||||
u32 ApplicationMemoryEnd;
|
||||
asm volatile("lis %0, __CODE_END@h; ori %0, %0, __CODE_END@l" : "=r" (ApplicationMemoryEnd));
|
||||
u32 ApplicationMemoryEnd = getApplicationEndAddr();
|
||||
|
||||
loadAddress = (unsigned char*)ApplicationMemoryEnd;
|
||||
resumeThread();
|
||||
|
5
src/utils/utils.S
Normal file
5
src/utils/utils.S
Normal file
@ -0,0 +1,5 @@
|
||||
.globl getApplicationEndAddr
|
||||
getApplicationEndAddr:
|
||||
lis r3, __CODE_END@h
|
||||
ori r3, r3, __CODE_END@l
|
||||
blr
|
@ -40,6 +40,8 @@ extern "C" {
|
||||
#define le32(i) ((((u32)le16((i) & 0xFFFF)) << 16) | ((u32)le16(((i) & 0xFFFF0000) >> 16)))
|
||||
#define le64(i) ((((u64)le32((i) & 0xFFFFFFFFLL)) << 32) | ((u64)le32(((i) & 0xFFFFFFFF00000000LL) >> 32)))
|
||||
|
||||
unsigned int getApplicationEndAddr(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user