-
Notifications
You must be signed in to change notification settings - Fork 118
implemented yield_wait_for #575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@addrian-77 can we move forward with this? Please fix the ci issues. |
Signed-off-by: addrian-77 <[email protected]>
Signed-off-by: addrian-77 <[email protected]>
|
||
share::scope(|subscribe| { | ||
// Subscribe to the button callback. | ||
Buttons::register_listener(&listener, subscribe).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yield-wait-for
does not trigger the callback, it returns the arguments for the callback when yield-for-returns
.
platform/src/syscalls_impl.rs
Outdated
} | ||
} | ||
|
||
fn yield_wait_for(driver_number: u32, subscribe_number: u32) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn yield_wait_for(driver_number: u32, subscribe_number: u32) { | |
fn yield_wait_for(driver_number: u32, subscribe_number: u32) -> (u32, u32, u32) { |
yield-wait-for
returns values instead of calling an upcall, all registers return. This is similar to yield-no-wait
, but it only returns r1
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first u32 is always 3, and the rest are driver_number and subscribe_number?
Signed-off-by: addrian-77 <[email protected]>
apis/interface/buttons/src/lib.rs
Outdated
} | ||
|
||
// Wrapper for yield_wait_for | ||
pub fn wait_for_button(driver_number: u32, subscribe_number: u32) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub fn wait_for_button(driver_number: u32, subscribe_number: u32) { | |
pub fn wait_for_button(driver_number: u32, subscribe_number: u32) -> (u32, ButtonState) { |
Yes, but it returns values.On Aug 5, 2025, at 11:59, Adrian Lungu ***@***.***> wrote:
@addrian-77 commented on this pull request.
In platform/src/syscalls_impl.rs:
@@ -35,6 +35,19 @@ impl<S: RawSyscalls> Syscalls for S {
}
}
+ fn yield_wait_for(driver_number: u32, subscribe_number: u32) {
The first u32 is always 3, and the rest are driver_number and subscribe_number?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Signed-off-by: addrian-77 <[email protected]>
"yield-wait-for called with no queueued upcall" | ||
); | ||
(r0, driver_number, subscribe_number) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this unittest, this function basically returns the same thing everytime, is this okay? What should happen if we don't have the expected upcall?
Signed-off-by: addrian-77 <[email protected]>
Added the function
yield_wait_for
, which returns after the wanted Syscall occurs, pushing back into the queue other Syscalls.The function was tested inside
buttons_wait_for.rs
, called withButtons::wait_for_button