pspSdkGetK1 "bug"

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

Moderators: cheriff, TyRaNiD

Post Reply
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

pspSdkGetK1 "bug"

Post by moonlight »

I don't know if it's really a bug or if it's done on purpose, anyways i comment it here.

I can use the pspSdkSetK1 without problems, but with pspSdkGetK1 i always get a undefined reference in the linker.
Looking at the sources of k1set.S, the problem is easy to find:

Code: Select all

   set noreorder
   .set noat

   .global pspSdkSetK1
   .ent    pspSdkSetK1

pspSdkSetK1:
   move $v0, $k1
   jr	 $ra
   move $k1, $a0

   .end pspSdkSetK1

   .global pspSdkGetK1
   .ent    pspSdkGetK1

   jr   $ra
   move $v0, $k1

   .end    pspSdkGetK1
The label "pspSdkGetK1:" is missing.
It should be:

Code: Select all

   set noreorder
   .set noat

   .global pspSdkSetK1
   .ent    pspSdkSetK1

pspSdkSetK1:
   move $v0, $k1
   jr	 $ra
   move $k1, $a0

   .end pspSdkSetK1

   .global pspSdkGetK1
   .ent    pspSdkGetK1
pspSdkGetK1:   ### Label missing ###

   jr   $ra
   move $v0, $k1

   .end    pspSdkGetK1
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Aye a bug me thinks, I probably threw that into pspsdk and never bothered to actually check it worked cause psplink has its own version. Of course in general it doesn't get used alot and when it does you probably more likely to abitrarily set it to 0 and get the return from SetK1 anyway. Ill fix it ;)
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

TyRaNiD wrote:Aye a bug me thinks, I probably threw that into pspsdk and never bothered to actually check it worked cause psplink has its own version. Of course in general it doesn't get used alot and when it does you probably more likely to abitrarily set it to 0 and get the return from SetK1 anyway. Ill fix it ;)
Well, i'm actually doing the contrary, setting the k1 to 1 :D
I know it's something unusual, but it's the only way i've found to use the net functions from a kernel prx.
Anyways, the getK1 is not essential, i just tried to use it for doing some debug and i found that bug.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Really setting it to 1 makes a difference ? For one thing user threads I think are indicated by 0x10 and as the net libs are direct link and not through syscalls it shouldn't make a difference anyway. Still who knows ;)
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

Ok i get confused. i am experiencing weirds thing. Some things that didn't work before (crash)are working now.
I think i need some holidays :)
Post Reply