diff options
author | Andre Heider | 2010-09-05 12:37:07 +0000 |
---|---|---|
committer | Andre Heider | 2010-09-05 12:37:07 +0000 |
commit | 2c746709aac3bbd1e228cc9e2e675011d895bbc4 (patch) | |
tree | bfd64346c662e062cdc9cb1dcf805c08464ae7d7 | |
parent | 4ac6c6a1ddfd5d4b99b8cc4937ca730683758010 (diff) | |
download | scummvm-rg350-2c746709aac3bbd1e228cc9e2e675011d895bbc4.tar.gz scummvm-rg350-2c746709aac3bbd1e228cc9e2e675011d895bbc4.tar.bz2 scummvm-rg350-2c746709aac3bbd1e228cc9e2e675011d895bbc4.zip |
PLUGINS: Flush only memory ranges, not everything
svn-id: r52546
-rw-r--r-- | backends/plugins/elf-loader.cpp | 19 | ||||
-rw-r--r-- | backends/plugins/elf-loader.h | 2 |
2 files changed, 13 insertions, 8 deletions
diff --git a/backends/plugins/elf-loader.cpp b/backends/plugins/elf-loader.cpp index eb4891e641..231c2ffa22 100644 --- a/backends/plugins/elf-loader.cpp +++ b/backends/plugins/elf-loader.cpp @@ -39,7 +39,8 @@ #ifdef __PSP__ #include "backends/platform/psp/powerman.h" -#include "psputils.h" +#include <psputils.h> +#include <psputilsforkernel.h> #endif #ifdef __DS__ @@ -59,16 +60,20 @@ /** * Flushes the data cache (Platform Specific). */ -static void flushDataCache() { +static void flushDataCache(void *ptr, uint32 len) { #ifdef __DS__ - DC_FlushAll(); + DC_FlushRange(ptr, len); + IC_InvalidateRange(ptr, len); #endif #ifdef __PLAYSTATION2__ - FlushCache(0); - FlushCache(2); + (void) ptr; + (void) len; + FlushCache(0); + FlushCache(2); #endif #ifdef __PSP__ - sceKernelDcacheWritebackAll(); + sceKernelDcacheWritebackRange(ptr, len); + sceKernelIcacheInvalidateRange(ptr, len); #endif } @@ -326,7 +331,7 @@ bool DLObject::open(const char *path) { DBG("loaded!/n"); - flushDataCache(); + flushDataCache(_segment, _segmentSize); ctors_start = symbol("___plugin_ctors"); ctors_end = symbol("___plugin_ctors_end"); diff --git a/backends/plugins/elf-loader.h b/backends/plugins/elf-loader.h index 7150141567..fc6a022d34 100644 --- a/backends/plugins/elf-loader.h +++ b/backends/plugins/elf-loader.h @@ -47,7 +47,7 @@ protected: int _symtab_sect; void *_dtors_start, *_dtors_end; - int _segmentSize; + uint32 _segmentSize; //void seterror(const char *fmt, ...); virtual void unload(); |