Permalink
Browse files

lv2_fs_object fix

  • Loading branch information...
1 parent ee173dc commit 5db0f477106f1d07bd446b8fcb56c732cfe2a80a @Nekotekina Nekotekina committed with Nekotekina Jan 26, 2017
@@ -221,7 +221,7 @@ s32 cellFsGetDirectoryEntries(u32 fd, vm::ptr<CellFsDirectoryEntry> entries, u32
{
cellFs.warning("cellFsGetDirectoryEntries(fd=%d, entries=*0x%x, entries_size=0x%x, data_count=*0x%x)", fd, entries, entries_size, data_count);
- const auto directory = idm::get<lv2_dir>(fd);
+ const auto directory = idm::get<lv2_fs_object, lv2_dir>(fd);
if (!directory)
{
@@ -345,7 +345,7 @@ s32 cellFsStReadInit(u32 fd, vm::cptr<CellFsRingBuffer> ringbuf)
return CELL_EINVAL;
}
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -366,7 +366,7 @@ s32 cellFsStReadFinish(u32 fd)
{
cellFs.todo("cellFsStReadFinish(fd=%d)", fd);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -382,7 +382,7 @@ s32 cellFsStReadGetRingBuf(u32 fd, vm::ptr<CellFsRingBuffer> ringbuf)
{
cellFs.todo("cellFsStReadGetRingBuf(fd=%d, ringbuf=*0x%x)", fd, ringbuf);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -398,7 +398,7 @@ s32 cellFsStReadGetStatus(u32 fd, vm::ptr<u64> status)
{
cellFs.todo("cellFsStReadGetRingBuf(fd=%d, status=*0x%x)", fd, status);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -414,7 +414,7 @@ s32 cellFsStReadGetRegid(u32 fd, vm::ptr<u64> regid)
{
cellFs.todo("cellFsStReadGetRingBuf(fd=%d, regid=*0x%x)", fd, regid);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -430,7 +430,7 @@ s32 cellFsStReadStart(u32 fd, u64 offset, u64 size)
{
cellFs.todo("cellFsStReadStart(fd=%d, offset=0x%llx, size=0x%llx)", fd, offset, size);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -446,7 +446,7 @@ s32 cellFsStReadStop(u32 fd)
{
cellFs.todo("cellFsStReadStop(fd=%d)", fd);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -462,7 +462,7 @@ s32 cellFsStRead(u32 fd, vm::ptr<u8> buf, u64 size, vm::ptr<u64> rsize)
{
cellFs.todo("cellFsStRead(fd=%d, buf=*0x%x, size=0x%llx, rsize=*0x%x)", fd, buf, size, rsize);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -478,7 +478,7 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr<u32> addr, vm::ptr<u64> size)
{
cellFs.todo("cellFsStReadGetCurrentAddr(fd=%d, addr=*0x%x, size=*0x%x)", fd, addr, size);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -494,7 +494,7 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, vm::ptr<u8> addr, u64 size)
{
cellFs.todo("cellFsStReadPutCurrentAddr(fd=%d, addr=*0x%x, size=0x%llx)", fd, addr, size);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -510,7 +510,7 @@ s32 cellFsStReadWait(u32 fd, u64 size)
{
cellFs.todo("cellFsStReadWait(fd=%d, size=0x%llx)", fd, size);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -526,7 +526,7 @@ s32 cellFsStReadWaitCallback(u32 fd, u64 size, vm::ptr<void(s32 xfd, u64 xsize)>
{
cellFs.todo("cellFsStReadWaitCallback(fd=%d, size=0x%llx, func=*0x%x)", fd, size, func);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -710,7 +710,7 @@ struct fs_aio_thread : ppu_thread
s32 error = CELL_OK;
u64 result = 0;
- const auto file = idm::get<lv2_file>(aio->fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(aio->fd);
if (!file || (type == 1 && file->flags & CELL_FS_O_WRONLY) || (type == 2 && !(file->flags & CELL_FS_O_ACCMODE)))
{
@@ -838,7 +838,7 @@ s32 cellFsSetIoBufferFromDefaultContainer(u32 fd, u32 buffer_size, u32 page_type
{
cellFs.todo("cellFsSetIoBufferFromDefaultContainer(fd=%d, buffer_size=%d, page_type=%d)", fd, buffer_size, page_type);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -61,7 +61,7 @@ s32 cellGifDecOpen(PMainHandle mainHandle, PPSubHandle subHandle, PSrc src, POpe
if (!file_s) return CELL_GIFDEC_ERROR_OPEN_FILE;
current_subHandle.fileSize = file_s.size();
- current_subHandle.fd = idm::make<lv2_file>(src->fileName.get_ptr(), std::move(file_s), 0, 0);
+ current_subHandle.fd = idm::make<lv2_fs_object, lv2_file>(src->fileName.get_ptr(), std::move(file_s), 0, 0);
break;
}
}
@@ -97,7 +97,7 @@ s32 cellGifDecReadHeader(PMainHandle mainHandle, PSubHandle subHandle, PInfo inf
case CELL_GIFDEC_FILE:
{
- auto file = idm::get<lv2_file>(fd);
+ auto file = idm::get<lv2_fs_object, lv2_file>(fd);
file->file.seek(0);
file->file.read(buffer, sizeof(buffer));
break;
@@ -181,7 +181,7 @@ s32 cellGifDecDecodeData(PMainHandle mainHandle, PSubHandle subHandle, vm::ptr<u
case CELL_GIFDEC_FILE:
{
- auto file = idm::get<lv2_file>(fd);
+ auto file = idm::get<lv2_fs_object, lv2_file>(fd);
file->file.seek(0);
file->file.read(gif.get(), fileSize);
break;
@@ -283,7 +283,7 @@ s32 cellGifDecClose(PMainHandle mainHandle, PSubHandle subHandle)
{
cellGifDec.warning("cellGifDecClose(mainHandle=*0x%x, subHandle=*0x%x)", mainHandle, subHandle);
- idm::remove<lv2_file>(subHandle->fd);
+ idm::remove<lv2_fs_object, lv2_file>(subHandle->fd);
vm::dealloc(subHandle.addr());
@@ -51,7 +51,7 @@ s32 cellJpgDecOpen(u32 mainHandle, vm::ptr<u32> subHandle, vm::ptr<CellJpgDecSrc
if (!file_s) return CELL_JPGDEC_ERROR_OPEN_FILE;
current_subHandle.fileSize = file_s.size();
- current_subHandle.fd = idm::make<lv2_file>(src->fileName.get_ptr(), std::move(file_s), 0, 0);
+ current_subHandle.fd = idm::make<lv2_fs_object, lv2_file>(src->fileName.get_ptr(), std::move(file_s), 0, 0);
break;
}
}
@@ -78,7 +78,7 @@ s32 cellJpgDecClose(u32 mainHandle, u32 subHandle)
return CELL_JPGDEC_ERROR_FATAL;
}
- idm::remove<lv2_file>(subHandle_data->fd);
+ idm::remove<lv2_fs_object, lv2_file>(subHandle_data->fd);
idm::remove<CellJpgDecSubHandle>(subHandle);
return CELL_OK;
@@ -110,7 +110,7 @@ s32 cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, vm::ptr<CellJpgDecInfo>
case CELL_JPGDEC_FILE:
{
- auto file = idm::get<lv2_file>(fd);
+ auto file = idm::get<lv2_fs_object, lv2_file>(fd);
file->file.seek(0);
file->file.read(buffer.get(), fileSize);
break;
@@ -189,7 +189,7 @@ s32 cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, vm::cp
case CELL_JPGDEC_FILE:
{
- auto file = idm::get<lv2_file>(fd);
+ auto file = idm::get<lv2_fs_object, lv2_file>(fd);
file->file.seek(0);
file->file.read(jpg.get(), fileSize);
break;
@@ -65,7 +65,7 @@ void pngDecReadBuffer(png_structp png_ptr, png_bytep out, png_size_t length)
if (buffer.file)
{
// Get the file
- auto file = idm::get<lv2_file>(buffer.fd);
+ auto file = idm::get<lv2_fs_object, lv2_file>(buffer.fd);
// Read the data
file->file.read(out, length);
@@ -364,7 +364,7 @@ s32 pngDecOpen(ppu_thread& ppu, PHandle handle, PPStream png_stream, PSrc source
}
// Get the file descriptor
- buffer->fd = idm::make<lv2_file>(stream->source.fileName.get_ptr(), std::move(file_stream), 0, 0);
+ buffer->fd = idm::make<lv2_fs_object, lv2_file>(stream->source.fileName.get_ptr(), std::move(file_stream), 0, 0);
// Indicate that we need to read from a file stream
buffer->file = true;
@@ -447,7 +447,7 @@ s32 pngDecClose(ppu_thread& ppu, PHandle handle, PStream stream)
// Remove the file descriptor, if a file descriptor was used for decoding
if (stream->buffer->file)
{
- idm::remove<lv2_file>(stream->buffer->fd);
+ idm::remove<lv2_fs_object, lv2_file>(stream->buffer->fd);
}
// Deallocate the PNG buffer structure used to decode from memory, if we decoded from memory
@@ -143,7 +143,7 @@ error_code sys_fs_open(vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, s32 mode
return CELL_ENOENT;
}
- const auto _file = idm::make_ptr<lv2_file>(path.get_ptr(), std::move(file), mode, flags);
+ const auto _file = idm::make_ptr<lv2_fs_object, lv2_file>(path.get_ptr(), std::move(file), mode, flags);
if (!_file)
{
@@ -165,7 +165,7 @@ error_code sys_fs_read(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<u64> nread
return CELL_EFAULT;
}
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file || file->flags & CELL_FS_O_WRONLY)
{
@@ -183,7 +183,7 @@ error_code sys_fs_write(u32 fd, vm::cptr<void> buf, u64 nbytes, vm::ptr<u64> nwr
{
sys_fs.trace("sys_fs_write(fd=%d, buf=*0x%x, nbytes=0x%llx, nwrite=*0x%x)", fd, buf, nbytes, nwrite);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file || !(file->flags & CELL_FS_O_ACCMODE))
{
@@ -203,7 +203,7 @@ error_code sys_fs_close(u32 fd)
{
sys_fs.trace("sys_fs_close(fd=%d)", fd);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -212,7 +212,7 @@ error_code sys_fs_close(u32 fd)
// TODO: return CELL_EBUSY if locked
- idm::remove<lv2_file>(fd);
+ idm::remove<lv2_fs_object, lv2_file>(fd);
return CELL_OK;
}
@@ -245,7 +245,7 @@ error_code sys_fs_opendir(vm::cptr<char> path, vm::ptr<u32> fd)
return CELL_ENOENT;
}
- const auto _dir = idm::make_ptr<lv2_dir>(path.get_ptr(), std::move(dir));
+ const auto _dir = idm::make_ptr<lv2_fs_object, lv2_dir>(path.get_ptr(), std::move(dir));
if (!_dir)
{
@@ -263,7 +263,7 @@ error_code sys_fs_readdir(u32 fd, vm::ptr<CellFsDirent> dir, vm::ptr<u64> nread)
{
sys_fs.warning("sys_fs_readdir(fd=%d, dir=*0x%x, nread=*0x%x)", fd, dir, nread);
- const auto directory = idm::get<lv2_dir>(fd);
+ const auto directory = idm::get<lv2_fs_object, lv2_dir>(fd);
if (!directory)
{
@@ -291,14 +291,14 @@ error_code sys_fs_closedir(u32 fd)
{
sys_fs.warning("sys_fs_closedir(fd=%d)", fd);
- const auto directory = idm::get<lv2_dir>(fd);
+ const auto directory = idm::get<lv2_fs_object, lv2_dir>(fd);
if (!directory)
{
return CELL_EBADF;
}
- idm::remove<lv2_dir>(fd);
+ idm::remove<lv2_fs_object, lv2_dir>(fd);
return CELL_OK;
}
@@ -339,7 +339,7 @@ error_code sys_fs_fstat(u32 fd, vm::ptr<CellFsStat> sb)
{
sys_fs.warning("sys_fs_fstat(fd=%d, sb=*0x%x)", fd, sb);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -449,7 +449,7 @@ error_code sys_fs_fcntl(u32 fd, u32 op, vm::ptr<void> _arg, u32 _size)
return CELL_EINVAL;
}
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -500,7 +500,7 @@ error_code sys_fs_lseek(u32 fd, s64 offset, s32 whence, vm::ptr<u64> pos)
return CELL_EINVAL;
}
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -518,7 +518,7 @@ error_code sys_fs_fget_block_size(u32 fd, vm::ptr<u64> sector_size, vm::ptr<u64>
{
sys_fs.todo("sys_fs_fget_block_size(fd=%d, sector_size=*0x%x, block_size=*0x%x, arg4=*0x%x, arg5=*0x%x)", fd, sector_size, block_size, arg4, arg5);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file)
{
@@ -563,7 +563,7 @@ error_code sys_fs_ftruncate(u32 fd, u64 size)
{
sys_fs.warning("sys_fs_ftruncate(fd=%d, size=0x%llx)", fd, size);
- const auto file = idm::get<lv2_file>(fd);
+ const auto file = idm::get<lv2_fs_object, lv2_file>(fd);
if (!file || !(file->flags & CELL_FS_O_ACCMODE))
{

0 comments on commit 5db0f47

Please sign in to comment.