[QUESTION] How to flush instruction cache?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
theHobbit
Posts: 65
Joined: Sat Sep 30, 2006 5:26 am

[QUESTION] How to flush instruction cache?

Post by theHobbit »

Hi, i am trying to test the psx4all port for Dingoo on the PSP to learn about the mips recompiler it is using. But i found it uses the function cacheflush defined in sys/cachectl.h to flush the instruction cache, and it seems it isn´t available on the pspsdk. I found more about it here cacheflush

Is there an instruction to flush the instruction cache on the PSP?.

Thanks in advance.
psPea
Posts: 60
Joined: Sat Sep 01, 2007 12:51 pm

Post by psPea »

sceKernelIcacheInvalidateAll()
it requires kernel mode i believe
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

Following the description of cacheflush, it would rather be
sceKernelDCacheInvalidateRange(*addr, size);
sceKernelICacheInvalidateRange(*addr, size);
or
sceKernelDCacheWritebackInvalidateRange(*addr, size);
sceKernelICacheWritebackInvalidateRange(*addr, size);
depending on need.

Write a wrapper function and and it should be ok.
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
theHobbit
Posts: 65
Joined: Sat Sep 30, 2006 5:26 am

Post by theHobbit »

Thanks for your answers, i will test those :).
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

sheeh, another guy trying to port it... a port of a port of a port... dude, it's like redoing ps1p or psxp...
Post Reply