IdManager improved, atomic_t improved

Various changes
This commit is contained in:
Nekotekina 2015-05-27 06:11:59 +03:00
parent cdf70e0b77
commit 22b78fec71
69 changed files with 4304 additions and 4098 deletions

View file

@ -210,7 +210,7 @@ s32 cellFsGetDirectoryEntries(u32 fd, vm::ptr<CellFsDirectoryEntry> entries, u32
{
cellFs.Warning("cellFsGetDirectoryEntries(fd=0x%x, entries=*0x%x, entries_size=0x%x, data_count=*0x%x)", fd, entries, entries_size, data_count);
const auto directory = Emu.GetIdManager().GetIDData<vfsDirBase>(fd);
const auto directory = Emu.GetIdManager().get<lv2_dir_t>(fd);
if (!directory)
{
@ -255,7 +255,7 @@ s32 cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 buffer_size,
// TODO: use single sys_fs_fcntl syscall
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file || file->flags & CELL_FS_O_WRONLY)
{
@ -286,7 +286,7 @@ s32 cellFsWriteWithOffset(u32 fd, u64 offset, vm::ptr<const void> buf, u64 data_
// TODO: use single sys_fs_fcntl syscall
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file || !(file->flags & CELL_FS_O_ACCMODE))
{
@ -330,7 +330,7 @@ s32 cellFsStReadInit(u32 fd, vm::ptr<const CellFsRingBuffer> ringbuf)
return CELL_FS_EINVAL;
}
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{
@ -368,7 +368,7 @@ s32 cellFsStReadFinish(u32 fd)
{
cellFs.Warning("cellFsStReadFinish(fd=0x%x)", fd);
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{
@ -391,7 +391,7 @@ s32 cellFsStReadGetRingBuf(u32 fd, vm::ptr<CellFsRingBuffer> ringbuf)
{
cellFs.Warning("cellFsStReadGetRingBuf(fd=0x%x, ringbuf=*0x%x)", fd, ringbuf);
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{
@ -415,7 +415,7 @@ s32 cellFsStReadGetStatus(u32 fd, vm::ptr<u64> status)
{
cellFs.Warning("cellFsStReadGetRingBuf(fd=0x%x, status=*0x%x)", fd, status);
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{
@ -449,7 +449,7 @@ s32 cellFsStReadGetRegid(u32 fd, vm::ptr<u64> regid)
{
cellFs.Warning("cellFsStReadGetRingBuf(fd=0x%x, regid=*0x%x)", fd, regid);
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{
@ -470,7 +470,7 @@ s32 cellFsStReadStart(u32 fd, u64 offset, u64 size)
{
cellFs.Warning("cellFsStReadStart(fd=0x%x, offset=0x%llx, size=0x%llx)", fd, offset, size);
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{
@ -552,7 +552,7 @@ s32 cellFsStReadStop(u32 fd)
{
cellFs.Warning("cellFsStReadStop(fd=0x%x)", fd);
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{
@ -583,7 +583,7 @@ s32 cellFsStRead(u32 fd, vm::ptr<u8> buf, u64 size, vm::ptr<u64> rsize)
{
cellFs.Warning("cellFsStRead(fd=0x%x, buf=*0x%x, size=0x%llx, rsize=*0x%x)", fd, buf, size, rsize);
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{
@ -617,7 +617,7 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr<u32> addr, vm::ptr<u64> size)
{
cellFs.Warning("cellFsStReadGetCurrentAddr(fd=0x%x, addr=*0x%x, size=*0x%x)", fd, addr, size);
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{
@ -650,7 +650,7 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, vm::ptr<u8> addr, u64 size)
{
cellFs.Warning("cellFsStReadPutCurrentAddr(fd=0x%x, addr=*0x%x, size=0x%llx)", fd, addr, size);
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{
@ -677,7 +677,7 @@ s32 cellFsStReadWait(u32 fd, u64 size)
{
cellFs.Warning("cellFsStReadWait(fd=0x%x, size=0x%llx)", fd, size);
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{
@ -711,7 +711,7 @@ s32 cellFsStReadWaitCallback(u32 fd, u64 size, fs_st_cb_t func)
{
cellFs.Warning("cellFsStReadWaitCallback(fd=0x%x, size=0x%llx, func=*0x%x)", fd, size, func);
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{
@ -879,7 +879,7 @@ void fsAio(vm::ptr<CellFsAio> aio, bool write, s32 xid, fs_aio_cb_t func)
s32 error = CELL_OK;
u64 result = 0;
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(aio->fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(aio->fd);
if (!file || (!write && file->flags & CELL_FS_O_WRONLY) || (write && !(file->flags & CELL_FS_O_ACCMODE)))
{
@ -931,11 +931,6 @@ s32 cellFsAioRead(vm::ptr<CellFsAio> aio, vm::ptr<s32> id, fs_aio_cb_t func)
{
cellFs.Warning("cellFsAioRead(aio=*0x%x, id=*0x%x, func=*0x%x)", aio, id, func);
if (!Emu.GetIdManager().CheckID<fs_file_t>(aio->fd))
{
return CELL_FS_EBADF;
}
// TODO: detect mount point and send AIO request to the AIO thread of this mount point
const s32 xid = (*id = ++g_fs_aio_id);
@ -949,11 +944,6 @@ s32 cellFsAioWrite(vm::ptr<CellFsAio> aio, vm::ptr<s32> id, fs_aio_cb_t func)
{
cellFs.Warning("cellFsAioWrite(aio=*0x%x, id=*0x%x, func=*0x%x)", aio, id, func);
if (!Emu.GetIdManager().CheckID<fs_file_t>(aio->fd))
{
return CELL_FS_EBADF;
}
// TODO: detect mount point and send AIO request to the AIO thread of this mount point
const s32 xid = (*id = ++g_fs_aio_id);
@ -983,7 +973,7 @@ s32 cellFsSetIoBufferFromDefaultContainer(u32 fd, u32 buffer_size, u32 page_type
{
cellFs.Todo("cellFsSetIoBufferFromDefaultContainer(fd=0x%x, buffer_size=%d, page_type=%d)", fd, buffer_size, page_type);
const auto file = Emu.GetIdManager().GetIDData<fs_file_t>(fd);
const auto file = Emu.GetIdManager().get<lv2_file_t>(fd);
if (!file)
{