Skip to content

Conversation

@bradjc
Copy link
Contributor

@bradjc bradjc commented Aug 20, 2025

Pull Request Overview

This is an example of using SingleThreadValue for DeferredCall. This is implemented on top of #4551 #4624.

Testing Strategy

TODO or Help Wanted

I don't know if there is a way to check that these functions are always called in every tock build.

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

@github-actions github-actions bot added kernel chips/nrf Change pertains to the nRF5x family of MCUs. arch/risc-v RISC-V architecture labels Aug 20, 2025
@bradjc bradjc force-pushed the single-thread-value-atomics-deferred-call branch from 9368a5e to 0df0209 Compare October 9, 2025 02:16
@github-actions github-actions bot added WG-OpenTitan In the purview of the OpenTitan working group. component labels Oct 9, 2025
/// # Safety
///
/// Callers of this function must ensure that this function is never called
/// concurrently with other calls to [`initialize_debug_writer_wrapper_unsafe`].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Callers also need to avoid calling this concurrently with initialize_debug_writer_wrapper().

/// # Safety
///
/// Callers of this function must ensure that this function is never called
/// concurrently with other calls to [`initialize_deferred_call_state_unsafe`].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here: callers cannot call this concurrently with initialize_deferred_call_state.

bit
if let Some(defcalls_cell) = DEFCALLS.get() {
defcalls_cell.map_or(None, |defcalls| {
if let Some(bitmask) = BITMASK.get() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if let Some(bitmask) = BITMASK.get() else { return None };
/* Rest of closure */

}

// Allow dead code because we need the `Chip` type but don't use `chip`.
#[allow(dead_code)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any reference to Chip in this file. What changed to require this annotation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch/risc-v RISC-V architecture chips/nrf Change pertains to the nRF5x family of MCUs. component kernel WG-OpenTitan In the purview of the OpenTitan working group.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants