exo/mariko fatal: save fatal error binaries to the SD

This commit is contained in:
Michael Scire 2020-11-16 23:04:41 -08:00 committed by SciresM
parent 5f6942aec8
commit b32c9bf17c
20 changed files with 24419 additions and 12 deletions

View file

@ -94,6 +94,19 @@ namespace ams::secmon {
/* TODO: On cores other than 3, halt/wfi. */
/* Copy the fatal error context to mariko tzram. */
{
/* Map the iram page. */
constexpr uintptr_t FatalErrorPhysicalAddress = MemoryRegionPhysicalIramFatalErrorContext.GetAddress();
AtmosphereIramPageMapper mapper(FatalErrorPhysicalAddress);
if (mapper.Map()) {
/* Copy the fatal error context. */
void *dst = MemoryRegionVirtualTzramMarikoProgramFatalErrorContext.GetPointer<void>();
const void *src = mapper.GetPointerTo(FatalErrorPhysicalAddress, sizeof(ams::impl::FatalErrorContext));
std::memcpy(dst, src, sizeof(ams::impl::FatalErrorContext));
}
}
/* Map Dram for the mariko program. */
MapDramForMarikoProgram();