mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 07:21:25 +12:00
Merge pull request #800 from darkf/stread
implement cellFsStRead (does *not* use ringbuffers)
This commit is contained in:
commit
ff29320a34
2 changed files with 11 additions and 2 deletions
|
@ -696,15 +696,20 @@ s32 cellFsStReadStop(u32 fd)
|
||||||
|
|
||||||
s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, vm::ptr<be_t<u64>> rsize)
|
s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, vm::ptr<be_t<u64>> rsize)
|
||||||
{
|
{
|
||||||
sys_fs->Todo("cellFsStRead(fd=%d, buf_addr=0x%x, size=0x%llx, rsize_addr = 0x%x)", fd, buf_addr, size, rsize.addr());
|
sys_fs->Warning("cellFsStRead(fd=%d, buf_addr=0x%x, size=0x%llx, rsize_addr=0x%x)", fd, buf_addr, size, rsize.addr());
|
||||||
|
|
||||||
LV2_LOCK(0);
|
LV2_LOCK(0);
|
||||||
|
|
||||||
vfsStream* file;
|
vfsStream* file;
|
||||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
// TODO: use ringbuffer (fs_config)
|
||||||
fs_config.m_regid += size;
|
fs_config.m_regid += size;
|
||||||
*rsize = fs_config.m_regid;
|
|
||||||
|
if (file->Eof())
|
||||||
|
return CELL_FS_ERANGE;
|
||||||
|
|
||||||
|
*rsize = file->Read(vm::get_ptr<void>(buf_addr), size);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,10 @@ enum cellFsStStatus
|
||||||
CELL_FS_ST_PROGRESS = 0x0200,
|
CELL_FS_ST_PROGRESS = 0x0200,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum cellFsErrors
|
||||||
|
{
|
||||||
|
CELL_FS_ERANGE = 34
|
||||||
|
};
|
||||||
|
|
||||||
#pragma pack(push, 4)
|
#pragma pack(push, 4)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue