mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00:00
Removed external functions from SysCalls.h
* Replace `int` with `s32` as return type for syscalls. * Renamed `SC_Something.*` files with the proper lv2 name `sys_something.*`. * Moving away from the lv2, those functions and folders that doesn't correspond to lv2 functions. E.g. module functions from sys_io, sysPrxForUser, cellGcmSys. * Splitted some files (memory -> memory+mmapper) and merged other ones (event+event_flag ->event, spu+spu_thread -> spu), according to common sense, PSDevWiki docs, and checking firmware files. * Removed external functions from `SysCalls.h`. NOTE: What should we do about: cellGcmCallback? It's not a lv2 syscall but it appears on the sc_table and it is actually called in games. Is this some kind of hack?
This commit is contained in:
parent
7218ccfe66
commit
08d61163ea
73 changed files with 2243 additions and 968 deletions
|
@ -2,8 +2,8 @@
|
|||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Lwmutex.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Event_flag.h"
|
||||
#include "Emu/SysCalls/lv2/sys_lwmutex.h"
|
||||
#include "Emu/SysCalls/lv2/sys_event.h"
|
||||
|
||||
#include "Emu/Cell/RawSPUThread.h"
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Lwmutex.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Event_flag.h"
|
||||
#include "Emu/SysCalls/lv2/sys_lwmutex.h"
|
||||
#include "Emu/SysCalls/lv2/sys_event.h"
|
||||
|
||||
#include "SPUInstrTable.h"
|
||||
#include "SPUDisAsm.h"
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Lwmutex.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Event_flag.h"
|
||||
#include "Emu/SysCalls/lv2/sys_lwmutex.h"
|
||||
#include "Emu/SysCalls/lv2/sys_event.h"
|
||||
|
||||
|
||||
#include "Emu/Cell/SPUThread.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include "PPCThread.h"
|
||||
#include "Emu/event.h"
|
||||
#include "Emu/SysCalls/lv2/SC_SPU_Thread.h"
|
||||
#include "Emu/SysCalls/lv2/sys_spu.h"
|
||||
#include "MFC.h"
|
||||
#include "Emu/SysCalls/ErrorCodes.h"
|
||||
#include <mutex>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "RSXThread.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Time.h"
|
||||
#include "Emu/SysCalls/lv2/sys_time.h"
|
||||
|
||||
#define ARGS(x) (x >= count ? OutOfArgsCount(x, cmd, count) : Memory.Read32(Memory.RSXIOMem.GetStartAddr() + m_ctrl->get + (4*(x+1))))
|
||||
|
||||
|
|
|
@ -1149,6 +1149,31 @@ int cellGcmSetTile(u8 index, u8 location, u32 offset, u32 size, u32 pitch, u8 co
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// TODO: This function was originally located in lv2/SC_GCM and appears in RPCS3 as a lv2 syscall with id 1023,
|
||||
// which according to lv2 dumps isn't the case. So, is this a proper place for this function?
|
||||
|
||||
int cellGcmCallback(u32 context_addr, u32 count)
|
||||
{
|
||||
GSLockCurrent gslock(GS_LOCK_WAIT_FLUSH);
|
||||
|
||||
CellGcmContextData& ctx = (CellGcmContextData&)Memory[context_addr];
|
||||
CellGcmControl& ctrl = (CellGcmControl&)Memory[gcm_info.control_addr];
|
||||
|
||||
const s32 res = ctx.current - ctx.begin - ctrl.put;
|
||||
|
||||
if(res > 0) Memory.Copy(ctx.begin, ctx.current - res, res);
|
||||
|
||||
ctx.current = ctx.begin + res;
|
||||
|
||||
//InterlockedExchange64((volatile long long*)((u8*)&ctrl + offsetof(CellGcmControl, put)), (u64)(u32)re(res));
|
||||
ctrl.put = res;
|
||||
ctrl.get = 0;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
void cellGcmSys_init()
|
||||
{
|
||||
// Data Retrieval
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/SysCalls/SC_FUNC.h"
|
||||
#include "Emu/SysCalls/Modules.h"
|
||||
#include "cellSysutil.h"
|
||||
#include "cellResc.h"
|
||||
|
||||
//void cellResc_init();
|
||||
|
|
|
@ -199,7 +199,7 @@ int cellVideoOutGetResolution(u32 resolutionId, mem_ptr_t<CellVideoOutResolution
|
|||
return CELL_VIDEO_OUT_SUCCEEDED;
|
||||
}
|
||||
|
||||
int cellVideoOutConfigure(u32 videoOut, u32 config_addr, u32 option_addr, u32 waitForEvent)
|
||||
s32 cellVideoOutConfigure(u32 videoOut, u32 config_addr, u32 option_addr, u32 waitForEvent)
|
||||
{
|
||||
cellSysutil->Warning("cellVideoOutConfigure(videoOut=%d, config_addr=0x%x, option_addr=0x%x, waitForEvent=0x%x)",
|
||||
videoOut, config_addr, option_addr, waitForEvent);
|
||||
|
|
|
@ -213,3 +213,6 @@ struct CellHddGameCBResult
|
|||
be_t<u32> invalidMsg_addr; // char*
|
||||
be_t<u32> reserved_addr; // void*
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 cellVideoOutConfigure(u32 videoOut, u32 config_addr, u32 option_addr, u32 waitForEvent);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "Loader/TRP.h"
|
||||
#include "Loader/TROPUSR.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Time.h"
|
||||
#include "Emu/SysCalls/lv2/sys_time.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "Emu/SysCalls/Modules.h"
|
||||
#include "Emu/FS/vfsFile.h"
|
||||
#include "Emu/FS/vfsStreamMemory.h"
|
||||
#include "Emu/SysCalls/lv2/SC_SPU_Thread.h"
|
||||
#include "Emu/SysCalls/lv2/sys_spu.h"
|
||||
#include "Loader/ELF.h"
|
||||
#include "Emu/Cell/RawSPUThread.h"
|
||||
|
||||
|
@ -15,6 +15,49 @@
|
|||
//Module sysPrxForUser("sysPrxForUser", sysPrxForUser_init);
|
||||
Module *sysPrxForUser = nullptr;
|
||||
|
||||
struct HeapInfo
|
||||
{
|
||||
u32 heap_addr;
|
||||
u32 align;
|
||||
u32 size;
|
||||
|
||||
HeapInfo(u32 _heap_addr, u32 _align, u32 _size)
|
||||
: heap_addr(_heap_addr)
|
||||
, align(_align)
|
||||
, size(_size)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
int sys_heap_create_heap(const u32 heap_addr, const u32 align, const u32 size)
|
||||
{
|
||||
sysPrxForUser->Warning("sys_heap_create_heap(heap_addr=0x%x, align=0x%x, size=0x%x)", heap_addr, align, size);
|
||||
|
||||
u32 heap_id = sysPrxForUser->GetNewId(new HeapInfo(heap_addr, align, size));
|
||||
sysPrxForUser->Warning("*** sys_heap created: id = %d", heap_id);
|
||||
return heap_id;
|
||||
}
|
||||
|
||||
int sys_heap_malloc(const u32 heap_id, const u32 size)
|
||||
{
|
||||
sysPrxForUser->Warning("sys_heap_malloc(heap_id=%d, size=0x%x)", heap_id, size);
|
||||
|
||||
HeapInfo* heap;
|
||||
if(!sysPrxForUser->CheckId(heap_id, heap)) return CELL_ESRCH;
|
||||
|
||||
return Memory.Alloc(size, 1);
|
||||
}
|
||||
|
||||
int _sys_heap_memalign(u32 heap_id, u32 align, u32 size)
|
||||
{
|
||||
sysPrxForUser->Warning("_sys_heap_memalign(heap_id=%d, align=0x%x, size=0x%x)", heap_id, align, size);
|
||||
|
||||
HeapInfo* heap;
|
||||
if(!sysPrxForUser->CheckId(heap_id, heap)) return CELL_ESRCH;
|
||||
|
||||
return Memory.Alloc(size, align);
|
||||
}
|
||||
|
||||
void sys_initialize_tls()
|
||||
{
|
||||
sysPrxForUser->Log("sys_initialize_tls()");
|
||||
|
@ -204,5 +247,4 @@ void sysPrxForUser_init()
|
|||
|
||||
sysPrxForUser->AddFunc(0x67f9fedb, sys_game_process_exitspawn2);
|
||||
sysPrxForUser->AddFunc(0xfc52a7a9, sys_game_process_exitspawn);
|
||||
|
||||
}
|
||||
|
|
|
@ -10,6 +10,46 @@
|
|||
//Module sys_io(0x0017, sys_io_init);
|
||||
Module *sys_io = nullptr;
|
||||
|
||||
//cellPad
|
||||
extern int cellPadInit(u32 max_connect);
|
||||
extern int cellPadEnd();
|
||||
extern int cellPadClearBuf(u32 port_no);
|
||||
extern int cellPadGetData(u32 port_no, u32 data_addr);
|
||||
extern int cellPadGetDataExtra(u32 port_no, u32 device_type_addr, u32 data_addr);
|
||||
extern int cellPadSetActDirect(u32 port_no, u32 param_addr);
|
||||
extern int cellPadGetInfo(u32 info_addr);
|
||||
extern int cellPadGetInfo2(u32 info_addr);
|
||||
extern int cellPadSetPortSetting(u32 port_no, u32 port_setting);
|
||||
extern int cellPadInfoPressMode(u32 port_no);
|
||||
extern int cellPadInfoSensorMode(u32 port_no);
|
||||
extern int cellPadSetPressMode(u32 port_no, u32 mode);
|
||||
extern int cellPadSetSensorMode(u32 port_no, u32 mode);
|
||||
extern int cellPadGetCapabilityInfo(u32 port_no, mem32_t info_addr);
|
||||
|
||||
//cellKb
|
||||
extern int cellKbInit(u32 max_connect);
|
||||
extern int cellKbEnd();
|
||||
extern int cellKbClearBuf(u32 port_no);
|
||||
extern u16 cellKbCnvRawCode(u32 arrange, u32 mkey, u32 led, u16 rawcode);
|
||||
extern int cellKbGetInfo(mem_class_t info);
|
||||
extern int cellKbRead(u32 port_no, mem_class_t data);
|
||||
extern int cellKbSetCodeType(u32 port_no, u32 type);
|
||||
extern int cellKbSetLEDStatus(u32 port_no, u8 led);
|
||||
extern int cellKbSetReadMode(u32 port_no, u32 rmode);
|
||||
extern int cellKbGetConfiguration(u32 port_no, mem_class_t config);
|
||||
|
||||
//cellMouse
|
||||
extern int cellMouseInit(u32 max_connect);
|
||||
extern int cellMouseClearBuf(u32 port_no);
|
||||
extern int cellMouseEnd();
|
||||
extern int cellMouseGetInfo(mem_class_t info);
|
||||
extern int cellMouseInfoTabletMode(u32 port_no, mem_class_t info);
|
||||
extern int cellMouseGetData(u32 port_no, mem_class_t data);
|
||||
extern int cellMouseGetDataList(u32 port_no, mem_class_t data);
|
||||
extern int cellMouseSetTabletMode(u32 port_no, u32 mode);
|
||||
extern int cellMouseGetTabletDataList(u32 port_no, mem_class_t data);
|
||||
extern int cellMouseGetRawData(u32 port_no, mem_class_t data);
|
||||
|
||||
void sys_io_init()
|
||||
{
|
||||
sys_io->AddFunc(0x1cf98800, cellPadInit);
|
||||
|
|
|
@ -523,7 +523,7 @@ static func_caller* sc_table[kSyscallTableLength] =
|
|||
null_func, null_func, null_func, null_func, null_func, //1009
|
||||
null_func, null_func, null_func, null_func, null_func, //1014
|
||||
null_func, null_func, null_func, null_func, null_func, //1019
|
||||
null_func, null_func, null_func, bind_func(cellGcmCallback), //1024
|
||||
null_func, null_func, null_func, bind_func(cellGcmCallback), //1023
|
||||
};
|
||||
|
||||
/** HACK: Used to delete func_caller objects that get allocated and stored in sc_table (above).
|
||||
|
|
|
@ -1,20 +1,31 @@
|
|||
#pragma once
|
||||
#include "ErrorCodes.h"
|
||||
#include "lv2/SC_Process.h"
|
||||
#include "lv2/SC_PRX.h"
|
||||
#include "lv2/SC_FileSystem.h"
|
||||
#include "lv2/SC_Memory.h"
|
||||
#include "lv2/SC_Timer.h"
|
||||
#include "lv2/SC_Rwlock.h"
|
||||
#include "lv2/SC_SPU_Thread.h"
|
||||
#include "lv2/SC_Lwmutex.h"
|
||||
#include "lv2/SC_Lwcond.h"
|
||||
#include "lv2/SC_Event_flag.h"
|
||||
#include "lv2/SC_Condition.h"
|
||||
#include "lv2/SC_Spinlock.h"
|
||||
#include "lv2/SC_Semaphore.h"
|
||||
#include "Emu/event.h"
|
||||
#include "Static.h"
|
||||
|
||||
#include "lv2/lv2Fs.h"
|
||||
#include "lv2/sys_cond.h"
|
||||
#include "lv2/sys_event.h"
|
||||
#include "lv2/sys_interrupt.h"
|
||||
#include "lv2/sys_lwcond.h"
|
||||
#include "lv2/sys_lwmutex.h"
|
||||
#include "lv2/sys_memory.h"
|
||||
#include "lv2/sys_mmapper.h"
|
||||
#include "lv2/sys_ppu_thread.h"
|
||||
#include "lv2/sys_process.h"
|
||||
#include "lv2/sys_prx.h"
|
||||
#include "lv2/sys_rsx.h"
|
||||
#include "lv2/sys_rwlock.h"
|
||||
#include "lv2/sys_semaphore.h"
|
||||
#include "lv2/sys_spinlock.h"
|
||||
#include "lv2/sys_spu.h"
|
||||
#include "lv2/sys_time.h"
|
||||
#include "lv2/sys_timer.h"
|
||||
#include "lv2/sys_trace.h"
|
||||
#include "lv2/sys_tty.h"
|
||||
#include "lv2/sys_vm.h"
|
||||
|
||||
#include "Emu/event.h"
|
||||
|
||||
//#define SYSCALLS_DEBUG
|
||||
|
||||
#define declCPU PPUThread& CPU = GetCurrentPPUThread
|
||||
|
@ -123,313 +134,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
//sys_event
|
||||
extern int sys_event_queue_create(mem32_t equeue_id, mem_ptr_t<sys_event_queue_attr> attr, u64 event_queue_key, int size);
|
||||
extern int sys_event_queue_destroy(u32 equeue_id, int mode);
|
||||
extern int sys_event_queue_receive(u32 equeue_id, mem_ptr_t<sys_event_data> event, u64 timeout);
|
||||
extern int sys_event_queue_tryreceive(u32 equeue_id, mem_ptr_t<sys_event_data> event_array, int size, mem32_t number);
|
||||
extern int sys_event_queue_drain(u32 event_queue_id);
|
||||
extern int sys_event_port_create(mem32_t eport_id, int port_type, u64 name);
|
||||
extern int sys_event_port_destroy(u32 eport_id);
|
||||
extern int sys_event_port_connect_local(u32 event_port_id, u32 event_queue_id);
|
||||
extern int sys_event_port_disconnect(u32 eport_id);
|
||||
extern int sys_event_port_send(u32 event_port_id, u64 data1, u64 data2, u64 data3);
|
||||
|
||||
//sys_event_flag
|
||||
extern int sys_event_flag_create(mem32_t eflag_id, mem_ptr_t<sys_event_flag_attr> attr, u64 init);
|
||||
extern int sys_event_flag_destroy(u32 eflag_id);
|
||||
extern int sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64 timeout);
|
||||
extern int sys_event_flag_trywait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result);
|
||||
extern int sys_event_flag_set(u32 eflag_id, u64 bitptn);
|
||||
extern int sys_event_flag_clear(u32 eflag_id, u64 bitptn);
|
||||
extern int sys_event_flag_cancel(u32 eflag_id, mem32_t num);
|
||||
extern int sys_event_flag_get(u32 eflag_id, mem64_t flags);
|
||||
|
||||
//sys_semaphore
|
||||
extern int sys_semaphore_create(mem32_t sem, mem_ptr_t<sys_semaphore_attribute> attr, int initial_count, int max_count);
|
||||
extern int sys_semaphore_destroy(u32 sem_id);
|
||||
extern int sys_semaphore_wait(u32 sem_id, u64 timeout);
|
||||
extern int sys_semaphore_trywait(u32 sem_id);
|
||||
extern int sys_semaphore_post(u32 sem_id, int count);
|
||||
extern int sys_semaphore_get_value(u32 sem_id, mem32_t count);
|
||||
|
||||
//sys_lwcond
|
||||
extern int sys_lwcond_create(mem_ptr_t<sys_lwcond_t> lwcond, mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwcond_attribute_t> attr);
|
||||
extern int sys_lwcond_destroy(mem_ptr_t<sys_lwcond_t> lwcond);
|
||||
extern int sys_lwcond_signal(mem_ptr_t<sys_lwcond_t> lwcond);
|
||||
extern int sys_lwcond_signal_all(mem_ptr_t<sys_lwcond_t> lwcond);
|
||||
extern int sys_lwcond_signal_to(mem_ptr_t<sys_lwcond_t> lwcond, u32 ppu_thread_id);
|
||||
extern int sys_lwcond_wait(mem_ptr_t<sys_lwcond_t> lwcond, u64 timeout);
|
||||
|
||||
//sys_lwmutex
|
||||
extern int sys_lwmutex_create(mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwmutex_attribute_t> attr);
|
||||
extern int sys_lwmutex_destroy(mem_ptr_t<sys_lwmutex_t> lwmutex);
|
||||
extern int sys_lwmutex_lock(mem_ptr_t<sys_lwmutex_t> lwmutex, u64 timeout);
|
||||
extern int sys_lwmutex_trylock(mem_ptr_t<sys_lwmutex_t> lwmutex);
|
||||
extern int sys_lwmutex_unlock(mem_ptr_t<sys_lwmutex_t> lwmutex);
|
||||
|
||||
//sys_cond
|
||||
extern int sys_cond_create(mem32_t cond_id, u32 mutex_id, mem_ptr_t<sys_cond_attribute> attr);
|
||||
extern int sys_cond_destroy(u32 cond_id);
|
||||
extern int sys_cond_wait(u32 cond_id, u64 timeout);
|
||||
extern int sys_cond_signal(u32 cond_id);
|
||||
extern int sys_cond_signal_all(u32 cond_id);
|
||||
extern int sys_cond_signal_to(u32 cond_id, u32 thread_id);
|
||||
|
||||
//sys_mutex
|
||||
extern int sys_mutex_create(mem32_t mutex_id, mem_ptr_t<sys_mutex_attribute> attr);
|
||||
extern int sys_mutex_destroy(u32 mutex_id);
|
||||
extern int sys_mutex_lock(u32 mutex_id, u64 timeout);
|
||||
extern int sys_mutex_trylock(u32 mutex_id);
|
||||
extern int sys_mutex_unlock(u32 mutex_id);
|
||||
|
||||
//sys_rwlock
|
||||
extern int sys_rwlock_create(mem32_t rw_lock_id, mem_ptr_t<sys_rwlock_attribute_t> attr);
|
||||
extern int sys_rwlock_destroy(u32 rw_lock_id);
|
||||
extern int sys_rwlock_rlock(u32 rw_lock_id, u64 timeout);
|
||||
extern int sys_rwlock_tryrlock(u32 rw_lock_id);
|
||||
extern int sys_rwlock_runlock(u32 rw_lock_id);
|
||||
extern int sys_rwlock_wlock(u32 rw_lock_id, u64 timeout);
|
||||
extern int sys_rwlock_trywlock(u32 rw_lock_id);
|
||||
extern int sys_rwlock_wunlock(u32 rw_lock_id);
|
||||
|
||||
//sys_spinlock
|
||||
extern void sys_spinlock_initialize(mem_ptr_t<spinlock> lock);
|
||||
extern void sys_spinlock_lock(mem_ptr_t<spinlock> lock);
|
||||
extern int sys_spinlock_trylock(mem_ptr_t<spinlock> lock);
|
||||
extern void sys_spinlock_unlock(mem_ptr_t<spinlock> lock);
|
||||
|
||||
//ppu_thread
|
||||
extern void sys_ppu_thread_exit(u64 errorcode);
|
||||
extern int sys_ppu_thread_yield();
|
||||
extern int sys_ppu_thread_join(u64 thread_id, mem64_t vptr);
|
||||
extern int sys_ppu_thread_detach(u64 thread_id);
|
||||
extern void sys_ppu_thread_get_join_state(u32 isjoinable_addr);
|
||||
extern int sys_ppu_thread_set_priority(u64 thread_id, int prio);
|
||||
extern int sys_ppu_thread_get_priority(u64 thread_id, u32 prio_addr);
|
||||
extern int sys_ppu_thread_get_stack_information(u32 info_addr);
|
||||
extern int sys_ppu_thread_stop(u64 thread_id);
|
||||
extern int sys_ppu_thread_restart(u64 thread_id);
|
||||
extern int sys_ppu_thread_create(mem64_t thread_id, u32 entry, u64 arg, int prio, u32 stacksize, u64 flags, u32 threadname_addr);
|
||||
extern void sys_ppu_thread_once(u32 once_ctrl_addr, u32 entry);
|
||||
extern int sys_ppu_thread_get_id(const u32 id_addr);
|
||||
|
||||
//memory
|
||||
extern int sys_memory_allocate(u32 size, u32 flags, u32 alloc_addr_addr);
|
||||
extern int sys_memory_allocate_from_container(u32 size, u32 cid, u32 flags, u32 alloc_addr_addr);
|
||||
extern int sys_memory_free(u32 start_addr);
|
||||
extern int sys_memory_get_page_attribute(u32 addr, mem_ptr_t<sys_page_attr_t> attr);
|
||||
extern int sys_memory_get_user_memory_size(mem_ptr_t<sys_memory_info_t> mem_info);
|
||||
extern int sys_memory_container_create(mem32_t cid, u32 yield_size);
|
||||
extern int sys_memory_container_destroy(u32 cid);
|
||||
extern int sys_memory_container_get_size(mem_ptr_t<sys_memory_info_t> mem_info, u32 cid);
|
||||
extern int sys_mmapper_allocate_address(u32 size, u64 flags, u32 alignment, u32 alloc_addr);
|
||||
extern int sys_mmapper_allocate_fixed_address();
|
||||
extern int sys_mmapper_allocate_memory(u32 size, u64 flags, mem32_t mem_id);
|
||||
extern int sys_mmapper_allocate_memory_from_container(u32 size, u32 cid, u64 flags, mem32_t mem_id);
|
||||
extern int sys_mmapper_change_address_access_right(u32 start_addr, u64 flags);
|
||||
extern int sys_mmapper_free_address(u32 start_addr);
|
||||
extern int sys_mmapper_free_memory(u32 mem_id);
|
||||
extern int sys_mmapper_map_memory(u32 start_addr, u32 mem_id, u64 flags);
|
||||
extern int sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags, u32 alloc_addr);
|
||||
extern int sys_mmapper_unmap_memory(u32 start_addr, u32 mem_id_addr);
|
||||
extern int sys_mmapper_enable_page_fault_notification(u32 start_addr, u32 q_id);
|
||||
|
||||
//vm
|
||||
extern int sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, u32 addr);
|
||||
extern int sys_vm_unmap(u32 addr);
|
||||
extern int sys_vm_append_memory(u32 addr, u32 size);
|
||||
extern int sys_vm_return_memory(u32 addr, u32 size);
|
||||
extern int sys_vm_lock(u32 addr, u32 size);
|
||||
extern int sys_vm_unlock(u32 addr, u32 size);
|
||||
extern int sys_vm_touch(u32 addr, u32 size);
|
||||
extern int sys_vm_flush(u32 addr, u32 size);
|
||||
extern int sys_vm_invalidate(u32 addr, u32 size);
|
||||
extern int sys_vm_store(u32 addr, u32 size);
|
||||
extern int sys_vm_sync(u32 addr, u32 size);
|
||||
extern int sys_vm_test(u32 addr, u32 size, u32 result_addr);
|
||||
extern int sys_vm_get_statistics(u32 addr, u32 stat_addr);
|
||||
|
||||
//cellFs
|
||||
extern int cellFsOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size);
|
||||
extern int cellFsRead(u32 fd, u32 buf_addr, u64 nbytes, mem64_t nread);
|
||||
extern int cellFsWrite(u32 fd, u32 buf_addr, u64 nbytes, mem64_t nwrite);
|
||||
extern int cellFsClose(u32 fd);
|
||||
extern int cellFsOpendir(u32 path_addr, mem32_t fd);
|
||||
extern int cellFsReaddir(u32 fd, mem_ptr_t<CellFsDirent> dir, mem64_t nread);
|
||||
extern int cellFsClosedir(u32 fd);
|
||||
extern int cellFsStat(u32 path_addr, mem_ptr_t<CellFsStat> sb);
|
||||
extern int cellFsFstat(u32 fd, mem_ptr_t<CellFsStat> sb);
|
||||
extern int cellFsMkdir(u32 path_addr, u32 mode);
|
||||
extern int cellFsRename(u32 from_addr, u32 to_addr);
|
||||
extern int cellFsRmdir(u32 path_addr);
|
||||
extern int cellFsUnlink(u32 path_addr);
|
||||
extern int cellFsLseek(u32 fd, s64 offset, u32 whence, mem64_t pos);
|
||||
extern int cellFsFtruncate(u32 fd, u64 size);
|
||||
extern int cellFsTruncate(u32 path_addr, u64 size);
|
||||
extern int cellFsFGetBlockSize(u32 fd, mem64_t sector_size, mem64_t block_size);
|
||||
extern int cellFsGetBlockSize(u32 path_addr, mem64_t sector_size, mem64_t block_size);
|
||||
extern int cellFsGetFreeSize(u32 path_addr, mem32_t block_size, mem64_t block_count);
|
||||
extern int cellFsGetDirectoryEntries(u32 fd, mem_ptr_t<CellFsDirectoryEntry> entries, u32 entries_size, mem32_t data_count);
|
||||
extern int cellFsStReadInit(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf);
|
||||
extern int cellFsStReadFinish(u32 fd);
|
||||
extern int cellFsStReadGetRingBuf(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf);
|
||||
extern int cellFsStReadGetStatus(u32 fd, mem64_t status);
|
||||
extern int cellFsStReadGetRegid(u32 fd, mem64_t regid);
|
||||
extern int cellFsStReadStart(u32 fd, u64 offset, u64 size);
|
||||
extern int cellFsStReadStop(u32 fd);
|
||||
extern int cellFsStRead(u32 fd, u32 buf_addr, u64 size, mem64_t rsize);
|
||||
extern int cellFsStReadGetCurrentAddr(u32 fd, mem32_t addr_addr, mem64_t size);
|
||||
extern int cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size);
|
||||
extern int cellFsStReadWait(u32 fd, u64 size);
|
||||
extern int cellFsStReadWaitCallback(u32 fd, u64 size, mem_func_ptr_t<void (*)(int xfd, u64 xsize)> func);
|
||||
|
||||
//cellVideo
|
||||
extern int cellVideoOutGetState(u32 videoOut, u32 deviceIndex, u32 state_addr);
|
||||
extern int cellVideoOutGetResolution(u32 resolutionId, mem_ptr_t<CellVideoOutResolution> resolution);
|
||||
extern int cellVideoOutConfigure(u32 videoOut, u32 config_addr, u32 option_addr, u32 waitForEvent);
|
||||
extern int cellVideoOutGetConfiguration(u32 videoOut, u32 config_addr, u32 option_addr);
|
||||
extern int cellVideoOutGetNumberOfDevice(u32 videoOut);
|
||||
extern int cellVideoOutGetResolutionAvailability(u32 videoOut, u32 resolutionId, u32 aspect, u32 option);
|
||||
|
||||
//cellPad
|
||||
extern int cellPadInit(u32 max_connect);
|
||||
extern int cellPadEnd();
|
||||
extern int cellPadClearBuf(u32 port_no);
|
||||
extern int cellPadGetData(u32 port_no, u32 data_addr);
|
||||
extern int cellPadGetDataExtra(u32 port_no, u32 device_type_addr, u32 data_addr);
|
||||
extern int cellPadSetActDirect(u32 port_no, u32 param_addr);
|
||||
extern int cellPadGetInfo(u32 info_addr);
|
||||
extern int cellPadGetInfo2(u32 info_addr);
|
||||
extern int cellPadSetPortSetting(u32 port_no, u32 port_setting);
|
||||
extern int cellPadInfoPressMode(u32 port_no);
|
||||
extern int cellPadInfoSensorMode(u32 port_no);
|
||||
extern int cellPadSetPressMode(u32 port_no, u32 mode);
|
||||
extern int cellPadSetSensorMode(u32 port_no, u32 mode);
|
||||
extern int cellPadGetCapabilityInfo(u32 port_no, mem32_t info_addr);
|
||||
|
||||
//cellKb
|
||||
extern int cellKbInit(u32 max_connect);
|
||||
extern int cellKbEnd();
|
||||
extern int cellKbClearBuf(u32 port_no);
|
||||
extern u16 cellKbCnvRawCode(u32 arrange, u32 mkey, u32 led, u16 rawcode);
|
||||
extern int cellKbGetInfo(mem_class_t info);
|
||||
extern int cellKbRead(u32 port_no, mem_class_t data);
|
||||
extern int cellKbSetCodeType(u32 port_no, u32 type);
|
||||
extern int cellKbSetLEDStatus(u32 port_no, u8 led);
|
||||
extern int cellKbSetReadMode(u32 port_no, u32 rmode);
|
||||
extern int cellKbGetConfiguration(u32 port_no, mem_class_t config);
|
||||
|
||||
//cellMouse
|
||||
extern int cellMouseInit(u32 max_connect);
|
||||
extern int cellMouseClearBuf(u32 port_no);
|
||||
extern int cellMouseEnd();
|
||||
extern int cellMouseGetInfo(mem_class_t info);
|
||||
extern int cellMouseInfoTabletMode(u32 port_no, mem_class_t info);
|
||||
extern int cellMouseGetData(u32 port_no, mem_class_t data);
|
||||
extern int cellMouseGetDataList(u32 port_no, mem_class_t data);
|
||||
extern int cellMouseSetTabletMode(u32 port_no, u32 mode);
|
||||
extern int cellMouseGetTabletDataList(u32 port_no, mem_class_t data);
|
||||
extern int cellMouseGetRawData(u32 port_no, mem_class_t data);
|
||||
|
||||
//cellGcm
|
||||
//cellGcm (used as lv2 syscall #1023)
|
||||
extern int cellGcmCallback(u32 context_addr, u32 count);
|
||||
|
||||
//sys_tty
|
||||
extern int sys_tty_read(u32 ch, u64 buf_addr, u32 len, u64 preadlen_addr);
|
||||
extern int sys_tty_write(u32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr);
|
||||
|
||||
//sys_heap
|
||||
extern int sys_heap_create_heap(const u32 heap_addr, const u32 start_addr, const u32 size);
|
||||
extern int sys_heap_malloc(const u32 heap_addr, const u32 size);
|
||||
extern int _sys_heap_memalign(u32 heap_id, u32 align, u32 size);
|
||||
|
||||
//sys_spu
|
||||
extern int sys_spu_image_open(mem_ptr_t<sys_spu_image> img, u32 path_addr);
|
||||
extern int sys_spu_thread_initialize(mem32_t thread, u32 group, u32 spu_num, mem_ptr_t<sys_spu_image> img, mem_ptr_t<sys_spu_thread_attribute> attr, mem_ptr_t<sys_spu_thread_argument> arg);
|
||||
extern int sys_spu_thread_set_argument(u32 id, mem_ptr_t<sys_spu_thread_argument> arg);
|
||||
extern int sys_spu_thread_group_destroy(u32 id);
|
||||
extern int sys_spu_thread_group_start(u32 id);
|
||||
extern int sys_spu_thread_group_suspend(u32 id);
|
||||
extern int sys_spu_thread_group_resume(u32 id);
|
||||
extern int sys_spu_thread_group_create(mem32_t id, u32 num, int prio, mem_ptr_t<sys_spu_thread_group_attribute> attr);
|
||||
extern int sys_spu_thread_create(mem32_t thread_id, mem32_t entry, u64 arg, int prio, u32 stacksize, u64 flags, u32 threadname_addr);
|
||||
extern int sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status);
|
||||
extern int sys_spu_thread_group_connect_event(u32 id, u32 eq, u32 et);
|
||||
extern int sys_spu_thread_group_disconnect_event(u32 id, u32 et);
|
||||
extern int sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq, u64 req, u32 spup_addr);
|
||||
extern int sys_spu_thread_group_disconnect_event_all_threads(u32 id, u8 spup);
|
||||
extern int sys_spu_initialize(u32 max_usable_spu, u32 max_raw_spu);
|
||||
extern int sys_spu_thread_write_ls(u32 id, u32 address, u64 value, u32 type);
|
||||
extern int sys_spu_thread_read_ls(u32 id, u32 address, mem64_t value, u32 type);
|
||||
extern int sys_spu_thread_write_spu_mb(u32 id, u32 value);
|
||||
extern int sys_spu_thread_set_spu_cfg(u32 id, u64 value);
|
||||
extern int sys_spu_thread_get_spu_cfg(u32 id, mem64_t value);
|
||||
extern int sys_spu_thread_write_snr(u32 id, u32 number, u32 value);
|
||||
extern int sys_spu_thread_connect_event(u32 id, u32 eq, u32 et, u8 spup);
|
||||
extern int sys_spu_thread_disconnect_event(u32 id, u32 event_type, u8 spup);
|
||||
extern int sys_spu_thread_bind_queue(u32 id, u32 spuq, u32 spuq_num);
|
||||
extern int sys_spu_thread_unbind_queue(u32 id, u32 spuq_num);
|
||||
extern int sys_spu_thread_get_exit_status(u32 id, mem32_t status);
|
||||
extern int sys_raw_spu_create(mem32_t id, u32 attr_addr);
|
||||
extern int sys_raw_spu_destroy(u32 id);
|
||||
extern int sys_raw_spu_create_interrupt_tag(u32 id, u32 class_id, u32 hwthread, mem32_t intrtag);
|
||||
extern int sys_raw_spu_set_int_mask(u32 id, u32 class_id, u64 mask);
|
||||
extern int sys_raw_spu_get_int_mask(u32 id, u32 class_id, mem64_t mask);
|
||||
extern int sys_raw_spu_set_int_stat(u32 id, u32 class_id, u64 stat);
|
||||
extern int sys_raw_spu_get_int_stat(u32 id, u32 class_id, mem64_t stat);
|
||||
extern int sys_raw_spu_read_puint_mb(u32 id, mem32_t value);
|
||||
extern int sys_raw_spu_set_spu_cfg(u32 id, u32 value);
|
||||
extern int sys_raw_spu_get_spu_cfg(u32 id, mem32_t value);
|
||||
|
||||
//sys_interrupt
|
||||
extern int sys_interrupt_tag_destroy(u32 intrtag);
|
||||
extern int sys_interrupt_thread_establish(mem32_t ih, u32 intrtag, u64 intrthread, u64 arg);
|
||||
extern int sys_interrupt_thread_disestablish(u32 ih);
|
||||
extern void sys_interrupt_thread_eoi();
|
||||
|
||||
//sys_time
|
||||
extern int sys_time_get_timezone(mem32_t timezone, mem32_t summertime);
|
||||
extern int sys_time_get_current_time(u32 sec_addr, u32 nsec_addr);
|
||||
extern s64 sys_time_get_system_time();
|
||||
extern u64 sys_time_get_timebase_frequency();
|
||||
|
||||
//sys_timer
|
||||
extern int sys_timer_create(mem32_t timer_id);
|
||||
extern int sys_timer_destroy(u32 timer_id);
|
||||
extern int sys_timer_get_information(u32 timer_id, mem_ptr_t<sys_timer_information_t> info);
|
||||
extern int sys_timer_start(u32 timer_id, s64 basetime, u64 period);
|
||||
extern int sys_timer_stop(u32 timer_id);
|
||||
extern int sys_timer_connect_event_queue(u32 timer_id, u32 queue_id, u64 name, u64 data1, u64 data2);
|
||||
extern int sys_timer_disconnect_event_queue(u32 timer_id);
|
||||
extern int sys_timer_sleep(u32 sleep_time);
|
||||
extern int sys_timer_usleep(u64 sleep_time);
|
||||
|
||||
//sys_trace
|
||||
extern int sys_trace_create();
|
||||
extern int sys_trace_start();
|
||||
extern int sys_trace_stop();
|
||||
extern int sys_trace_update_top_index();
|
||||
extern int sys_trace_destroy();
|
||||
extern int sys_trace_drain();
|
||||
extern int sys_trace_attach_process();
|
||||
extern int sys_trace_allocate_buffer();
|
||||
extern int sys_trace_free_buffer();
|
||||
extern int sys_trace_create2();
|
||||
|
||||
//sys_rsx
|
||||
extern int sys_rsx_device_open();
|
||||
extern int sys_rsx_device_close();
|
||||
extern int sys_rsx_memory_allocate();
|
||||
extern int sys_rsx_memory_free();
|
||||
extern int sys_rsx_context_allocate();
|
||||
extern int sys_rsx_context_free();
|
||||
extern int sys_rsx_context_iomap();
|
||||
extern int sys_rsx_context_iounmap();
|
||||
extern int sys_rsx_context_attribute(s32 context_id, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
|
||||
extern int sys_rsx_device_map(mem32_t a1, mem32_t a2, u32 a3);
|
||||
extern int sys_rsx_device_unmap();
|
||||
extern int sys_rsx_attribute();
|
||||
|
||||
#define UNIMPLEMENTED_FUNC(module) module->Error("Unimplemented function: %s", __FUNCTION__)
|
||||
|
||||
|
@ -481,5 +188,3 @@ public:
|
|||
#define REG_SUB_EMPTY(module, group, name,...) \
|
||||
static const u64 name ## _table[] = {0}; \
|
||||
module->AddFuncSub(group, name ## _table, #name, name)
|
||||
|
||||
extern u64 get_system_time();
|
|
@ -1 +0,0 @@
|
|||
#pragma once
|
|
@ -1,27 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
struct sys_lwcond_attribute_t
|
||||
{
|
||||
union
|
||||
{
|
||||
char name[8];
|
||||
u64 name_u64;
|
||||
};
|
||||
};
|
||||
|
||||
struct sys_lwcond_t
|
||||
{
|
||||
be_t<u32> lwmutex;
|
||||
be_t<u32> lwcond_queue;
|
||||
};
|
||||
|
||||
struct Lwcond
|
||||
{
|
||||
SMutex signal;
|
||||
SleepQueue m_queue;
|
||||
|
||||
Lwcond(u64 name)
|
||||
: m_queue(name)
|
||||
{
|
||||
}
|
||||
};
|
|
@ -1,82 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
u32 LoadSpuImage(vfsStream& stream, u32& spu_ep);
|
||||
|
||||
enum
|
||||
{
|
||||
SYS_SPU_THREAD_GROUP_JOIN_GROUP_EXIT = 0x0001,
|
||||
SYS_SPU_THREAD_GROUP_JOIN_ALL_THREADS_EXIT = 0x0002,
|
||||
SYS_SPU_THREAD_GROUP_JOIN_TERMINATED = 0x0004
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SYS_SPU_SEGMENT_TYPE_COPY = 0x0001,
|
||||
SYS_SPU_SEGMENT_TYPE_FILL = 0x0002,
|
||||
SYS_SPU_SEGMENT_TYPE_INFO = 0x0004,
|
||||
};
|
||||
|
||||
struct sys_spu_thread_group_attribute
|
||||
{
|
||||
be_t<u32> name_len;
|
||||
be_t<u32> name_addr;
|
||||
be_t<int> type;
|
||||
/* struct {} option; */
|
||||
be_t<u32> ct; // memory container id
|
||||
};
|
||||
|
||||
struct sys_spu_thread_attribute
|
||||
{
|
||||
be_t<u32> name_addr;
|
||||
be_t<u32> name_len;
|
||||
be_t<u32> option;
|
||||
};
|
||||
|
||||
struct sys_spu_thread_argument
|
||||
{
|
||||
be_t<u64> arg1;
|
||||
be_t<u64> arg2;
|
||||
be_t<u64> arg3;
|
||||
be_t<u64> arg4;
|
||||
};
|
||||
|
||||
struct sys_spu_image
|
||||
{
|
||||
be_t<u32> type;
|
||||
be_t<u32> entry_point;
|
||||
be_t<u32> segs_addr; //temporarily used as offset of LS image after elf loading
|
||||
be_t<int> nsegs;
|
||||
};
|
||||
|
||||
struct sys_spu_segment
|
||||
{
|
||||
be_t<int> type;
|
||||
be_t<u32> ls_start;
|
||||
be_t<int> size;
|
||||
be_t<u64> src;
|
||||
};
|
||||
|
||||
struct SpuGroupInfo
|
||||
{
|
||||
std::vector<u32> list;
|
||||
std::atomic<u32> lock;
|
||||
std::string m_name;
|
||||
int m_prio;
|
||||
int m_type;
|
||||
int m_ct;
|
||||
|
||||
SpuGroupInfo(const std::string& name, u32 num, int prio, int type, u32 ct)
|
||||
: m_name(name)
|
||||
, m_prio(prio)
|
||||
, m_type(type)
|
||||
, m_ct(ct)
|
||||
, lock(0)
|
||||
{
|
||||
num = 256;
|
||||
list.resize(num);
|
||||
for (u32 i = 0; i < num; i++)
|
||||
{
|
||||
list[i] = 0;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -1,6 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
struct spinlock
|
||||
{
|
||||
SMutexBE mutex;
|
||||
};
|
|
@ -1,4 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
u64 get_time();
|
||||
u64 get_system_time();
|
|
@ -1,23 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
SYS_TIMER_STATE_STOP = 0x00U,
|
||||
SYS_TIMER_STATE_RUN = 0x01U,
|
||||
};
|
||||
|
||||
struct sys_timer_information_t
|
||||
{
|
||||
s64 next_expiration_time; //system_time_t
|
||||
u64 period; //usecond_t
|
||||
u32 timer_state;
|
||||
u32 pad;
|
||||
};
|
||||
|
||||
struct timer
|
||||
{
|
||||
rTimer tmr;
|
||||
sys_timer_information_t timer_information_t;
|
||||
};
|
||||
|
||||
#pragma pack()
|
|
@ -1,23 +0,0 @@
|
|||
#if 0
|
||||
#include "stdafx.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
|
||||
static SysCallBase sc_spu("sys_spu");
|
||||
|
||||
u32 _max_usable_spu = 0;
|
||||
u32 _max_raw_spu = 0;
|
||||
|
||||
int sys_spu_initialize(u32 max_usable_spu, u32 max_raw_spu)
|
||||
{
|
||||
sc_spu.Log("sys_spu_initialize(max_usable_spu=%d, max_raw_spu=%d)", max_usable_spu, max_raw_spu);
|
||||
_max_usable_spu = max_usable_spu;
|
||||
_max_raw_spu = max_raw_spu;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_raw_spu_create(u32 id_addr, u32 attr_addr)
|
||||
{
|
||||
Memory.Write32(id_addr, Emu.GetIdManager().GetNewID("raw_spu"));
|
||||
return CELL_OK;
|
||||
}
|
||||
#endif
|
|
@ -8,7 +8,7 @@
|
|||
#include "Emu/FS/vfsFile.h"
|
||||
#include "Emu/FS/vfsDir.h"
|
||||
|
||||
#include "SC_FileSystem.h"
|
||||
#include "lv2Fs.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
|
||||
extern Module *sys_fs;
|
||||
|
@ -52,7 +52,7 @@ struct FsRingBufferConfig
|
|||
} m_fs_config;
|
||||
|
||||
|
||||
int cellFsOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size)
|
||||
s32 cellFsOpen(u32 path_addr, s32 flags, mem32_t fd, mem32_t arg, u64 size)
|
||||
{
|
||||
const std::string& path = Memory.ReadString(path_addr);
|
||||
sys_fs->Log("cellFsOpen(path=\"%s\", flags=0x%x, fd_addr=0x%x, arg_addr=0x%x, size=0x%llx)",
|
||||
|
@ -137,7 +137,7 @@ int cellFsOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsRead(u32 fd, u32 buf_addr, u64 nbytes, mem64_t nread)
|
||||
s32 cellFsRead(u32 fd, u32 buf_addr, u64 nbytes, mem64_t nread)
|
||||
{
|
||||
sys_fs->Log("cellFsRead(fd=%d, buf_addr=0x%x, nbytes=0x%llx, nread_addr=0x%x)",
|
||||
fd, buf_addr, nbytes, nread.GetAddr());
|
||||
|
@ -185,7 +185,7 @@ fin:
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsWrite(u32 fd, u32 buf_addr, u64 nbytes, mem64_t nwrite)
|
||||
s32 cellFsWrite(u32 fd, u32 buf_addr, u64 nbytes, mem64_t nwrite)
|
||||
{
|
||||
sys_fs->Log("cellFsWrite(fd=%d, buf_addr=0x%x, nbytes=0x%llx, nwrite_addr=0x%x)",
|
||||
fd, buf_addr, nbytes, nwrite.GetAddr());
|
||||
|
@ -206,7 +206,7 @@ int cellFsWrite(u32 fd, u32 buf_addr, u64 nbytes, mem64_t nwrite)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsClose(u32 fd)
|
||||
s32 cellFsClose(u32 fd)
|
||||
{
|
||||
sys_fs->Warning("cellFsClose(fd=%d)", fd);
|
||||
|
||||
|
@ -216,7 +216,7 @@ int cellFsClose(u32 fd)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsOpendir(u32 path_addr, mem32_t fd)
|
||||
s32 cellFsOpendir(u32 path_addr, mem32_t fd)
|
||||
{
|
||||
const std::string& path = Memory.ReadString(path_addr);
|
||||
sys_fs->Warning("cellFsOpendir(path=\"%s\", fd_addr=0x%x)", path.c_str(), fd.GetAddr());
|
||||
|
@ -235,7 +235,7 @@ int cellFsOpendir(u32 path_addr, mem32_t fd)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsReaddir(u32 fd, mem_ptr_t<CellFsDirent> dir, mem64_t nread)
|
||||
s32 cellFsReaddir(u32 fd, mem_ptr_t<CellFsDirent> dir, mem64_t nread)
|
||||
{
|
||||
sys_fs->Log("cellFsReaddir(fd=%d, dir_addr=0x%x, nread_addr=0x%x)", fd, dir.GetAddr(), nread.GetAddr());
|
||||
|
||||
|
@ -261,7 +261,7 @@ int cellFsReaddir(u32 fd, mem_ptr_t<CellFsDirent> dir, mem64_t nread)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsClosedir(u32 fd)
|
||||
s32 cellFsClosedir(u32 fd)
|
||||
{
|
||||
sys_fs->Log("cellFsClosedir(fd=%d)", fd);
|
||||
|
||||
|
@ -271,7 +271,7 @@ int cellFsClosedir(u32 fd)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStat(const u32 path_addr, mem_ptr_t<CellFsStat> sb)
|
||||
s32 cellFsStat(const u32 path_addr, mem_ptr_t<CellFsStat> sb)
|
||||
{
|
||||
const std::string& path = Memory.ReadString(path_addr);
|
||||
sys_fs->Log("cellFsStat(path=\"%s\", sb_addr: 0x%x)", path.c_str(), sb.GetAddr());
|
||||
|
@ -311,7 +311,7 @@ int cellFsStat(const u32 path_addr, mem_ptr_t<CellFsStat> sb)
|
|||
return CELL_ENOENT;
|
||||
}
|
||||
|
||||
int cellFsFstat(u32 fd, mem_ptr_t<CellFsStat> sb)
|
||||
s32 cellFsFstat(u32 fd, mem_ptr_t<CellFsStat> sb)
|
||||
{
|
||||
sys_fs->Log("cellFsFstat(fd=%d, sb_addr: 0x%x)", fd, sb.GetAddr());
|
||||
|
||||
|
@ -336,7 +336,7 @@ int cellFsFstat(u32 fd, mem_ptr_t<CellFsStat> sb)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsMkdir(u32 path_addr, u32 mode)
|
||||
s32 cellFsMkdir(u32 path_addr, u32 mode)
|
||||
{
|
||||
const std::string& ps3_path = Memory.ReadString(path_addr);
|
||||
sys_fs->Log("cellFsMkdir(path=\"%s\", mode=0x%x)", ps3_path.c_str(), mode);
|
||||
|
@ -355,7 +355,7 @@ int cellFsMkdir(u32 path_addr, u32 mode)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsRename(u32 from_addr, u32 to_addr)
|
||||
s32 cellFsRename(u32 from_addr, u32 to_addr)
|
||||
{
|
||||
const std::string& ps3_from = Memory.ReadString(from_addr);
|
||||
const std::string& ps3_to = Memory.ReadString(to_addr);
|
||||
|
@ -385,7 +385,7 @@ int cellFsRename(u32 from_addr, u32 to_addr)
|
|||
return CELL_ENOENT;
|
||||
}
|
||||
|
||||
int cellFsRmdir(u32 path_addr)
|
||||
s32 cellFsRmdir(u32 path_addr)
|
||||
{
|
||||
const std::string& ps3_path = Memory.ReadString(path_addr);
|
||||
sys_fs->Log("cellFsRmdir(path=\"%s\")", ps3_path.c_str());
|
||||
|
@ -400,7 +400,7 @@ int cellFsRmdir(u32 path_addr)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsUnlink(u32 path_addr)
|
||||
s32 cellFsUnlink(u32 path_addr)
|
||||
{
|
||||
const std::string& ps3_path = Memory.ReadString(path_addr);
|
||||
sys_fs->Warning("cellFsUnlink(path=\"%s\")", ps3_path.c_str());
|
||||
|
@ -420,7 +420,7 @@ int cellFsUnlink(u32 path_addr)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsLseek(u32 fd, s64 offset, u32 whence, mem64_t pos)
|
||||
s32 cellFsLseek(u32 fd, s64 offset, u32 whence, mem64_t pos)
|
||||
{
|
||||
vfsSeekMode seek_mode;
|
||||
sys_fs->Log("cellFsLseek(fd=%d, offset=0x%llx, whence=0x%x, pos_addr=0x%x)", fd, offset, whence, pos.GetAddr());
|
||||
|
@ -441,7 +441,7 @@ int cellFsLseek(u32 fd, s64 offset, u32 whence, mem64_t pos)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsFtruncate(u32 fd, u64 size)
|
||||
s32 cellFsFtruncate(u32 fd, u64 size)
|
||||
{
|
||||
sys_fs->Log("cellFsFtruncate(fd=%d, size=%lld)", fd, size);
|
||||
u32 attr;
|
||||
|
@ -467,7 +467,7 @@ int cellFsFtruncate(u32 fd, u64 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsTruncate(u32 path_addr, u64 size)
|
||||
s32 cellFsTruncate(u32 path_addr, u64 size)
|
||||
{
|
||||
const std::string& path = Memory.ReadString(path_addr);
|
||||
sys_fs->Log("cellFsTruncate(path=\"%s\", size=%lld)", path.c_str(), size);
|
||||
|
@ -498,7 +498,7 @@ int cellFsTruncate(u32 path_addr, u64 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsFGetBlockSize(u32 fd, mem64_t sector_size, mem64_t block_size)
|
||||
s32 cellFsFGetBlockSize(u32 fd, mem64_t sector_size, mem64_t block_size)
|
||||
{
|
||||
sys_fs->Log("cellFsFGetBlockSize(fd=%d, sector_size_addr: 0x%x, block_size_addr: 0x%x)", fd, sector_size.GetAddr(), block_size.GetAddr());
|
||||
|
||||
|
@ -511,7 +511,7 @@ int cellFsFGetBlockSize(u32 fd, mem64_t sector_size, mem64_t block_size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsGetBlockSize(u32 path_addr, mem64_t sector_size, mem64_t block_size)
|
||||
s32 cellFsGetBlockSize(u32 path_addr, mem64_t sector_size, mem64_t block_size)
|
||||
{
|
||||
sys_fs->Log("cellFsGetBlockSize(file: %s, sector_size_addr: 0x%x, block_size_addr: 0x%x)", Memory.ReadString(path_addr).c_str(), sector_size.GetAddr(), block_size.GetAddr());
|
||||
|
||||
|
@ -521,7 +521,7 @@ int cellFsGetBlockSize(u32 path_addr, mem64_t sector_size, mem64_t block_size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsGetFreeSize(u32 path_addr, mem32_t block_size, mem64_t block_count)
|
||||
s32 cellFsGetFreeSize(u32 path_addr, mem32_t block_size, mem64_t block_count)
|
||||
{
|
||||
const std::string& ps3_path = Memory.ReadString(path_addr);
|
||||
sys_fs->Warning("cellFsGetFreeSize(path=\"%s\", block_size_addr=0x%x, block_count_addr=0x%x)",
|
||||
|
@ -540,7 +540,7 @@ int cellFsGetFreeSize(u32 path_addr, mem32_t block_size, mem64_t block_count)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsGetDirectoryEntries(u32 fd, mem_ptr_t<CellFsDirectoryEntry> entries, u32 entries_size, mem32_t data_count)
|
||||
s32 cellFsGetDirectoryEntries(u32 fd, mem_ptr_t<CellFsDirectoryEntry> entries, u32 entries_size, mem32_t data_count)
|
||||
{
|
||||
sys_fs->Log("cellFsGetDirectoryEntries(fd=%d, entries_addr=0x%x, entries_size = 0x%x, data_count_addr=0x%x)", fd, entries.GetAddr(), entries_size, data_count.GetAddr());
|
||||
|
||||
|
@ -578,7 +578,7 @@ int cellFsGetDirectoryEntries(u32 fd, mem_ptr_t<CellFsDirectoryEntry> entries, u
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStReadInit(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf)
|
||||
s32 cellFsStReadInit(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf)
|
||||
{
|
||||
sys_fs->Warning("cellFsStReadInit(fd=%d, ringbuf_addr=0x%x)", fd, ringbuf.GetAddr());
|
||||
|
||||
|
@ -608,7 +608,7 @@ int cellFsStReadInit(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStReadFinish(u32 fd)
|
||||
s32 cellFsStReadFinish(u32 fd)
|
||||
{
|
||||
sys_fs->Warning("cellFsStReadFinish(fd=%d)", fd);
|
||||
|
||||
|
@ -621,7 +621,7 @@ int cellFsStReadFinish(u32 fd)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStReadGetRingBuf(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf)
|
||||
s32 cellFsStReadGetRingBuf(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf)
|
||||
{
|
||||
sys_fs->Warning("cellFsStReadGetRingBuf(fd=%d, ringbuf_addr=0x%x)", fd, ringbuf.GetAddr());
|
||||
|
||||
|
@ -643,7 +643,7 @@ int cellFsStReadGetRingBuf(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStReadGetStatus(u32 fd, mem64_t status)
|
||||
s32 cellFsStReadGetStatus(u32 fd, mem64_t status)
|
||||
{
|
||||
sys_fs->Warning("cellFsStReadGetRingBuf(fd=%d, status_addr=0x%x)", fd, status.GetAddr());
|
||||
|
||||
|
@ -655,7 +655,7 @@ int cellFsStReadGetStatus(u32 fd, mem64_t status)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStReadGetRegid(u32 fd, mem64_t regid)
|
||||
s32 cellFsStReadGetRegid(u32 fd, mem64_t regid)
|
||||
{
|
||||
sys_fs->Warning("cellFsStReadGetRingBuf(fd=%d, regid_addr=0x%x)", fd, regid.GetAddr());
|
||||
|
||||
|
@ -667,7 +667,7 @@ int cellFsStReadGetRegid(u32 fd, mem64_t regid)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStReadStart(u32 fd, u64 offset, u64 size)
|
||||
s32 cellFsStReadStart(u32 fd, u64 offset, u64 size)
|
||||
{
|
||||
sys_fs->Warning("TODO: cellFsStReadStart(fd=%d, offset=0x%llx, size=0x%llx)", fd, offset, size);
|
||||
|
||||
|
@ -680,7 +680,7 @@ int cellFsStReadStart(u32 fd, u64 offset, u64 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStReadStop(u32 fd)
|
||||
s32 cellFsStReadStop(u32 fd)
|
||||
{
|
||||
sys_fs->Warning("cellFsStReadStop(fd=%d)", fd);
|
||||
|
||||
|
@ -692,7 +692,7 @@ int cellFsStReadStop(u32 fd)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStRead(u32 fd, u32 buf_addr, u64 size, mem64_t rsize)
|
||||
s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, mem64_t rsize)
|
||||
{
|
||||
sys_fs->Warning("TODO: cellFsStRead(fd=%d, buf_addr=0x%x, size=0x%llx, rsize_addr = 0x%x)", fd, buf_addr, size, rsize.GetAddr());
|
||||
|
||||
|
@ -707,7 +707,7 @@ int cellFsStRead(u32 fd, u32 buf_addr, u64 size, mem64_t rsize)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStReadGetCurrentAddr(u32 fd, mem32_t addr_addr, mem64_t size)
|
||||
s32 cellFsStReadGetCurrentAddr(u32 fd, mem32_t addr_addr, mem64_t size)
|
||||
{
|
||||
sys_fs->Warning("TODO: cellFsStReadGetCurrentAddr(fd=%d, addr_addr=0x%x, size_addr = 0x%x)", fd, addr_addr.GetAddr(), size.GetAddr());
|
||||
|
||||
|
@ -719,7 +719,7 @@ int cellFsStReadGetCurrentAddr(u32 fd, mem32_t addr_addr, mem64_t size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size)
|
||||
s32 cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size)
|
||||
{
|
||||
sys_fs->Warning("TODO: cellFsStReadPutCurrentAddr(fd=%d, addr_addr=0x%x, size = 0x%llx)", fd, addr_addr, size);
|
||||
|
||||
|
@ -731,7 +731,7 @@ int cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStReadWait(u32 fd, u64 size)
|
||||
s32 cellFsStReadWait(u32 fd, u64 size)
|
||||
{
|
||||
sys_fs->Warning("TODO: cellFsStReadWait(fd=%d, size = 0x%llx)", fd, size);
|
||||
|
||||
|
@ -741,7 +741,7 @@ int cellFsStReadWait(u32 fd, u64 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsStReadWaitCallback(u32 fd, u64 size, mem_func_ptr_t<void (*)(int xfd, u64 xsize)> func)
|
||||
s32 cellFsStReadWaitCallback(u32 fd, u64 size, mem_func_ptr_t<void (*)(int xfd, u64 xsize)> func)
|
||||
{
|
||||
sys_fs->Warning("TODO: cellFsStReadWaitCallback(fd=%d, size = 0x%llx, func_addr = 0x%x)", fd, size, func.GetAddr());
|
||||
|
||||
|
@ -752,4 +752,4 @@ int cellFsStReadWaitCallback(u32 fd, u64 size, mem_func_ptr_t<void (*)(int xfd,
|
|||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
}
|
|
@ -122,3 +122,37 @@ struct CellFsRingBuffer
|
|||
be_t<u64> transfer_rate;
|
||||
be_t<u32> copy;
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 cellFsOpen(u32 path_addr, s32 flags, mem32_t fd, mem32_t arg, u64 size);
|
||||
s32 cellFsRead(u32 fd, u32 buf_addr, u64 nbytes, mem64_t nread);
|
||||
s32 cellFsWrite(u32 fd, u32 buf_addr, u64 nbytes, mem64_t nwrite);
|
||||
s32 cellFsClose(u32 fd);
|
||||
s32 cellFsOpendir(u32 path_addr, mem32_t fd);
|
||||
s32 cellFsReaddir(u32 fd, mem_ptr_t<CellFsDirent> dir, mem64_t nread);
|
||||
s32 cellFsClosedir(u32 fd);
|
||||
s32 cellFsStat(u32 path_addr, mem_ptr_t<CellFsStat> sb);
|
||||
s32 cellFsFstat(u32 fd, mem_ptr_t<CellFsStat> sb);
|
||||
s32 cellFsMkdir(u32 path_addr, u32 mode);
|
||||
s32 cellFsRename(u32 from_addr, u32 to_addr);
|
||||
s32 cellFsRmdir(u32 path_addr);
|
||||
s32 cellFsUnlink(u32 path_addr);
|
||||
s32 cellFsLseek(u32 fd, s64 offset, u32 whence, mem64_t pos);
|
||||
s32 cellFsFtruncate(u32 fd, u64 size);
|
||||
s32 cellFsTruncate(u32 path_addr, u64 size);
|
||||
s32 cellFsFGetBlockSize(u32 fd, mem64_t sector_size, mem64_t block_size);
|
||||
s32 cellFsGetBlockSize(u32 path_addr, mem64_t sector_size, mem64_t block_size);
|
||||
s32 cellFsGetFreeSize(u32 path_addr, mem32_t block_size, mem64_t block_count);
|
||||
s32 cellFsGetDirectoryEntries(u32 fd, mem_ptr_t<CellFsDirectoryEntry> entries, u32 entries_size, mem32_t data_count);
|
||||
s32 cellFsStReadInit(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf);
|
||||
s32 cellFsStReadFinish(u32 fd);
|
||||
s32 cellFsStReadGetRingBuf(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf);
|
||||
s32 cellFsStReadGetStatus(u32 fd, mem64_t status);
|
||||
s32 cellFsStReadGetRegid(u32 fd, mem64_t regid);
|
||||
s32 cellFsStReadStart(u32 fd, u64 offset, u64 size);
|
||||
s32 cellFsStReadStop(u32 fd);
|
||||
s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, mem64_t rsize);
|
||||
s32 cellFsStReadGetCurrentAddr(u32 fd, mem32_t addr_addr, mem64_t size);
|
||||
s32 cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size);
|
||||
s32 cellFsStReadWait(u32 fd, u64 size);
|
||||
s32 cellFsStReadWaitCallback(u32 fd, u64 size, mem_func_ptr_t<void (*)(int xfd, u64 xsize)> func);
|
|
@ -5,11 +5,11 @@
|
|||
#include "Emu/Cell/PPUThread.h"
|
||||
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Condition.h"
|
||||
#include "sys_cond.h"
|
||||
|
||||
SysCallBase sys_cond("sys_cond");
|
||||
|
||||
int sys_cond_create(mem32_t cond_id, u32 mutex_id, mem_ptr_t<sys_cond_attribute> attr)
|
||||
s32 sys_cond_create(mem32_t cond_id, u32 mutex_id, mem_ptr_t<sys_cond_attribute> attr)
|
||||
{
|
||||
sys_cond.Log("sys_cond_create(cond_id_addr=0x%x, mutex_id=%d, attr_addr=0x%x)",
|
||||
cond_id.GetAddr(), mutex_id, attr.GetAddr());
|
||||
|
@ -45,7 +45,7 @@ int sys_cond_create(mem32_t cond_id, u32 mutex_id, mem_ptr_t<sys_cond_attribute>
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_cond_destroy(u32 cond_id)
|
||||
s32 sys_cond_destroy(u32 cond_id)
|
||||
{
|
||||
sys_cond.Warning("sys_cond_destroy(cond_id=%d)", cond_id);
|
||||
|
||||
|
@ -65,7 +65,7 @@ int sys_cond_destroy(u32 cond_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_cond_signal(u32 cond_id)
|
||||
s32 sys_cond_signal(u32 cond_id)
|
||||
{
|
||||
sys_cond.Log("sys_cond_signal(cond_id=%d)", cond_id);
|
||||
|
||||
|
@ -92,7 +92,7 @@ int sys_cond_signal(u32 cond_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_cond_signal_all(u32 cond_id)
|
||||
s32 sys_cond_signal_all(u32 cond_id)
|
||||
{
|
||||
sys_cond.Log("sys_cond_signal_all(cond_id=%d)", cond_id);
|
||||
|
||||
|
@ -122,7 +122,7 @@ int sys_cond_signal_all(u32 cond_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_cond_signal_to(u32 cond_id, u32 thread_id)
|
||||
s32 sys_cond_signal_to(u32 cond_id, u32 thread_id)
|
||||
{
|
||||
sys_cond.Log("sys_cond_signal_to(cond_id=%d, thread_id=%d)", cond_id, thread_id);
|
||||
|
||||
|
@ -159,7 +159,7 @@ int sys_cond_signal_to(u32 cond_id, u32 thread_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_cond_wait(u32 cond_id, u64 timeout)
|
||||
s32 sys_cond_wait(u32 cond_id, u64 timeout)
|
||||
{
|
||||
sys_cond.Log("sys_cond_wait(cond_id=%d, timeout=%lld)", cond_id, timeout);
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "SC_Mutex.h"
|
||||
#include "sys_mutex.h"
|
||||
|
||||
struct sys_cond_attribute
|
||||
{
|
||||
|
@ -28,4 +28,12 @@ struct Cond
|
|||
, signaler(0)
|
||||
{
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 sys_cond_create(mem32_t cond_id, u32 mutex_id, mem_ptr_t<sys_cond_attribute> attr);
|
||||
s32 sys_cond_destroy(u32 cond_id);
|
||||
s32 sys_cond_wait(u32 cond_id, u64 timeout);
|
||||
s32 sys_cond_signal(u32 cond_id);
|
||||
s32 sys_cond_signal_all(u32 cond_id);
|
||||
s32 sys_cond_signal_to(u32 cond_id, u32 thread_id);
|
751
rpcs3/Emu/SysCalls/lv2/sys_event.cpp
Normal file
751
rpcs3/Emu/SysCalls/lv2/sys_event.cpp
Normal file
|
@ -0,0 +1,751 @@
|
|||
#include "stdafx.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "Emu/Cell/SPUThread.h"
|
||||
#include "Emu/event.h"
|
||||
|
||||
#include "sys_lwmutex.h"
|
||||
#include "sys_event.h"
|
||||
|
||||
SysCallBase sys_event("sys_event");
|
||||
|
||||
s32 sys_event_queue_create(mem32_t equeue_id, mem_ptr_t<sys_event_queue_attr> attr, u64 event_queue_key, int size)
|
||||
{
|
||||
sys_event.Warning("sys_event_queue_create(equeue_id_addr=0x%x, attr_addr=0x%x, event_queue_key=0x%llx, size=%d)",
|
||||
equeue_id.GetAddr(), attr.GetAddr(), event_queue_key, size);
|
||||
|
||||
if(size <= 0 || size > 127)
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
if(!equeue_id.IsGood() || !attr.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
switch (attr->protocol.ToBE())
|
||||
{
|
||||
case se32(SYS_SYNC_PRIORITY): break;
|
||||
case se32(SYS_SYNC_RETRY): sys_event.Error("Invalid SYS_SYNC_RETRY protocol attr"); return CELL_EINVAL;
|
||||
case se32(SYS_SYNC_PRIORITY_INHERIT): sys_event.Error("Invalid SYS_SYNC_PRIORITY_INHERIT protocol attr"); return CELL_EINVAL;
|
||||
case se32(SYS_SYNC_FIFO): break;
|
||||
default: sys_event.Error("Unknown 0x%x protocol attr", (u32)attr->protocol); return CELL_EINVAL;
|
||||
}
|
||||
|
||||
switch (attr->type.ToBE())
|
||||
{
|
||||
case se32(SYS_PPU_QUEUE): break;
|
||||
case se32(SYS_SPU_QUEUE): break;
|
||||
default: sys_event.Error("Unknown 0x%x type attr", (u32)attr->type); return CELL_EINVAL;
|
||||
}
|
||||
|
||||
if (event_queue_key && Emu.GetEventManager().CheckKey(event_queue_key))
|
||||
{
|
||||
return CELL_EEXIST;
|
||||
}
|
||||
|
||||
EventQueue* eq = new EventQueue((u32)attr->protocol, (int)attr->type, attr->name_u64, event_queue_key, size);
|
||||
|
||||
if (event_queue_key && !Emu.GetEventManager().RegisterKey(eq, event_queue_key))
|
||||
{
|
||||
delete eq;
|
||||
return CELL_EAGAIN;
|
||||
}
|
||||
|
||||
equeue_id = sys_event.GetNewId(eq);
|
||||
sys_event.Warning("*** event_queue created [%s] (protocol=0x%x, type=0x%x): id = %d",
|
||||
std::string(attr->name, 8).c_str(), (u32)attr->protocol, (int)attr->type, equeue_id.GetValue());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_queue_destroy(u32 equeue_id, int mode)
|
||||
{
|
||||
sys_event.Error("sys_event_queue_destroy(equeue_id=%d, mode=0x%x)", equeue_id, mode);
|
||||
|
||||
EventQueue* eq;
|
||||
if (!Emu.GetIdManager().GetIDData(equeue_id, eq))
|
||||
{
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
if (mode && mode != SYS_EVENT_QUEUE_DESTROY_FORCE)
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
u32 tid = GetCurrentPPUThread().GetId();
|
||||
|
||||
eq->sq.m_mutex.lock();
|
||||
eq->owner.lock(tid);
|
||||
// check if some threads are waiting for an event
|
||||
if (!mode && eq->sq.list.size())
|
||||
{
|
||||
eq->owner.unlock(tid);
|
||||
eq->sq.m_mutex.unlock();
|
||||
return CELL_EBUSY;
|
||||
}
|
||||
eq->owner.unlock(tid, ~0);
|
||||
eq->sq.m_mutex.unlock();
|
||||
while (eq->sq.list.size())
|
||||
{
|
||||
Sleep(1);
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
LOG_WARNING(HLE, "sys_event_queue_destroy(equeue=%d) aborted", equeue_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Emu.GetEventManager().UnregisterKey(eq->key);
|
||||
eq->ports.clear();
|
||||
Emu.GetIdManager().RemoveID(equeue_id);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_queue_tryreceive(u32 equeue_id, mem_ptr_t<sys_event_data> event_array, int size, mem32_t number)
|
||||
{
|
||||
sys_event.Error("sys_event_queue_tryreceive(equeue_id=%d, event_array_addr=0x%x, size=%d, number_addr=0x%x)",
|
||||
equeue_id, event_array.GetAddr(), size, number.GetAddr());
|
||||
|
||||
if (size < 0 || !number.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (size && !Memory.IsGoodAddr(event_array.GetAddr(), sizeof(sys_event_data) * size))
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
EventQueue* eq;
|
||||
if (!Emu.GetIdManager().GetIDData(equeue_id, eq))
|
||||
{
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
if (eq->type != SYS_PPU_QUEUE)
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
if (size == 0)
|
||||
{
|
||||
number = 0;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
u32 tid = GetCurrentPPUThread().GetId();
|
||||
|
||||
eq->sq.m_mutex.lock();
|
||||
eq->owner.lock(tid);
|
||||
if (eq->sq.list.size())
|
||||
{
|
||||
number = 0;
|
||||
eq->owner.unlock(tid);
|
||||
eq->sq.m_mutex.unlock();
|
||||
return CELL_OK;
|
||||
}
|
||||
number = eq->events.pop_all((sys_event_data*)(Memory + event_array.GetAddr()), size);
|
||||
eq->owner.unlock(tid);
|
||||
eq->sq.m_mutex.unlock();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_queue_receive(u32 equeue_id, mem_ptr_t<sys_event_data> event, u64 timeout)
|
||||
{
|
||||
sys_event.Log("sys_event_queue_receive(equeue_id=%d, event_addr=0x%x, timeout=%lld)",
|
||||
equeue_id, event.GetAddr(), timeout);
|
||||
|
||||
if (!event.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
EventQueue* eq;
|
||||
if (!Emu.GetIdManager().GetIDData(equeue_id, eq))
|
||||
{
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
if (eq->type != SYS_PPU_QUEUE)
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
u32 tid = GetCurrentPPUThread().GetId();
|
||||
|
||||
eq->sq.push(tid); // add thread to sleep queue
|
||||
|
||||
timeout = timeout ? (timeout / 1000) : ~0;
|
||||
u64 counter = 0;
|
||||
while (true)
|
||||
{
|
||||
switch (eq->owner.trylock(tid))
|
||||
{
|
||||
case SMR_OK:
|
||||
if (!eq->events.count())
|
||||
{
|
||||
eq->owner.unlock(tid);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
u32 next = (eq->protocol == SYS_SYNC_FIFO) ? eq->sq.pop() : eq->sq.pop_prio();
|
||||
if (next != tid)
|
||||
{
|
||||
eq->owner.unlock(tid, next);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case SMR_SIGNAL:
|
||||
{
|
||||
eq->events.pop(*event);
|
||||
eq->owner.unlock(tid);
|
||||
sys_event.Log(" *** event received: source=0x%llx, d1=0x%llx, d2=0x%llx, d3=0x%llx",
|
||||
(u64)event->source, (u64)event->data1, (u64)event->data2, (u64)event->data3);
|
||||
/* passing event data in registers */
|
||||
PPUThread& t = GetCurrentPPUThread();
|
||||
t.GPR[4] = event->source;
|
||||
t.GPR[5] = event->data1;
|
||||
t.GPR[6] = event->data2;
|
||||
t.GPR[7] = event->data3;
|
||||
return CELL_OK;
|
||||
}
|
||||
case SMR_FAILED: break;
|
||||
default: eq->sq.invalidate(tid); return CELL_ECANCELED;
|
||||
}
|
||||
|
||||
Sleep(1);
|
||||
if (counter++ > timeout || Emu.IsStopped())
|
||||
{
|
||||
if (Emu.IsStopped()) LOG_WARNING(HLE, "sys_event_queue_receive(equeue=%d) aborted", equeue_id);
|
||||
eq->sq.invalidate(tid);
|
||||
return CELL_ETIMEDOUT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 sys_event_queue_drain(u32 equeue_id)
|
||||
{
|
||||
sys_event.Log("sys_event_queue_drain(equeue_id=%d)", equeue_id);
|
||||
|
||||
EventQueue* eq;
|
||||
if (!Emu.GetIdManager().GetIDData(equeue_id, eq))
|
||||
{
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
eq->events.clear();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_port_create(mem32_t eport_id, int port_type, u64 name)
|
||||
{
|
||||
sys_event.Warning("sys_event_port_create(eport_id_addr=0x%x, port_type=0x%x, name=0x%llx)",
|
||||
eport_id.GetAddr(), port_type, name);
|
||||
|
||||
if (!eport_id.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (port_type != SYS_EVENT_PORT_LOCAL)
|
||||
{
|
||||
sys_event.Error("sys_event_port_create: invalid port_type(0x%x)", port_type);
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
EventPort* eport = new EventPort();
|
||||
u32 id = sys_event.GetNewId(eport);
|
||||
eport->name = name ? name : ((u64)sys_process_getpid() << 32) | (u64)id;
|
||||
eport_id = id;
|
||||
sys_event.Warning("*** sys_event_port created: id = %d", id);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_port_destroy(u32 eport_id)
|
||||
{
|
||||
sys_event.Warning("sys_event_port_destroy(eport_id=%d)", eport_id);
|
||||
|
||||
EventPort* eport;
|
||||
if (!Emu.GetIdManager().GetIDData(eport_id, eport))
|
||||
{
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
if (!eport->m_mutex.try_lock())
|
||||
{
|
||||
return CELL_EISCONN;
|
||||
}
|
||||
|
||||
if (eport->eq)
|
||||
{
|
||||
eport->m_mutex.unlock();
|
||||
return CELL_EISCONN;
|
||||
}
|
||||
|
||||
eport->m_mutex.unlock();
|
||||
Emu.GetIdManager().RemoveID(eport_id);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_port_connect_local(u32 eport_id, u32 equeue_id)
|
||||
{
|
||||
sys_event.Warning("sys_event_port_connect_local(eport_id=%d, equeue_id=%d)", eport_id, equeue_id);
|
||||
|
||||
EventPort* eport;
|
||||
if (!Emu.GetIdManager().GetIDData(eport_id, eport))
|
||||
{
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
if (!eport->m_mutex.try_lock())
|
||||
{
|
||||
return CELL_EISCONN;
|
||||
}
|
||||
|
||||
if (eport->eq)
|
||||
{
|
||||
eport->m_mutex.unlock();
|
||||
return CELL_EISCONN;
|
||||
}
|
||||
|
||||
EventQueue* equeue;
|
||||
if (!Emu.GetIdManager().GetIDData(equeue_id, equeue))
|
||||
{
|
||||
sys_event.Error("sys_event_port_connect_local: event_queue(%d) not found!", equeue_id);
|
||||
eport->m_mutex.unlock();
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
else
|
||||
{
|
||||
equeue->ports.add(eport);
|
||||
}
|
||||
|
||||
eport->eq = equeue;
|
||||
eport->m_mutex.unlock();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_port_disconnect(u32 eport_id)
|
||||
{
|
||||
sys_event.Warning("sys_event_port_disconnect(eport_id=%d)", eport_id);
|
||||
|
||||
EventPort* eport;
|
||||
if (!Emu.GetIdManager().GetIDData(eport_id, eport))
|
||||
{
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
if (!eport->eq)
|
||||
{
|
||||
return CELL_ENOTCONN;
|
||||
}
|
||||
|
||||
if (!eport->m_mutex.try_lock())
|
||||
{
|
||||
return CELL_EBUSY;
|
||||
}
|
||||
|
||||
eport->eq->ports.remove(eport);
|
||||
eport->eq = nullptr;
|
||||
eport->m_mutex.unlock();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_port_send(u32 eport_id, u64 data1, u64 data2, u64 data3)
|
||||
{
|
||||
sys_event.Log("sys_event_port_send(eport_id=%d, data1=0x%llx, data2=0x%llx, data3=0x%llx)",
|
||||
eport_id, data1, data2, data3);
|
||||
|
||||
EventPort* eport;
|
||||
if (!Emu.GetIdManager().GetIDData(eport_id, eport))
|
||||
{
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(eport->m_mutex);
|
||||
|
||||
EventQueue* eq = eport->eq;
|
||||
if (!eq)
|
||||
{
|
||||
return CELL_ENOTCONN;
|
||||
}
|
||||
|
||||
if (!eq->events.push(eport->name, data1, data2, data3))
|
||||
{
|
||||
return CELL_EBUSY;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
// sys_event_flag
|
||||
s32 sys_event_flag_create(mem32_t eflag_id, mem_ptr_t<sys_event_flag_attr> attr, u64 init)
|
||||
{
|
||||
sys_event.Warning("sys_event_flag_create(eflag_id_addr=0x%x, attr_addr=0x%x, init=0x%llx)",
|
||||
eflag_id.GetAddr(), attr.GetAddr(), init);
|
||||
|
||||
if(!eflag_id.IsGood() || !attr.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
switch (attr->protocol.ToBE())
|
||||
{
|
||||
case se32(SYS_SYNC_PRIORITY): break;
|
||||
case se32(SYS_SYNC_RETRY): sys_event.Warning("TODO: SYS_SYNC_RETRY attr"); break;
|
||||
case se32(SYS_SYNC_PRIORITY_INHERIT): sys_event.Warning("TODO: SYS_SYNC_PRIORITY_INHERIT attr"); break;
|
||||
case se32(SYS_SYNC_FIFO): break;
|
||||
default: return CELL_EINVAL;
|
||||
}
|
||||
|
||||
if (attr->pshared.ToBE() != se32(0x200))
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
switch (attr->type.ToBE())
|
||||
{
|
||||
case se32(SYS_SYNC_WAITER_SINGLE): break;
|
||||
case se32(SYS_SYNC_WAITER_MULTIPLE): break;
|
||||
default: return CELL_EINVAL;
|
||||
}
|
||||
|
||||
eflag_id = sys_event.GetNewId(new EventFlag(init, (u32)attr->protocol, (int)attr->type));
|
||||
|
||||
sys_event.Warning("*** event_flag created [%s] (protocol=0x%x, type=0x%x): id = %d",
|
||||
std::string(attr->name, 8).c_str(), (u32)attr->protocol, (int)attr->type, eflag_id.GetValue());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_flag_destroy(u32 eflag_id)
|
||||
{
|
||||
sys_event.Warning("sys_event_flag_destroy(eflag_id=%d)", eflag_id);
|
||||
|
||||
EventFlag* ef;
|
||||
if(!sys_event.CheckId(eflag_id, ef)) return CELL_ESRCH;
|
||||
|
||||
if (ef->waiters.size()) // ???
|
||||
{
|
||||
return CELL_EBUSY;
|
||||
}
|
||||
|
||||
Emu.GetIdManager().RemoveID(eflag_id);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64 timeout)
|
||||
{
|
||||
sys_event.Log("sys_event_flag_wait(eflag_id=%d, bitptn=0x%llx, mode=0x%x, result_addr=0x%x, timeout=%lld)",
|
||||
eflag_id, bitptn, mode, result.GetAddr(), timeout);
|
||||
|
||||
if (result.IsGood()) result = 0;
|
||||
|
||||
switch (mode & 0xf)
|
||||
{
|
||||
case SYS_EVENT_FLAG_WAIT_AND: break;
|
||||
case SYS_EVENT_FLAG_WAIT_OR: break;
|
||||
default: return CELL_EINVAL;
|
||||
}
|
||||
|
||||
switch (mode & ~0xf)
|
||||
{
|
||||
case 0: break; // ???
|
||||
case SYS_EVENT_FLAG_WAIT_CLEAR: break;
|
||||
case SYS_EVENT_FLAG_WAIT_CLEAR_ALL: break;
|
||||
default: return CELL_EINVAL;
|
||||
}
|
||||
|
||||
EventFlag* ef;
|
||||
if(!sys_event.CheckId(eflag_id, ef)) return CELL_ESRCH;
|
||||
|
||||
u32 tid = GetCurrentPPUThread().GetId();
|
||||
|
||||
{
|
||||
SMutexLocker lock(ef->m_mutex);
|
||||
if (ef->m_type == SYS_SYNC_WAITER_SINGLE && ef->waiters.size() > 0)
|
||||
{
|
||||
return CELL_EPERM;
|
||||
}
|
||||
EventFlagWaiter rec;
|
||||
rec.bitptn = bitptn;
|
||||
rec.mode = mode;
|
||||
rec.tid = tid;
|
||||
ef->waiters.push_back(rec);
|
||||
|
||||
if (ef->check() == tid)
|
||||
{
|
||||
u64 flags = ef->flags;
|
||||
|
||||
ef->waiters.erase(ef->waiters.end() - 1);
|
||||
|
||||
if (mode & SYS_EVENT_FLAG_WAIT_CLEAR)
|
||||
{
|
||||
ef->flags &= ~bitptn;
|
||||
}
|
||||
else if (mode & SYS_EVENT_FLAG_WAIT_CLEAR_ALL)
|
||||
{
|
||||
ef->flags = 0;
|
||||
}
|
||||
|
||||
if (result.IsGood())
|
||||
{
|
||||
result = flags;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
if (!result.GetAddr())
|
||||
{
|
||||
return CELL_OK;
|
||||
}
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
u32 counter = 0;
|
||||
const u32 max_counter = timeout ? (timeout / 1000) : ~0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (ef->signal.unlock(tid, tid) == SMR_OK)
|
||||
{
|
||||
SMutexLocker lock(ef->m_mutex);
|
||||
|
||||
u64 flags = ef->flags;
|
||||
|
||||
for (u32 i = 0; i < ef->waiters.size(); i++)
|
||||
{
|
||||
if (ef->waiters[i].tid == tid)
|
||||
{
|
||||
ef->waiters.erase(ef->waiters.begin() +i);
|
||||
|
||||
if (mode & SYS_EVENT_FLAG_WAIT_CLEAR)
|
||||
{
|
||||
ef->flags &= ~bitptn;
|
||||
}
|
||||
else if (mode & SYS_EVENT_FLAG_WAIT_CLEAR_ALL)
|
||||
{
|
||||
ef->flags = 0;
|
||||
}
|
||||
|
||||
if (u32 target = ef->check())
|
||||
{
|
||||
// if signal, leave both mutexes locked...
|
||||
ef->signal.unlock(tid, target);
|
||||
ef->m_mutex.unlock(tid, target);
|
||||
}
|
||||
else
|
||||
{
|
||||
ef->signal.unlock(tid);
|
||||
}
|
||||
|
||||
if (result.IsGood())
|
||||
{
|
||||
result = flags;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
if (!result.GetAddr())
|
||||
{
|
||||
return CELL_OK;
|
||||
}
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
ef->signal.unlock(tid);
|
||||
return CELL_ECANCELED;
|
||||
}
|
||||
|
||||
Sleep(1);
|
||||
|
||||
if (counter++ > max_counter)
|
||||
{
|
||||
SMutexLocker lock(ef->m_mutex);
|
||||
|
||||
for (u32 i = 0; i < ef->waiters.size(); i++)
|
||||
{
|
||||
if (ef->waiters[i].tid == tid)
|
||||
{
|
||||
ef->waiters.erase(ef->waiters.begin() + i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_ETIMEDOUT;
|
||||
}
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
LOG_WARNING(HLE, "sys_event_flag_wait(id=%d) aborted", eflag_id);
|
||||
return CELL_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 sys_event_flag_trywait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result)
|
||||
{
|
||||
sys_event.Log("sys_event_flag_trywait(eflag_id=%d, bitptn=0x%llx, mode=0x%x, result_addr=0x%x)",
|
||||
eflag_id, bitptn, mode, result.GetAddr());
|
||||
|
||||
if (result.IsGood()) result = 0;
|
||||
|
||||
switch (mode & 0xf)
|
||||
{
|
||||
case SYS_EVENT_FLAG_WAIT_AND: break;
|
||||
case SYS_EVENT_FLAG_WAIT_OR: break;
|
||||
default: return CELL_EINVAL;
|
||||
}
|
||||
|
||||
switch (mode & ~0xf)
|
||||
{
|
||||
case 0: break; // ???
|
||||
case SYS_EVENT_FLAG_WAIT_CLEAR: break;
|
||||
case SYS_EVENT_FLAG_WAIT_CLEAR_ALL: break;
|
||||
default: return CELL_EINVAL;
|
||||
}
|
||||
|
||||
EventFlag* ef;
|
||||
if(!sys_event.CheckId(eflag_id, ef)) return CELL_ESRCH;
|
||||
|
||||
SMutexLocker lock(ef->m_mutex);
|
||||
|
||||
u64 flags = ef->flags;
|
||||
|
||||
if (((mode & SYS_EVENT_FLAG_WAIT_AND) && (flags & bitptn) == bitptn) ||
|
||||
((mode & SYS_EVENT_FLAG_WAIT_OR) && (flags & bitptn)))
|
||||
{
|
||||
if (mode & SYS_EVENT_FLAG_WAIT_CLEAR)
|
||||
{
|
||||
ef->flags &= ~bitptn;
|
||||
}
|
||||
else if (mode & SYS_EVENT_FLAG_WAIT_CLEAR_ALL)
|
||||
{
|
||||
ef->flags = 0;
|
||||
}
|
||||
|
||||
if (result.IsGood())
|
||||
{
|
||||
result = flags;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
if (!result.GetAddr())
|
||||
{
|
||||
return CELL_OK;
|
||||
}
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
return CELL_EBUSY;
|
||||
}
|
||||
|
||||
s32 sys_event_flag_set(u32 eflag_id, u64 bitptn)
|
||||
{
|
||||
sys_event.Log("sys_event_flag_set(eflag_id=%d, bitptn=0x%llx)", eflag_id, bitptn);
|
||||
|
||||
EventFlag* ef;
|
||||
if(!sys_event.CheckId(eflag_id, ef)) return CELL_ESRCH;
|
||||
|
||||
u32 tid = GetCurrentPPUThread().GetId();
|
||||
|
||||
ef->m_mutex.lock(tid);
|
||||
ef->flags |= bitptn;
|
||||
if (u32 target = ef->check())
|
||||
{
|
||||
// if signal, leave both mutexes locked...
|
||||
ef->signal.lock(target);
|
||||
ef->m_mutex.unlock(tid, target);
|
||||
}
|
||||
else
|
||||
{
|
||||
ef->m_mutex.unlock(tid);
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_flag_clear(u32 eflag_id, u64 bitptn)
|
||||
{
|
||||
sys_event.Log("sys_event_flag_clear(eflag_id=%d, bitptn=0x%llx)", eflag_id, bitptn);
|
||||
|
||||
EventFlag* ef;
|
||||
if(!sys_event.CheckId(eflag_id, ef)) return CELL_ESRCH;
|
||||
|
||||
SMutexLocker lock(ef->m_mutex);
|
||||
ef->flags &= bitptn;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_flag_cancel(u32 eflag_id, mem32_t num)
|
||||
{
|
||||
sys_event.Log("sys_event_flag_cancel(eflag_id=%d, num_addr=0x%x)", eflag_id, num.GetAddr());
|
||||
|
||||
EventFlag* ef;
|
||||
if(!sys_event.CheckId(eflag_id, ef)) return CELL_ESRCH;
|
||||
|
||||
std::vector<u32> tids;
|
||||
|
||||
{
|
||||
SMutexLocker lock(ef->m_mutex);
|
||||
tids.resize(ef->waiters.size());
|
||||
for (u32 i = 0; i < ef->waiters.size(); i++)
|
||||
{
|
||||
tids[i] = ef->waiters[i].tid;
|
||||
}
|
||||
ef->waiters.clear();
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < tids.size(); i++)
|
||||
{
|
||||
ef->signal.lock(tids[i]);
|
||||
}
|
||||
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
LOG_WARNING(HLE, "sys_event_flag_cancel(id=%d) aborted", eflag_id);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
if (num.IsGood())
|
||||
{
|
||||
num = tids.size();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
if (!num.GetAddr())
|
||||
{
|
||||
return CELL_OK;
|
||||
}
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
s32 sys_event_flag_get(u32 eflag_id, mem64_t flags)
|
||||
{
|
||||
sys_event.Log("sys_event_flag_get(eflag_id=%d, flags_addr=0x%x)", eflag_id, flags.GetAddr());
|
||||
|
||||
EventFlag* ef;
|
||||
if(!sys_event.CheckId(eflag_id, ef)) return CELL_ESRCH;
|
||||
|
||||
if (!flags.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
SMutexLocker lock(ef->m_mutex);
|
||||
flags = ef->flags;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#include "Emu/event.h"
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -73,3 +74,25 @@ struct EventFlag
|
|||
return target;
|
||||
}
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 sys_event_queue_create(mem32_t equeue_id, mem_ptr_t<sys_event_queue_attr> attr, u64 event_queue_key, int size);
|
||||
s32 sys_event_queue_destroy(u32 equeue_id, int mode);
|
||||
s32 sys_event_queue_receive(u32 equeue_id, mem_ptr_t<sys_event_data> event, u64 timeout);
|
||||
s32 sys_event_queue_tryreceive(u32 equeue_id, mem_ptr_t<sys_event_data> event_array, int size, mem32_t number);
|
||||
s32 sys_event_queue_drain(u32 event_queue_id);
|
||||
|
||||
s32 sys_event_port_create(mem32_t eport_id, int port_type, u64 name);
|
||||
s32 sys_event_port_destroy(u32 eport_id);
|
||||
s32 sys_event_port_connect_local(u32 event_port_id, u32 event_queue_id);
|
||||
s32 sys_event_port_disconnect(u32 eport_id);
|
||||
s32 sys_event_port_send(u32 event_port_id, u64 data1, u64 data2, u64 data3);
|
||||
|
||||
s32 sys_event_flag_create(mem32_t eflag_id, mem_ptr_t<sys_event_flag_attr> attr, u64 init);
|
||||
s32 sys_event_flag_destroy(u32 eflag_id);
|
||||
s32 sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64 timeout);
|
||||
s32 sys_event_flag_trywait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result);
|
||||
s32 sys_event_flag_set(u32 eflag_id, u64 bitptn);
|
||||
s32 sys_event_flag_clear(u32 eflag_id, u64 bitptn);
|
||||
s32 sys_event_flag_cancel(u32 eflag_id, mem32_t num);
|
||||
s32 sys_event_flag_get(u32 eflag_id, mem64_t flags);
|
|
@ -7,11 +7,11 @@
|
|||
#include "Emu/SysCalls/SC_FUNC.h"
|
||||
#include "Emu/SysCalls/Modules.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "SC_Interrupt.h"
|
||||
#include "sys_interrupt.h"
|
||||
|
||||
static SysCallBase sc_int("sys_interrupt");
|
||||
|
||||
int sys_interrupt_tag_destroy(u32 intrtag)
|
||||
s32 sys_interrupt_tag_destroy(u32 intrtag)
|
||||
{
|
||||
sc_int.Warning("sys_interrupt_tag_destroy(intrtag=%d)", intrtag);
|
||||
|
||||
|
@ -38,7 +38,7 @@ int sys_interrupt_tag_destroy(u32 intrtag)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_interrupt_thread_establish(mem32_t ih, u32 intrtag, u64 intrthread, u64 arg)
|
||||
s32 sys_interrupt_thread_establish(mem32_t ih, u32 intrtag, u64 intrthread, u64 arg)
|
||||
{
|
||||
sc_int.Warning("sys_interrupt_thread_establish(ih_addr=0x%x, intrtag=%d, intrthread=%lld, arg=0x%llx)", ih.GetAddr(), intrtag, intrthread, arg);
|
||||
|
||||
|
@ -82,7 +82,7 @@ int sys_interrupt_thread_establish(mem32_t ih, u32 intrtag, u64 intrthread, u64
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_interrupt_thread_disestablish(u32 ih)
|
||||
s32 sys_interrupt_thread_disestablish(u32 ih)
|
||||
{
|
||||
sc_int.Error("sys_interrupt_thread_disestablish(ih=%d)", ih);
|
||||
|
7
rpcs3/Emu/SysCalls/lv2/sys_interrupt.h
Normal file
7
rpcs3/Emu/SysCalls/lv2/sys_interrupt.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
// SysCalls
|
||||
s32 sys_interrupt_tag_destroy(u32 intrtag);
|
||||
s32 sys_interrupt_thread_establish(mem32_t ih, u32 intrtag, u64 intrthread, u64 arg);
|
||||
s32 sys_interrupt_thread_disestablish(u32 ih);
|
||||
void sys_interrupt_thread_eoi();
|
|
@ -4,12 +4,12 @@
|
|||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "SC_Lwmutex.h"
|
||||
#include "SC_Lwcond.h"
|
||||
#include "sys_lwmutex.h"
|
||||
#include "sys_lwcond.h"
|
||||
|
||||
SysCallBase sys_lwcond("sys_lwcond");
|
||||
|
||||
int sys_lwcond_create(mem_ptr_t<sys_lwcond_t> lwcond, mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwcond_attribute_t> attr)
|
||||
s32 sys_lwcond_create(mem_ptr_t<sys_lwcond_t> lwcond, mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwcond_attribute_t> attr)
|
||||
{
|
||||
sys_lwcond.Log("sys_lwcond_create(lwcond_addr=0x%x, lwmutex_addr=0x%x, attr_addr=0x%x)",
|
||||
lwcond.GetAddr(), lwmutex.GetAddr(), attr.GetAddr());
|
||||
|
@ -46,7 +46,7 @@ int sys_lwcond_create(mem_ptr_t<sys_lwcond_t> lwcond, mem_ptr_t<sys_lwmutex_t> l
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_lwcond_destroy(mem_ptr_t<sys_lwcond_t> lwcond)
|
||||
s32 sys_lwcond_destroy(mem_ptr_t<sys_lwcond_t> lwcond)
|
||||
{
|
||||
sys_lwcond.Warning("sys_lwcond_destroy(lwcond_addr=0x%x)", lwcond.GetAddr());
|
||||
|
||||
|
@ -72,7 +72,7 @@ int sys_lwcond_destroy(mem_ptr_t<sys_lwcond_t> lwcond)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_lwcond_signal(mem_ptr_t<sys_lwcond_t> lwcond)
|
||||
s32 sys_lwcond_signal(mem_ptr_t<sys_lwcond_t> lwcond)
|
||||
{
|
||||
sys_lwcond.Log("sys_lwcond_signal(lwcond_addr=0x%x)", lwcond.GetAddr());
|
||||
|
||||
|
@ -103,7 +103,7 @@ int sys_lwcond_signal(mem_ptr_t<sys_lwcond_t> lwcond)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_lwcond_signal_all(mem_ptr_t<sys_lwcond_t> lwcond)
|
||||
s32 sys_lwcond_signal_all(mem_ptr_t<sys_lwcond_t> lwcond)
|
||||
{
|
||||
sys_lwcond.Log("sys_lwcond_signal_all(lwcond_addr=0x%x)", lwcond.GetAddr());
|
||||
|
||||
|
@ -134,7 +134,7 @@ int sys_lwcond_signal_all(mem_ptr_t<sys_lwcond_t> lwcond)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_lwcond_signal_to(mem_ptr_t<sys_lwcond_t> lwcond, u32 ppu_thread_id)
|
||||
s32 sys_lwcond_signal_to(mem_ptr_t<sys_lwcond_t> lwcond, u32 ppu_thread_id)
|
||||
{
|
||||
sys_lwcond.Log("sys_lwcond_signal_to(lwcond_addr=0x%x, ppu_thread_id=%d)", lwcond.GetAddr(), ppu_thread_id);
|
||||
|
||||
|
@ -173,7 +173,7 @@ int sys_lwcond_signal_to(mem_ptr_t<sys_lwcond_t> lwcond, u32 ppu_thread_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_lwcond_wait(mem_ptr_t<sys_lwcond_t> lwcond, u64 timeout)
|
||||
s32 sys_lwcond_wait(mem_ptr_t<sys_lwcond_t> lwcond, u64 timeout)
|
||||
{
|
||||
sys_lwcond.Log("sys_lwcond_wait(lwcond_addr=0x%x, timeout=%lld)", lwcond.GetAddr(), timeout);
|
||||
|
35
rpcs3/Emu/SysCalls/lv2/sys_lwcond.h
Normal file
35
rpcs3/Emu/SysCalls/lv2/sys_lwcond.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
struct sys_lwcond_attribute_t
|
||||
{
|
||||
union
|
||||
{
|
||||
char name[8];
|
||||
u64 name_u64;
|
||||
};
|
||||
};
|
||||
|
||||
struct sys_lwcond_t
|
||||
{
|
||||
be_t<u32> lwmutex;
|
||||
be_t<u32> lwcond_queue;
|
||||
};
|
||||
|
||||
struct Lwcond
|
||||
{
|
||||
SMutex signal;
|
||||
SleepQueue m_queue;
|
||||
|
||||
Lwcond(u64 name)
|
||||
: m_queue(name)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 sys_lwcond_create(mem_ptr_t<sys_lwcond_t> lwcond, mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwcond_attribute_t> attr);
|
||||
s32 sys_lwcond_destroy(mem_ptr_t<sys_lwcond_t> lwcond);
|
||||
s32 sys_lwcond_signal(mem_ptr_t<sys_lwcond_t> lwcond);
|
||||
s32 sys_lwcond_signal_all(mem_ptr_t<sys_lwcond_t> lwcond);
|
||||
s32 sys_lwcond_signal_to(mem_ptr_t<sys_lwcond_t> lwcond, u32 ppu_thread_id);
|
||||
s32 sys_lwcond_wait(mem_ptr_t<sys_lwcond_t> lwcond, u64 timeout);
|
|
@ -4,11 +4,11 @@
|
|||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Lwmutex.h"
|
||||
#include "sys_lwmutex.h"
|
||||
|
||||
SysCallBase sc_lwmutex("sys_lwmutex");
|
||||
|
||||
int sys_lwmutex_create(mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwmutex_attribute_t> attr)
|
||||
s32 sys_lwmutex_create(mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwmutex_attribute_t> attr)
|
||||
{
|
||||
sc_lwmutex.Log("sys_lwmutex_create(lwmutex_addr=0x%x, lwmutex_attr_addr=0x%x)",
|
||||
lwmutex.GetAddr(), attr.GetAddr());
|
||||
|
@ -48,7 +48,7 @@ int sys_lwmutex_create(mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwmutex_a
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_lwmutex_destroy(mem_ptr_t<sys_lwmutex_t> lwmutex)
|
||||
s32 sys_lwmutex_destroy(mem_ptr_t<sys_lwmutex_t> lwmutex)
|
||||
{
|
||||
sc_lwmutex.Warning("sys_lwmutex_destroy(lwmutex_addr=0x%x)", lwmutex.GetAddr());
|
||||
|
||||
|
@ -69,7 +69,7 @@ int sys_lwmutex_destroy(mem_ptr_t<sys_lwmutex_t> lwmutex)
|
|||
}
|
||||
}
|
||||
|
||||
int sys_lwmutex_lock(mem_ptr_t<sys_lwmutex_t> lwmutex, u64 timeout)
|
||||
s32 sys_lwmutex_lock(mem_ptr_t<sys_lwmutex_t> lwmutex, u64 timeout)
|
||||
{
|
||||
sc_lwmutex.Log("sys_lwmutex_lock(lwmutex_addr=0x%x, timeout=%lld)", lwmutex.GetAddr(), timeout);
|
||||
|
||||
|
@ -81,7 +81,7 @@ int sys_lwmutex_lock(mem_ptr_t<sys_lwmutex_t> lwmutex, u64 timeout)
|
|||
return lwmutex->lock(GetCurrentPPUThread().GetId(), timeout ? ((timeout < 1000) ? 1 : (timeout / 1000)) : 0);
|
||||
}
|
||||
|
||||
int sys_lwmutex_trylock(mem_ptr_t<sys_lwmutex_t> lwmutex)
|
||||
s32 sys_lwmutex_trylock(mem_ptr_t<sys_lwmutex_t> lwmutex)
|
||||
{
|
||||
sc_lwmutex.Log("sys_lwmutex_trylock(lwmutex_addr=0x%x)", lwmutex.GetAddr());
|
||||
|
||||
|
@ -90,7 +90,7 @@ int sys_lwmutex_trylock(mem_ptr_t<sys_lwmutex_t> lwmutex)
|
|||
return lwmutex->trylock(GetCurrentPPUThread().GetId());
|
||||
}
|
||||
|
||||
int sys_lwmutex_unlock(mem_ptr_t<sys_lwmutex_t> lwmutex)
|
||||
s32 sys_lwmutex_unlock(mem_ptr_t<sys_lwmutex_t> lwmutex)
|
||||
{
|
||||
sc_lwmutex.Log("sys_lwmutex_unlock(lwmutex_addr=0x%x)", lwmutex.GetAddr());
|
||||
|
|
@ -78,3 +78,10 @@ struct sys_lwmutex_t
|
|||
int unlock(be_t<u32> tid);
|
||||
int lock(be_t<u32> tid, u64 timeout);
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 sys_lwmutex_create(mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwmutex_attribute_t> attr);
|
||||
s32 sys_lwmutex_destroy(mem_ptr_t<sys_lwmutex_t> lwmutex);
|
||||
s32 sys_lwmutex_lock(mem_ptr_t<sys_lwmutex_t> lwmutex, u64 timeout);
|
||||
s32 sys_lwmutex_trylock(mem_ptr_t<sys_lwmutex_t> lwmutex);
|
||||
s32 sys_lwmutex_unlock(mem_ptr_t<sys_lwmutex_t> lwmutex);
|
169
rpcs3/Emu/SysCalls/lv2/sys_memory.cpp
Normal file
169
rpcs3/Emu/SysCalls/lv2/sys_memory.cpp
Normal file
|
@ -0,0 +1,169 @@
|
|||
#include "stdafx.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "sys_memory.h"
|
||||
#include <map>
|
||||
|
||||
SysCallBase sc_mem("memory");
|
||||
|
||||
s32 sys_memory_allocate(u32 size, u32 flags, u32 alloc_addr_addr)
|
||||
{
|
||||
sc_mem.Log("sys_memory_allocate(size=0x%x, flags=0x%x)", size, flags);
|
||||
|
||||
// Check page size.
|
||||
u32 addr;
|
||||
switch(flags)
|
||||
{
|
||||
case SYS_MEMORY_PAGE_SIZE_1M:
|
||||
if(size & 0xfffff) return CELL_EALIGN;
|
||||
addr = Memory.Alloc(size, 0x100000);
|
||||
break;
|
||||
|
||||
case SYS_MEMORY_PAGE_SIZE_64K:
|
||||
if(size & 0xffff) return CELL_EALIGN;
|
||||
addr = Memory.Alloc(size, 0x10000);
|
||||
break;
|
||||
|
||||
default: return CELL_EINVAL;
|
||||
}
|
||||
|
||||
if(!addr)
|
||||
return CELL_ENOMEM;
|
||||
|
||||
// Write back the start address of the allocated area.
|
||||
sc_mem.Log("Memory allocated! [addr: 0x%x, size: 0x%x]", addr, size);
|
||||
Memory.Write32(alloc_addr_addr, addr);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_memory_allocate_from_container(u32 size, u32 cid, u32 flags, u32 alloc_addr_addr)
|
||||
{
|
||||
sc_mem.Log("sys_memory_allocate_from_container(size=0x%x, cid=0x%x, flags=0x%x)", size, cid, flags);
|
||||
|
||||
// Check if this container ID is valid.
|
||||
MemoryContainerInfo* ct;
|
||||
if(!sc_mem.CheckId(cid, ct))
|
||||
return CELL_ESRCH;
|
||||
|
||||
// Check page size.
|
||||
switch(flags)
|
||||
{
|
||||
case SYS_MEMORY_PAGE_SIZE_1M:
|
||||
if(size & 0xfffff) return CELL_EALIGN;
|
||||
ct->addr = Memory.Alloc(size, 0x100000);
|
||||
break;
|
||||
|
||||
case SYS_MEMORY_PAGE_SIZE_64K:
|
||||
if(size & 0xffff) return CELL_EALIGN;
|
||||
ct->addr = Memory.Alloc(size, 0x10000);
|
||||
break;
|
||||
|
||||
default: return CELL_EINVAL;
|
||||
}
|
||||
|
||||
// Store the address and size in the container.
|
||||
if(!ct->addr)
|
||||
return CELL_ENOMEM;
|
||||
ct->size = size;
|
||||
|
||||
// Write back the start address of the allocated area.
|
||||
sc_mem.Log("Memory allocated! [addr: 0x%x, size: 0x%x]", ct->addr, ct->size);
|
||||
Memory.Write32(alloc_addr_addr, ct->addr);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_memory_free(u32 start_addr)
|
||||
{
|
||||
sc_mem.Log("sys_memory_free(start_addr=0x%x)", start_addr);
|
||||
|
||||
// Release the allocated memory.
|
||||
if(!Memory.Free(start_addr))
|
||||
return CELL_EFAULT;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_memory_get_page_attribute(u32 addr, mem_ptr_t<sys_page_attr_t> attr)
|
||||
{
|
||||
sc_mem.Warning("sys_memory_get_page_attribute(addr=0x%x, attr_addr=0x%x)", addr, attr.GetAddr());
|
||||
|
||||
if (!attr.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
// TODO: Implement per thread page attribute setting.
|
||||
attr->attribute = 0;
|
||||
attr->page_size = 0;
|
||||
attr->access_right = 0;
|
||||
attr->pad = 0;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_memory_get_user_memory_size(mem_ptr_t<sys_memory_info_t> mem_info)
|
||||
{
|
||||
sc_mem.Warning("sys_memory_get_user_memory_size(mem_info_addr=0x%x)", mem_info.GetAddr());
|
||||
|
||||
// Fetch the user memory available.
|
||||
mem_info->total_user_memory = Memory.GetUserMemTotalSize();
|
||||
mem_info->available_user_memory = Memory.GetUserMemAvailSize();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_memory_container_create(mem32_t cid, u32 yield_size)
|
||||
{
|
||||
sc_mem.Warning("sys_memory_container_create(cid_addr=0x%x, yield_size=0x%x)", cid.GetAddr(), yield_size);
|
||||
|
||||
if (!cid.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
yield_size &= ~0xfffff; //round down to 1 MB granularity
|
||||
u64 addr = Memory.Alloc(yield_size, 0x100000); //1 MB alignment
|
||||
|
||||
if(!addr)
|
||||
return CELL_ENOMEM;
|
||||
|
||||
// Wrap the allocated memory in a memory container.
|
||||
MemoryContainerInfo *ct = new MemoryContainerInfo(addr, yield_size);
|
||||
cid = sc_mem.GetNewId(ct);
|
||||
procObjects.mem_objects.insert(cid);
|
||||
|
||||
sc_mem.Warning("*** memory_container created(addr=0x%llx): id = %d", addr, cid.GetValue());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_memory_container_destroy(u32 cid)
|
||||
{
|
||||
sc_mem.Warning("sys_memory_container_destroy(cid=%d)", cid);
|
||||
|
||||
// Check if this container ID is valid.
|
||||
MemoryContainerInfo* ct;
|
||||
if(!sc_mem.CheckId(cid, ct))
|
||||
return CELL_ESRCH;
|
||||
|
||||
// Release the allocated memory and remove the ID.
|
||||
Memory.Free(ct->addr);
|
||||
Emu.GetIdManager().RemoveID(cid);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_memory_container_get_size(mem_ptr_t<sys_memory_info_t> mem_info, u32 cid)
|
||||
{
|
||||
sc_mem.Warning("sys_memory_container_get_size(mem_info_addr=0x%x, cid=%d)", mem_info.GetAddr(), cid);
|
||||
|
||||
// Check if this container ID is valid.
|
||||
MemoryContainerInfo* ct;
|
||||
if(!sc_mem.CheckId(cid, ct))
|
||||
return CELL_ESRCH;
|
||||
|
||||
// HACK: Return all memory.
|
||||
sys_memory_info_t info;
|
||||
mem_info->total_user_memory = ct->size;
|
||||
mem_info->available_user_memory = ct->size;
|
||||
return CELL_OK;
|
||||
}
|
|
@ -1,77 +1,53 @@
|
|||
#pragma once
|
||||
|
||||
#define SYS_MEMORY_CONTAINER_ID_INVALID 0xFFFFFFFF
|
||||
#define SYS_MEMORY_ACCESS_RIGHT_NONE 0x00000000000000F0ULL
|
||||
#define SYS_MEMORY_ACCESS_RIGHT_PPU_THREAD 0x0000000000000008ULL
|
||||
#define SYS_MEMORY_ACCESS_RIGHT_HANDLER 0x0000000000000004ULL
|
||||
#define SYS_MEMORY_ACCESS_RIGHT_SPU_THREAD 0x0000000000000002ULL
|
||||
#define SYS_MEMORY_ACCESS_RIGHT_SPU_RAW 0x0000000000000001ULL
|
||||
#define SYS_MEMORY_ATTR_READ_ONLY 0x0000000000080000ULL
|
||||
#define SYS_MEMORY_ATTR_READ_WRITE 0x0000000000040000ULL
|
||||
#define SYS_MMAPPER_FIXED_ADDR 0xB0000000
|
||||
#define SYS_MMAPPER_FIXED_SIZE 0x10000000
|
||||
#define SYS_VM_TEST_INVALID 0x0000ULL
|
||||
#define SYS_VM_TEST_UNUSED 0x0001ULL
|
||||
#define SYS_VM_TEST_ALLOCATED 0x0002ULL
|
||||
#define SYS_VM_TEST_STORED 0x0004ULL
|
||||
|
||||
enum
|
||||
{
|
||||
SYS_MEMORY_PAGE_SIZE_1M = 0x400,
|
||||
SYS_MEMORY_PAGE_SIZE_64K = 0x200,
|
||||
};
|
||||
|
||||
struct sys_memory_info_t
|
||||
{
|
||||
be_t<u32> total_user_memory;
|
||||
be_t<u32> available_user_memory;
|
||||
};
|
||||
|
||||
|
||||
struct sys_page_attr_t
|
||||
{
|
||||
u64 attribute;
|
||||
u64 access_right;
|
||||
u32 page_size;
|
||||
u32 pad;
|
||||
};
|
||||
|
||||
struct MemoryContainerInfo
|
||||
{
|
||||
u64 addr;
|
||||
u32 size;
|
||||
|
||||
MemoryContainerInfo(u64 addr, u32 size)
|
||||
: addr(addr)
|
||||
, size(size)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
struct mmapper_info
|
||||
{
|
||||
u64 addr;
|
||||
u32 size;
|
||||
u32 flags;
|
||||
|
||||
mmapper_info(u64 _addr, u32 _size, u32 _flags)
|
||||
: addr(_addr)
|
||||
, size(_size)
|
||||
, flags(_flags)
|
||||
{
|
||||
}
|
||||
|
||||
mmapper_info()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
struct sys_vm_statistics {
|
||||
u64 vm_crash_ppu;
|
||||
u64 vm_crash_spu;
|
||||
u64 vm_read;
|
||||
u64 vm_write;
|
||||
u32 physical_mem_size;
|
||||
u32 physical_mem_used;
|
||||
u64 timestamp;
|
||||
};
|
||||
#pragma once
|
||||
|
||||
#define SYS_MEMORY_CONTAINER_ID_INVALID 0xFFFFFFFF
|
||||
#define SYS_MEMORY_ACCESS_RIGHT_NONE 0x00000000000000F0ULL
|
||||
#define SYS_MEMORY_ACCESS_RIGHT_PPU_THREAD 0x0000000000000008ULL
|
||||
#define SYS_MEMORY_ACCESS_RIGHT_HANDLER 0x0000000000000004ULL
|
||||
#define SYS_MEMORY_ACCESS_RIGHT_SPU_THREAD 0x0000000000000002ULL
|
||||
#define SYS_MEMORY_ACCESS_RIGHT_SPU_RAW 0x0000000000000001ULL
|
||||
#define SYS_MEMORY_ATTR_READ_ONLY 0x0000000000080000ULL
|
||||
#define SYS_MEMORY_ATTR_READ_WRITE 0x0000000000040000ULL
|
||||
|
||||
enum
|
||||
{
|
||||
SYS_MEMORY_PAGE_SIZE_1M = 0x400,
|
||||
SYS_MEMORY_PAGE_SIZE_64K = 0x200,
|
||||
};
|
||||
|
||||
struct sys_memory_info_t
|
||||
{
|
||||
be_t<u32> total_user_memory;
|
||||
be_t<u32> available_user_memory;
|
||||
};
|
||||
|
||||
|
||||
struct sys_page_attr_t
|
||||
{
|
||||
u64 attribute;
|
||||
u64 access_right;
|
||||
u32 page_size;
|
||||
u32 pad;
|
||||
};
|
||||
|
||||
struct MemoryContainerInfo
|
||||
{
|
||||
u64 addr;
|
||||
u32 size;
|
||||
|
||||
MemoryContainerInfo(u64 addr, u32 size)
|
||||
: addr(addr)
|
||||
, size(size)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 sys_memory_allocate(u32 size, u32 flags, u32 alloc_addr_addr);
|
||||
s32 sys_memory_allocate_from_container(u32 size, u32 cid, u32 flags, u32 alloc_addr_addr);
|
||||
s32 sys_memory_free(u32 start_addr);
|
||||
s32 sys_memory_get_page_attribute(u32 addr, mem_ptr_t<sys_page_attr_t> attr);
|
||||
s32 sys_memory_get_user_memory_size(mem_ptr_t<sys_memory_info_t> mem_info);
|
||||
s32 sys_memory_container_create(mem32_t cid, u32 yield_size);
|
||||
s32 sys_memory_container_destroy(u32 cid);
|
||||
s32 sys_memory_container_get_size(mem_ptr_t<sys_memory_info_t> mem_info, u32 cid);
|
263
rpcs3/Emu/SysCalls/lv2/sys_mmapper.cpp
Normal file
263
rpcs3/Emu/SysCalls/lv2/sys_mmapper.cpp
Normal file
|
@ -0,0 +1,263 @@
|
|||
#include "stdafx.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "sys_mmapper.h"
|
||||
#include <map>
|
||||
|
||||
SysCallBase sys_mmapper("sys_mmapper");
|
||||
std::map<u32, u32> mmapper_info_map;
|
||||
|
||||
s32 sys_mmapper_allocate_address(u32 size, u64 flags, u32 alignment, u32 alloc_addr)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_allocate_address(size=0x%x, flags=0x%llx, alignment=0x%x, alloc_addr=0x%x)",
|
||||
size, flags, alignment, alloc_addr);
|
||||
|
||||
if(!Memory.IsGoodAddr(alloc_addr))
|
||||
return CELL_EFAULT;
|
||||
|
||||
// Check for valid alignment.
|
||||
if(alignment > 0x80000000)
|
||||
return CELL_EALIGN;
|
||||
|
||||
// Check page size.
|
||||
u32 addr;
|
||||
switch(flags & (SYS_MEMORY_PAGE_SIZE_1M | SYS_MEMORY_PAGE_SIZE_64K))
|
||||
{
|
||||
default:
|
||||
case SYS_MEMORY_PAGE_SIZE_1M:
|
||||
if(Memory.AlignAddr(size, alignment) & 0xfffff)
|
||||
return CELL_EALIGN;
|
||||
addr = Memory.Alloc(size, 0x100000);
|
||||
break;
|
||||
|
||||
case SYS_MEMORY_PAGE_SIZE_64K:
|
||||
if(Memory.AlignAddr(size, alignment) & 0xffff)
|
||||
return CELL_EALIGN;
|
||||
addr = Memory.Alloc(size, 0x10000);
|
||||
break;
|
||||
}
|
||||
|
||||
// Write back the start address of the allocated area.
|
||||
Memory.Write32(alloc_addr, addr);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_mmapper_allocate_fixed_address()
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_allocate_fixed_address");
|
||||
|
||||
// Allocate a fixed size from user memory.
|
||||
if (!Memory.Alloc(SYS_MMAPPER_FIXED_SIZE, 0x100000))
|
||||
return CELL_EEXIST;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_mmapper_allocate_memory(u32 size, u64 flags, mem32_t mem_id)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_allocate_memory(size=0x%x, flags=0x%llx, mem_id_addr=0x%x)", size, flags, mem_id.GetAddr());
|
||||
|
||||
if(!mem_id.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
// Check page granularity.
|
||||
u32 addr;
|
||||
switch(flags & (SYS_MEMORY_PAGE_SIZE_1M | SYS_MEMORY_PAGE_SIZE_64K))
|
||||
{
|
||||
case SYS_MEMORY_PAGE_SIZE_1M:
|
||||
if(size & 0xfffff)
|
||||
return CELL_EALIGN;
|
||||
addr = Memory.Alloc(size, 0x100000);
|
||||
break;
|
||||
|
||||
case SYS_MEMORY_PAGE_SIZE_64K:
|
||||
if(size & 0xffff)
|
||||
return CELL_EALIGN;
|
||||
addr = Memory.Alloc(size, 0x10000);
|
||||
break;
|
||||
|
||||
default:
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
if(!addr)
|
||||
return CELL_ENOMEM;
|
||||
|
||||
// Generate a new mem ID.
|
||||
mem_id = sys_mmapper.GetNewId(new mmapper_info(addr, size, flags));
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_mmapper_allocate_memory_from_container(u32 size, u32 cid, u64 flags, mem32_t mem_id)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_allocate_memory_from_container(size=0x%x, cid=%d, flags=0x%llx, mem_id_addr=0x%x)",
|
||||
size, cid, flags, mem_id.GetAddr());
|
||||
|
||||
if(!mem_id.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
// Check if this container ID is valid.
|
||||
MemoryContainerInfo* ct;
|
||||
if(!sys_mmapper.CheckId(cid, ct))
|
||||
return CELL_ESRCH;
|
||||
|
||||
// Check page granularity.
|
||||
switch(flags & (SYS_MEMORY_PAGE_SIZE_1M | SYS_MEMORY_PAGE_SIZE_64K))
|
||||
{
|
||||
case SYS_MEMORY_PAGE_SIZE_1M:
|
||||
if(size & 0xfffff)
|
||||
return CELL_EALIGN;
|
||||
ct->addr = Memory.Alloc(size, 0x100000);
|
||||
break;
|
||||
|
||||
case SYS_MEMORY_PAGE_SIZE_64K:
|
||||
if(size & 0xffff)
|
||||
return CELL_EALIGN;
|
||||
ct->addr = Memory.Alloc(size, 0x10000);
|
||||
break;
|
||||
|
||||
default:
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
if(!ct->addr)
|
||||
return CELL_ENOMEM;
|
||||
ct->size = size;
|
||||
|
||||
// Generate a new mem ID.
|
||||
mem_id = sys_mmapper.GetNewId(new mmapper_info(ct->addr, ct->size, flags));
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_mmapper_change_address_access_right(u32 start_addr, u64 flags)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_change_address_access_right(start_addr=0x%x, flags=0x%llx)", start_addr, flags);
|
||||
|
||||
if (!Memory.IsGoodAddr(start_addr))
|
||||
return CELL_EINVAL;
|
||||
|
||||
// TODO
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_mmapper_free_address(u32 start_addr)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_free_address(start_addr=0x%x)", start_addr);
|
||||
|
||||
if(!Memory.IsGoodAddr(start_addr))
|
||||
return CELL_EINVAL;
|
||||
|
||||
// Free the address.
|
||||
Memory.Free(start_addr);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_mmapper_free_memory(u32 mem_id)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_free_memory(mem_id=0x%x)", mem_id);
|
||||
|
||||
// Check if this mem ID is valid.
|
||||
mmapper_info* info;
|
||||
if(!sys_mmapper.CheckId(mem_id, info))
|
||||
return CELL_ESRCH;
|
||||
|
||||
// Release the allocated memory and remove the ID.
|
||||
Memory.Free(info->addr);
|
||||
Emu.GetIdManager().RemoveID(mem_id);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_mmapper_map_memory(u32 start_addr, u32 mem_id, u64 flags)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_map_memory(start_addr=0x%x, mem_id=0x%x, flags=0x%llx)", start_addr, mem_id, flags);
|
||||
|
||||
// Check if this mem ID is valid.
|
||||
mmapper_info* info;
|
||||
if(!sys_mmapper.CheckId(mem_id, info))
|
||||
return CELL_ESRCH;
|
||||
|
||||
// Map the memory into the process address.
|
||||
if(!Memory.Map(start_addr, info->addr, info->size))
|
||||
sys_mmapper.Error("sys_mmapper_map_memory failed!");
|
||||
|
||||
// Keep track of mapped addresses.
|
||||
mmapper_info_map[mem_id] = start_addr;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags, u32 alloc_addr)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_search_and_map(start_addr=0x%x, mem_id=0x%x, flags=0x%llx, alloc_addr=0x%x)",
|
||||
start_addr, mem_id, flags, alloc_addr);
|
||||
|
||||
if(!Memory.IsGoodAddr(alloc_addr))
|
||||
return CELL_EFAULT;
|
||||
|
||||
// Check if this mem ID is valid.
|
||||
mmapper_info* info;
|
||||
if(!sys_mmapper.CheckId(mem_id, info))
|
||||
return CELL_ESRCH;
|
||||
|
||||
// Search for a mappable address.
|
||||
u32 addr;
|
||||
bool found;
|
||||
for (int i = 0; i < SYS_MMAPPER_FIXED_SIZE; i += 0x100000)
|
||||
{
|
||||
addr = start_addr + i;
|
||||
found = Memory.Map(addr, info->addr, info->size);
|
||||
if(found)
|
||||
{
|
||||
sys_mmapper.Warning("Found and mapped address 0x%x", addr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the address is valid.
|
||||
if (!Memory.IsGoodAddr(addr) || !found)
|
||||
return CELL_ENOMEM;
|
||||
|
||||
// Write back the start address of the allocated area.
|
||||
Memory.Write32(alloc_addr, addr);
|
||||
|
||||
// Keep track of mapped addresses.
|
||||
mmapper_info_map[mem_id] = addr;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_mmapper_unmap_memory(u32 start_addr, u32 mem_id_addr)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_unmap_memory(start_addr=0x%x, mem_id_addr=0x%x)", start_addr, mem_id_addr);
|
||||
|
||||
if (!Memory.IsGoodAddr(start_addr))
|
||||
return CELL_EINVAL;
|
||||
|
||||
if (!Memory.IsGoodAddr(mem_id_addr))
|
||||
return CELL_EFAULT;
|
||||
|
||||
// Write back the mem ID of the unmapped area.
|
||||
u32 mem_id = mmapper_info_map.find(start_addr)->first;
|
||||
Memory.Write32(mem_id_addr, mem_id);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_mmapper_enable_page_fault_notification(u32 start_addr, u32 q_id)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_enable_page_fault_notification(start_addr=0x%x, q_id=0x%x)", start_addr, q_id);
|
||||
|
||||
if (!Memory.IsGoodAddr(start_addr))
|
||||
return CELL_EINVAL;
|
||||
|
||||
// TODO
|
||||
|
||||
return CELL_OK;
|
||||
}
|
35
rpcs3/Emu/SysCalls/lv2/sys_mmapper.h
Normal file
35
rpcs3/Emu/SysCalls/lv2/sys_mmapper.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
#define SYS_MMAPPER_FIXED_ADDR 0xB0000000
|
||||
#define SYS_MMAPPER_FIXED_SIZE 0x10000000
|
||||
|
||||
struct mmapper_info
|
||||
{
|
||||
u64 addr;
|
||||
u32 size;
|
||||
u32 flags;
|
||||
|
||||
mmapper_info(u64 _addr, u32 _size, u32 _flags)
|
||||
: addr(_addr)
|
||||
, size(_size)
|
||||
, flags(_flags)
|
||||
{
|
||||
}
|
||||
|
||||
mmapper_info()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 sys_mmapper_allocate_address(u32 size, u64 flags, u32 alignment, u32 alloc_addr);
|
||||
s32 sys_mmapper_allocate_fixed_address();
|
||||
s32 sys_mmapper_allocate_memory(u32 size, u64 flags, mem32_t mem_id);
|
||||
s32 sys_mmapper_allocate_memory_from_container(u32 size, u32 cid, u64 flags, mem32_t mem_id);
|
||||
s32 sys_mmapper_change_address_access_right(u32 start_addr, u64 flags);
|
||||
s32 sys_mmapper_free_address(u32 start_addr);
|
||||
s32 sys_mmapper_free_memory(u32 mem_id);
|
||||
s32 sys_mmapper_map_memory(u32 start_addr, u32 mem_id, u64 flags);
|
||||
s32 sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags, u32 alloc_addr);
|
||||
s32 sys_mmapper_unmap_memory(u32 start_addr, u32 mem_id_addr);
|
||||
s32 sys_mmapper_enable_page_fault_notification(u32 start_addr, u32 q_id);
|
|
@ -4,12 +4,12 @@
|
|||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "SC_Mutex.h"
|
||||
#include "Utilities/SMutex.h"
|
||||
#include "sys_mutex.h"
|
||||
|
||||
SysCallBase sys_mtx("sys_mutex");
|
||||
|
||||
int sys_mutex_create(mem32_t mutex_id, mem_ptr_t<sys_mutex_attribute> attr)
|
||||
s32 sys_mutex_create(mem32_t mutex_id, mem_ptr_t<sys_mutex_attribute> attr)
|
||||
{
|
||||
sys_mtx.Log("sys_mutex_create(mutex_id_addr=0x%x, attr_addr=0x%x)", mutex_id.GetAddr(), attr.GetAddr());
|
||||
|
||||
|
@ -58,7 +58,7 @@ int sys_mutex_create(mem32_t mutex_id, mem_ptr_t<sys_mutex_attribute> attr)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_mutex_destroy(u32 mutex_id)
|
||||
s32 sys_mutex_destroy(u32 mutex_id)
|
||||
{
|
||||
sys_mtx.Warning("sys_mutex_destroy(mutex_id=%d)", mutex_id);
|
||||
|
||||
|
@ -91,7 +91,7 @@ int sys_mutex_destroy(u32 mutex_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_mutex_lock(u32 mutex_id, u64 timeout)
|
||||
s32 sys_mutex_lock(u32 mutex_id, u64 timeout)
|
||||
{
|
||||
sys_mtx.Log("sys_mutex_lock(mutex_id=%d, timeout=%lld)", mutex_id, timeout);
|
||||
|
||||
|
@ -160,7 +160,7 @@ abort:
|
|||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
int sys_mutex_trylock(u32 mutex_id)
|
||||
s32 sys_mutex_trylock(u32 mutex_id)
|
||||
{
|
||||
sys_mtx.Log("sys_mutex_trylock(mutex_id=%d)", mutex_id);
|
||||
|
||||
|
@ -207,7 +207,7 @@ int sys_mutex_trylock(u32 mutex_id)
|
|||
return CELL_EBUSY;
|
||||
}
|
||||
|
||||
int sys_mutex_unlock(u32 mutex_id)
|
||||
s32 sys_mutex_unlock(u32 mutex_id)
|
||||
{
|
||||
sys_mtx.Log("sys_mutex_unlock(mutex_id=%d)", mutex_id);
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#include "sys_lwmutex.h"
|
||||
|
||||
struct sys_mutex_attribute
|
||||
{
|
||||
|
@ -52,3 +53,10 @@ struct Mutex
|
|||
m_queue.m_mutex.unlock();
|
||||
}
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 sys_mutex_create(mem32_t mutex_id, mem_ptr_t<sys_mutex_attribute> attr);
|
||||
s32 sys_mutex_destroy(u32 mutex_id);
|
||||
s32 sys_mutex_lock(u32 mutex_id, u64 timeout);
|
||||
s32 sys_mutex_trylock(u32 mutex_id);
|
||||
s32 sys_mutex_unlock(u32 mutex_id);
|
|
@ -6,23 +6,12 @@
|
|||
#include "Emu/SysCalls/SC_FUNC.h"
|
||||
#include "Emu/SysCalls/Modules.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "sys_ppu_thread.h"
|
||||
|
||||
extern Module *sysPrxForUser;
|
||||
|
||||
static const u32 PPU_THREAD_ID_INVALID = 0xFFFFFFFFU;
|
||||
|
||||
enum
|
||||
{
|
||||
SYS_PPU_THREAD_ONCE_INIT,
|
||||
SYS_PPU_THREAD_DONE_INIT,
|
||||
};
|
||||
|
||||
enum ppu_thread_flags : u64
|
||||
{
|
||||
SYS_PPU_THREAD_CREATE_JOINABLE = 0x1,
|
||||
SYS_PPU_THREAD_CREATE_INTERRUPT = 0x2,
|
||||
};
|
||||
|
||||
void sys_ppu_thread_exit(u64 errorcode)
|
||||
{
|
||||
sysPrxForUser->Log("sys_ppu_thread_exit(0x%llx)", errorcode);
|
||||
|
@ -40,14 +29,14 @@ void sys_ppu_thread_exit(u64 errorcode)
|
|||
thr.Stop();
|
||||
}
|
||||
|
||||
int sys_ppu_thread_yield()
|
||||
s32 sys_ppu_thread_yield()
|
||||
{
|
||||
sysPrxForUser->Log("sys_ppu_thread_yield()");
|
||||
Sleep(1);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_ppu_thread_join(u64 thread_id, mem64_t vptr)
|
||||
s32 sys_ppu_thread_join(u64 thread_id, mem64_t vptr)
|
||||
{
|
||||
sysPrxForUser->Warning("sys_ppu_thread_join(thread_id=%lld, vptr_addr=0x%x)", thread_id, vptr.GetAddr());
|
||||
|
||||
|
@ -68,7 +57,7 @@ int sys_ppu_thread_join(u64 thread_id, mem64_t vptr)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_ppu_thread_detach(u64 thread_id)
|
||||
s32 sys_ppu_thread_detach(u64 thread_id)
|
||||
{
|
||||
sysPrxForUser->Error("sys_ppu_thread_detach(thread_id=%lld)", thread_id);
|
||||
|
||||
|
@ -88,7 +77,7 @@ void sys_ppu_thread_get_join_state(u32 isjoinable_addr)
|
|||
Memory.Write32(isjoinable_addr, GetCurrentPPUThread().IsJoinable());
|
||||
}
|
||||
|
||||
int sys_ppu_thread_set_priority(u64 thread_id, int prio)
|
||||
s32 sys_ppu_thread_set_priority(u64 thread_id, s32 prio)
|
||||
{
|
||||
sysPrxForUser->Log("sys_ppu_thread_set_priority(thread_id=%lld, prio=%d)", thread_id, prio);
|
||||
|
||||
|
@ -100,7 +89,7 @@ int sys_ppu_thread_set_priority(u64 thread_id, int prio)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_ppu_thread_get_priority(u64 thread_id, u32 prio_addr)
|
||||
s32 sys_ppu_thread_get_priority(u64 thread_id, u32 prio_addr)
|
||||
{
|
||||
sysPrxForUser->Log("sys_ppu_thread_get_priority(thread_id=%lld, prio_addr=0x%x)", thread_id, prio_addr);
|
||||
|
||||
|
@ -113,7 +102,7 @@ int sys_ppu_thread_get_priority(u64 thread_id, u32 prio_addr)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_ppu_thread_get_stack_information(u32 info_addr)
|
||||
s32 sys_ppu_thread_get_stack_information(u32 info_addr)
|
||||
{
|
||||
sysPrxForUser->Log("sys_ppu_thread_get_stack_information(info_addr=0x%x)", info_addr);
|
||||
|
||||
|
@ -127,7 +116,7 @@ int sys_ppu_thread_get_stack_information(u32 info_addr)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_ppu_thread_stop(u64 thread_id)
|
||||
s32 sys_ppu_thread_stop(u64 thread_id)
|
||||
{
|
||||
sysPrxForUser->Warning("sys_ppu_thread_stop(thread_id=%lld)", thread_id);
|
||||
|
||||
|
@ -139,7 +128,7 @@ int sys_ppu_thread_stop(u64 thread_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_ppu_thread_restart(u64 thread_id)
|
||||
s32 sys_ppu_thread_restart(u64 thread_id)
|
||||
{
|
||||
sysPrxForUser->Warning("sys_ppu_thread_restart(thread_id=%lld)", thread_id);
|
||||
|
||||
|
@ -152,7 +141,7 @@ int sys_ppu_thread_restart(u64 thread_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_ppu_thread_create(mem64_t thread_id, u32 entry, u64 arg, int prio, u32 stacksize, u64 flags, u32 threadname_addr)
|
||||
s32 sys_ppu_thread_create(mem64_t thread_id, u32 entry, u64 arg, s32 prio, u32 stacksize, u64 flags, u32 threadname_addr)
|
||||
{
|
||||
std::string threadname = "";
|
||||
if (Memory.IsGoodAddr(threadname_addr))
|
||||
|
@ -232,7 +221,7 @@ void sys_ppu_thread_once(u32 once_ctrl_addr, u32 entry)
|
|||
}
|
||||
}
|
||||
|
||||
int sys_ppu_thread_get_id(const u32 id_addr)
|
||||
s32 sys_ppu_thread_get_id(const u32 id_addr)
|
||||
{
|
||||
sysPrxForUser->Log("sys_ppu_thread_get_id(id_addr=0x%x)", id_addr);
|
||||
|
28
rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.h
Normal file
28
rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
SYS_PPU_THREAD_ONCE_INIT,
|
||||
SYS_PPU_THREAD_DONE_INIT,
|
||||
};
|
||||
|
||||
enum ppu_thread_flags : u64
|
||||
{
|
||||
SYS_PPU_THREAD_CREATE_JOINABLE = 0x1,
|
||||
SYS_PPU_THREAD_CREATE_INTERRUPT = 0x2,
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
void sys_ppu_thread_exit(u64 errorcode);
|
||||
s32 sys_ppu_thread_yield();
|
||||
s32 sys_ppu_thread_join(u64 thread_id, mem64_t vptr);
|
||||
s32 sys_ppu_thread_detach(u64 thread_id);
|
||||
void sys_ppu_thread_get_join_state(u32 isjoinable_addr);
|
||||
s32 sys_ppu_thread_set_priority(u64 thread_id, s32 prio);
|
||||
s32 sys_ppu_thread_get_priority(u64 thread_id, u32 prio_addr);
|
||||
s32 sys_ppu_thread_get_stack_information(u32 info_addr);
|
||||
s32 sys_ppu_thread_stop(u64 thread_id);
|
||||
s32 sys_ppu_thread_restart(u64 thread_id);
|
||||
s32 sys_ppu_thread_create(mem64_t thread_id, u32 entry, u64 arg, s32 prio, u32 stacksize, u64 flags, u32 threadname_addr);
|
||||
void sys_ppu_thread_once(u32 once_ctrl_addr, u32 entry);
|
||||
s32 sys_ppu_thread_get_id(const u32 id_addr);
|
|
@ -3,24 +3,24 @@
|
|||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "SC_Process.h"
|
||||
#include "sys_process.h"
|
||||
|
||||
SysCallBase sc_p("Process");
|
||||
|
||||
sysProcessObjects_t procObjects;
|
||||
|
||||
int sys_process_getpid()
|
||||
s32 sys_process_getpid()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sys_process_getppid()
|
||||
s32 sys_process_getppid()
|
||||
{
|
||||
sc_p.Warning("TODO: sys_process_getppid() returns 0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sys_process_exit(s32 errorcode)
|
||||
s32 sys_process_exit(s32 errorcode)
|
||||
{
|
||||
sc_p.Warning("sys_process_exit(%d)", errorcode);
|
||||
Emu.Pause(); // Emu.Stop() does crash
|
||||
|
@ -130,7 +130,7 @@ void sys_game_process_exitspawn2(
|
|||
return;
|
||||
}
|
||||
|
||||
int sys_process_get_number_of_object(u32 object, mem32_t nump)
|
||||
s32 sys_process_get_number_of_object(u32 object, mem32_t nump)
|
||||
{
|
||||
sc_p.Warning("sys_process_get_number_of_object(object=%d, nump_addr=0x%x)",
|
||||
object, nump.GetAddr());
|
||||
|
@ -165,7 +165,7 @@ int sys_process_get_number_of_object(u32 object, mem32_t nump)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_process_get_id(u32 object, mem32_ptr_t buffer, u32 size, mem32_t set_size)
|
||||
s32 sys_process_get_id(u32 object, mem32_ptr_t buffer, u32 size, mem32_t set_size)
|
||||
{
|
||||
sc_p.Warning("TODO: sys_process_get_id(object=%d, buffer_addr=0x%x, size=%d, set_size_addr=0x%x)",
|
||||
object, buffer.GetAddr(), size, set_size.GetAddr());
|
||||
|
@ -208,7 +208,7 @@ int sys_process_get_id(u32 object, mem32_ptr_t buffer, u32 size, mem32_t set_siz
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_process_get_paramsfo(mem8_ptr_t buffer)
|
||||
s32 sys_process_get_paramsfo(mem8_ptr_t buffer)
|
||||
{
|
||||
sc_p.Warning("TODO: sys_process_get_paramsfo(buffer_addr=0x%x) returns CELL_ENOENT", buffer.GetAddr());
|
||||
return CELL_ENOENT;
|
||||
|
@ -227,7 +227,7 @@ int sys_process_get_paramsfo(mem8_ptr_t buffer)
|
|||
return CELL_OK;*/
|
||||
}
|
||||
|
||||
int sys_process_get_sdk_version(u32 pid, mem32_t version)
|
||||
s32 sys_process_get_sdk_version(u32 pid, mem32_t version)
|
||||
{
|
||||
sc_p.Warning("sys_process_get_sdk_version(pid=%d, version_addr=0x%x)", pid, version.GetAddr());
|
||||
|
||||
|
@ -238,34 +238,34 @@ int sys_process_get_sdk_version(u32 pid, mem32_t version)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_process_kill(u32 pid)
|
||||
s32 sys_process_kill(u32 pid)
|
||||
{
|
||||
sc_p.Error("TODO: sys_process_kill(pid=%d)", pid);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_process_wait_for_child(u32 pid, mem32_t status, u64 unk)
|
||||
s32 sys_process_wait_for_child(u32 pid, mem32_t status, u64 unk)
|
||||
{
|
||||
sc_p.Error("TODO: sys_process_wait_for_child(pid=%d, status_addr=0x%x, unk=0x%llx",
|
||||
pid, status.GetAddr(), unk);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_process_wait_for_child2(u64 unk1, u64 unk2, u64 unk3, u64 unk4, u64 unk5, u64 unk6)
|
||||
s32 sys_process_wait_for_child2(u64 unk1, u64 unk2, u64 unk3, u64 unk4, u64 unk5, u64 unk6)
|
||||
{
|
||||
sc_p.Error("TODO: sys_process_wait_for_child2(unk1=0x%llx, unk2=0x%llx, unk3=0x%llx, unk4=0x%llx, unk5=0x%llx, unk6=0x%llx)",
|
||||
unk1, unk2, unk3, unk4, unk5, unk6);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_process_get_status(u64 unk)
|
||||
s32 sys_process_get_status(u64 unk)
|
||||
{
|
||||
sc_p.Error("TODO: sys_process_get_status(unk=0x%llx)", unk);
|
||||
//Memory.Write32(CPU.GPR[4], GetPPUThreadStatus(CPU));
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_process_detach_child(u64 unk)
|
||||
s32 sys_process_detach_child(u64 unk)
|
||||
{
|
||||
sc_p.Error("TODO: sys_process_detach_child(unk=0x%llx)", unk);
|
||||
return CELL_OK;
|
|
@ -52,18 +52,18 @@ struct sysProcessObjects_t
|
|||
extern sysProcessObjects_t procObjects;
|
||||
|
||||
// SysCalls
|
||||
int sys_process_getpid();
|
||||
int sys_process_getppid();
|
||||
int sys_process_get_number_of_object(u32 object, mem32_t nump);
|
||||
int sys_process_get_id(u32 object, mem32_ptr_t buffer, u32 size, mem32_t set_size);
|
||||
int sys_process_get_paramsfo(mem8_ptr_t buffer);
|
||||
int sys_process_get_sdk_version(u32 pid, mem32_t version);
|
||||
int sys_process_get_status(u64 unk);
|
||||
int sys_process_exit(s32 errorcode);
|
||||
int sys_process_kill(u32 pid);
|
||||
int sys_process_wait_for_child(u32 pid, mem32_t status, u64 unk);
|
||||
int sys_process_wait_for_child2(u64 unk1, u64 unk2, u64 unk3, u64 unk4, u64 unk5, u64 unk6);
|
||||
int sys_process_detach_child(u64 unk);
|
||||
s32 sys_process_getpid();
|
||||
s32 sys_process_getppid();
|
||||
s32 sys_process_get_number_of_object(u32 object, mem32_t nump);
|
||||
s32 sys_process_get_id(u32 object, mem32_ptr_t buffer, u32 size, mem32_t set_size);
|
||||
s32 sys_process_get_paramsfo(mem8_ptr_t buffer);
|
||||
s32 sys_process_get_sdk_version(u32 pid, mem32_t version);
|
||||
s32 sys_process_get_status(u64 unk);
|
||||
s32 sys_process_exit(s32 errorcode);
|
||||
s32 sys_process_kill(u32 pid);
|
||||
s32 sys_process_wait_for_child(u32 pid, mem32_t status, u64 unk);
|
||||
s32 sys_process_wait_for_child2(u64 unk1, u64 unk2, u64 unk3, u64 unk4, u64 unk5, u64 unk6);
|
||||
s32 sys_process_detach_child(u64 unk);
|
||||
void sys_game_process_exitspawn(u32 path_addr, u32 argv_addr, u32 envp_addr,
|
||||
u32 data_addr, u32 data_size, u32 prio, u64 flags);
|
||||
void sys_game_process_exitspawn2(u32 path_addr, u32 argv_addr, u32 envp_addr,
|
|
@ -3,7 +3,7 @@
|
|||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "SC_PRX.h"
|
||||
#include "sys_prx.h"
|
||||
|
||||
SysCallBase sys_prx("sys_prx");
|
||||
|
|
@ -3,76 +3,77 @@
|
|||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "sys_rsx.h"
|
||||
|
||||
SysCallBase sys_rsx("sys_rsx");
|
||||
|
||||
int sys_rsx_device_open()
|
||||
s32 sys_rsx_device_open()
|
||||
{
|
||||
sys_rsx.Error("TODO: sys_rsx_device_open()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rsx_device_close()
|
||||
s32 sys_rsx_device_close()
|
||||
{
|
||||
sys_rsx.Error("TODO: sys_rsx_device_close()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rsx_memory_allocate()
|
||||
s32 sys_rsx_memory_allocate()
|
||||
{
|
||||
sys_rsx.Error("TODO: sys_rsx_memory_allocate()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rsx_memory_free()
|
||||
s32 sys_rsx_memory_free()
|
||||
{
|
||||
sys_rsx.Error("TODO: sys_rsx_memory_free()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rsx_context_allocate()
|
||||
s32 sys_rsx_context_allocate()
|
||||
{
|
||||
sys_rsx.Error("TODO: sys_rsx_context_allocate()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rsx_context_free()
|
||||
s32 sys_rsx_context_free()
|
||||
{
|
||||
sys_rsx.Error("TODO: sys_rsx_context_free()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rsx_context_iomap()
|
||||
s32 sys_rsx_context_iomap()
|
||||
{
|
||||
sys_rsx.Error("TODO: sys_rsx_context_iomap()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rsx_context_iounmap()
|
||||
s32 sys_rsx_context_iounmap()
|
||||
{
|
||||
sys_rsx.Error("TODO: sys_rsx_context_iounmap()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rsx_context_attribute(s32 context_id, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6)
|
||||
s32 sys_rsx_context_attribute(s32 context_id, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6)
|
||||
{
|
||||
sys_rsx.Error("TODO: sys_rsx_context_attribute(context_id=%d, a2=%llu, a3=%llu, a4=%llu, a5=%llu, a6=%llu)", context_id, a2, a3, a4, a5, a6);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rsx_device_map(mem32_t a1, mem32_t a2, u32 a3)
|
||||
s32 sys_rsx_device_map(mem32_t a1, mem32_t a2, u32 a3)
|
||||
{
|
||||
sys_rsx.Error("TODO: sys_rsx_device_map(a1_addr=0x%x, a2_addr=0x%x, a3=%d)", a1.GetAddr(), a2.GetAddr(), a3);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rsx_device_unmap()
|
||||
s32 sys_rsx_device_unmap()
|
||||
{
|
||||
sys_rsx.Error("TODO: sys_rsx_device_unmap()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rsx_attribute()
|
||||
s32 sys_rsx_attribute()
|
||||
{
|
||||
sys_rsx.Error("TODO: sys_rsx_attribute()");
|
||||
return CELL_OK;
|
15
rpcs3/Emu/SysCalls/lv2/sys_rsx.h
Normal file
15
rpcs3/Emu/SysCalls/lv2/sys_rsx.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
// SysCalls
|
||||
s32 sys_rsx_device_open();
|
||||
s32 sys_rsx_device_close();
|
||||
s32 sys_rsx_memory_allocate();
|
||||
s32 sys_rsx_memory_free();
|
||||
s32 sys_rsx_context_allocate();
|
||||
s32 sys_rsx_context_free();
|
||||
s32 sys_rsx_context_iomap();
|
||||
s32 sys_rsx_context_iounmap();
|
||||
s32 sys_rsx_context_attribute(s32 context_id, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
|
||||
s32 sys_rsx_device_map(mem32_t a1, mem32_t a2, u32 a3);
|
||||
s32 sys_rsx_device_unmap();
|
||||
s32 sys_rsx_attribute();
|
|
@ -3,12 +3,12 @@
|
|||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "SC_Rwlock.h"
|
||||
#include "sys_rwlock.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
|
||||
SysCallBase sys_rwlock("sys_rwlock");
|
||||
|
||||
int sys_rwlock_create(mem32_t rw_lock_id, mem_ptr_t<sys_rwlock_attribute_t> attr)
|
||||
s32 sys_rwlock_create(mem32_t rw_lock_id, mem_ptr_t<sys_rwlock_attribute_t> attr)
|
||||
{
|
||||
sys_rwlock.Warning("sys_rwlock_create(rw_lock_id_addr=0x%x, attr_addr=0x%x)", rw_lock_id.GetAddr(), attr.GetAddr());
|
||||
|
||||
|
@ -37,7 +37,7 @@ int sys_rwlock_create(mem32_t rw_lock_id, mem_ptr_t<sys_rwlock_attribute_t> attr
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rwlock_destroy(u32 rw_lock_id)
|
||||
s32 sys_rwlock_destroy(u32 rw_lock_id)
|
||||
{
|
||||
sys_rwlock.Warning("sys_rwlock_destroy(rw_lock_id=%d)", rw_lock_id);
|
||||
|
||||
|
@ -53,7 +53,7 @@ int sys_rwlock_destroy(u32 rw_lock_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rwlock_rlock(u32 rw_lock_id, u64 timeout)
|
||||
s32 sys_rwlock_rlock(u32 rw_lock_id, u64 timeout)
|
||||
{
|
||||
sys_rwlock.Log("sys_rwlock_rlock(rw_lock_id=%d, timeout=%lld)", rw_lock_id, timeout);
|
||||
|
||||
|
@ -90,7 +90,7 @@ int sys_rwlock_rlock(u32 rw_lock_id, u64 timeout)
|
|||
} while (true);
|
||||
}
|
||||
|
||||
int sys_rwlock_tryrlock(u32 rw_lock_id)
|
||||
s32 sys_rwlock_tryrlock(u32 rw_lock_id)
|
||||
{
|
||||
sys_rwlock.Log("sys_rwlock_tryrlock(rw_lock_id=%d)", rw_lock_id);
|
||||
|
||||
|
@ -102,7 +102,7 @@ int sys_rwlock_tryrlock(u32 rw_lock_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rwlock_runlock(u32 rw_lock_id)
|
||||
s32 sys_rwlock_runlock(u32 rw_lock_id)
|
||||
{
|
||||
sys_rwlock.Log("sys_rwlock_runlock(rw_lock_id=%d)", rw_lock_id);
|
||||
|
||||
|
@ -114,7 +114,7 @@ int sys_rwlock_runlock(u32 rw_lock_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rwlock_wlock(u32 rw_lock_id, u64 timeout)
|
||||
s32 sys_rwlock_wlock(u32 rw_lock_id, u64 timeout)
|
||||
{
|
||||
sys_rwlock.Log("sys_rwlock_wlock(rw_lock_id=%d, timeout=%lld)", rw_lock_id, timeout);
|
||||
|
||||
|
@ -153,7 +153,7 @@ int sys_rwlock_wlock(u32 rw_lock_id, u64 timeout)
|
|||
} while (true);
|
||||
}
|
||||
|
||||
int sys_rwlock_trywlock(u32 rw_lock_id)
|
||||
s32 sys_rwlock_trywlock(u32 rw_lock_id)
|
||||
{
|
||||
sys_rwlock.Log("sys_rwlock_trywlock(rw_lock_id=%d)", rw_lock_id);
|
||||
|
||||
|
@ -168,7 +168,7 @@ int sys_rwlock_trywlock(u32 rw_lock_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_rwlock_wunlock(u32 rw_lock_id)
|
||||
s32 sys_rwlock_wunlock(u32 rw_lock_id)
|
||||
{
|
||||
sys_rwlock.Log("sys_rwlock_wunlock(rw_lock_id=%d)", rw_lock_id);
|
||||
|
|
@ -150,3 +150,13 @@ struct RWLock
|
|||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 sys_rwlock_create(mem32_t rw_lock_id, mem_ptr_t<sys_rwlock_attribute_t> attr);
|
||||
s32 sys_rwlock_destroy(u32 rw_lock_id);
|
||||
s32 sys_rwlock_rlock(u32 rw_lock_id, u64 timeout);
|
||||
s32 sys_rwlock_tryrlock(u32 rw_lock_id);
|
||||
s32 sys_rwlock_runlock(u32 rw_lock_id);
|
||||
s32 sys_rwlock_wlock(u32 rw_lock_id, u64 timeout);
|
||||
s32 sys_rwlock_trywlock(u32 rw_lock_id);
|
||||
s32 sys_rwlock_wunlock(u32 rw_lock_id);
|
|
@ -3,11 +3,11 @@
|
|||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "SC_Semaphore.h"
|
||||
#include "sys_semaphore.h"
|
||||
|
||||
SysCallBase sys_sem("sys_semaphore");
|
||||
|
||||
int sys_semaphore_create(mem32_t sem, mem_ptr_t<sys_semaphore_attribute> attr, int initial_count, int max_count)
|
||||
s32 sys_semaphore_create(mem32_t sem, mem_ptr_t<sys_semaphore_attribute> attr, int initial_count, int max_count)
|
||||
{
|
||||
sys_sem.Warning("sys_semaphore_create(sem_addr=0x%x, attr_addr=0x%x, initial_count=%d, max_count=%d)",
|
||||
sem.GetAddr(), attr.GetAddr(), initial_count, max_count);
|
||||
|
@ -45,7 +45,7 @@ int sys_semaphore_create(mem32_t sem, mem_ptr_t<sys_semaphore_attribute> attr, i
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_semaphore_destroy(u32 sem_id)
|
||||
s32 sys_semaphore_destroy(u32 sem_id)
|
||||
{
|
||||
sys_sem.Warning("sys_semaphore_destroy(sem_id=%d)", sem_id);
|
||||
|
||||
|
@ -64,7 +64,7 @@ int sys_semaphore_destroy(u32 sem_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_semaphore_wait(u32 sem_id, u64 timeout)
|
||||
s32 sys_semaphore_wait(u32 sem_id, u64 timeout)
|
||||
{
|
||||
sys_sem.Log("sys_semaphore_wait(sem_id=%d, timeout=%lld)", sem_id, timeout);
|
||||
|
||||
|
@ -118,7 +118,7 @@ int sys_semaphore_wait(u32 sem_id, u64 timeout)
|
|||
}
|
||||
}
|
||||
|
||||
int sys_semaphore_trywait(u32 sem_id)
|
||||
s32 sys_semaphore_trywait(u32 sem_id)
|
||||
{
|
||||
sys_sem.Log("sys_semaphore_trywait(sem_id=%d)", sem_id);
|
||||
|
||||
|
@ -141,7 +141,7 @@ int sys_semaphore_trywait(u32 sem_id)
|
|||
}
|
||||
}
|
||||
|
||||
int sys_semaphore_post(u32 sem_id, int count)
|
||||
s32 sys_semaphore_post(u32 sem_id, int count)
|
||||
{
|
||||
sys_sem.Log("sys_semaphore_post(sem_id=%d, count=%d)", sem_id, count);
|
||||
|
||||
|
@ -193,7 +193,7 @@ int sys_semaphore_post(u32 sem_id, int count)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_semaphore_get_value(u32 sem_id, mem32_t count)
|
||||
s32 sys_semaphore_get_value(u32 sem_id, mem32_t count)
|
||||
{
|
||||
sys_sem.Log("sys_semaphore_get_value(sem_id=%d, count_addr=0x%x)", sem_id, count.GetAddr());
|
||||
|
|
@ -33,4 +33,12 @@ struct Semaphore
|
|||
, name(name)
|
||||
{
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 sys_semaphore_create(mem32_t sem, mem_ptr_t<sys_semaphore_attribute> attr, int initial_count, int max_count);
|
||||
s32 sys_semaphore_destroy(u32 sem_id);
|
||||
s32 sys_semaphore_wait(u32 sem_id, u64 timeout);
|
||||
s32 sys_semaphore_trywait(u32 sem_id);
|
||||
s32 sys_semaphore_post(u32 sem_id, int count);
|
||||
s32 sys_semaphore_get_value(u32 sem_id, mem32_t count);
|
|
@ -4,7 +4,7 @@
|
|||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Spinlock.h"
|
||||
#include "sys_spinlock.h"
|
||||
|
||||
SysCallBase sys_spinlock("sys_spinlock");
|
||||
|
||||
|
@ -28,7 +28,7 @@ void sys_spinlock_lock(mem_ptr_t<spinlock> lock)
|
|||
}
|
||||
}
|
||||
|
||||
int sys_spinlock_trylock(mem_ptr_t<spinlock> lock)
|
||||
s32 sys_spinlock_trylock(mem_ptr_t<spinlock> lock)
|
||||
{
|
||||
sys_spinlock.Log("sys_spinlock_trylock(lock_addr=0x%x)", lock.GetAddr());
|
||||
|
12
rpcs3/Emu/SysCalls/lv2/sys_spinlock.h
Normal file
12
rpcs3/Emu/SysCalls/lv2/sys_spinlock.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
struct spinlock
|
||||
{
|
||||
SMutexBE mutex;
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
void sys_spinlock_initialize(mem_ptr_t<spinlock> lock);
|
||||
void sys_spinlock_lock(mem_ptr_t<spinlock> lock);
|
||||
s32 sys_spinlock_trylock(mem_ptr_t<spinlock> lock);
|
||||
void sys_spinlock_unlock(mem_ptr_t<spinlock> lock);
|
|
@ -4,7 +4,7 @@
|
|||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/FS/vfsFile.h"
|
||||
#include "SC_SPU_Thread.h"
|
||||
#include "sys_spu.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "Emu/SysCalls/SC_FUNC.h"
|
||||
#include "Loader/ELF.h"
|
||||
|
@ -42,8 +42,25 @@ u32 LoadSpuImage(vfsStream& stream)
|
|||
return LoadSpuImage(stream, g_last_spu_offset);
|
||||
}*/
|
||||
|
||||
/*u32 _max_usable_spu = 0;
|
||||
u32 _max_raw_spu = 0;
|
||||
|
||||
s32 sys_spu_initialize(u32 max_usable_spu, u32 max_raw_spu)
|
||||
{
|
||||
sc_spu.Log("sys_spu_initialize(max_usable_spu=%d, max_raw_spu=%d)", max_usable_spu, max_raw_spu);
|
||||
_max_usable_spu = max_usable_spu;
|
||||
_max_raw_spu = max_raw_spu;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_raw_spu_create(u32 id_addr, u32 attr_addr)
|
||||
{
|
||||
Memory.Write32(id_addr, Emu.GetIdManager().GetNewID("raw_spu"));
|
||||
return CELL_OK;
|
||||
}*/
|
||||
|
||||
//156
|
||||
int sys_spu_image_open(mem_ptr_t<sys_spu_image> img, u32 path_addr)
|
||||
s32 sys_spu_image_open(mem_ptr_t<sys_spu_image> img, u32 path_addr)
|
||||
{
|
||||
const std::string path = Memory.ReadString(path_addr).c_str();
|
||||
sc_spu.Warning("sys_spu_image_open(img_addr=0x%x, path_addr=0x%x [%s])", img.GetAddr(), path_addr, path.c_str());
|
||||
|
@ -72,7 +89,7 @@ int sys_spu_image_open(mem_ptr_t<sys_spu_image> img, u32 path_addr)
|
|||
}
|
||||
|
||||
//172
|
||||
int sys_spu_thread_initialize(mem32_t thread, u32 group, u32 spu_num, mem_ptr_t<sys_spu_image> img, mem_ptr_t<sys_spu_thread_attribute> attr, mem_ptr_t<sys_spu_thread_argument> arg)
|
||||
s32 sys_spu_thread_initialize(mem32_t thread, u32 group, u32 spu_num, mem_ptr_t<sys_spu_image> img, mem_ptr_t<sys_spu_thread_attribute> attr, mem_ptr_t<sys_spu_thread_argument> arg)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_initialize(thread_addr=0x%x, group=0x%x, spu_num=%d, img_addr=0x%x, attr_addr=0x%x, arg_addr=0x%x)",
|
||||
thread.GetAddr(), group, spu_num, img.GetAddr(), attr.GetAddr(), arg.GetAddr());
|
||||
|
@ -143,7 +160,7 @@ int sys_spu_thread_initialize(mem32_t thread, u32 group, u32 spu_num, mem_ptr_t<
|
|||
}
|
||||
|
||||
//166
|
||||
int sys_spu_thread_set_argument(u32 id, mem_ptr_t<sys_spu_thread_argument> arg)
|
||||
s32 sys_spu_thread_set_argument(u32 id, mem_ptr_t<sys_spu_thread_argument> arg)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_set_argument(id=%d, arg_addr=0x%x)", id, arg.GetAddr());
|
||||
CPUThread* thr = Emu.GetCPU().GetThread(id);
|
||||
|
@ -167,7 +184,7 @@ int sys_spu_thread_set_argument(u32 id, mem_ptr_t<sys_spu_thread_argument> arg)
|
|||
}
|
||||
|
||||
//165
|
||||
int sys_spu_thread_get_exit_status(u32 id, mem32_t status)
|
||||
s32 sys_spu_thread_get_exit_status(u32 id, mem32_t status)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_get_exit_status(id=%d, status_addr=0x%x)", id, status.GetAddr());
|
||||
|
||||
|
@ -194,7 +211,7 @@ int sys_spu_thread_get_exit_status(u32 id, mem32_t status)
|
|||
}
|
||||
|
||||
//171
|
||||
int sys_spu_thread_group_destroy(u32 id)
|
||||
s32 sys_spu_thread_group_destroy(u32 id)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_group_destroy(id=%d)", id);
|
||||
|
||||
|
@ -221,7 +238,7 @@ int sys_spu_thread_group_destroy(u32 id)
|
|||
}
|
||||
|
||||
//173
|
||||
int sys_spu_thread_group_start(u32 id)
|
||||
s32 sys_spu_thread_group_start(u32 id)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_group_start(id=%d)", id);
|
||||
|
||||
|
@ -246,7 +263,7 @@ int sys_spu_thread_group_start(u32 id)
|
|||
}
|
||||
|
||||
//174
|
||||
int sys_spu_thread_group_suspend(u32 id)
|
||||
s32 sys_spu_thread_group_suspend(u32 id)
|
||||
{
|
||||
sc_spu.Log("sys_spu_thread_group_suspend(id=%d)", id);
|
||||
|
||||
|
@ -270,7 +287,7 @@ int sys_spu_thread_group_suspend(u32 id)
|
|||
}
|
||||
|
||||
//175
|
||||
int sys_spu_thread_group_resume(u32 id)
|
||||
s32 sys_spu_thread_group_resume(u32 id)
|
||||
{
|
||||
sc_spu.Log("sys_spu_thread_group_resume(id=%d)", id);
|
||||
|
||||
|
@ -294,7 +311,7 @@ int sys_spu_thread_group_resume(u32 id)
|
|||
}
|
||||
|
||||
//170
|
||||
int sys_spu_thread_group_create(mem32_t id, u32 num, int prio, mem_ptr_t<sys_spu_thread_group_attribute> attr)
|
||||
s32 sys_spu_thread_group_create(mem32_t id, u32 num, int prio, mem_ptr_t<sys_spu_thread_group_attribute> attr)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_group_create(id_addr=0x%x, num=%d, prio=%d, attr_addr=0x%x)",
|
||||
id.GetAddr(), num, prio, attr.GetAddr());
|
||||
|
@ -318,7 +335,7 @@ int sys_spu_thread_group_create(mem32_t id, u32 num, int prio, mem_ptr_t<sys_spu
|
|||
}
|
||||
|
||||
//178
|
||||
int sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status)
|
||||
s32 sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_group_join(id=%d, cause_addr=0x%x, status_addr=0x%x)", id, cause.GetAddr(), status.GetAddr());
|
||||
|
||||
|
@ -357,7 +374,7 @@ int sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_spu_thread_create(mem32_t thread_id, mem32_t entry, u64 arg, int prio, u32 stacksize, u64 flags, u32 threadname_addr)
|
||||
s32 sys_spu_thread_create(mem32_t thread_id, mem32_t entry, u64 arg, int prio, u32 stacksize, u64 flags, u32 threadname_addr)
|
||||
{
|
||||
sc_spu.Error("sys_spu_thread_create(thread_id_addr=0x%x, entry_addr=0x%x, arg=0x%llx, prio=%d, stacksize=0x%x, flags=0x%llx, threadname_addr=0x%x",
|
||||
thread_id.GetAddr(), entry.GetAddr(), arg, prio, stacksize, flags, threadname_addr);
|
||||
|
@ -365,7 +382,7 @@ int sys_spu_thread_create(mem32_t thread_id, mem32_t entry, u64 arg, int prio, u
|
|||
}
|
||||
|
||||
//169
|
||||
int sys_spu_initialize(u32 max_usable_spu, u32 max_raw_spu)
|
||||
s32 sys_spu_initialize(u32 max_usable_spu, u32 max_raw_spu)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_initialize(max_usable_spu=%d, max_raw_spu=%d)", max_usable_spu, max_raw_spu);
|
||||
|
||||
|
@ -386,7 +403,7 @@ int sys_spu_initialize(u32 max_usable_spu, u32 max_raw_spu)
|
|||
}
|
||||
|
||||
//181
|
||||
int sys_spu_thread_write_ls(u32 id, u32 address, u64 value, u32 type)
|
||||
s32 sys_spu_thread_write_ls(u32 id, u32 address, u64 value, u32 type)
|
||||
{
|
||||
sc_spu.Log("sys_spu_thread_write_ls(id=%d, address=0x%x, value=0x%llx, type=0x%x)",
|
||||
id, address, value, type);
|
||||
|
@ -419,7 +436,7 @@ int sys_spu_thread_write_ls(u32 id, u32 address, u64 value, u32 type)
|
|||
}
|
||||
|
||||
//182
|
||||
int sys_spu_thread_read_ls(u32 id, u32 address, mem64_t value, u32 type)
|
||||
s32 sys_spu_thread_read_ls(u32 id, u32 address, mem64_t value, u32 type)
|
||||
{
|
||||
sc_spu.Log("sys_spu_thread_read_ls(id=%d, address=0x%x, value_addr=0x%x, type=0x%x)",
|
||||
id, address, value.GetAddr(), type);
|
||||
|
@ -457,7 +474,7 @@ int sys_spu_thread_read_ls(u32 id, u32 address, mem64_t value, u32 type)
|
|||
}
|
||||
|
||||
//190
|
||||
int sys_spu_thread_write_spu_mb(u32 id, u32 value)
|
||||
s32 sys_spu_thread_write_spu_mb(u32 id, u32 value)
|
||||
{
|
||||
sc_spu.Log("sys_spu_thread_write_spu_mb(id=%d, value=0x%x)", id, value);
|
||||
|
||||
|
@ -474,7 +491,7 @@ int sys_spu_thread_write_spu_mb(u32 id, u32 value)
|
|||
}
|
||||
|
||||
//187
|
||||
int sys_spu_thread_set_spu_cfg(u32 id, u64 value)
|
||||
s32 sys_spu_thread_set_spu_cfg(u32 id, u64 value)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_set_spu_cfg(id=%d, value=0x%x)", id, value);
|
||||
|
||||
|
@ -496,7 +513,7 @@ int sys_spu_thread_set_spu_cfg(u32 id, u64 value)
|
|||
}
|
||||
|
||||
//188
|
||||
int sys_spu_thread_get_spu_cfg(u32 id, mem64_t value)
|
||||
s32 sys_spu_thread_get_spu_cfg(u32 id, mem64_t value)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_get_spu_cfg(id=%d, value_addr=0x%x)", id, value.GetAddr());
|
||||
|
||||
|
@ -513,7 +530,7 @@ int sys_spu_thread_get_spu_cfg(u32 id, mem64_t value)
|
|||
}
|
||||
|
||||
//184
|
||||
int sys_spu_thread_write_snr(u32 id, u32 number, u32 value)
|
||||
s32 sys_spu_thread_write_snr(u32 id, u32 number, u32 value)
|
||||
{
|
||||
sc_spu.Log("sys_spu_thread_write_snr(id=%d, number=%d, value=0x%x)", id, number, value);
|
||||
CPUThread* thr = Emu.GetCPU().GetThread(id);
|
||||
|
@ -533,14 +550,14 @@ int sys_spu_thread_write_snr(u32 id, u32 number, u32 value)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_spu_thread_group_connect_event(u32 id, u32 eq, u32 et)
|
||||
s32 sys_spu_thread_group_connect_event(u32 id, u32 eq, u32 et)
|
||||
{
|
||||
sc_spu.Error("sys_spu_thread_group_connect_event(id=%d, eq=%d, et=0x%x)", id, eq, et);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_spu_thread_group_disconnect_event(u32 id, u32 et)
|
||||
s32 sys_spu_thread_group_disconnect_event(u32 id, u32 et)
|
||||
{
|
||||
sc_spu.Error("sys_spu_thread_group_disconnect_event(id=%d, et=0x%x)", id, et);
|
||||
|
||||
|
@ -549,13 +566,13 @@ int sys_spu_thread_group_disconnect_event(u32 id, u32 et)
|
|||
|
||||
/*
|
||||
SPU-Side functions:
|
||||
int sys_spu_thread_receive_event(u32 spuq_num, mem32_t d1, mem32_t d2, mem32_t d3);
|
||||
int sys_spu_thread_send_event(u8 spup, u24 data0, u32 data1);
|
||||
int sys_spu_thread_throw_event(u8 spup, u24 data0, u32 data1);
|
||||
int sys_spu_thread_tryreceive_event(u32 spuq_num, mem32_t d1, mem32_t d2, mem32_t d3);
|
||||
s32 sys_spu_thread_receive_event(u32 spuq_num, mem32_t d1, mem32_t d2, mem32_t d3);
|
||||
s32 sys_spu_thread_send_event(u8 spup, u24 data0, u32 data1);
|
||||
s32 sys_spu_thread_throw_event(u8 spup, u24 data0, u32 data1);
|
||||
s32 sys_spu_thread_tryreceive_event(u32 spuq_num, mem32_t d1, mem32_t d2, mem32_t d3);
|
||||
*/
|
||||
|
||||
int sys_spu_thread_connect_event(u32 id, u32 eq_id, u32 et, u8 spup)
|
||||
s32 sys_spu_thread_connect_event(u32 id, u32 eq_id, u32 et, u8 spup)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_connect_event(id=%d, eq_id=%d, event_type=0x%x, spup=%d)", id, eq_id, et, spup);
|
||||
|
||||
|
@ -604,7 +621,7 @@ int sys_spu_thread_connect_event(u32 id, u32 eq_id, u32 et, u8 spup)
|
|||
}
|
||||
|
||||
//
|
||||
int sys_spu_thread_disconnect_event(u32 id, u32 et, u8 spup)
|
||||
s32 sys_spu_thread_disconnect_event(u32 id, u32 et, u8 spup)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_disconnect_event(id=%d, event_type=0x%x, spup=%d)", id, et, spup);
|
||||
|
||||
|
@ -644,7 +661,7 @@ int sys_spu_thread_disconnect_event(u32 id, u32 et, u8 spup)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_spu_thread_bind_queue(u32 id, u32 eq_id, u32 spuq_num)
|
||||
s32 sys_spu_thread_bind_queue(u32 id, u32 eq_id, u32 spuq_num)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_bind_queue(id=%d, equeue_id=%d, spuq_num=0x%x)", id, eq_id, spuq_num);
|
||||
|
||||
|
@ -674,7 +691,7 @@ int sys_spu_thread_bind_queue(u32 id, u32 eq_id, u32 spuq_num)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_spu_thread_unbind_queue(u32 id, u32 spuq_num)
|
||||
s32 sys_spu_thread_unbind_queue(u32 id, u32 spuq_num)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_unbind_queue(id=0x%x, spuq_num=0x%x)", id, spuq_num);
|
||||
|
||||
|
@ -693,7 +710,7 @@ int sys_spu_thread_unbind_queue(u32 id, u32 spuq_num)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq, u64 req, u32 spup_addr)
|
||||
s32 sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq, u64 req, u32 spup_addr)
|
||||
{
|
||||
sc_spu.Error("sys_spu_thread_group_connect_event_all_threads(id=%d, eq=%d, req=0x%llx, spup_addr=0x%x)",
|
||||
id, eq, req, spup_addr);
|
||||
|
@ -740,7 +757,7 @@ int sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq, u64 req, u32
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_spu_thread_group_disconnect_event_all_threads(u32 id, u8 spup)
|
||||
s32 sys_spu_thread_group_disconnect_event_all_threads(u32 id, u8 spup)
|
||||
{
|
||||
sc_spu.Error("sys_spu_thread_group_disconnect_event_all_threads(id=%d, spup=%d)", id, spup);
|
||||
|
||||
|
@ -748,7 +765,7 @@ int sys_spu_thread_group_disconnect_event_all_threads(u32 id, u8 spup)
|
|||
}
|
||||
|
||||
//160
|
||||
int sys_raw_spu_create(mem32_t id, u32 attr_addr)
|
||||
s32 sys_raw_spu_create(mem32_t id, u32 attr_addr)
|
||||
{
|
||||
sc_spu.Warning("sys_raw_spu_create(id_addr=0x%x, attr_addr=0x%x)", id.GetAddr(), attr_addr);
|
||||
|
||||
|
@ -761,14 +778,14 @@ int sys_raw_spu_create(mem32_t id, u32 attr_addr)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_raw_spu_destroy(u32 id)
|
||||
s32 sys_raw_spu_destroy(u32 id)
|
||||
{
|
||||
sc_spu.Error("sys_raw_spu_destroy(id=%d)", id);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_raw_spu_create_interrupt_tag(u32 id, u32 class_id, u32 hwthread, mem32_t intrtag)
|
||||
s32 sys_raw_spu_create_interrupt_tag(u32 id, u32 class_id, u32 hwthread, mem32_t intrtag)
|
||||
{
|
||||
sc_spu.Error("sys_raw_spu_create_interrupt_tag(id=%d, class_id=%d, hwthread=0x%x, intrtag_addr=0x%x)", id, class_id, hwthread, intrtag.GetAddr());
|
||||
|
||||
|
@ -800,7 +817,7 @@ int sys_raw_spu_create_interrupt_tag(u32 id, u32 class_id, u32 hwthread, mem32_t
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_raw_spu_set_int_mask(u32 id, u32 class_id, u64 mask)
|
||||
s32 sys_raw_spu_set_int_mask(u32 id, u32 class_id, u64 mask)
|
||||
{
|
||||
sc_spu.Warning("sys_raw_spu_set_int_mask(id=%d, class_id=%d, mask=0x%llx)", id, class_id, mask);
|
||||
|
||||
|
@ -819,7 +836,7 @@ int sys_raw_spu_set_int_mask(u32 id, u32 class_id, u64 mask)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_raw_spu_get_int_mask(u32 id, u32 class_id, mem64_t mask)
|
||||
s32 sys_raw_spu_get_int_mask(u32 id, u32 class_id, mem64_t mask)
|
||||
{
|
||||
sc_spu.Log("sys_raw_spu_get_int_mask(id=%d, class_id=%d, mask_addr=0x%x)", id, class_id, mask.GetAddr());
|
||||
|
||||
|
@ -843,7 +860,7 @@ int sys_raw_spu_get_int_mask(u32 id, u32 class_id, mem64_t mask)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_raw_spu_set_int_stat(u32 id, u32 class_id, u64 stat)
|
||||
s32 sys_raw_spu_set_int_stat(u32 id, u32 class_id, u64 stat)
|
||||
{
|
||||
sc_spu.Log("sys_raw_spu_set_int_stat(id=%d, class_id=%d, stat=0x%llx)", id, class_id, stat);
|
||||
|
||||
|
@ -862,7 +879,7 @@ int sys_raw_spu_set_int_stat(u32 id, u32 class_id, u64 stat)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_raw_spu_get_int_stat(u32 id, u32 class_id, mem64_t stat)
|
||||
s32 sys_raw_spu_get_int_stat(u32 id, u32 class_id, mem64_t stat)
|
||||
{
|
||||
sc_spu.Log("sys_raw_spu_get_int_stat(id=%d, class_id=%d, stat_addr=0xx)", id, class_id, stat.GetAddr());
|
||||
|
||||
|
@ -886,7 +903,7 @@ int sys_raw_spu_get_int_stat(u32 id, u32 class_id, mem64_t stat)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_raw_spu_read_puint_mb(u32 id, mem32_t value)
|
||||
s32 sys_raw_spu_read_puint_mb(u32 id, mem32_t value)
|
||||
{
|
||||
sc_spu.Log("sys_raw_spu_read_puint_mb(id=%d, value_addr=0x%x)", id, value.GetAddr());
|
||||
|
||||
|
@ -907,7 +924,7 @@ int sys_raw_spu_read_puint_mb(u32 id, mem32_t value)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_raw_spu_set_spu_cfg(u32 id, u32 value)
|
||||
s32 sys_raw_spu_set_spu_cfg(u32 id, u32 value)
|
||||
{
|
||||
sc_spu.Log("sys_raw_spu_set_spu_cfg(id=%d, value=0x%x)", id, value);
|
||||
|
||||
|
@ -921,7 +938,7 @@ int sys_raw_spu_set_spu_cfg(u32 id, u32 value)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_raw_spu_get_spu_cfg(u32 id, mem32_t value)
|
||||
s32 sys_raw_spu_get_spu_cfg(u32 id, mem32_t value)
|
||||
{
|
||||
sc_spu.Log("sys_raw_spu_get_spu_afg(id=%d, value_addr=0x%x)", id, value.GetAddr());
|
||||
|
121
rpcs3/Emu/SysCalls/lv2/sys_spu.h
Normal file
121
rpcs3/Emu/SysCalls/lv2/sys_spu.h
Normal file
|
@ -0,0 +1,121 @@
|
|||
#pragma once
|
||||
|
||||
u32 LoadSpuImage(vfsStream& stream, u32& spu_ep);
|
||||
|
||||
enum
|
||||
{
|
||||
SYS_SPU_THREAD_GROUP_JOIN_GROUP_EXIT = 0x0001,
|
||||
SYS_SPU_THREAD_GROUP_JOIN_ALL_THREADS_EXIT = 0x0002,
|
||||
SYS_SPU_THREAD_GROUP_JOIN_TERMINATED = 0x0004
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SYS_SPU_SEGMENT_TYPE_COPY = 0x0001,
|
||||
SYS_SPU_SEGMENT_TYPE_FILL = 0x0002,
|
||||
SYS_SPU_SEGMENT_TYPE_INFO = 0x0004,
|
||||
};
|
||||
|
||||
struct sys_spu_thread_group_attribute
|
||||
{
|
||||
be_t<u32> name_len;
|
||||
be_t<u32> name_addr;
|
||||
be_t<int> type;
|
||||
/* struct {} option; */
|
||||
be_t<u32> ct; // memory container id
|
||||
};
|
||||
|
||||
struct sys_spu_thread_attribute
|
||||
{
|
||||
be_t<u32> name_addr;
|
||||
be_t<u32> name_len;
|
||||
be_t<u32> option;
|
||||
};
|
||||
|
||||
struct sys_spu_thread_argument
|
||||
{
|
||||
be_t<u64> arg1;
|
||||
be_t<u64> arg2;
|
||||
be_t<u64> arg3;
|
||||
be_t<u64> arg4;
|
||||
};
|
||||
|
||||
struct sys_spu_image
|
||||
{
|
||||
be_t<u32> type;
|
||||
be_t<u32> entry_point;
|
||||
be_t<u32> segs_addr; //temporarily used as offset of LS image after elf loading
|
||||
be_t<int> nsegs;
|
||||
};
|
||||
|
||||
struct sys_spu_segment
|
||||
{
|
||||
be_t<int> type;
|
||||
be_t<u32> ls_start;
|
||||
be_t<int> size;
|
||||
be_t<u64> src;
|
||||
};
|
||||
|
||||
struct SpuGroupInfo
|
||||
{
|
||||
std::vector<u32> list;
|
||||
std::atomic<u32> lock;
|
||||
std::string m_name;
|
||||
int m_prio;
|
||||
int m_type;
|
||||
int m_ct;
|
||||
|
||||
SpuGroupInfo(const std::string& name, u32 num, int prio, int type, u32 ct)
|
||||
: m_name(name)
|
||||
, m_prio(prio)
|
||||
, m_type(type)
|
||||
, m_ct(ct)
|
||||
, lock(0)
|
||||
{
|
||||
num = 256;
|
||||
list.resize(num);
|
||||
for (u32 i = 0; i < num; i++)
|
||||
{
|
||||
list[i] = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 sys_spu_initialize(u32 max_usable_spu, u32 max_raw_spu);
|
||||
s32 sys_spu_image_open(mem_ptr_t<sys_spu_image> img, u32 path_addr);
|
||||
s32 sys_spu_thread_initialize(mem32_t thread, u32 group, u32 spu_num, mem_ptr_t<sys_spu_image> img, mem_ptr_t<sys_spu_thread_attribute> attr, mem_ptr_t<sys_spu_thread_argument> arg);
|
||||
s32 sys_spu_thread_set_argument(u32 id, mem_ptr_t<sys_spu_thread_argument> arg);
|
||||
s32 sys_spu_thread_group_destroy(u32 id);
|
||||
s32 sys_spu_thread_group_start(u32 id);
|
||||
s32 sys_spu_thread_group_suspend(u32 id);
|
||||
s32 sys_spu_thread_group_resume(u32 id);
|
||||
s32 sys_spu_thread_group_create(mem32_t id, u32 num, int prio, mem_ptr_t<sys_spu_thread_group_attribute> attr);
|
||||
s32 sys_spu_thread_create(mem32_t thread_id, mem32_t entry, u64 arg, int prio, u32 stacksize, u64 flags, u32 threadname_addr);
|
||||
s32 sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status);
|
||||
s32 sys_spu_thread_group_connect_event(u32 id, u32 eq, u32 et);
|
||||
s32 sys_spu_thread_group_disconnect_event(u32 id, u32 et);
|
||||
s32 sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq, u64 req, u32 spup_addr);
|
||||
s32 sys_spu_thread_group_disconnect_event_all_threads(u32 id, u8 spup);
|
||||
s32 sys_spu_thread_write_ls(u32 id, u32 address, u64 value, u32 type);
|
||||
s32 sys_spu_thread_read_ls(u32 id, u32 address, mem64_t value, u32 type);
|
||||
s32 sys_spu_thread_write_spu_mb(u32 id, u32 value);
|
||||
s32 sys_spu_thread_set_spu_cfg(u32 id, u64 value);
|
||||
s32 sys_spu_thread_get_spu_cfg(u32 id, mem64_t value);
|
||||
s32 sys_spu_thread_write_snr(u32 id, u32 number, u32 value);
|
||||
s32 sys_spu_thread_connect_event(u32 id, u32 eq, u32 et, u8 spup);
|
||||
s32 sys_spu_thread_disconnect_event(u32 id, u32 event_type, u8 spup);
|
||||
s32 sys_spu_thread_bind_queue(u32 id, u32 spuq, u32 spuq_num);
|
||||
s32 sys_spu_thread_unbind_queue(u32 id, u32 spuq_num);
|
||||
s32 sys_spu_thread_get_exit_status(u32 id, mem32_t status);
|
||||
|
||||
s32 sys_raw_spu_create(mem32_t id, u32 attr_addr);
|
||||
s32 sys_raw_spu_destroy(u32 id);
|
||||
s32 sys_raw_spu_create_interrupt_tag(u32 id, u32 class_id, u32 hwthread, mem32_t intrtag);
|
||||
s32 sys_raw_spu_set_int_mask(u32 id, u32 class_id, u64 mask);
|
||||
s32 sys_raw_spu_get_int_mask(u32 id, u32 class_id, mem64_t mask);
|
||||
s32 sys_raw_spu_set_int_stat(u32 id, u32 class_id, u64 stat);
|
||||
s32 sys_raw_spu_get_int_stat(u32 id, u32 class_id, mem64_t stat);
|
||||
s32 sys_raw_spu_read_puint_mb(u32 id, mem32_t value);
|
||||
s32 sys_raw_spu_set_spu_cfg(u32 id, u32 value);
|
||||
s32 sys_raw_spu_get_spu_cfg(u32 id, mem32_t value);
|
|
@ -10,7 +10,7 @@
|
|||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "SC_Time.h"
|
||||
#include "sys_time.h"
|
||||
|
||||
SysCallBase sys_time("sys_time");
|
||||
|
||||
|
@ -45,7 +45,7 @@ u64 get_system_time()
|
|||
|
||||
|
||||
// Functions
|
||||
int sys_time_get_timezone(mem32_t timezone, mem32_t summertime)
|
||||
s32 sys_time_get_timezone(mem32_t timezone, mem32_t summertime)
|
||||
{
|
||||
int ret;
|
||||
ret = cellSysutilGetSystemParamInt(0x0116, timezone); //0x0116 = CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE
|
||||
|
@ -55,7 +55,7 @@ int sys_time_get_timezone(mem32_t timezone, mem32_t summertime)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_time_get_current_time(u32 sec_addr, u32 nsec_addr)
|
||||
s32 sys_time_get_current_time(u32 sec_addr, u32 nsec_addr)
|
||||
{
|
||||
sys_time.Log("sys_time_get_current_time(sec_addr=0x%x, nsec_addr=0x%x)", sec_addr, nsec_addr);
|
||||
|
11
rpcs3/Emu/SysCalls/lv2/sys_time.h
Normal file
11
rpcs3/Emu/SysCalls/lv2/sys_time.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
// Auxiliary functions
|
||||
u64 get_time();
|
||||
u64 get_system_time();
|
||||
|
||||
// SysCalls
|
||||
s32 sys_time_get_timezone(mem32_t timezone, mem32_t summertime);
|
||||
s32 sys_time_get_current_time(u32 sec_addr, u32 nsec_addr);
|
||||
s64 sys_time_get_system_time();
|
||||
u64 sys_time_get_timebase_frequency();
|
|
@ -2,13 +2,13 @@
|
|||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "SC_Timer.h"
|
||||
#include "sys_timer.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "Emu/event.h"
|
||||
|
||||
SysCallBase sys_timer("sys_timer");
|
||||
|
||||
int sys_timer_create(mem32_t timer_id)
|
||||
s32 sys_timer_create(mem32_t timer_id)
|
||||
{
|
||||
sys_timer.Warning("sys_timer_create(timer_id_addr=0x%x)", timer_id.GetAddr());
|
||||
|
||||
|
@ -18,7 +18,7 @@ int sys_timer_create(mem32_t timer_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_timer_destroy(u32 timer_id)
|
||||
s32 sys_timer_destroy(u32 timer_id)
|
||||
{
|
||||
sys_timer.Warning("TODO: sys_timer_destroy(timer_id=%d)", timer_id);
|
||||
|
||||
|
@ -28,7 +28,7 @@ int sys_timer_destroy(u32 timer_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_timer_get_information(u32 timer_id, mem_ptr_t<sys_timer_information_t> info)
|
||||
s32 sys_timer_get_information(u32 timer_id, mem_ptr_t<sys_timer_information_t> info)
|
||||
{
|
||||
sys_timer.Warning("sys_timer_get_information(timer_id=%d, info_addr=0x%x)", timer_id, info.GetAddr());
|
||||
|
||||
|
@ -39,7 +39,7 @@ int sys_timer_get_information(u32 timer_id, mem_ptr_t<sys_timer_information_t> i
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_timer_start(u32 timer_id, s64 base_time, u64 period)
|
||||
s32 sys_timer_start(u32 timer_id, s64 base_time, u64 period)
|
||||
{
|
||||
sys_timer.Warning("sys_timer_start_periodic_absolute(timer_id=%d, basetime=%lld, period=%llu)", timer_id, base_time, period);
|
||||
|
||||
|
@ -58,7 +58,7 @@ int sys_timer_start(u32 timer_id, s64 base_time, u64 period)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_timer_stop(u32 timer_id)
|
||||
s32 sys_timer_stop(u32 timer_id)
|
||||
{
|
||||
sys_timer.Warning("TODO: sys_timer_stop()");
|
||||
|
||||
|
@ -70,7 +70,7 @@ int sys_timer_stop(u32 timer_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_timer_connect_event_queue(u32 timer_id, u32 queue_id, u64 name, u64 data1, u64 data2)
|
||||
s32 sys_timer_connect_event_queue(u32 timer_id, u32 queue_id, u64 name, u64 data1, u64 data2)
|
||||
{
|
||||
sys_timer.Warning("sys_timer_connect_event_queue(timer_id=%d, queue_id=%d, name=%llu, data1=%llu, data2=%llu)",
|
||||
timer_id, queue_id, name, data1, data2);
|
||||
|
@ -85,7 +85,7 @@ int sys_timer_connect_event_queue(u32 timer_id, u32 queue_id, u64 name, u64 data
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_timer_disconnect_event_queue(u32 timer_id)
|
||||
s32 sys_timer_disconnect_event_queue(u32 timer_id)
|
||||
{
|
||||
sys_timer.Warning("TODO: sys_timer_disconnect_event_queue(timer_id=%d)", timer_id);
|
||||
|
||||
|
@ -97,14 +97,14 @@ int sys_timer_disconnect_event_queue(u32 timer_id)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_timer_sleep(u32 sleep_time)
|
||||
s32 sys_timer_sleep(u32 sleep_time)
|
||||
{
|
||||
sys_timer.Warning("sys_timer_sleep(sleep_time=%d)", sleep_time);
|
||||
rSleep(sleep_time);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_timer_usleep(u64 sleep_time)
|
||||
s32 sys_timer_usleep(u64 sleep_time)
|
||||
{
|
||||
sys_timer.Log("sys_timer_usleep(sleep_time=%lld)", sleep_time);
|
||||
if (sleep_time > 0xFFFFFFFFFFFF) sleep_time = 0xFFFFFFFFFFFF; //2^48-1
|
33
rpcs3/Emu/SysCalls/lv2/sys_timer.h
Normal file
33
rpcs3/Emu/SysCalls/lv2/sys_timer.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
SYS_TIMER_STATE_STOP = 0x00U,
|
||||
SYS_TIMER_STATE_RUN = 0x01U,
|
||||
};
|
||||
|
||||
struct sys_timer_information_t
|
||||
{
|
||||
s64 next_expiration_time; //system_time_t
|
||||
u64 period; //usecond_t
|
||||
u32 timer_state;
|
||||
u32 pad;
|
||||
};
|
||||
|
||||
struct timer
|
||||
{
|
||||
rTimer tmr;
|
||||
sys_timer_information_t timer_information_t;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
s32 sys_timer_create(mem32_t timer_id);
|
||||
s32 sys_timer_destroy(u32 timer_id);
|
||||
s32 sys_timer_get_information(u32 timer_id, mem_ptr_t<sys_timer_information_t> info);
|
||||
s32 sys_timer_start(u32 timer_id, s64 basetime, u64 period);
|
||||
s32 sys_timer_stop(u32 timer_id);
|
||||
s32 sys_timer_connect_event_queue(u32 timer_id, u32 queue_id, u64 name, u64 data1, u64 data2);
|
||||
s32 sys_timer_disconnect_event_queue(u32 timer_id);
|
||||
s32 sys_timer_sleep(u32 sleep_time);
|
||||
s32 sys_timer_usleep(u64 sleep_time);
|
|
@ -6,61 +6,61 @@
|
|||
|
||||
SysCallBase sys_trace("sys_trace");
|
||||
|
||||
int sys_trace_create()
|
||||
s32 sys_trace_create()
|
||||
{
|
||||
sys_trace.Warning("Unimplemented function: sys_trace_create()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_trace_start()
|
||||
s32 sys_trace_start()
|
||||
{
|
||||
sys_trace.Warning("Unimplemented function: sys_trace_start()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_trace_stop()
|
||||
s32 sys_trace_stop()
|
||||
{
|
||||
sys_trace.Warning("Unimplemented function: sys_trace_stop()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_trace_update_top_index()
|
||||
s32 sys_trace_update_top_index()
|
||||
{
|
||||
sys_trace.Warning("Unimplemented function: sys_trace_update_top_index()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_trace_destroy()
|
||||
s32 sys_trace_destroy()
|
||||
{
|
||||
sys_trace.Warning("Unimplemented function: sys_trace_destroy()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_trace_drain()
|
||||
s32 sys_trace_drain()
|
||||
{
|
||||
sys_trace.Warning("Unimplemented function: sys_trace_drain()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_trace_attach_process()
|
||||
s32 sys_trace_attach_process()
|
||||
{
|
||||
sys_trace.Warning("Unimplemented function: sys_trace_attach_process()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_trace_allocate_buffer()
|
||||
s32 sys_trace_allocate_buffer()
|
||||
{
|
||||
sys_trace.Warning("Unimplemented function: sys_trace_allocate_buffer()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_trace_free_buffer()
|
||||
s32 sys_trace_free_buffer()
|
||||
{
|
||||
sys_trace.Warning("Unimplemented function: sys_trace_free_buffer()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_trace_create2()
|
||||
s32 sys_trace_create2()
|
||||
{
|
||||
sys_trace.Warning("Unimplemented function: sys_trace_create2()");
|
||||
return CELL_OK;
|
13
rpcs3/Emu/SysCalls/lv2/sys_trace.h
Normal file
13
rpcs3/Emu/SysCalls/lv2/sys_trace.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
// SysCalls
|
||||
s32 sys_trace_create();
|
||||
s32 sys_trace_start();
|
||||
s32 sys_trace_stop();
|
||||
s32 sys_trace_update_top_index();
|
||||
s32 sys_trace_destroy();
|
||||
s32 sys_trace_drain();
|
||||
s32 sys_trace_attach_process();
|
||||
s32 sys_trace_allocate_buffer();
|
||||
s32 sys_trace_free_buffer();
|
||||
s32 sys_trace_create2();
|
|
@ -4,7 +4,7 @@
|
|||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
|
||||
int sys_tty_read(u32 ch, u64 buf_addr, u32 len, u64 preadlen_addr)
|
||||
s32 sys_tty_read(u32 ch, u64 buf_addr, u32 len, u64 preadlen_addr)
|
||||
{
|
||||
//we currently do not support reading from the Console
|
||||
LOG_WARNING(HLE, "sys_tty_read: ch: %d, buf addr: %llx, len: %d", ch, buf_addr, len);
|
||||
|
@ -14,7 +14,7 @@ int sys_tty_read(u32 ch, u64 buf_addr, u32 len, u64 preadlen_addr)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_tty_write(u32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr)
|
||||
s32 sys_tty_write(u32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr)
|
||||
{
|
||||
if(ch > 15 || (s32)len <= 0) return CELL_EINVAL;
|
||||
if(!Memory.IsGoodAddr(buf_addr)) return CELL_EFAULT;
|
4
rpcs3/Emu/SysCalls/lv2/sys_tty.h
Normal file
4
rpcs3/Emu/SysCalls/lv2/sys_tty.h
Normal file
|
@ -0,0 +1,4 @@
|
|||
#pragma once
|
||||
|
||||
s32 sys_tty_read(u32 ch, u64 buf_addr, u32 len, u64 preadlen_addr);
|
||||
s32 sys_tty_write(u32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr);
|
|
@ -3,12 +3,12 @@
|
|||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "SC_Memory.h"
|
||||
#include "sys_memory.h"
|
||||
|
||||
SysCallBase sc_vm("vm");
|
||||
MemoryContainerInfo* current_ct;
|
||||
|
||||
int sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, u32 addr)
|
||||
s32 sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, u32 addr)
|
||||
{
|
||||
sc_vm.Warning("sys_vm_memory_map(vsize=0x%x,psize=0x%x,cidr=0x%x,flags=0x%llx,policy=0x%llx,addr=0x%x)",
|
||||
vsize, psize, cid, flag, policy, addr);
|
||||
|
@ -68,7 +68,7 @@ int sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, u32 a
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_vm_unmap(u32 addr)
|
||||
s32 sys_vm_unmap(u32 addr)
|
||||
{
|
||||
sc_vm.Warning("sys_vm_unmap(addr=0x%x)", addr);
|
||||
|
||||
|
@ -78,7 +78,7 @@ int sys_vm_unmap(u32 addr)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_vm_append_memory(u32 addr, u32 size)
|
||||
s32 sys_vm_append_memory(u32 addr, u32 size)
|
||||
{
|
||||
sc_vm.Warning("sys_vm_append_memory(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
|
@ -100,7 +100,7 @@ int sys_vm_append_memory(u32 addr, u32 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_vm_return_memory(u32 addr, u32 size)
|
||||
s32 sys_vm_return_memory(u32 addr, u32 size)
|
||||
{
|
||||
sc_vm.Warning("sys_vm_return_memory(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
|
@ -122,7 +122,7 @@ int sys_vm_return_memory(u32 addr, u32 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_vm_lock(u32 addr, u32 size)
|
||||
s32 sys_vm_lock(u32 addr, u32 size)
|
||||
{
|
||||
sc_vm.Warning("sys_vm_lock(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
|
@ -144,7 +144,7 @@ int sys_vm_lock(u32 addr, u32 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_vm_unlock(u32 addr, u32 size)
|
||||
s32 sys_vm_unlock(u32 addr, u32 size)
|
||||
{
|
||||
sc_vm.Warning("sys_vm_unlock(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
|
@ -159,7 +159,7 @@ int sys_vm_unlock(u32 addr, u32 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_vm_touch(u32 addr, u32 size)
|
||||
s32 sys_vm_touch(u32 addr, u32 size)
|
||||
{
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_touch(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
|
@ -176,7 +176,7 @@ int sys_vm_touch(u32 addr, u32 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_vm_flush(u32 addr, u32 size)
|
||||
s32 sys_vm_flush(u32 addr, u32 size)
|
||||
{
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_flush(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
|
@ -193,7 +193,7 @@ int sys_vm_flush(u32 addr, u32 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_vm_invalidate(u32 addr, u32 size)
|
||||
s32 sys_vm_invalidate(u32 addr, u32 size)
|
||||
{
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_invalidate(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
|
@ -210,7 +210,7 @@ int sys_vm_invalidate(u32 addr, u32 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_vm_store(u32 addr, u32 size)
|
||||
s32 sys_vm_store(u32 addr, u32 size)
|
||||
{
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_store(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
|
@ -227,7 +227,7 @@ int sys_vm_store(u32 addr, u32 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_vm_sync(u32 addr, u32 size)
|
||||
s32 sys_vm_sync(u32 addr, u32 size)
|
||||
{
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_sync(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
|
@ -243,7 +243,7 @@ int sys_vm_sync(u32 addr, u32 size)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_vm_test(u32 addr, u32 size, u32 result_addr)
|
||||
s32 sys_vm_test(u32 addr, u32 size, u32 result_addr)
|
||||
{
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_test(addr=0x%x,size=0x%x,result_addr=0x%x)", addr, size, result_addr);
|
||||
|
||||
|
@ -262,7 +262,7 @@ int sys_vm_test(u32 addr, u32 size, u32 result_addr)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_vm_get_statistics(u32 addr, u32 stat_addr)
|
||||
s32 sys_vm_get_statistics(u32 addr, u32 stat_addr)
|
||||
{
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_get_statistics(addr=0x%x,stat_addr=0x%x)", addr, stat_addr);
|
||||
|
31
rpcs3/Emu/SysCalls/lv2/sys_vm.h
Normal file
31
rpcs3/Emu/SysCalls/lv2/sys_vm.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
#pragma pack
|
||||
|
||||
#define SYS_VM_TEST_INVALID 0x0000ULL
|
||||
#define SYS_VM_TEST_UNUSED 0x0001ULL
|
||||
#define SYS_VM_TEST_ALLOCATED 0x0002ULL
|
||||
#define SYS_VM_TEST_STORED 0x0004ULL
|
||||
|
||||
struct sys_vm_statistics {
|
||||
u64 vm_crash_ppu;
|
||||
u64 vm_crash_spu;
|
||||
u64 vm_read;
|
||||
u64 vm_write;
|
||||
u32 physical_mem_size;
|
||||
u32 physical_mem_used;
|
||||
u64 timestamp;
|
||||
};
|
||||
|
||||
// SysCalls
|
||||
s32 sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, u32 addr);
|
||||
s32 sys_vm_unmap(u32 addr);
|
||||
s32 sys_vm_append_memory(u32 addr, u32 size);
|
||||
s32 sys_vm_return_memory(u32 addr, u32 size);
|
||||
s32 sys_vm_lock(u32 addr, u32 size);
|
||||
s32 sys_vm_unlock(u32 addr, u32 size);
|
||||
s32 sys_vm_touch(u32 addr, u32 size);
|
||||
s32 sys_vm_flush(u32 addr, u32 size);
|
||||
s32 sys_vm_invalidate(u32 addr, u32 size);
|
||||
s32 sys_vm_store(u32 addr, u32 size);
|
||||
s32 sys_vm_sync(u32 addr, u32 size);
|
||||
s32 sys_vm_test(u32 addr, u32 size, u32 result_addr);
|
||||
s32 sys_vm_get_statistics(u32 addr, u32 stat_addr);
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "Emu/SysCalls/lv2/SC_Lwmutex.h"
|
||||
#include "Emu/SysCalls/lv2/sys_lwmutex.h"
|
||||
|
||||
#define FIX_SPUQ(x) ((u64)x | 0x5350555100000000ULL)
|
||||
// arbitrary code to prevent "special" zero value in key argument
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Lwmutex.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Event_flag.h"
|
||||
#include "Emu/SysCalls/lv2/sys_lwmutex.h"
|
||||
#include "Emu/SysCalls/lv2/sys_event.h"
|
||||
#include "DisAsmFrame.h"
|
||||
#include "Emu/FS/vfsLocalFile.h"
|
||||
#include "Emu/Cell/PPCThread.h"
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "rpcs3.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Lwmutex.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Event_flag.h"
|
||||
#include "Emu/SysCalls/lv2/sys_lwmutex.h"
|
||||
#include "Emu/SysCalls/lv2/sys_event.h"
|
||||
#include "InterpreterDisAsm.h"
|
||||
#include "Emu/Cell/PPUDecoder.h"
|
||||
#include "Emu/Cell/PPUDisAsm.h"
|
||||
|
|
|
@ -92,33 +92,28 @@
|
|||
<ClCompile Include="Emu\Memory\Memory.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Callback.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\FuncList.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Condition.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Event.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Event_flag.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_FileSystem.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_GCM.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Heap.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Interrupt.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Keyboard.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Lwcond.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Lwmutex.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Memory.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Mouse.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Mutex.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Pad.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_PPU_Thread.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Process.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_PRX.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_RSX.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Rwlock.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Semaphore.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Spinlock.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_SPU_Thread.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Time.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Timer.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Trace.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_TTY.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_VM.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_cond.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_event.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\lv2Fs.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_interrupt.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_lwcond.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_lwmutex.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_memory.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_mmapper.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_mutex.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_ppu_thread.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_process.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_prx.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_rsx.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_rwlock.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_semaphore.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_spinlock.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_spu.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_time.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_timer.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_trace.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_tty.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_vm.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\ModuleManager.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellAdec.cpp" />
|
||||
|
@ -184,6 +179,9 @@
|
|||
<ClCompile Include="Emu\SysCalls\Modules\libsynth2.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\sceNp.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\sceNpTrophy.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\SC_Keyboard.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\SC_Mouse.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\SC_Pad.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\sysPrxForUser.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\sys_fs.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\sys_http.cpp" />
|
||||
|
@ -318,22 +316,28 @@
|
|||
<ClInclude Include="Emu\Memory\MemoryBlock.h" />
|
||||
<ClInclude Include="Emu\SysCalls\Callback.h" />
|
||||
<ClInclude Include="Emu\SysCalls\ErrorCodes.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Condition.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Event_flag.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_FileSystem.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Interrupt.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Lwcond.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Lwmutex.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Memory.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Mutex.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Process.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_PRX.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Rwlock.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Semaphore.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Spinlock.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_SPU_Thread.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Time.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Timer.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_cond.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_event.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\lv2Fs.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_interrupt.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_lwcond.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_lwmutex.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_memory.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_mmapper.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_mutex.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_ppu_thread.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_process.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_prx.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_rsx.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_rwlock.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_semaphore.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_spinlock.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_spu.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_time.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_timer.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_trace.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_tty.h" />
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_vm.h" />
|
||||
<ClInclude Include="Emu\SysCalls\ModuleManager.h" />
|
||||
<ClInclude Include="Emu\SysCalls\Modules.h" />
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellAdec.h" />
|
||||
|
|
|
@ -128,81 +128,6 @@
|
|||
<ClCompile Include="Emu\SysCalls\SysCalls.cpp">
|
||||
<Filter>Emu\SysCalls</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Condition.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Event.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Event_flag.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_FileSystem.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_GCM.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Heap.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Keyboard.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Lwcond.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Lwmutex.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Memory.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Mouse.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Mutex.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Pad.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_PPU_Thread.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Process.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_RSX.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Rwlock.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Semaphore.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Spinlock.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_SPU_Thread.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Time.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Timer.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Trace.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_TTY.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_VM.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellAdec.cpp">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClCompile>
|
||||
|
@ -578,10 +503,79 @@
|
|||
<ClCompile Include="..\Utilities\SSemaphore.cpp">
|
||||
<Filter>Utilities</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_Interrupt.cpp">
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_process.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\SC_PRX.cpp">
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_prx.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_memory.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_timer.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_lwcond.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_rwlock.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_lwmutex.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_cond.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_mutex.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_semaphore.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_rsx.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_spinlock.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_ppu_thread.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_tty.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_vm.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_trace.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_event.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_spu.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_time.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_interrupt.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\sys_mmapper.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\Modules\SC_Mouse.cpp">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\Modules\SC_Pad.cpp">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\Modules\SC_Keyboard.cpp">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\lv2\lv2Fs.cpp">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Utilities\Log.cpp">
|
||||
|
@ -637,42 +631,6 @@
|
|||
<ClInclude Include="Emu\SysCalls\SysCalls.h">
|
||||
<Filter>Emu\SysCalls</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Condition.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Event_flag.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_FileSystem.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Lwcond.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Lwmutex.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Memory.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Mutex.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Rwlock.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Spinlock.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_SPU_Thread.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Time.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Timer.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellAdec.h">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClInclude>
|
||||
|
@ -1057,16 +1015,70 @@
|
|||
<ClInclude Include="..\Utilities\SSemaphore.h">
|
||||
<Filter>Utilities</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Semaphore.h">
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_process.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Interrupt.h">
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_prx.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_PRX.h">
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_memory.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\SC_Process.h">
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_timer.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_lwcond.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_rwlock.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_lwmutex.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_cond.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_mutex.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_semaphore.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_rsx.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_spinlock.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_ppu_thread.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_tty.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_vm.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_trace.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_event.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_spu.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_time.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_interrupt.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\sys_mmapper.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\lv2\lv2Fs.h">
|
||||
<Filter>Emu\SysCalls\lv2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Utilities\MTRingbuffer.h">
|
||||
|
|
Loading…
Add table
Reference in a new issue