Changes

111 bytes added ,  17:26, 30 September 2017
Line 252: Line 252:  
'''Description:''' Maps a memory range into a different range.
 
'''Description:''' Maps a memory range into a different range.
   −
Useful for adding guard pages around stack.
+
Mainly used for adding guard pages around stack.
   −
Source range gets reprotected to --- (it can no longer be accessed), and bit0 is set in [[#MemoryAttribute]].
+
Source range gets reprotected to --- (it can no longer be accessed), and bit0 is set in the source [[#MemoryAttribute]].
    
If dstaddr >= LowerTreshold, the dst-range is enforced to be within the process' "MapRegion". Code can get the range of this region from [[#svcGetInfo]] id0=2,3.
 
If dstaddr >= LowerTreshold, the dst-range is enforced to be within the process' "MapRegion". Code can get the range of this region from [[#svcGetInfo]] id0=2,3.
   −
In this case, the mapped memory will have state <code>0x482907</code>.
+
In this case, the mapped memory will have state <code>0x5C3C0B</code>.
   −
As long as (dstaddr+size) < LowerThreshold, then you can map anywhere but the mapped memory will have state <code>0x5C3C0B</code> instead.
+
As long as (dstaddr+size) < LowerThreshold, then you can map anywhere but the mapped memory will have state <code>0x482907</code> instead.
    
LowerTreshold is 0x80000000 for 36-bit address spaces, and 0x40000000 for 32-bit ones.
 
LowerTreshold is 0x80000000 for 36-bit address spaces, and 0x40000000 for 32-bit ones.
 +
 +
[2.0.0+] Support for the <code>0x482907</code> mappings outside the "MapRegion" were removed.
    
== svcUnmapMemory ==
 
== svcUnmapMemory ==