@@ -311,7 +311,7 @@ pub struct Api {
311311 /// (if any), or from the top of Region 0 (although this reduces the maximum
312312 /// application space available). The OS will prefer lower numbered regions
313313 /// (other than Region 0), so faster memory should be listed first.
314- pub memory_get_region : extern "C" fn ( region_index : u8 ) -> crate :: FfiOption < types :: MemoryRegion > ,
314+ pub memory_get_region : extern "C" fn ( region_index : u8 ) -> crate :: FfiOption < MemoryRegion > ,
315315
316316 // ========================================================================
317317 // Human Interface Device Support
@@ -598,6 +598,25 @@ pub struct Api {
598598 /// On a microcontroller, this will wait for interrupts. Running in an
599599 /// emulator, this will sleep the thread for a while.
600600 pub power_idle : extern "C" fn ( ) ,
601+ /// The OS will call this function to control power on this system.
602+ ///
603+ /// This function will not return, because the system will be switched off
604+ /// before it can return. In the event on an error, this function will hang
605+ /// instead.
606+ pub power_control : extern "C" fn ( mode : PowerMode ) -> !,
607+
608+ // ========================================================================
609+ // Mutex functions
610+ // ========================================================================
611+ /// Performs a compare-and-swap on `value`.
612+ ///
613+ /// * If `value == old_value`, sets `value = new_value` and returns `true`
614+ /// * If `value != old_value`, returns `false`
615+ pub compare_and_swap_bool : extern "C" fn (
616+ value : & core:: sync:: atomic:: AtomicBool ,
617+ old_value : bool ,
618+ new_value : bool ,
619+ ) -> bool ,
601620}
602621
603622// ============================================================================
0 commit comments