mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-31 23:08:22 -04:00
mariko fatal: map 0xC0000000 for framebuffer usage
This commit is contained in:
parent
898fe61034
commit
a2c89a8f3f
6 changed files with 102 additions and 24 deletions
|
@ -86,6 +86,12 @@ namespace ams::secmon {
|
|||
InvalidateL3Entries(l3, MemoryRegionVirtualAtmosphereUserPage.GetAddress(), MemoryRegionVirtualAtmosphereUserPage.GetSize());
|
||||
}
|
||||
|
||||
constexpr void MapDramForMarikoProgramImpl(u64 *l1, u64 *l2, u64 *l3) {
|
||||
/* Map the L1 entry corresponding to the mariko program dram entry. */
|
||||
AMS_UNUSED(l2, l3);
|
||||
SetL1BlockEntry(l1, MemoryRegionDramForMarikoProgram.GetAddress(), MemoryRegionDramForMarikoProgram.GetAddress(), MemoryRegionDramForMarikoProgram.GetSize(), MappingAttributesEl3NonSecureRwData);
|
||||
}
|
||||
|
||||
void ClearLow(uintptr_t address, size_t size) {
|
||||
/* Clear the low part. */
|
||||
util::ClearMemory(reinterpret_cast<void *>(address), size / 2);
|
||||
|
@ -301,4 +307,16 @@ namespace ams::secmon {
|
|||
ReleaseSpinLock(g_ams_user_page_spin_lock);
|
||||
}
|
||||
|
||||
void MapDramForMarikoProgram() {
|
||||
/* Get the tables. */
|
||||
u64 * const l1 = MemoryRegionVirtualTzramL1PageTable.GetPointer<u64>();
|
||||
u64 * const l2_l3 = MemoryRegionVirtualTzramL2L3PageTable.GetPointer<u64>();
|
||||
|
||||
/* Map. */
|
||||
MapDramForMarikoProgramImpl(l1, l2_l3, l2_l3);
|
||||
|
||||
/* Ensure the mappings are consistent. */
|
||||
secmon::EnsureMappingConsistency();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,4 +32,6 @@ namespace ams::secmon {
|
|||
uintptr_t MapAtmosphereUserPage(uintptr_t address);
|
||||
void UnmapAtmosphereUserPage();
|
||||
|
||||
void MapDramForMarikoProgram();
|
||||
|
||||
}
|
|
@ -14,6 +14,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <exosphere.hpp>
|
||||
#include "secmon_map.hpp"
|
||||
#include "secmon_page_mapper.hpp"
|
||||
#include "secmon_user_power_management.hpp"
|
||||
|
||||
|
@ -93,6 +94,9 @@ namespace ams::secmon {
|
|||
|
||||
/* TODO: On cores other than 3, halt/wfi. */
|
||||
|
||||
/* Map Dram for the mariko program. */
|
||||
MapDramForMarikoProgram();
|
||||
|
||||
AMS_SECMON_LOG("%s\n", "Jumping to Mariko Fatal.");
|
||||
AMS_LOG_FLUSH();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue