Skip to content

No way to emit volatile loads/stores #11172

Closed
@whitequark

Description

@whitequark

I'm interested in using Rust for bare-metal embedded development. For that, Rust would need to support volatile loads and stores.

In a nutshell:

  • Volatile loads and stores represent a barrier preventing compiler from reordering them across other volatile operations (reference).
  • They're mainly used to represent accesses to I/O memory, where normal compiler assumptions don't hold.

C implements them with a pointer attribute. Arguably, semantically it would be a better fit to use an intrinsic function. What should Rust use?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions