Difference between revisions of "Kernel ABI"

From 3dbrew
Jump to navigation Jump to search
(Add ControlMemory)
(Add up to GetProcessIdealProcessor)
Line 19: Line 19:
 
<code>r0</code>: <code>Result</code><br>
 
<code>r0</code>: <code>Result</code><br>
 
<code>r1</code>: <code>u32 addr_out</code>
 
<code>r1</code>: <code>u32 addr_out</code>
 +
|-
 +
| 0x02
 +
| QueryMemory
 +
|
 +
<code>r2</code>?: <code>u32 addr</code>
 +
|
 +
<code>r0</code>: <code>Result</code><br>
 +
<code>r1</code>: <code>u32 base_process_virtual_address</code><br>
 +
<code>r2</code>: <code>u32 size</code><br>
 +
<code>r3</code>: <code>u32 permission</code><br>
 +
<code>r4</code>: <code>[[Memory_Management#enum_MemoryState|MemoryState]] state</code><br>
 +
<code>r5</code>: <code>[[Memory_Management#enum_PageFlags|PageFlags]] page_flags</code>
 +
|-
 +
| 0x03
 +
| ExitProcess
 +
| None
 +
| None
 +
|-
 +
| 0x04
 +
| GetProcessAffinityMask
 +
|
 +
<code>r0</code>: <code>[out] u8* affinitymask</code><br>
 +
<code>r1</code>: <code>Handle process</code><br>
 +
<code>r2</code>: <code>s32 processorcount</code>
 +
|
 +
<code>r0</code>: <code>Result</code>
 +
|-
 +
| 0x04
 +
| SetProcessAffinityMask
 +
|
 +
<code>r0</code>: <code>Handle process</code><br>
 +
<code>r1</code>: <code>[in] u8* affinitymask</code><br>
 +
<code>r2</code>: <code>s32 processorcount</code>
 +
|
 +
<code>r0</code>: <code>Result</code>
 +
|-
 +
| 0x05
 +
| GetProcessIdealProcessor
 +
|
 +
<code>r1</code>?: <code>Handle process</code>
 +
|
 +
<code>r0</code>: <code>Result</code><br>
 +
<code>r1</code>: <code>s32 processorid</code>
 
|-
 
|-
 
| 0x1B
 
| 0x1B

Revision as of 19:33, 4 January 2018

Inputs are read from registers starting from r0 and outputs are written back to the same registers (also starting with r0).

ID Name Inputs Outputs
0x01 ControlMemory

r0: MemoryOperation operation
r1: u32 addr0
r2: u32 addr1
r3: u32 size
r4: MemoryPermission permissions

r0: Result
r1: u32 addr_out

0x02 QueryMemory

r2?: u32 addr

r0: Result
r1: u32 base_process_virtual_address
r2: u32 size
r3: u32 permission
r4: MemoryState state
r5: PageFlags page_flags

0x03 ExitProcess None None
0x04 GetProcessAffinityMask

r0: [out] u8* affinitymask
r1: Handle process
r2: s32 processorcount

r0: Result

0x04 SetProcessAffinityMask

r0: Handle process
r1: [in] u8* affinitymask
r2: s32 processorcount

r0: Result

0x05 GetProcessIdealProcessor

r1?: Handle process

r0: Result
r1: s32 processorid

0x1B SetTimer Timer handle, initial_low, interval_low, initial_high, interval_high Result
0x2D ConnectToPort ??, pointer to port name Result, handle to KClientSession
0x32 SendSyncRequest handle to KClientSession Result