diff --git a/apps/system/components/kata-os-common/src/sel4-sys/arch/aarch32.rs b/apps/system/components/kata-os-common/src/sel4-sys/arch/aarch32.rs index 0f6adc9..c5b639f 100644 --- a/apps/system/components/kata-os-common/src/sel4-sys/arch/aarch32.rs +++ b/apps/system/components/kata-os-common/src/sel4-sys/arch/aarch32.rs @@ -183,23 +183,11 @@ pub unsafe fn seL4_SetCap(index: usize, cptr: seL4_CPtr) { } #[inline(always)] -pub unsafe fn seL4_GetCapReceivePath( - receiveCNode: *mut seL4_CPtr, - receiveIndex: *mut seL4_CPtr, - receiveDepth: *mut seL4_Word, -) { +pub unsafe fn seL4_GetCapReceivePath() -> (seL4_CPtr, seL4_CPtr, seL4_CPtr) { let ipcbuffer = seL4_GetIPCBuffer(); - if !receiveCNode.is_null() { - *receiveCNode = (*ipcbuffer).receiveCNode; - } - - if !receiveIndex.is_null() { - *receiveIndex = (*ipcbuffer).receiveIndex; - } - - if !receiveDepth.is_null() { - *receiveDepth = (*ipcbuffer).receiveDepth; - } + ((*ipcbuffer).receiveCNode, + (*ipcbuffer).receiveIndex, + (*ipcbuffer).receiveDepth) } #[inline(always)] diff --git a/apps/system/components/kata-os-common/src/sel4-sys/arch/aarch64.rs b/apps/system/components/kata-os-common/src/sel4-sys/arch/aarch64.rs index a16a0c7..7b7ba7d 100644 --- a/apps/system/components/kata-os-common/src/sel4-sys/arch/aarch64.rs +++ b/apps/system/components/kata-os-common/src/sel4-sys/arch/aarch64.rs @@ -172,23 +172,11 @@ pub unsafe fn seL4_SetCap(index: usize, cptr: seL4_CPtr) { } #[inline(always)] -pub unsafe fn seL4_GetCapReceivePath( - receiveCNode: *mut seL4_CPtr, - receiveIndex: *mut seL4_CPtr, - receiveDepth: *mut seL4_Word, -) { +pub unsafe fn seL4_GetCapReceivePath() -> (seL4_CPtr, seL4_CPtr, seL4_CPtr) { let ipcbuffer = seL4_GetIPCBuffer(); - if !receiveCNode.is_null() { - *receiveCNode = (*ipcbuffer).receiveCNode; - } - - if !receiveIndex.is_null() { - *receiveIndex = (*ipcbuffer).receiveIndex; - } - - if !receiveDepth.is_null() { - *receiveDepth = (*ipcbuffer).receiveDepth; - } + ((*ipcbuffer).receiveCNode, + (*ipcbuffer).receiveIndex, + (*ipcbuffer).receiveDepth) } #[inline(always)] diff --git a/apps/system/components/kata-os-common/src/sel4-sys/arch/riscv.rs b/apps/system/components/kata-os-common/src/sel4-sys/arch/riscv.rs index 5d62fef..1298e44 100644 --- a/apps/system/components/kata-os-common/src/sel4-sys/arch/riscv.rs +++ b/apps/system/components/kata-os-common/src/sel4-sys/arch/riscv.rs @@ -196,21 +196,11 @@ pub unsafe fn seL4_SetCap(index: usize, cptr: seL4_CPtr) { } #[inline(always)] -pub unsafe fn seL4_GetCapReceivePath( - receiveCNode: *mut seL4_CPtr, - receiveIndex: *mut seL4_CPtr, - receiveDepth: *mut seL4_Word, -) { +pub unsafe fn seL4_GetCapReceivePath() -> (seL4_CPtr, seL4_CPtr, seL4_CPtr) { let ipcbuffer = seL4_GetIPCBuffer(); - if !receiveCNode.is_null() { - *receiveCNode = (*ipcbuffer).receiveCNode; - } - if !receiveIndex.is_null() { - *receiveIndex = (*ipcbuffer).receiveIndex; - } - if !receiveDepth.is_null() { - *receiveDepth = (*ipcbuffer).receiveDepth; - } + ((*ipcbuffer).receiveCNode, + (*ipcbuffer).receiveIndex, + (*ipcbuffer).receiveDepth) } #[inline(always)] diff --git a/apps/system/components/kata-os-common/src/sel4-sys/arch/x86_64.rs b/apps/system/components/kata-os-common/src/sel4-sys/arch/x86_64.rs index 2a9df9f..9f266d7 100644 --- a/apps/system/components/kata-os-common/src/sel4-sys/arch/x86_64.rs +++ b/apps/system/components/kata-os-common/src/sel4-sys/arch/x86_64.rs @@ -267,21 +267,11 @@ pub unsafe fn seL4_SetCap(index: usize, cptr: seL4_CPtr) { } #[inline(always)] -pub unsafe fn seL4_GetCapReceivePath( - receiveCNode: *mut seL4_CPtr, - receiveIndex: *mut seL4_CPtr, - receiveDepth: *mut seL4_Word, -) { +pub unsafe fn seL4_GetCapReceivePath() -> (seL4_CPtr, seL4_CPtr, seL4_CPtr) { let ipcbuffer = seL4_GetIPCBuffer(); - if !receiveCNode.is_null() { - *receiveCNode = (*ipcbuffer).receiveCNode; - } - if !receiveIndex.is_null() { - *receiveIndex = (*ipcbuffer).receiveIndex; - } - if !receiveDepth.is_null() { - *receiveDepth = (*ipcbuffer).receiveDepth; - } + ((*ipcbuffer).receiveCNode, + (*ipcbuffer).receiveIndex, + (*ipcbuffer).receiveDepth) } #[inline(always)]