forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ctc0/cfc0 instructions

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
chrismulhearn



Joined: 22 Feb 2006
Posts: 80

PostPosted: Wed Mar 08, 2006 4:18 pm    Post subject: ctc0/cfc0 instructions Reply with quote

The r4000/r4400 manual states that "CTCz x, y" (move general register x to _control_ register y of Coprocessor(z)) and "CFCz x, y" are not valid z=0 (as in, coprocessor 0 has no _control_ registers.)

Apparantly this is not the case for Allegrex. Someone mentioned that they spotted CTC0 and CFC0 in a partial disassembly. I wrote some code to output all 32 "control" registers of CP0, and I can't really make sense of it, but someone with a firmware dump should find every case of CTC0 and CFC0 instructions and record the operands, so we can figure out just which of these registers are actually being used.


cp0c $0: [08900d78]cp0c $1: [00212180]cp0c $2: [20000403]cp0c $3: [00008400]
cp0c $4: [00000000]cp0c $5: [00001006]cp0c $6: [00212180]cp0c $7: [00212180]
cp0c $8: [8801ea00]cp0c $9: [8801cdc8]cp0c$10: [8801ce30]cp0 $11: [88021e74]
cp0c$12: [a802368c]cp0c$13: [000000fc]cp0c$14: [881b80c0]cp0c$15: [00000000]
cp0c$16: [88227668]cp0c$17: [20040420]cp0c$18: [8801ec38]cp0c$19: [2004b22a]
cp0c$20: [00212180]cp0c$21: [3c821600]cp0c$22: [fffffc34]cp0c$23: [de6bb002]
cp0c$24: [ba0b48f4]cp0c$25: [00000000]cp0c$26: [00212180]cp0c$27: [ccc6b9f4]
cp0c$28: [8801ec10]cp0c$29: [00212180]cp0c$30: [6ac408c0]cp0c$31: [00212180]
Back to top
View user's profile Send private message
groepaz



Joined: 01 Sep 2005
Posts: 305

PostPosted: Wed Mar 08, 2006 6:04 pm    Post subject: Reply with quote

äääh.....have you ever looked at pspinside? you are replicating some work here i think :)
_________________
http://www.hitmen-console.org
http://hitmen.c02.at/files/yapspd/
Back to top
View user's profile Send private message Visit poster's website
chrismulhearn



Joined: 22 Feb 2006
Posts: 80

PostPosted: Thu Mar 09, 2006 12:09 am    Post subject: Reply with quote

Then post a link! Someone (somewhere) has looked into the CP0 _config_ registers?
Back to top
View user's profile Send private message
HaQue



Joined: 25 Nov 2005
Posts: 91
Location: Adelaide, Australia

PostPosted: Thu Mar 09, 2006 12:51 am    Post subject: Reply with quote

This is a fantastic tool.
As your google is broken ;-) ... heres a link:

http://www.hitmen-console.org/ --> Playstation portable --> Releases -->pspinside v0.9q
_________________
www.smartwave-wireless.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chrismulhearn



Joined: 22 Feb 2006
Posts: 80

PostPosted: Thu Mar 09, 2006 2:13 am    Post subject: Reply with quote

Ahhh I assumed he was talking about a PLACE. oops! Should have googled. Plus my eyes have whizzed right by the word "psplink" about 1000 times in the last month.

I will have to check that tool out.

But anyone who already has a disassembly should be able to find out what arguments are being sent to ctc0 and cfc0, and then they should tell me. :-)

Perhaps we should start an "Allegrex CPU" thread, dedicated entirely to the mysteries inside this ASIC?
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Thu Mar 09, 2006 2:57 am    Post subject: Reply with quote

The control registers are used by the kernel for general purpose stuff, for example when an exception occurs it stores v0/v1 in I think control registers 4 and 5 at the start of the exception then uses them v0/v1 as general purpose regs, later exception handlers can then restore the values of v0/v1 at a later date.

They also use it again in exceptions to point to the dispatch tables for the various exception types, and one of them also points to the control block which is used to determine syscall dispatch.

Basically they are just simple non-gpr registers used by the kernel for what ever it feels like, there is no special significance to them and they could change from firmware revision to firmware revision.
Back to top
View user's profile Send private message
chrismulhearn



Joined: 22 Feb 2006
Posts: 80

PostPosted: Thu Mar 09, 2006 3:47 am    Post subject: Reply with quote

So... no top secret TLB then... nuts!
Back to top
View user's profile Send private message
HaQue



Joined: 25 Nov 2005
Posts: 91
Location: Adelaide, Australia

PostPosted: Thu Mar 09, 2006 1:27 pm    Post subject: Reply with quote

chrismulhearn wrote:
I will have to check that tool out.


You will! I think it will be an enormous eye opener for you, and probably answer heaps of questions in itself.
_________________
www.smartwave-wireless.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chrismulhearn



Joined: 22 Feb 2006
Posts: 80

PostPosted: Fri Mar 10, 2006 7:04 am    Post subject: Reply with quote

wow Haque, very uhhh helpful
Back to top
View user's profile Send private message
HaQue



Joined: 25 Nov 2005
Posts: 91
Location: Adelaide, Australia

PostPosted: Fri Mar 10, 2006 10:52 am    Post subject: Reply with quote

I know... wasnt exactly a fantastic post, I was trying to urge you into looking at the tool, thats all. If I want sarcasm I already have a wife ;)

Cheers
_________________
www.smartwave-wireless.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group