sysPrxForUser: improve crash dump functions

this might fix some crashes that could appear in the todo logging itself
This commit is contained in:
Megamouse 2019-01-14 21:50:26 +01:00 committed by Ani
parent f5163cc4ff
commit b107718869
2 changed files with 30 additions and 11 deletions

View File

@ -144,21 +144,27 @@ s32 sys_lv2coredump_D725F320()
fmt::raw_error(__func__);
}
// quick notes on sys_crash_dump_(get|set)_user_log_area
// (only tested with Destiny BLUS31181)
// unk1 is always 0
// unk2 is a pointer to a cstring
// unk3 is a pointer to... something? a struct maybe?
s32 sys_crash_dump_get_user_log_area(u32 unk1, vm::ptr<char> unk2, vm::ptr<void> unk3)
error_code sys_crash_dump_get_user_log_area(u8 index, vm::ptr<sys_crash_dump_log_area_info_t> entry)
{
sysPrxForUser.todo("sys_crash_dump_get_user_log_area(unk1=%d, unk2=*0x%x, unk3=*0x%x)", unk1, unk2, unk3);
sysPrxForUser.todo("sys_crash_dump_get_user_log_area(index=%d, entry=*0x%x)", index, entry);
if (index > SYS_CRASH_DUMP_MAX_LOG_AREA || !entry)
{
return CELL_EINVAL;
}
return CELL_OK;
}
s32 sys_crash_dump_set_user_log_area(u32 unk1, vm::ptr<char> unk2, vm::ptr<void> unk3)
error_code sys_crash_dump_set_user_log_area(u8 index, vm::ptr<sys_crash_dump_log_area_info_t> new_entry)
{
sysPrxForUser.todo("sys_crash_dump_set_user_log_area(unk1=%d, unk2=*0x%x %s, unk3=*0x%x)", unk1, unk2, unk2, unk3);
sysPrxForUser.todo("sys_crash_dump_set_user_log_area(index=%d, new_entry=*0x%x)", index, new_entry);
if (index > SYS_CRASH_DUMP_MAX_LOG_AREA || !new_entry)
{
return CELL_EINVAL;
}
return CELL_OK;
}

View File

@ -1,4 +1,4 @@
#pragma once
#pragma once
@ -42,6 +42,19 @@ struct sys_lwmutex_locker
}
};
enum
{
SYS_CRASH_DUMP_MAX_LABEL_SIZE = 16,
SYS_CRASH_DUMP_MAX_LOG_AREA = 127 // not actually defined in CELL
};
struct sys_crash_dump_log_area_info_t
{
char label[SYS_CRASH_DUMP_MAX_LABEL_SIZE]; // 15 + 1 (0 terminated)
vm::ptr<void> addr;
be_t<u64> size;
};
struct sys_lwcond_t;
struct sys_lwcond_attribute_t;