Difference between revisions of "HIPC"

From Nintendo Switch Brew
Jump to navigation Jump to search
Line 7: Line 7:
 
| 0 || 19-16 || Number of marshalls type X (each: 2 words).
 
| 0 || 19-16 || Number of marshalls type X (each: 2 words).
 
|-
 
|-
| 0 || 23-20 || Number of marshalls type Y (each: 3 words).
+
| 0 || 23-20 || Number of inbufs (each: 3 words). Type mask: 5
 
|-
 
|-
| 0 || 27-24 || Number of marshalls type Z (each: 3 words).
+
| 0 || 27-24 || Number of outbufs (each: 3 words). Type mask: 6
 
|-
 
|-
 
| 0 || 31-28 || Number of marshalls type W (each: 3 words)
 
| 0 || 31-28 || Number of marshalls type W (each: 3 words)
Line 15: Line 15:
 
| 1 || 9-0 || Size of data portion in u32's.
 
| 1 || 9-0 || Size of data portion in u32's.
 
|-
 
|-
| 1 || 13-10 || Marshalls type T something.  
+
| 1 || 13-10 || Marshal type T something.  
 
|-
 
|-
| 1 || 17-14 || Marshalls type T something.  
+
| 1 || 17-14 || Marshal type T something.  
 
|-
 
|-
 
| 1 || 31 || Enable special descriptor.
 
| 1 || 31 || Enable special descriptor.
Line 46: Line 46:
 
| 1 || || A-words, purpose unknown.
 
| 1 || || A-words, purpose unknown.
 
|-
 
|-
| x || || B-words, purpose unknown.
+
| 1+x || || B-words, purpose unknown.
 
|}
 
|}
  
=== Descriptor type A ===
+
=== Inbuf/outbuf Descriptor ===
 +
They fucked up this one, big time.
 +
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
! Word || Description
+
! Word || Bits || Description
 +
|-
 +
| 0 || || Lower 32-bits of size.
 +
|-
 +
| 1 || || Lower 32-bits of address.
 +
|-
 +
| 2 || 1-0 || Unknown flag.
 
|-
 
|-
| 0 || Word1 is written here.
+
| 2 || 4-2 || Bit 38-36 of address.
 
|-
 
|-
| 1 || Word0 is written here.
+
| 2 || 27-24 || Bit 35-32 of size.
 
|-
 
|-
| 2 || Weird mix.
+
| 2 || 31-28 || Bit 35-32 of address.
 
|}
 
|}
  

Revision as of 23:28, 13 April 2017

Marshall Portion

This is an array of u32's.

Word Bits Description
0 19-16 Number of marshalls type X (each: 2 words).
0 23-20 Number of inbufs (each: 3 words). Type mask: 5
0 27-24 Number of outbufs (each: 3 words). Type mask: 6
0 31-28 Number of marshalls type W (each: 3 words)
1 9-0 Size of data portion in u32's.
1 13-10 Marshal type T something.
1 17-14 Marshal type T something.
1 31 Enable special descriptor.
... Special descriptor, if enabled.
... Type X descriptors, each one 2 words.
... Type Y descriptors, each one 3 words.
... Type Z descriptors, each one 3 words.
... Type W descriptors, each one 3 words.

Special descriptor

There can only be one of this descriptor type. It is enabled by bit31 of the second word.

Word Bits Description
0 0 ?
0 4-1 Number of A-words for this special descriptor (=x).
0 8-5 Number of B-words for this special descriptor (=y).
1 A-words, purpose unknown.
1+x B-words, purpose unknown.

Inbuf/outbuf Descriptor

They fucked up this one, big time.

Word Bits Description
0 Lower 32-bits of size.
1 Lower 32-bits of address.
2 1-0 Unknown flag.
2 4-2 Bit 38-36 of address.
2 27-24 Bit 35-32 of size.
2 31-28 Bit 35-32 of address.

Descriptor type B

Word Description
0 Lower 32-bits of addr?
1 Upper 16bits: Size, Lower 16bits: Rest of addr?

Descriptor type C

Word Description
0 Upper 16bits: Size, Lower 16: ?
1 ?

Data Portion

This is an array of u64's placed after the marshall header. But it's always aligned to 16 so sometimes there is padding words inserted inbetween.

Word Description
0 Magic ("SFCI")
1 Cmd id
... Non-marshalled data is placed here

Cmd header

Cmd header 1 Cmd header 2 Description
4 9 Data portion size 20.
4 10 Data portion size 24.
4 12 Data portion size 32.
4 14 Data portion size 40.
4 0x8000000C Marshall words: (u32) 1. Data portion size 32.