diff --git a/docs/install.md b/docs/install.md index 59bb7c4b1dd018b2cb69ae8010b5cdf68e26d3e3..11a9147bd1fb0f34a60279846ede1abee0c73f12 100644 --- a/docs/install.md +++ b/docs/install.md @@ -359,7 +359,7 @@ When plugging in the USB key, you should see a similar line by using the `ioreg` tool: ```shell -$ ioreg -P USB +$ ioreg -p IOUSB +-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> diff --git a/patches/tock/04-fix-dynamic-deferred-call.patch b/patches/tock/04-fix-dynamic-deferred-call.patch new file mode 100644 index 0000000000000000000000000000000000000000..4e29004ecfa049b815a79884aeb96c6acf605d8e --- /dev/null +++ b/patches/tock/04-fix-dynamic-deferred-call.patch @@ -0,0 +1,46 @@ +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()), ++ ); + } + } + }