Skip to content

Commit

Permalink
move getter of thread_semaphore into preempt
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Feb 7, 2025
1 parent e4ac994 commit 02e25cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion esp-wifi/src/compat/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ pub(crate) fn sem_give(semphr: *mut c_void) -> i32 {

pub(crate) fn thread_sem_get() -> *mut c_void {
trace!("wifi_thread_semphr_get");
unsafe { &mut ((*current_task()).thread_semaphore) as *mut _ as *mut c_void }
crate::preempt::current_task_thread_semaphore()
}

pub(crate) fn create_recursive_mutex() -> *mut c_void {
Expand Down
6 changes: 6 additions & 0 deletions esp-wifi/src/preempt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,9 @@ pub(crate) fn task_switch(trap_frame: &mut TrapFrame) {
next_task();
restore_task_context(current_task(), trap_frame);
}

pub(crate) fn current_task_thread_semaphore() -> *mut crate::binary::c_types::c_void {
unsafe {
&mut ((*current_task()).thread_semaphore) as *mut _ as *mut crate::binary::c_types::c_void
}
}

0 comments on commit 02e25cc

Please sign in to comment.