Changes

Jump to navigation Jump to search
2,449 bytes added ,  18:24, 1 November 2023
Fixups for query/insecure
Line 95: Line 95:  
| [3.0.0+] 0x2D  || Result || [[#UnmapPhysicalMemory|UnmapPhysicalMemory]] || uintptr_t address, size_t size
 
| [3.0.0+] 0x2D  || Result || [[#UnmapPhysicalMemory|UnmapPhysicalMemory]] || uintptr_t address, size_t size
 
|-
 
|-
| [5.0.0+] 0x2E  || Result || [[#GetDebugFutureThreadInfo|GetDebugFutureThreadInfo]] || arch::LastThreadContext *out_context, uint64_t *thread_id, Handle debug_handle, int64_t ns
+
| [5.0.0-5.1.0] 0x2E  || Result || GetFutureThreadInfo || arch::LastThreadContext *out_context, uintptr_t *out_tls_address, uint32_t *out_flags, int64_t ns
 +
|-
 +
| [6.0.0+] 0x2E  || Result || [[#GetDebugFutureThreadInfo|GetDebugFutureThreadInfo]] || arch::LastThreadContext *out_context, uint64_t *thread_id, Handle debug_handle, int64_t ns
 
|-
 
|-
 
| 0x2F || Result || [[#GetLastThreadInfo|GetLastThreadInfo]] || arch::LastThreadContext *out_context, uintptr_t *out_tls_address, uint32_t *out_flags
 
| 0x2F || Result || [[#GetLastThreadInfo|GetLastThreadInfo]] || arch::LastThreadContext *out_context, uintptr_t *out_tls_address, uint32_t *out_flags
Line 112: Line 114:  
|-
 
|-
 
| [8.0.0+] 0x36 || void || [[#SynchronizePreemptionState|SynchronizePreemptionState]] ||  
 
| [8.0.0+] 0x36 || void || [[#SynchronizePreemptionState|SynchronizePreemptionState]] ||  
 +
|-
 +
| [11.0.0+] 0x37 || Result || [[#GetResourceLimitPeakValue|GetResourceLimitPeakValue]] || int64_t *out_peak_value, Handle resource_limit_handle, LimitableResource which
 +
|- style="border-top: double"
 +
| [13.0.0+] 0x39 || Result || CreateIoPool || Handle *out_handle, IoPoolType which_pool
 +
|-
 +
| [13.0.0+] 0x3A || Result || CreateIoRegion || Handle *out_handle, Handle io_pool, PhysicalAddress physical_address, size_t size, MemoryMapping mapping, MemoryPermission perm
 
|- style="border-top: double"
 
|- style="border-top: double"
 
| [1.0.0-3.0.2] 0x3C || void || [[#DumpInfo|DumpInfo]] || DumpInfoType dump_info_type, uint64_t arg
 
| [1.0.0-3.0.2] 0x3C || void || [[#DumpInfo|DumpInfo]] || DumpInfoType dump_info_type, uint64_t arg
Line 130: Line 138:  
|-
 
|-
 
| 0x45 || Result || [[#CreateEvent|CreateEvent]] || Handle *out_write_handle, Handle *out_read_handle
 
| 0x45 || Result || [[#CreateEvent|CreateEvent]] || Handle *out_write_handle, Handle *out_read_handle
|- style="border-top: double"
+
|-
 +
| [13.0.0+] 0x46 || Result || MapIoRegion || Handle io_region, uintptr_t address, size_t size, MemoryPermission perm
 +
|-
 +
| [13.0.0+] 0x47 || Result || UnmapIoRegion || Handle io_region, uintptr_t address, size_t size
 +
|-
 
| [5.0.0+] 0x48 || Result || [[#MapPhysicalMemoryUnsafe|MapPhysicalMemoryUnsafe]] || uintptr_t address, size_t size
 
| [5.0.0+] 0x48 || Result || [[#MapPhysicalMemoryUnsafe|MapPhysicalMemoryUnsafe]] || uintptr_t address, size_t size
 
|-
 
|-
Line 157: Line 169:  
| 0x54 || Result || [[#QueryPhysicalAddress|QueryPhysicalAddress]] || arch::PhysicalMemoryInfo *out_info, uintptr_t address
 
| 0x54 || Result || [[#QueryPhysicalAddress|QueryPhysicalAddress]] || arch::PhysicalMemoryInfo *out_info, uintptr_t address
 
|-
 
|-
| 0x55 || Result || [[#QueryIoMapping|QueryIoMapping]] || uintptr_t *out_address, [10.0.0+] size_t *out_size, PhysicalAddress physical_address, size_t size
+
| [1.0.0-9.2.0] 0x55 || Result || [[#QueryIoMapping|QueryIoMapping]] || uintptr_t *out_address, PhysicalAddress physical_address, size_t size
 +
|-
 +
| [10.0.0+] 0x55 || Result || QueryMemoryMapping || uintptr_t *out_address, size_t *out_size, PhysicalAddress physical_address, size_t size
 
|-
 
|-
 
| 0x56 || Result || [[#CreateDeviceAddressSpace|CreateDeviceAddressSpace]] || Handle *out_handle, uint64_t das_address, uint64_t das_size
 
| 0x56 || Result || [[#CreateDeviceAddressSpace|CreateDeviceAddressSpace]] || Handle *out_handle, uint64_t das_address, uint64_t das_size
Line 165: Line 179:  
| 0x58 || Result || [[#DetachDeviceAddressSpace|DetachDeviceAddressSpace]] || DeviceName device_name, Handle das_handle
 
| 0x58 || Result || [[#DetachDeviceAddressSpace|DetachDeviceAddressSpace]] || DeviceName device_name, Handle das_handle
 
|-
 
|-
| 0x59 || Result || [[#MapDeviceAddressSpaceByForce|MapDeviceAddressSpaceByForce]] || Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address, MemoryPermission device_perm
+
| 0x59 || Result || [[#MapDeviceAddressSpaceByForce|MapDeviceAddressSpaceByForce]] || Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address, uint32_t option
 
|-
 
|-
| 0x5A || Result || [[#MapDeviceAddressSpaceAligned|MapDeviceAddressSpaceAligned]] || Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address, MemoryPermission device_perm
+
| 0x5A || Result || [[#MapDeviceAddressSpaceAligned|MapDeviceAddressSpaceAligned]] || Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address, uint32_t option
 
|-
 
|-
| 0x5B || Result || [[#MapDeviceAddressSpace|MapDeviceAddressSpace]] || size_t *out_mapped_size, Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address, MemoryPermission device_perm
+
| [1.0.0-12.1.0] 0x5B || Result || [[#MapDeviceAddressSpace|MapDeviceAddressSpace]] || size_t *out_mapped_size, Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address, MemoryPermission device_perm
 
|-
 
|-
 
| 0x5C || Result || [[#UnmapDeviceAddressSpace|UnmapDeviceAddressSpace]] || Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address
 
| 0x5C || Result || [[#UnmapDeviceAddressSpace|UnmapDeviceAddressSpace]] || Handle das_handle, Handle process_handle, uint64_t process_address, size_t size, uint64_t device_address
Line 240: Line 254:  
|-
 
|-
 
| 0x7F || void || [[#CallSecureMonitor|CallSecureMonitor]] || SecureMonitorArguments *args
 
| 0x7F || void || [[#CallSecureMonitor|CallSecureMonitor]] || SecureMonitorArguments *args
 +
|- style="border-top: double"
 +
| [15.0.0+] 0x90  || Result || MapInsecurePhysicalMemory || uintptr_t address, size_t size
 +
|-
 +
| [15.0.0+] 0x91  || Result || UnmapInsecurePhysicalMemory || uintptr_t address, size_t size
 
|-
 
|-
 
|}
 
|}
Line 249: Line 267:  
! Argument || Type || Name
 
! Argument || Type || Name
 
|-
 
|-
| (In) W1 || uint32_t || Size
+
| (In) X1 || uint64_t || Size
 
|-
 
|-
 
| (Out) W0 || [[#Result]] || Result
 
| (Out) W0 || [[#Result]] || Result
Line 631: Line 649:  
</div>
 
</div>
   −
Takes the given event out of the signaled state.
+
Takes the given event out of the signaled state, if it is signaled.
    
=== Result codes ===
 
=== Result codes ===
Line 637: Line 655:     
'''0xE401:''' Invalid handle. The handle either does not exist, or is not a ReadableEvent nor a WritableEvent.
 
'''0xE401:''' Invalid handle. The handle either does not exist, or is not a ReadableEvent nor a WritableEvent.
  −
'''0xFA01:''' The handle was not in a signaled state.
      
== MapSharedMemory ==
 
== MapSharedMemory ==
Line 726: Line 742:  
</div>
 
</div>
   −
Resets the signal on the given handle, ensuring future calls to [[#WaitSynchronization]] on this handle will sleep until the handle is signaled again. If the handle is a ReadableEvent, this is equivalent to calling ClearEvent() on the handle.
+
Resets the signal on the given handle, ensuring future calls to [[#WaitSynchronization]] on this handle will sleep until the handle is signaled again. If the handle is a ReadableEvent, this returns ResultInvalidState if the event is not signaled.
    
If the handle is a Process, it will clear the signaled state (which is set when the process changes [[#ProcessState]]. Once the process enters the Exited state, calling ResetSignal on the process will no longer have an effect (the process is permanently signaled), and the syscall will return 0xFA01.
 
If the handle is a Process, it will clear the signaled state (which is set when the process changes [[#ProcessState]]. Once the process enters the Exited state, calling ResetSignal on the process will no longer have an effect (the process is permanently signaled), and the syscall will return 0xFA01.
Line 1,111: Line 1,127:     
Uses current process pool partition.
 
Uses current process pool partition.
 +
 +
=== Result codes ===
 +
'''0x0:''' Success.
 +
 +
'''0xCA01:''' Invalid size passed. It's either zero or not 4k-aligned
 +
 +
'''0xCC01:''' Invalid address. (not 4k-aligned)
 +
 +
'''0xDC01:''' Invalid memory range. It's either causes overflow, or does not fall into "reserved" address range (aka Alias). See AliasRegionAddress at [[#InfoType]]
 +
 +
'''0xFA01:''' Invalid state. (not enough SystemResource (see [[NPDM#SystemResourceSize]]))
    
== UnmapPhysicalMemory ==
 
== UnmapPhysicalMemory ==
Line 1,248: Line 1,275:  
| (In) X3 || R3, R4 || uint64_t || Timeout
 
| (In) X3 || R3, R4 || uint64_t || Timeout
 
|-
 
|-
| (Out) None || || ||
+
| (Out) W0 || R0 || [[#Result]] || Result
 
|}
 
|}
 
</div>
 
</div>
Line 1,266: Line 1,293:  
| (In) W3 || R3 || uint32_t || NumToSignal
 
| (In) W3 || R3 || uint32_t || NumToSignal
 
|-
 
|-
| (Out) None || || ||
+
| (Out) W0 || R0  || [[#Result]] || Result
 
|}
 
|}
 
</div>
 
</div>
Line 1,279: Line 1,306:  
|-
 
|-
 
| (Out) None ||  ||  
 
| (Out) None ||  ||  
 +
|}
 +
</div>
 +
 +
== GetResourceLimitPeakValue ==
 +
<div style="display: inline-block;">
 +
{| class="wikitable" border="1"
 +
|-
 +
! Argument64 || Argument32 || Type || Name
 +
|-
 +
| (In) W1 || R1 || Handle<ResourceLimit> || ResourceLimitHandle
 +
|-
 +
| (In) W2 || R2 || [[#LimitableResource]] || LimitableResource
 +
|-
 +
| (Out) W0 || R0 || [[#Result]] || Result
 +
|-
 +
| (Out) X1 || R1, R2 || int64_t || PeakValue
 
|}
 
|}
 
</div>
 
</div>
Line 1,387: Line 1,430:  
! Argument64 || Argument32 || Type || Name
 
! Argument64 || Argument32 || Type || Name
 
|-
 
|-
| (In) W1 || R1 || Handle<Port>* or Handle<ServerSession>* || Handles
+
| (In) X1 || R1 || Handle<Port>* or Handle<ServerSession>* || Handles
 
|-
 
|-
 
| (In) W2 || R2 || uint32_t || NumHandles
 
| (In) W2 || R2 || uint32_t || NumHandles
Line 1,819: Line 1,862:  
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress
 
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress
 
|-
 
|-
| (In) W5 || R7 || [[#MemoryPermission]] || MemoryPermission
+
| (In) W5 || R7 || uint32_t || Option
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 1,830: Line 1,873:     
The userspace destination address must have the [[SVC#MemoryState|FlagCanDeviceMap]] bit set. Bit [[SVC#MemoryAttribute|DeviceShared]] will be set after mapping.
 
The userspace destination address must have the [[SVC#MemoryState|FlagCanDeviceMap]] bit set. Bit [[SVC#MemoryAttribute|DeviceShared]] will be set after mapping.
 +
 +
The Option encodes a [[#MemoryPermission]] in the low 16 bits, and an indicator of IO mapping in the high bits.
    
== MapDeviceAddressSpaceAligned ==
 
== MapDeviceAddressSpaceAligned ==
Line 1,847: Line 1,892:  
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress
 
| (In) X4 || R5, R6 || uint64_t || DeviceAddressSpaceAddress
 
|-
 
|-
| (In) W5 || R7 || [[#MemoryPermission]] || MemoryPermission
+
| (In) W5 || R7 || uint32_t  || Option
 
|-
 
|-
 
| (Out) W0 || R0 || [[#Result]] || Result
 
| (Out) W0 || R0 || [[#Result]] || Result
Line 1,856: Line 1,901:     
Same as [[#MapDeviceAddressSpaceByForce]], but the userspace destination address must have the [[SVC#MemoryState|FlagCanAlignedDeviceMap]] bit set instead.
 
Same as [[#MapDeviceAddressSpaceByForce]], but the userspace destination address must have the [[SVC#MemoryState|FlagCanAlignedDeviceMap]] bit set instead.
 +
 +
The Option encodes a [[#MemoryPermission]] in the low 16 bits, and an indicator of IO mapping in the high bits.
    
== MapDeviceAddressSpace ==
 
== MapDeviceAddressSpace ==
Line 2,610: Line 2,657:  
| Process || 23 || 0 || [9.0.0+] IsApplication
 
| Process || 23 || 0 || [9.0.0+] IsApplication
 
|-
 
|-
| Thread  || 0xF0000002 || 0-3, -1 || ThreadTickCount. When 0-3 are passed, gets specific core CPU ticks spent on thread. When -1 is passed, gets total CPU ticks spent on thread.
+
| Process || 24 || 0 || [11.0.0+] FreeThreadCount
 +
|-
 +
| Thread  || 25 ([1.0.0-12.1.0] 0xF0000002) || 0-3, -1 || ThreadTickCount. When 0-3 are passed, gets specific core CPU ticks spent on thread. When -1 is passed, gets total CPU ticks spent on thread.
 +
|-
 +
| Process || 26 || 0 || [14.0.0+] IsSvcPermitted
 +
|-
 +
| Process || 27 || 0 || [16.0.0+] IoRegionHint
 
|}
 
|}
   Line 2,987: Line 3,040:  
|-
 
|-
 
| 25 || [4.0.0+] [[#CreateCodeMemory|FlagCanCodeMemory]] ||
 
| 25 || [4.0.0+] [[#CreateCodeMemory|FlagCanCodeMemory]] ||
 +
|-
 +
| 26 || [15.0.0+] FlagLinearMapped ||
 
|}
 
|}
   Line 3,056: Line 3,111:  
|-
 
|-
 
| 0x00402015 || [4.0.0+] CodeOut || Mapped in kernel during [[#ControlCodeMemory]].
 
| 0x00402015 || [4.0.0+] CodeOut || Mapped in kernel during [[#ControlCodeMemory]].
 +
|-
 +
| 0x00002016 || [13.0.0+] Coverage ||
 +
|-
 +
| 0x05583817 || [15.0.0+] Insecure ||
 
|}
 
|}
  

Navigation menu