Merge "sel4-sys: make seL4_GetCapReceivePath more Rust-friendly"

GitOrigin-RevId: 8a14f93d1f13718784e8377056d50377187f2343
This commit is contained in:
Sam Leffler 2022-04-01 23:11:40 +00:00
parent c24f1fc9d7
commit 3e37996648
4 changed files with 16 additions and 60 deletions

View File

@ -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)]

View File

@ -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)]

View File

@ -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)]

View File

@ -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)]