| View previous topic :: View next topic |
| Author |
Message |
chrismulhearn
Joined: 22 Feb 2006 Posts: 80
|
Posted: Wed Mar 08, 2006 4:18 pm Post subject: ctc0/cfc0 instructions |
|
|
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 |
|
 |
groepaz

Joined: 01 Sep 2005 Posts: 305
|
|
| Back to top |
|
 |
chrismulhearn
Joined: 22 Feb 2006 Posts: 80
|
Posted: Thu Mar 09, 2006 12:09 am Post subject: |
|
|
| Then post a link! Someone (somewhere) has looked into the CP0 _config_ registers? |
|
| Back to top |
|
 |
HaQue
Joined: 25 Nov 2005 Posts: 91 Location: Adelaide, Australia
|
|
| Back to top |
|
 |
chrismulhearn
Joined: 22 Feb 2006 Posts: 80
|
Posted: Thu Mar 09, 2006 2:13 am Post subject: |
|
|
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 |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Thu Mar 09, 2006 2:57 am Post subject: |
|
|
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 |
|
 |
chrismulhearn
Joined: 22 Feb 2006 Posts: 80
|
Posted: Thu Mar 09, 2006 3:47 am Post subject: |
|
|
| So... no top secret TLB then... nuts! |
|
| Back to top |
|
 |
HaQue
Joined: 25 Nov 2005 Posts: 91 Location: Adelaide, Australia
|
Posted: Thu Mar 09, 2006 1:27 pm Post subject: |
|
|
| 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 |
|
 |
chrismulhearn
Joined: 22 Feb 2006 Posts: 80
|
Posted: Fri Mar 10, 2006 7:04 am Post subject: |
|
|
| wow Haque, very uhhh helpful |
|
| Back to top |
|
 |
HaQue
Joined: 25 Nov 2005 Posts: 91 Location: Adelaide, Australia
|
Posted: Fri Mar 10, 2006 10:52 am Post subject: |
|
|
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 |
|
 |
|