-
Notifications
You must be signed in to change notification settings - Fork 110
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
apis: update breaking driver existence check changes #517
Conversation
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.
This is part of a trio of PRs across the kernel, libtock-c, and here. While it's a bit of churn, I think there's value in the consistency of the term "exists" across the tock ecosystem with these changes.
Blocked on pending kernel PR.
apis/gpio/src/lib.rs
Outdated
/// Returns true` if the driver was present. This does not necessarily mean | ||
/// that the driver is working, as it may still fail to allocate grant | ||
/// memory. |
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.
It might be a good idea to keep the latter half of this comment.
For another day—it's an interesting point more generally. What is the point of an "exists" check? I might think it's to make sure the driver will be available when you want to call it. Following that, there's a case that "exists" syscalls should do grant allocations, but that's a more fundamental design change.
Added ppannuto's suggested change and resquashed. diff
diff --git a/apis/gpio/src/lib.rs b/apis/gpio/src/lib.rs
index 8328358..bc2d500 100644
--- a/apis/gpio/src/lib.rs
+++ b/apis/gpio/src/lib.rs
@@ -57,7 +57,8 @@ pub struct Gpio<S: Syscalls>(S);
impl<S: Syscalls> Gpio<S> {
/// Returns Ok() if the driver was present.This does not necessarily mean
- /// that the driver is working.
+ /// that the driver is working, as it may still fail to allocate grant
+ /// memory.
pub fn exists() -> Result<(), ErrorCode> {
S::command(DRIVER_NUM, EXISTS, 0, 0).to_result()
} |
It looks like some of those CI errors are real — unit tests that need to be updated to match the new expectations. |
This PR accompanies tock#3613.
I rebased to master. The tests are passing, so I think this PR should be merged. |
Bring libtock-rs into consistency with the changes in this PR.
Only
apis/gpio/src/lib.rs
needed to be changed. The rest is a grepped driver_check -> exists.