Skip to content

r3 0.2.0

Compare
Choose a tag to compare
@yvt yvt released this 20 Mar 03:33
· 293 commits to 🦆 since this release

The overall design has been revamped! The original kernel implementation has been moved to a separate crate r3_kernel. r3_core harbors the interface definition for a kernel implementation, and r3 provides additional useful items, such as a mutex-backed cell type (StaticMutex). Different kernel implementations that use more exotic architectures (such as interrupt-driven multi-threading) or are built on top on existing RTOSes may be added in the future.

All packages

Changed

  • Breaking (semver-exempt): Change the target compiler version to nightly-2022-03-10

[email protected]

Changed

While much of the application-level API has retained its general shape, there are some significant changes that may require attention:

  • Introduces object safety. All kernel object handle types now have the following variations: Mutex<_> (owned), MutexRef<'_, _> (borrowed), StaticMutex (static). Owned handles aren't usable yet.
  • The way of instantiating a kernel and defining a system type has changed. The port-provided macro (use_port!) now defines a kernel trait type (SystemTraits: r3_kernel::KernelTraits), which is then used as a generic parameter to create a concrete system type (type System = r3_kernel::System<SystemTraits>). Please see the package documentation (README.md) for an example.
  • r3::kernel::Task::current was moved to r3::kernel::LocalTask::current and now requires a task context. It returns LocalTask, which cannot be sent to another thread but whose reference (&LocalTask or TaskRef) can be.
  • r3::kernel::ResultCode::BadId was renamed to NoAccess and covers general protection failures detected by a now-optional protection mechanism. This means that application and library code can't rely on NoAccess being returned reliably anymore (it can't anyway once owned handles are implemented), and that a kernel implementation may use this error code to indicate that a given kernel object ID might be valid, but the caller lacks the necessary privileges to access that object.
  • The chrono Cargo feature was renamed to chrono_0p4.
  • r3::sync is now gated by cfg(feature = "sync").
  • r3::sync::{Mutex, RecursiveMutex} is now backed by bindings (Bind). The default value is now <T as Default>::default() instead of <T as Init>::INIT. Additional options are available, which means you no longer have to implement Init just to put a custom type in Mutex, and that each Mutex can have a distinct initial value.

Added

  • Bindings (Bind), a static storage with runtime initialization and configuration-time borrow checking. They can be used, for example, to provide a task or timer callback with a state data storage that can be mutably borrowed and persists across invocations.
  • Kernel::{is_task_context, is_interrupt_context, is_boot_complete}

Fixed

  • The hard-coded kernel object count limitation has been removed. This was made possible by the use of growable arrays in the compile-time kernel configurator.

[email protected]

Initial release.

[email protected]

Initial release. Supports r3_core ^0.1.

[email protected]

Changed

  • Breaking: Adjusted for the new design of R3-OS (separation between interface and implementation). Supports r3_kernel ^0.1.
  • Breaking: sym_static! was redesigned to address multiple issues.

[email protected]

Changed

  • Breaking: Adjusted for the new design of R3-OS (separation between interface and implementation). Supports r3_kernel ^0.1.

[email protected]

Changed

  • Breaking: Adjusted for the new design of R3-OS (separation between interface and implementation). Supports r3_kernel ^0.1.

Fixed

  • The default stack alignment (PortThreading::STACK_ALIGN) now conforms to the architectural requirement (double-word alignment).

[email protected]

Changed

  • Breaking: Adjusted for the new design of R3-OS (separation between interface and implementation). Supports r3_kernel ^0.1.
  • Rename use_timer!use_mtime!, TimerOptionsMtimeOptions

Added

  • The new option ThreadingOptions::PRIVILEGE_LEVEL allows for running the kernel in other privilege levels than M-mode.
  • use_sbi_timer! can be used to install a timer driver based on the RISC-V Supervisor Binary Interface.

Fixed

  • The default stack alignment (PortThreading::STACK_ALIGN) now conforms to the standard ABI requirement (128-bit alignment).
  • The port startup code now calls <Traits as Timer>::init.

[email protected]

Changed

  • Breaking: Adjusted for the new design of R3-OS (separation between interface and implementation). Supports r3_kernel ^0.1.

Added

  • Added the Windows backend.

[email protected]

Changed

  • Breaking: Adjusted for the new design of R3-OS (separation between interface and implementation). Supports r3_port_arm_m ^0.3.
  • rp2040-pac ^0.3 replaces rp2040 ^0.1 as the RP2040 peripheral access crate used by r3_support_rp2040.

[email protected]

Changed

  • Breaking: Adjusted for the new design of R3-OS (separation between interface and implementation). Supports r3_port_arm ^0.2.