cellFs fixes

cellFsAllocateFileAreaWithoutZeroFill implemented
This commit is contained in:
Nekotekina 2017-05-07 01:08:44 +03:00
parent e8d76ede14
commit b1e8eefad0
4 changed files with 452 additions and 379 deletions

File diff suppressed because it is too large Load Diff

View File

@ -791,7 +791,7 @@ error_code sys_fs_fcntl(u32 fd, u32 op, vm::ptr<void> _arg, u32 _size)
break;
}
case 0xe0000001: // Unknown
case 0xe0000001: // Unknown (cellFsStat)
{
break;
}
@ -930,7 +930,15 @@ error_code sys_fs_fcntl(u32 fd, u32 op, vm::ptr<void> _arg, u32 _size)
case 0xe0000017: // cellFsAllocateFileAreaWithoutZeroFill
{
break;
const auto arg = vm::static_ptr_cast<lv2_file_e0000017>(_arg);
if (_size < arg->size || arg->_x4 != 0x10 || arg->_x8 != 0x20)
{
return CELL_EINVAL;
}
arg->out_code = sys_fs_truncate(arg->file_path, arg->file_size);
return CELL_OK;
}
case 0xe0000018: // cellFsChangeFileSizeWithoutAllocation

View File

@ -310,7 +310,7 @@ struct lv2_file_c0000002 : lv2_file_op
CHECK_SIZE(lv2_file_c0000002, 0x28);
// sys_fs_fnctl: unknown (called before cellFsOpen, for example)
// sys_fs_fcntl: unknown (called before cellFsOpen, for example)
struct lv2_file_c0000006 : lv2_file_op
{
be_t<u32> size; // 0x20
@ -325,6 +325,20 @@ struct lv2_file_c0000006 : lv2_file_op
CHECK_SIZE(lv2_file_c0000006, 0x20);
// sys_fs_fcntl: cellFsAllocateFileAreaWithoutZeroFill
struct lv2_file_e0000017 : lv2_file_op
{
be_t<u32> size; // 0x28
be_t<u32> _x4; // 0x10, offset
be_t<u32> _x8; // 0x20, offset
be_t<u32> _xc; // -
vm::ps3::bcptr<char> file_path;
be_t<u64> file_size;
be_t<u32> out_code;
};
CHECK_SIZE(lv2_file_e0000017, 0x28);
// Syscalls
error_code sys_fs_test(u32 arg1, u32 arg2, vm::ps3::ptr<u32> arg3, u32 arg4, vm::ps3::ptr<char> buf, u32 buf_size);

View File

@ -277,7 +277,7 @@ void KernelExplorer::Update()
idm::select<lv2_fs_object>([&](u32 id, lv2_fs_object& fo)
{
lv2_types.back().count++;
m_tree->AppendItem(lv2_types.back().node, fmt::format("FD: ID = 0x%08x '%s'", id));
m_tree->AppendItem(lv2_types.back().node, fmt::format("FD: ID = 0x%08x '%s'", id, fo.name.data()));
});
for (auto&& entry : lv2_types)