Skip to content

Commit 3d3a11c

Browse files
committed
Add some more system calls.
1 parent 1e0ad8c commit 3d3a11c

File tree

1 file changed

+74
-6
lines changed

1 file changed

+74
-6
lines changed

ps3api/syscalls.py

Lines changed: 74 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,18 @@ def __init__(self, RPC):
364364
Get the process id
365365
"""
366366
self.sys_process_getpid = RPC.SystemCall(SyscallIndex.SYS_PROCESS_GETPID)
367-
self.sys_process_getpid.ReturnType = c_ulong
367+
self.sys_process_getpid.ReturnType = c_uint32
368+
369+
"""
370+
int sys_process_wait_for_child(
371+
sys_pid_t pid,
372+
uint32_t *status,
373+
uint32_t unknown
374+
);
375+
"""
376+
self.sys_process_wait_for_child = RPC.SystemCall(SyscallIndex.SYS_PROCESS_WAIT_FOR_CHILD)
377+
self.sys_process_wait_for_child.ArgTypes = [ c_uint32, POINTER(c_uint32), c_uint32 ]
378+
self.sys_process_wait_for_child.ReturnType = c_uint32
368379

369380
"""
370381
void sys_process_exit(
@@ -374,8 +385,8 @@ def __init__(self, RPC):
374385
Terminate a process
375386
"""
376387
self.sys_process_exit = RPC.SystemCall(SyscallIndex.SYS_PROCESS_EXIT)
377-
self.sys_process_exit.ArgTypes = [ c_ulong ]
378-
self.sys_process_exit.ReturnType = c_ulong
388+
self.sys_process_exit.ArgTypes = [ c_uint32 ]
389+
self.sys_process_exit.ReturnType = c_uint32
379390

380391
"""
381392
int sys_process_get_status(
@@ -385,8 +396,8 @@ def __init__(self, RPC):
385396
Get process status
386397
"""
387398
self.sys_process_get_status = RPC.SystemCall(SyscallIndex.SYS_PROCESS_GET_STATUS)
388-
self.sys_process_get_status.ArgTypes = [ c_ulong ]
389-
self.sys_process_get_status.ReturnType = c_ulong
399+
self.sys_process_get_status.ArgTypes = [ c_uint32 ]
400+
self.sys_process_get_status.ReturnType = c_uint32
390401

391402
"""
392403
int sys_process_get_number_of_object(
@@ -400,6 +411,42 @@ def __init__(self, RPC):
400411
self.sys_process_get_number_of_object.ArgTypes = [ c_uint32, POINTER(c_uint32) ]
401412
self.sys_process_get_number_of_object.ReturnType = c_int32
402413

414+
"""
415+
int sys_process_get_id(
416+
uint32_t object,
417+
uint32_t *buff,
418+
size_t size,
419+
size_t *set_size
420+
);
421+
422+
Obtain ID of specified object
423+
"""
424+
self.sys_process_get_id = RPC.SystemCall(SyscallIndex.SYS_PROCESS_GET_ID)
425+
self.sys_process_get_id.ArgTypes = [ c_uint32, POINTER(c_uint32), c_uint32, POINTER(c_uint32) ]
426+
self.sys_process_get_id.ReturnType = c_int32
427+
428+
"""
429+
sys_pid_t sys_process_getppid(
430+
void
431+
);
432+
433+
Get the parent process id
434+
"""
435+
self.sys_process_getppid = RPC.SystemCall(SyscallIndex.SYS_PROCESS_GETPPID)
436+
self.sys_process_getppid.ArgTypes = [ ]
437+
self.sys_process_getppid.ReturnType = c_uint32
438+
439+
"""
440+
int sys_process_kill(
441+
sys_pid_t pid
442+
)
443+
444+
Get process status
445+
"""
446+
self.sys_process_kill = RPC.SystemCall(SyscallIndex.SYS_PROCESS_KILL)
447+
self.sys_process_kill.ArgTypes = [ c_uint32 ]
448+
self.sys_process_kill.ReturnType = c_int32
449+
403450
"""
404451
int sys_process_get_sdk_version(
405452
sys_pid_t pid,
@@ -412,6 +459,27 @@ def __init__(self, RPC):
412459
self.sys_process_get_sdk_version.ArgTypes = [ c_uint32, POINTER(c_uint32) ]
413460
self.sys_process_get_sdk_version.ReturnType = c_int32
414461

462+
"""
463+
sys_addr_t sys_process_get_ppu_guid(
464+
void
465+
);
466+
467+
Obtain PPU GUID information
468+
"""
469+
self.sys_process_get_ppu_guid = RPC.SystemCall(SyscallIndex.SYS_PROCESS_GET_PPU_GUID)
470+
self.sys_process_get_ppu_guid.ReturnType = POINTER(c_uint32)
471+
472+
"""
473+
int sys_ppu_thread_exit(
474+
uint64_t errorcode
475+
)
476+
477+
Exit a PPU thread
478+
"""
479+
self.sys_ppu_thread_exit = RPC.SystemCall(SyscallIndex.SYS_PPU_THREAD_EXIT)
480+
self.sys_ppu_thread_exit.ArgTypes = [ c_int32 ]
481+
self.sys_ppu_thread_exit.ReturnType = c_int32
482+
415483
"""
416484
int sys_console_write(
417485
const char *s,
@@ -422,7 +490,7 @@ def __init__(self, RPC):
422490
"""
423491
self.sys_console_write = RPC.SystemCall(SyscallIndex.SYS_CONSOLE_WRITE)
424492
self.sys_console_write.ArgTypes = [ c_char_p, c_uint32 ]
425-
self.sys_console_write.ReturnType = c_ulong
493+
self.sys_console_write.ReturnType = c_uint32
426494

427495
"""
428496
int sys_tty_read(

0 commit comments

Comments
 (0)