Skip to content

Commit 6063863

Browse files
WhatAmISupposedToPutHerejannau
authored andcommitted
fixup! rust: soc: apple: rtkit: Add Apple RTKit abstraction
1 parent 6100fbf commit 6063863

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

rust/kernel/soc/apple/rtkit.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ impl<T: Operations> RtKit<T> {
224224
}
225225

226226
/// Boots (wakes up) the RTKit coprocessor.
227+
pub fn wake(&mut self) -> Result {
228+
// SAFETY: `rtk` is valid per the type invariant.
229+
to_result(unsafe { bindings::apple_rtkit_wake(self.rtk) })
230+
}
231+
232+
/// Waits for the RTKit coprocessor to finish booting.
227233
pub fn boot(&mut self) -> Result {
228234
// SAFETY: `rtk` is valid per the type invariant.
229235
to_result(unsafe { bindings::apple_rtkit_boot(self.rtk) })
@@ -242,6 +248,11 @@ impl<T: Operations> RtKit<T> {
242248
bindings::apple_rtkit_send_message(self.rtk, endpoint, message, ptr::null_mut(), false)
243249
})
244250
}
251+
252+
/// Checks if an endpoint is present
253+
pub fn has_endpoint(&self, endpoint: u8) -> bool {
254+
unsafe { bindings::apple_rtkit_has_endpoint(self.rtk, endpoint) }
255+
}
245256
}
246257

247258
// SAFETY: `RtKit` operations require a mutable reference

0 commit comments

Comments
 (0)