VFPU instructions crash

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

Moderators: cheriff, TyRaNiD

Post Reply
Eib
Posts: 7
Joined: Wed Apr 15, 2009 4:56 am

VFPU instructions crash

Post by Eib »

Hi. Today i decided to rewrite some of my code to use VFPU and accidentally got a strange behavior. As soon as i add any VFPU instruction, code is crashed upon execution.
For testing, i modified GU/Lights sample from PSPSDK to compile into .PRX, added PSP_MAIN_THREAD_ATTR(THREAD_ATTR_VFPU) there, linked with pspmath library etc. And after all, i inserted single VFPU instruction "vfpu_srand(542.0f);". And as soon as i try to execute it - i get a crash :

Code: Select all

host0:/> lights.prx
Load/Start host0:/lights.prx UID: 0x0426F813 Name: Lights Sample
host0:/> Exception - Coprocessor unusable
Thread ID - 0x0426731F
Th Name   - main_thread
Module ID - 0x0426F813
Mod Name  - Lights Sample
EPC       - 0x08807228
Cause     - 0x2000002C
BadVAddr  - 0xFFEFFDBE
Status    - 0x20088613
zr:0x00000000 at:0x2008FF00 v0:0x00000001 v1:0x00000000
a0:0x0000021E a1:0x00000008 a2:0x880E0000 a3:0x00000008
t0:0x00000001 t1:0x00000035 t2:0x00000200 t3:0x880E57F0
t4:0x0BBBFE20 t5:0x00003E0C t6:0x08805F10 t7:0x20088600
s0:0x00110000 s1:0x08810000 s2:0x00000000 s3:0xDEADBEEF
s4:0x08820000 s5:0x08920000 s6:0x08920000 s7:0x08810000
t8:0x880E5818 t9:0x00000028 k0:0x0BBBFF00 k1:0x00000000
gp:0x08821B40 sp:0x0BBBFE28 fp:0x08930000 ra:0x088042F8
0x08807228: 0x48E20000 '...H' - mtv        $v0, S000
What could cause this ? Maybe VFPU need some kind of initialization ?

P.S. Sorry for bad english.
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

you seem to execute an VFPU instruction in a thread where THREAD_ATTR_VFPU was not set. Which is weird since you seem to be in the main thread. :/
Post Reply