SceSblSmschedProxy: Difference between revisions

From Vita Development Wiki
Jump to navigation Jump to search
No edit summary
Line 35: Line 35:
#define CRY_INTERRUPT_INDEX3 3
#define CRY_INTERRUPT_INDEX3 3


#define F00D_FIFO_REGISTER_INDEX1 1
#define MAILBOX_ID1 1
#define F00D_FIFO_REGISTER_INDEX2 2
#define MAILBOX_ID2 2
#define F00D_FIFO_REGISTER_INDEX3 3
#define MAILBOX_ID3 3


enum SmStatus
enum SmStatus {
{
   SM_STATUS_1 = 0x1,
   SM_STATUS_1 = 0x1,
   SM_STATUS_2 = 0x2,
   SM_STATUS_2 = 0x2,
Line 97: Line 96:
! Version !! NID
! Version !! NID
|-
|-
| 0.940-3.60 || 0x1916509B
| 0.931-3.60 || 0x1916509B
|}
|}


Line 107: Line 106:


<source lang="c">
<source lang="c">
struct sm_invoke_data_block_input
typedef struct sm_invoke_data_block_input {
{
   int unk0;
   int unk0;
   int unk4;
   int unk4;
   int unk8;
   int unk8;
   int unkC;
   int unkC;
};
} sm_invoke_data_block_input;


// paddr = Physical address of the buffer containing the result of ksceKernelGetPaddrList (req.output_buffer)
// paddr = Physical address of the buffer containing the result of sceKernelVARangeToPAVectorForDriver (req.output_buffer)
// num_pairs = number of (paddr, size) pairs in the buffer returned by ksceKernelGetPaddrList (ret_count)
// num_pairs = number of (paddr, size) pairs in the buffer returned by sceKernelVARangeToPAVectorForDriver (ret_count)
int sceSblSmSchedProxyInvokeForKernel(int priority, void *sm_self_data_paddr, unsigned int num_pairs, sm_invoke_data_block_input *invoke_input, SceSblSmCommContext130 *ctx, SmOperationId *id);
int sceSblSmSchedProxyInvokeForKernel(int priority, void *sm_self_data_paddr, unsigned int num_pairs, sm_invoke_data_block_input *invoke_input, SceSblSmCommContext130 *ctx, SmOperationId *req_id);
</source>
</source>


Line 137: Line 135:
};
};


int sceSblSmSchedProxyWaitForKernel(SmOperationId id, smc_12E_data_t* result);
int sceSblSmSchedProxyWaitForKernel(SmOperationId req_id, smc_12E_data_t* result);
</source>
</source>


Line 157: Line 155:
};
};


int sceSblSmSchedProxyGetStatusForKernel(SmOperationId id, smc_12F_data_t* status);
int sceSblSmSchedProxyGetStatusForKernel(SmOperationId req_id, smc_12F_data_t* status);
</source>
</source>


Line 172: Line 170:
Executes [[SceExcpmgr|smc 0x130]] call.
Executes [[SceExcpmgr|smc 0x130]] call.


<source lang="C">int sceSblSmSchedProxyKillForKernel(SmOperationId id);</source>
<source lang="C">int sceSblSmSchedProxyKillForKernel(SmOperationId req_id);</source>


