Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenSK
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
koenigl2
OpenSK
Commits
433103cb
Unverified
Commit
433103cb
authored
5 years ago
by
Jean-Michel Picod
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into master
parents
f9f27d7f
d6661a09
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/install.md
+1
-1
1 addition, 1 deletion
docs/install.md
patches/tock/04-fix-dynamic-deferred-call.patch
+46
-0
46 additions, 0 deletions
patches/tock/04-fix-dynamic-deferred-call.patch
with
47 additions
and
1 deletion
docs/install.md
+
1
−
1
View file @
433103cb
...
@@ -359,7 +359,7 @@ When plugging in the USB key, you should see a similar line by using the `ioreg`
...
@@ -359,7 +359,7 @@ When plugging in the USB key, you should see a similar line by using the `ioreg`
tool:
tool:
```
shell
```
shell
$
ioreg
-
P
USB
$
ioreg
-
p
IO
USB
+-o Root <class IORegistryEntry,
id
0x100000100, retain 21>
+-o Root <class IORegistryEntry,
id
0x100000100, retain 21>
...
...
+-o AppleUSBXHCI Root Hub Simulation@14000000 <class AppleUSBRootHubDevice,
id
0x100000a00, registered, matched, active, busy 0
(
0 ms
)
, retain 9>
+-o AppleUSBXHCI Root Hub Simulation@14000000 <class AppleUSBRootHubDevice,
id
0x100000a00, registered, matched, active, busy 0
(
0 ms
)
, retain 9>
...
...
This diff is collapsed.
Click to expand it.
patches/tock/04-fix-dynamic-deferred-call.patch
0 → 100644
+
46
−
0
View file @
433103cb
diff --git a/kernel/src/common/dynamic_deferred_call.rs b/kernel/src/common/dynamic_deferred_call.rs
index 53f5143d..ca349972 100644
--- a/kernel/src/common/dynamic_deferred_call.rs
+++ b/kernel/src/common/dynamic_deferred_call.rs
@@ -226,23 +226,25 @@
impl DynamicDeferredCall {
/// `call_global_instance_while`.
pub(self) fn call_while<F: Fn() -> bool>(&self, f: F) {
if self.call_pending.get() {
- // Reset call_pending here, as it may be set again in the deferred calls
- self.call_pending.set(false);
+ for (i, client_state) in self.client_states.iter().enumerate() {
+ if !f() {
+ break;
+ }
+ if client_state.scheduled.get() {
+ client_state.client.map(|client| {
+ client_state.scheduled.set(false);
+ client.call(DeferredCallHandle(i));
+ });
+ }
+ }
- self.client_states
- .iter()
- .enumerate()
- .filter(|(_i, client_state)| client_state.scheduled.get())
- .filter_map(|(i, client_state)| {
- client_state
- .client
- .map(|c| (i, &client_state.scheduled, *c))
- })
- .take_while(|_| f())
- .for_each(|(i, call_reqd, client)| {
- call_reqd.set(false);
- client.call(DeferredCallHandle(i));
- });
+ // Recompute call_pending here, as some deferred calls may have been skipped due to the
+ // `f` predicate becoming false.
+ self.call_pending.set(
+ self.client_states
+ .iter()
+ .any(|client_state| client_state.scheduled.get()),
+ );
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment