mirror of
https://github.com/wiiu-env/EnvironmentLoader.git
synced 2024-11-01 04:55:05 +01:00
Flush the caches after doing the relocations
This commit is contained in:
parent
2db63bafab
commit
e3b8de0204
@ -122,9 +122,6 @@ bool ElfUtils::doRelocation(std::vector<std::shared_ptr<RelocationData>> &relocD
|
||||
if (err != OS_DYNLOAD_OK || rplHandle == 0) {
|
||||
// only acquire if not already loaded.
|
||||
auto res = OSDynLoad_Acquire(rplName.c_str(), &rplHandle);
|
||||
DEBUG_FUNCTION_LINE("OSDynLoad_Acquire %s: %d", rplName.c_str(), res);
|
||||
} else {
|
||||
DEBUG_FUNCTION_LINE("already acquired %08X", rplHandle);
|
||||
}
|
||||
|
||||
uint32_t functionAddress = 0;
|
||||
|
@ -77,8 +77,8 @@ int main(int argc, char **argv) {
|
||||
VPADRead(VPAD_CHAN_0, &vpad_data, 1, &err);
|
||||
|
||||
uint32_t btn = 0;
|
||||
if(err == VPAD_READ_SUCCESS) {
|
||||
btn = vpad_data.hold | vpad_data.trigger;
|
||||
if (err == VPAD_READ_SUCCESS) {
|
||||
btn = vpad_data.hold | vpad_data.trigger;
|
||||
}
|
||||
|
||||
std::string environment_path = "fs:/vol/external01/wiiu/environments/default";
|
||||
@ -110,6 +110,9 @@ int main(int argc, char **argv) {
|
||||
DEBUG_FUNCTION_LINE("Relocation done");
|
||||
}
|
||||
|
||||
DCFlushRange((void *) moduleData.value()->getStartAddress(), moduleData.value()->getEndAddress() - moduleData.value()->getStartAddress());
|
||||
ICInvalidateRange((void *) moduleData.value()->getStartAddress(), moduleData.value()->getEndAddress() - moduleData.value()->getStartAddress());
|
||||
|
||||
DEBUG_FUNCTION_LINE("Calling entrypoint @%08X", moduleData.value()->getEntrypoint());
|
||||
char *arr[1];
|
||||
arr[0] = (char *) environment_path.c_str();
|
||||
|
@ -45,7 +45,25 @@ public:
|
||||
return entrypoint;
|
||||
}
|
||||
|
||||
void setStartAddress(uint32_t addr) {
|
||||
this->startAddress = addr;
|
||||
}
|
||||
|
||||
void setEndAddress(uint32_t _endAddress) {
|
||||
this->endAddress = _endAddress;
|
||||
}
|
||||
|
||||
[[nodiscard]] uint32_t getStartAddress() const {
|
||||
return startAddress;
|
||||
}
|
||||
|
||||
[[nodiscard]] uint32_t getEndAddress() const {
|
||||
return endAddress;
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<std::shared_ptr<RelocationData>> relocation_data_list;
|
||||
uint32_t entrypoint = 0;
|
||||
uint32_t startAddress = 0;
|
||||
uint32_t endAddress = 0;
|
||||
};
|
||||
|
@ -136,6 +136,8 @@ ModuleDataFactory::load(const std::string &path, uint32_t *destination_address_p
|
||||
|
||||
free(destinations);
|
||||
|
||||
moduleData->setStartAddress(*destination_address_ptr);
|
||||
moduleData->setEndAddress(endAddress);
|
||||
moduleData->setEntrypoint(entrypoint);
|
||||
DEBUG_FUNCTION_LINE("Saved entrypoint as %08X", entrypoint);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user