=== sceSblSmSchedProxyNotImplementedMaybeSMC0x131ForKernel ===
=== sceSblSmSchedProxyNotImplementedMaybeSMC0x131ForKernel ===
Line 209: Line 207:
Called by [[SceSblSsSmComm#sceSblSmCommCallFunc|sceSblSmCommCallFunc]].
Called by [[SceSblSsSmComm#sceSblSmCommCallFunc|sceSblSmCommCallFunc]].


* f00d_fifo_register_index - second smc arg
* mailbox_id - second smc arg
* cmd_paddr - third smc arg
* cmd_paddr - third smc arg


<source lang="c">
<source lang="c">
// f00d_cmd_fifo_idx can be 1, 2 or 3
// f00d_cmd_fifo_idx can be 1, 2 or 3
int sceSblSmSchedCallFuncForKernel(SmOperationId id, int f00d_fifo_register_index, SceSblSmschedCallFuncCommand* cmd_paddr);
int sceSblSmSchedCallFuncForKernel(SmOperationId req_id, int mailbox_id, SceSblSmschedCallFuncCommand* cmd_paddr);
</source>
</source>


Line 229: Line 227:
executes [[SceExcpmgr|smc 0x134]] call
executes [[SceExcpmgr|smc 0x134]] call


<source lang="C">int sceSblSmSchedProxyGetCommandF00DRegisterForKernel(SmOperationId id, int f00d_fifo_register_index, SceSblSmschedCallFuncCommand** cmd_paddr);</source>
<source lang="C">int sceSblSmSchedProxyGetCommandF00DRegisterForKernel(SmOperationId req_id, int mailbox_id, SceSblSmschedCallFuncCommand** cmd_paddr);</source>


=== sceSblSmSchedProxyGetUnknownF00DRegisterForKernel ===
=== sceSblSmSchedProxyGetUnknownF00DRegisterForKernel ===
Line 241: Line 239:
executes [[SceExcpmgr|smc 0x135]] call
executes [[SceExcpmgr|smc 0x135]] call


<source lang="C">int sceSblSmSchedProxyGetUnknownF00DRegisterForKernel(SmOperationId id, int f00d_fifo_register_index, int f00d_fifo_register_value);</source>
<source lang="C">int sceSblSmSchedProxyGetUnknownF00DRegisterForKernel(SmOperationId req_id, int mailbox_id, int f00d_fifo_register_value);</source>


=== sceSblSmSchedProxyWriteCry2ArmForKernel ===
=== sceSblSmSchedProxyWriteCry2ArmForKernel ===
Line 248: Line 246:
! Version !! NID
! Version !! NID
|-
|-
| 0.940-3.60 || 0x15B0E4DF
| 0.931-3.60 || 0x15B0E4DF
|}
|}


Line 257: Line 255:
Used by [[SceSblAuthMgr]].
Used by [[SceSblAuthMgr]].


<source lang="C">int sceSblSmSchedProxyWriteCry2ArmForKernel(SmOperationId id, int f00d_fifo_register_index, int status_code);</source>
<source lang="C">int sceSblSmSchedProxyWriteCry2ArmForKernel(SmOperationId req_id, int mailbox_id, int mailval);</source>


=== sceSblSmSchedProxyReadCry2ArmForKernel ===
=== sceSblSmSchedProxyReadCry2ArmForKernel ===
Line 264: Line 262:
! Version !! NID
! Version !! NID
|-
|-
| 0.940-3.60 || 0x973A4A7D
| 0.931-3.60 || 0x973A4A7D
|}
|}


Line 275: Line 273:
Used by [[SceSblAuthMgr]].
Used by [[SceSblAuthMgr]].


<source lang="C">int sceSblSmSchedProxyReadCry2ArmForKernel(SmOperationId id, int f00d_fifo_register_index, int* status_code);</source>
<source lang="C">int sceSblSmSchedProxyReadCry2ArmForKernel(SmOperationId req_id, int mailbox_id, int* mailval);</source>


=== sceSblSmSchedProxyRegisterIntrHandlerForKernel ===
=== sceSblSmSchedProxyRegisterIntrHandlerForKernel ===
Line 282: Line 280:
! Version !! NID
! Version !! NID
|-
|-
| 0.940-3.60 || 0x8B84AC2A
| 0.931-3.60 || 0x8B84AC2A
|}
|}


Line 294: Line 292:


<source lang="C">
<source lang="C">
typedef int smc_138_callback(SmOperationId id, int intr_index, int arg2, int arg3, int arg4);
typedef int sceSblIntrHandlerforInvoke(SmOperationId req_id, int intr_index, int arg2, int arg3, int arg4);


int sceSblSmSchedProxyRegisterIntrHandlerForKernel(SmOperationId id, int intr_index, smc_138_callback *cb, int func_arg2);
int sceSblSmSchedProxyRegisterIntrHandlerForKernel(SmOperationId req_id, int intr_index, sceSblIntrHandlerforInvoke *cb, int smcArg1_funcArg1);
</source>
</source>


Line 304: Line 302:
! Version !! NID
! Version !! NID
|-
|-
| 0.940-3.60 || 0x85EDA5FC
| 0.931-3.60 || 0x85EDA5FC
|}
|}


Line 313: Line 311:
Called by [[SceSblAuthMgr]].
Called by [[SceSblAuthMgr]].


<source lang="C">int sceSblSmSchedProxyReleaseIntrHandlerForKernel(SmOperationId id, int intr_index);</source>
<source lang="C">int sceSblSmSchedProxyReleaseIntrHandlerForKernel(SmOperationId req_id, int intr_index);</source>


=== sceSblSmSchedProxyUninitializeForKernel ===
=== sceSblSmSchedProxyUninitializeForKernel ===
Line 348: Line 346:
[[SceSdif]] at [[SceSdif#init|init]] (at PSVita boot and maybe called after PSVita resume):
[[SceSdif]] at [[SceSdif#init|init]] (at PSVita boot and maybe called after PSVita resume):
<source lang="C">sceSblSmSchedProxyExecuteF00DCommandForKernel(3, 0, 0, 0);</source>
<source lang="C">sceSblSmSchedProxyExecuteF00DCommandForKernel(3, 0, 0, 0);</source>


[[Category:Modules]]
[[Category:Modules]]
[[Category:Kernel]]
[[Category:Kernel]]

Revision as of 11:47, 20 December 2019

Module

Known NIDs

Version Name World Privilege NID
1.69 SceSblSmschedProxy Non-secure Kernel 0xF3BC3013
3.60 SceSblSmschedProxy Non-secure Kernel 0x254B02B3

Libraries

Known NIDs

Version Name World Visibility NID
1.69 SceSblSmSchedProxyForKernel Non-secure Kernel 0x15F25C84
3.60 SceSblSmSchedProxyForKernel Non-secure Kernel 0x15F25C84

Types


typedef unsigned int SmOperationId;

#define CRY_INTERRUPT_INDEX0 0
#define CRY_INTERRUPT_INDEX1 1
#define CRY_INTERRUPT_INDEX2 2
#define CRY_INTERRUPT_INDEX3 3

#define MAILBOX_ID1 1
#define MAILBOX_ID2 2
#define MAILBOX_ID3 3

enum SmStatus {
   SM_STATUS_1 = 0x1,
   SM_STATUS_2 = 0x2,
   SM_STATUS_3 = 0x3,
   SM_STATUS_4 = 0x4,
   SM_STATUS_5 = 0x5,
   SM_STATUS_6 = 0x6,
   SM_STATUS_7 = 0x7,
   SM_STATUS_8 = 0x8,
   SM_STATUS_9 = 0x9,
   SM_STATUS_A = 0xA,
   SM_STATUS_B = 0xB,
   SM_STATUS_C = 0xC,
};

enum class F00D_cmd_index
{
   F00D_CMD_B_INDEX = 0,
   F00D_CMD_C_INDEX = 1,
   F00D_CMD_D_INDEX = 2,
   F00D_CMD_E_INDEX = 3,
   F00D_CMD_F_INDEX = 4,
};

typedef struct SceSblSmschedCallFuncCommand {
	unsigned int size;
	unsigned int service_id;
	unsigned int response;
	unsigned int unk2;
	unsigned int padding[(0x40 - 0x10) / 4];
	unsigned int data[0];
} SceSblSmschedCallFuncCommand; /* size = 0X40 + ... */

SceSblSmSchedProxyForKernel

sceSblSmSchedProxyInitializeForKernel

Version NID
3.60 0xA488D604

Calls module_start if cpuid is 0.

int sceSblSmSchedProxyInitializeForKernel();

sceSblSmSchedProxyInvokeForKernel

Temp name was sceSblSmSchedProxyCreateSmOperationForKernel.

Version NID
0.931-3.60 0x1916509B

Executes smc 0x12D call.

  • priority - first smc arg
  • sm_self_data_paddr - second smc arg
  • num_pairs - third smc arg
typedef struct sm_invoke_data_block_input {
  int unk0;
  int unk4;
  int unk8;
  int unkC;
} sm_invoke_data_block_input;

// paddr = Physical address of the buffer containing the result of sceKernelVARangeToPAVectorForDriver (req.output_buffer)
// num_pairs = number of (paddr, size) pairs in the buffer returned by sceKernelVARangeToPAVectorForDriver (ret_count)
int sceSblSmSchedProxyInvokeForKernel(int priority, void *sm_self_data_paddr, unsigned int num_pairs, sm_invoke_data_block_input *invoke_input, SceSblSmCommContext130 *ctx, SmOperationId *req_id);

sceSblSmSchedProxyWaitForKernel

Version NID
0.940-3.60 0xF35EFC1A

Executes smc 0x12E call.

struct smc_12E_data_t
{
  int status0;
  SmStatus status1;
};

int sceSblSmSchedProxyWaitForKernel(SmOperationId req_id, smc_12E_data_t* result);

sceSblSmSchedProxyGetStatusForKernel

Version NID
0.940-3.60 0x27EB92F1

Executes smc 0x12F call.

struct smc_12F_data_t
{
  int status0;
  SmStatus status1;
};

int sceSblSmSchedProxyGetStatusForKernel(SmOperationId req_id, smc_12F_data_t* status);

sceSblSmSchedProxyKillForKernel

Version NID
0.940-3.60 0xDE4EAC3C

Temp name was sceSblSmSchedProxyChangeF00DStatusForKernel.

Executes smc 0x130 call.

int sceSblSmSchedProxyKillForKernel(SmOperationId req_id);

sceSblSmSchedProxyNotImplementedMaybeSMC0x131ForKernel

Version NID
3.60 0x984EC9D1

returns 0x800F0425

sceSblSmSchedProxyNotImplementedMaybeSMC0x132ForKernel

Version NID
3.60 0x1DFC8624

returns 0x800F0425

sceSblSmSchedCallFuncForKernel

temp name on wiki was: sceSblSmSchedProxySetCommandF00DRegisterForKernel

Version NID
3.60 0x723B382F

Executes smc 0x133 call.

Called by sceSblSmCommCallFunc.

  • mailbox_id - second smc arg
  • cmd_paddr - third smc arg
// f00d_cmd_fifo_idx can be 1, 2 or 3
int sceSblSmSchedCallFuncForKernel(SmOperationId req_id, int mailbox_id, SceSblSmschedCallFuncCommand* cmd_paddr);

sceSblSmSchedProxyGetCommandF00DRegisterForKernel

Version NID
0.990-3.60 0xF70C04EC

Calls subroutine "sceSblSmSchedProxyAccessMailbox".

executes smc 0x134 call

int sceSblSmSchedProxyGetCommandF00DRegisterForKernel(SmOperationId req_id, int mailbox_id, SceSblSmschedCallFuncCommand** cmd_paddr);

sceSblSmSchedProxyGetUnknownF00DRegisterForKernel

Version NID
3.60 0x3CE17233

executes smc 0x135 call

int sceSblSmSchedProxyGetUnknownF00DRegisterForKernel(SmOperationId req_id, int mailbox_id, int f00d_fifo_register_value);

sceSblSmSchedProxyWriteCry2ArmForKernel

Version NID
0.931-3.60 0x15B0E4DF

Temp name was sceSblSmSchedProxySetStatusCodeF00DRegisterForKernel.

Executes smc 0x136 call.

Used by SceSblAuthMgr.

int sceSblSmSchedProxyWriteCry2ArmForKernel(SmOperationId req_id, int mailbox_id, int mailval);

sceSblSmSchedProxyReadCry2ArmForKernel

Version NID
0.931-3.60 0x973A4A7D

Temp name was sceSblSmSchedProxyGetStatusCodeF00DRegisterForKernel.

Calls subroutine "sceSblSmSchedProxyAccessMailbox".

Executes smc 0x137 call.

Used by SceSblAuthMgr.

int sceSblSmSchedProxyReadCry2ArmForKernel(SmOperationId req_id, int mailbox_id, int* mailval);

sceSblSmSchedProxyRegisterIntrHandlerForKernel

Version NID
0.931-3.60 0x8B84AC2A

Temp name was sceSblSmSchedProxyEnableCry2ArmInterruptForKernel.

Executes smc 0x138 call.

Called by SceSblAuthMgr.

  • smcArg1_funcArg1 - second smc arg
typedef int sceSblIntrHandlerforInvoke(SmOperationId req_id, int intr_index, int arg2, int arg3, int arg4);

int sceSblSmSchedProxyRegisterIntrHandlerForKernel(SmOperationId req_id, int intr_index, sceSblIntrHandlerforInvoke *cb, int smcArg1_funcArg1);

sceSblSmSchedProxyReleaseIntrHandlerForKernel

Version NID
0.931-3.60 0x85EDA5FC

Temp name was sceSblSmSchedProxyDisableCry2ArmInterruptForKernel.

Executes smc 0x139 call.

Called by SceSblAuthMgr.

int sceSblSmSchedProxyReleaseIntrHandlerForKernel(SmOperationId req_id, int intr_index);

sceSblSmSchedProxyUninitializeForKernel

Version NID
3.60 0x33A3A1E2

executes smc 0x13B call

only executes if cpuid is 0

int sceSblSmSchedProxyUninitializeForKernel();

sceSblSmSchedProxyExecuteF00DCommandForKernel

Version NID
3.60 0x7894B6F0

executes smc 0x13C call

int sceSblSmSchedProxyExecuteF00DCommandForKernel(F00D_cmd_index cmd_index, int unused1, int unused2, int unused3);

This function is called by two modules:

SceSblSsMgr just before PSVita entering suspend mode:

sceSblSmSchedProxyExecuteF00DCommandForKernel(4, 0, 0, 0);

SceSdif at init (at PSVita boot and maybe called after PSVita resume):

sceSblSmSchedProxyExecuteF00DCommandForKernel(3, 0, 0, 0);