svc: QueryIoMapping ABI change in 10.x

This commit is contained in:
Michael Scire 2020-04-14 08:49:06 -07:00 committed by fincs
parent 02e4aad9dc
commit cb7c1f87a8
2 changed files with 20 additions and 1 deletions

View File

@ -1034,8 +1034,18 @@ Result svcQueryPhysicalAddress(PhysicalMemoryInfo *out, u64 virtaddr);
* @return Result code.
* @note Syscall number 0x55.
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
* @warning Only exists on [10.0.0+]. For older versions use \ref svcLegacyQueryIoMapping.
*/
Result svcQueryIoMapping(u64* virtaddr, u64 physaddr, u64 size);
Result svcQueryIoMapping(u64* virtaddr, u64* size, u64 physaddr);
/**
* @brief Returns a virtual address mapped to a given IO range.
* @return Result code.
* @note Syscall number 0x55.
* @warning This is a privileged syscall. Use \ref envIsSyscallHinted to check if it is available.
* @warning Only exists on [1.0.0-9.2.0]. For newer versions use \ref svcQueryIoMapping.
*/
Result svcLegacyQueryIoMapping(u64* virtaddr, u64 physaddr, u64 size);
///@}

View File

@ -481,6 +481,15 @@ SVC_BEGIN svcQueryPhysicalAddress
SVC_END
SVC_BEGIN svcQueryIoMapping
stp x0, x1, [sp, #-16]!
svc 0x55
ldp x3, x4, [sp], #16
str x1, [x3]
str x2, [x4]
ret
SVC_END
SVC_BEGIN svcLegacyQueryIoMapping
str x0, [sp, #-16]!
svc 0x55
ldr x2, [sp], #16