mirror of
https://github.com/AmbiML/sparrow-kata-full.git
synced 2025-08-01 21:59:41 +00:00
Merge "sel4-sys: make seL4_GetCapReceivePath more Rust-friendly"
GitOrigin-RevId: 8a14f93d1f13718784e8377056d50377187f2343
This commit is contained in:
parent
c24f1fc9d7
commit
3e37996648
@ -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)]
|
||||
|
@ -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)]
|
||||
|
@ -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)]
|
||||
|
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user