mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
removed excessive stuff
This commit is contained in:
parent
dabac03820
commit
653db28675
14 changed files with 54 additions and 133 deletions
|
|
@ -46,8 +46,6 @@ s32 cellFsOpen(vm::ptr<const char> path, s32 flags, vm::ptr<be_t<u32>> fd, vm::p
|
|||
|
||||
const std::string _path = path.get_ptr();
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
s32 _oflags = flags;
|
||||
if (flags & CELL_O_CREAT)
|
||||
{
|
||||
|
|
@ -129,8 +127,6 @@ s32 cellFsRead(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<be_t<u64>> nread)
|
|||
sys_fs->Log("cellFsRead(fd=%d, buf_addr=0x%x, nbytes=0x%llx, nread_addr=0x%x)",
|
||||
fd, buf.addr(), nbytes, nread.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
return CELL_ESRCH;
|
||||
|
|
@ -152,8 +148,6 @@ s32 cellFsWrite(u32 fd, vm::ptr<const void> buf, u64 nbytes, vm::ptr<u64> nwrite
|
|||
sys_fs->Log("cellFsWrite(fd=%d, buf_addr=0x%x, nbytes=0x%llx, nwrite_addr=0x%x)",
|
||||
fd, buf.addr(), nbytes, nwrite.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
||||
|
||||
|
|
@ -172,8 +166,6 @@ s32 cellFsClose(u32 fd)
|
|||
{
|
||||
sys_fs->Warning("cellFsClose(fd=%d)", fd);
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
if (!Emu.GetIdManager().RemoveID(fd))
|
||||
return CELL_ESRCH;
|
||||
|
||||
|
|
@ -183,8 +175,6 @@ s32 cellFsClose(u32 fd)
|
|||
s32 cellFsOpendir(vm::ptr<const char> path, vm::ptr<u32> fd)
|
||||
{
|
||||
sys_fs->Warning("cellFsOpendir(path=\"%s\", fd_addr=0x%x)", path.get_ptr(), fd.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsDirBase> dir(Emu.GetVFS().OpenDir(path.get_ptr()));
|
||||
if (!dir || !dir->IsOpened())
|
||||
|
|
@ -200,8 +190,6 @@ s32 cellFsReaddir(u32 fd, vm::ptr<CellFsDirent> dir, vm::ptr<u64> nread)
|
|||
{
|
||||
sys_fs->Warning("cellFsReaddir(fd=%d, dir_addr=0x%x, nread_addr=0x%x)", fd, dir.addr(), nread.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsDirBase> directory;
|
||||
if (!sys_fs->CheckId(fd, directory))
|
||||
return CELL_ESRCH;
|
||||
|
|
@ -226,8 +214,6 @@ s32 cellFsClosedir(u32 fd)
|
|||
{
|
||||
sys_fs->Warning("cellFsClosedir(fd=%d)", fd);
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
if (!Emu.GetIdManager().RemoveID(fd))
|
||||
return CELL_ESRCH;
|
||||
|
||||
|
|
@ -238,8 +224,6 @@ s32 cellFsStat(vm::ptr<const char> path, vm::ptr<CellFsStat> sb)
|
|||
{
|
||||
sys_fs->Warning("cellFsStat(path=\"%s\", sb_addr=0x%x)", path.get_ptr(), sb.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
const std::string _path = path.get_ptr();
|
||||
|
||||
u32 mode = 0;
|
||||
|
|
@ -316,8 +300,6 @@ s32 cellFsFstat(u32 fd, vm::ptr<CellFsStat> sb)
|
|||
{
|
||||
sys_fs->Warning("cellFsFstat(fd=%d, sb_addr=0x%x)", fd, sb.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
IDType type;
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file, type) || type != TYPE_FS_FILE)
|
||||
|
|
@ -344,8 +326,6 @@ s32 cellFsMkdir(vm::ptr<const char> path, u32 mode)
|
|||
{
|
||||
sys_fs->Warning("cellFsMkdir(path=\"%s\", mode=0x%x)", path.get_ptr(), mode);
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
const std::string _path = path.get_ptr();
|
||||
|
||||
if (vfsDir().IsExists(_path))
|
||||
|
|
@ -361,8 +341,6 @@ s32 cellFsRename(vm::ptr<const char> from, vm::ptr<const char> to)
|
|||
{
|
||||
sys_fs->Warning("cellFsRename(from='%s', to='%s')", from.get_ptr(), to.get_ptr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::string _from = from.get_ptr();
|
||||
std::string _to = to.get_ptr();
|
||||
|
||||
|
|
@ -395,8 +373,6 @@ s32 cellFsChmod(vm::ptr<const char> path, u32 mode)
|
|||
{
|
||||
sys_fs->Todo("cellFsChmod(path=\"%s\", mode=0x%x)", path.get_ptr(), mode);
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
// TODO:
|
||||
|
||||
return CELL_OK;
|
||||
|
|
@ -406,8 +382,6 @@ s32 cellFsFsync(u32 fd)
|
|||
{
|
||||
sys_fs->Todo("cellFsFsync(fd=0x%x)", fd);
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
// TODO:
|
||||
|
||||
return CELL_OK;
|
||||
|
|
@ -417,8 +391,6 @@ s32 cellFsRmdir(vm::ptr<const char> path)
|
|||
{
|
||||
sys_fs->Warning("cellFsRmdir(path=\"%s\")", path.get_ptr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::string _path = path.get_ptr();
|
||||
|
||||
vfsDir d;
|
||||
|
|
@ -435,8 +407,6 @@ s32 cellFsUnlink(vm::ptr<const char> path)
|
|||
{
|
||||
sys_fs->Warning("cellFsUnlink(path=\"%s\")", path.get_ptr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::string _path = path.get_ptr();
|
||||
|
||||
if (vfsDir().IsExists(_path))
|
||||
|
|
@ -455,8 +425,6 @@ s32 cellFsLseek(u32 fd, s64 offset, u32 whence, vm::ptr<be_t<u64>> pos)
|
|||
{
|
||||
sys_fs->Log("cellFsLseek(fd=%d, offset=0x%llx, whence=0x%x, pos_addr=0x%x)", fd, offset, whence, pos.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
vfsSeekMode seek_mode;
|
||||
switch(whence)
|
||||
{
|
||||
|
|
@ -480,8 +448,6 @@ s32 cellFsLseek(u32 fd, s64 offset, u32 whence, vm::ptr<be_t<u64>> pos)
|
|||
s32 cellFsFtruncate(u32 fd, u64 size)
|
||||
{
|
||||
sys_fs->Warning("cellFsFtruncate(fd=%d, size=%lld)", fd, size);
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
IDType type;
|
||||
std::shared_ptr<vfsStream> file;
|
||||
|
|
@ -512,8 +478,6 @@ s32 cellFsTruncate(vm::ptr<const char> path, u64 size)
|
|||
{
|
||||
sys_fs->Warning("cellFsTruncate(path=\"%s\", size=%lld)", path.get_ptr(), size);
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
vfsFile f(path.get_ptr(), vfsReadWrite);
|
||||
if (!f.IsOpened())
|
||||
{
|
||||
|
|
@ -562,8 +526,6 @@ s32 cellFsGetBlockSize(vm::ptr<const char> path, vm::ptr<u64> sector_size, vm::p
|
|||
sys_fs->Warning("cellFsGetBlockSize(file='%s', sector_size_addr=0x%x, block_size_addr=0x%x)",
|
||||
path.get_ptr(), sector_size.addr(), block_size.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
*sector_size = 4096; // ?
|
||||
*block_size = 4096; // ?
|
||||
|
||||
|
|
@ -575,8 +537,6 @@ s32 cellFsGetFreeSize(vm::ptr<const char> path, vm::ptr<u32> block_size, vm::ptr
|
|||
sys_fs->Warning("cellFsGetFreeSize(path=\"%s\", block_size_addr=0x%x, block_count_addr=0x%x)",
|
||||
path.get_ptr(), block_size.addr(), block_count.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
// TODO: Get real values. Currently, it always returns 40 GB of free space divided in 4 KB blocks
|
||||
*block_size = 4096; // ?
|
||||
*block_count = 10 * 1024 * 1024; // ?
|
||||
|
|
@ -589,8 +549,6 @@ s32 cellFsGetDirectoryEntries(u32 fd, vm::ptr<CellFsDirectoryEntry> entries, u32
|
|||
sys_fs->Warning("cellFsGetDirectoryEntries(fd=%d, entries_addr=0x%x, entries_size=0x%x, data_count_addr=0x%x)",
|
||||
fd, entries.addr(), entries_size, data_count.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsDirBase> directory;
|
||||
if (!sys_fs->CheckId(fd, directory))
|
||||
return CELL_ESRCH;
|
||||
|
|
@ -627,8 +585,6 @@ s32 cellFsStReadInit(u32 fd, vm::ptr<CellFsRingBuffer> ringbuf)
|
|||
{
|
||||
sys_fs->Warning("cellFsStReadInit(fd=%d, ringbuf_addr=0x%x)", fd, ringbuf.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
return CELL_ESRCH;
|
||||
|
|
@ -654,8 +610,6 @@ s32 cellFsStReadFinish(u32 fd)
|
|||
{
|
||||
sys_fs->Warning("cellFsStReadFinish(fd=%d)", fd);
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
return CELL_ESRCH;
|
||||
|
|
@ -670,8 +624,6 @@ s32 cellFsStReadGetRingBuf(u32 fd, vm::ptr<CellFsRingBuffer> ringbuf)
|
|||
{
|
||||
sys_fs->Warning("cellFsStReadGetRingBuf(fd=%d, ringbuf_addr=0x%x)", fd, ringbuf.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
return CELL_ESRCH;
|
||||
|
|
@ -687,8 +639,6 @@ s32 cellFsStReadGetStatus(u32 fd, vm::ptr<u64> status)
|
|||
{
|
||||
sys_fs->Warning("cellFsStReadGetRingBuf(fd=%d, status_addr=0x%x)", fd, status.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
return CELL_ESRCH;
|
||||
|
|
@ -702,8 +652,6 @@ s32 cellFsStReadGetRegid(u32 fd, vm::ptr<u64> regid)
|
|||
{
|
||||
sys_fs->Warning("cellFsStReadGetRingBuf(fd=%d, regid_addr=0x%x)", fd, regid.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
return CELL_ESRCH;
|
||||
|
|
@ -717,8 +665,6 @@ s32 cellFsStReadStart(u32 fd, u64 offset, u64 size)
|
|||
{
|
||||
sys_fs->Todo("cellFsStReadStart(fd=%d, offset=0x%llx, size=0x%llx)", fd, offset, size);
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
return CELL_ESRCH;
|
||||
|
|
@ -733,8 +679,6 @@ s32 cellFsStReadStop(u32 fd)
|
|||
{
|
||||
sys_fs->Warning("cellFsStReadStop(fd=%d)", fd);
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
return CELL_ESRCH;
|
||||
|
|
@ -747,8 +691,6 @@ s32 cellFsStReadStop(u32 fd)
|
|||
s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, vm::ptr<u64> rsize)
|
||||
{
|
||||
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);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
|
|
@ -769,8 +711,6 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr<u32> addr, vm::ptr<u64> size)
|
|||
{
|
||||
sys_fs->Todo("cellFsStReadGetCurrentAddr(fd=%d, addr_addr=0x%x, size_addr=0x%x)", fd, addr.addr(), size.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
return CELL_ESRCH;
|
||||
|
|
@ -781,8 +721,6 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr<u32> addr, vm::ptr<u64> size)
|
|||
s32 cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size)
|
||||
{
|
||||
sys_fs->Todo("cellFsStReadPutCurrentAddr(fd=%d, addr_addr=0x%x, size=0x%llx)", fd, addr_addr, size);
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
|
|
@ -794,8 +732,6 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size)
|
|||
s32 cellFsStReadWait(u32 fd, u64 size)
|
||||
{
|
||||
sys_fs->Todo("cellFsStReadWait(fd=%d, size=0x%llx)", fd, size);
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
|
|
@ -808,8 +744,6 @@ s32 cellFsStReadWaitCallback(u32 fd, u64 size, vm::ptr<void (*)(int xfd, u64 xsi
|
|||
{
|
||||
sys_fs->Todo("cellFsStReadWaitCallback(fd=%d, size=0x%llx, func_addr=0x%x)", fd, size, func.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> file;
|
||||
if (!sys_fs->CheckId(fd, file))
|
||||
return CELL_ESRCH;
|
||||
|
|
@ -971,8 +905,6 @@ void fsAioRead(u32 fd, vm::ptr<CellFsAio> aio, int xid, vm::ptr<void(*)(vm::ptr<
|
|||
u32 error = CELL_OK;
|
||||
u64 res = 0;
|
||||
{
|
||||
LV2_LOCK(0);
|
||||
|
||||
std::shared_ptr<vfsStream> orig_file;
|
||||
if (!sys_fs->CheckId(fd, orig_file))
|
||||
{
|
||||
|
|
@ -1018,8 +950,6 @@ int cellFsAioRead(vm::ptr<CellFsAio> aio, vm::ptr<u32> aio_id, vm::ptr<void(*)(v
|
|||
{
|
||||
sys_fs->Warning("cellFsAioRead(aio_addr=0x%x, id_addr=0x%x, func_addr=0x%x)", aio.addr(), aio_id.addr(), func.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
if (!aio_init)
|
||||
{
|
||||
return CELL_ENXIO;
|
||||
|
|
@ -1049,8 +979,6 @@ int cellFsAioWrite(vm::ptr<CellFsAio> aio, vm::ptr<u32> aio_id, vm::ptr<void(*)(
|
|||
{
|
||||
sys_fs->Todo("cellFsAioWrite(aio_addr=0x%x, id_addr=0x%x, func_addr=0x%x)", aio.addr(), aio_id.addr(), func.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
// TODO:
|
||||
|
||||
return CELL_OK;
|
||||
|
|
@ -1060,8 +988,6 @@ int cellFsAioInit(vm::ptr<const char> mount_point)
|
|||
{
|
||||
sys_fs->Warning("cellFsAioInit(mount_point_addr=0x%x (%s))", mount_point.addr(), mount_point.get_ptr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
aio_init = true;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -1070,8 +996,6 @@ int cellFsAioFinish(vm::ptr<const char> mount_point)
|
|||
{
|
||||
sys_fs->Warning("cellFsAioFinish(mount_point_addr=0x%x (%s))", mount_point.addr(), mount_point.get_ptr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
aio_init = false;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -1081,8 +1005,6 @@ int cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr<void> buf, u64 buffer_size,
|
|||
sys_fs->Warning("cellFsReadWithOffset(fd=%d, offset=0x%llx, buf_addr=0x%x, buffer_size=%lld nread=0x%llx)",
|
||||
fd, offset, buf.addr(), buffer_size, nread.addr());
|
||||
|
||||
LV2_LOCK(0);
|
||||
|
||||
int ret;
|
||||
vm::var<be_t<u64>> oldPos, newPos;
|
||||
ret = cellFsLseek(fd, 0, CELL_SEEK_CUR, oldPos); // Save the current position
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue