Skip to content

Releases: google/safe-mmio

0.3.0

03 Mar 18:08

Choose a tag to compare

Breaking changes

  • Take self rather than &mut self for UniqueMmioPointer::split. The old behaviour can be
    achieved by calling reborrow first.
  • Take self rather than &self for SharedMmioPointer::split. SharedMmioPointer is Copy so
    this should make no difference in most cases.

Improvements

  • Added modify and modify_mut methods to UniqueMmioPointer<ReadWrite<T>> and
    UniqueMmioPointer<ReadPureWrite<T>>.
  • Added get_range() methods to UniqueMmioPointer<[T]>, UniqueMmioPointer<[T; LEN]>,
    SharedMmioPointer<[T]>, SharedMmioPointer<[T; LEN]>. These methods return a pointer to the
    subset of elements, specified by a Range.
  • Added iter() methods to UniqueMmioPointer<[T]>, UniqueMmioPointer<[T; LEN]>,
    SharedMmioPointer<[T]>, SharedMmioPointer<[T; LEN]>. These methods return an iterator to the
    items of the pointer slices or arrays.

0.2.7

06 Jan 16:19

Choose a tag to compare

Improvements

  • Added UniqueMmioPointer::split_some for arrays and slices.

0.2.6

01 Dec 17:06

Choose a tag to compare

Improvements

  • Optimised implementation of From<UniqueMmioPointer<[T; LEN]>> for [UniqueMmioPointer<T>; LEN].

0.2.5

10 Apr 13:16

Choose a tag to compare

Improvements

  • Added UniqueMmioPointer::take for arrays and slices, similar to get but taking ownership of
    the original pointer rather than borrowing it.
  • Added implementation of From to convert from pointer to array to array of pointers.
  • Implemented Copy for SharedMmioPointer.
  • Extended lifetimes of values returned from SharedMmioPointer::as_slice,
    SharedMmioPointer::get, SharedMmioPointer::split and field_shared!. They are now tied only
    to the lifetime parameter of the original SharedMmioPointer, not the lifetime of the reference.

0.2.4

08 Apr 10:49

Choose a tag to compare

Improvements

  • Added UniqueMmioPointer::as_mut_slice and SharedMmioPointer::as_slice to convert from array
    pointer to slice pointer.
  • Added implementations of From to convert from array pointers to slice pointers.
  • Added implementations of From to convert from pointers to T to pointers to [T; 1] or [T].
  • Added split_fields! macro to split a UniqueMmioPointer to a struct into several
    UniqueMmioPointers to its fields.

0.2.3

04 Apr 15:56

Choose a tag to compare

Improvements

  • Made many methods const, in particular:
    • PhysicalInstance::new
    • PhysicalInstance::pa
    • SharedMmioPointer::child
    • SharedMmioPointer::get
    • SharedMmioPointer::new
    • SharedMmioPointer::ptr
    • UniqueMmioPointer::child
    • UniqueMmioPointer::get
    • UniqueMmioPointer::new
    • UniqueMmioPointer::ptr_mut
    • UniqueMmioPointer::ptr_nonnull
  • Fixed field! and field_shared! to allow getting unsized fields (e.g. slices) of structs.
  • Added UniqueMmioPointer::reborrow.

0.2.2

25 Mar 12:36

Choose a tag to compare

Bugfixes

  • Implemented KnownLayout for ReadPureWrite. This was missed accidentally before.

0.2.1

17 Mar 18:15

Choose a tag to compare

New features

  • Added get method to UniqueMmioPointer<[T; N]> and SharedMmioPointer<[T; N]>.

0.2.0

17 Mar 18:14

Choose a tag to compare

Breaking changes

  • Renamed OwnedMmioPointer to UniqueMmioPointer.

New features

  • Added SharedMmioPointer for an MMIO pointer that is not necessarily unique. Unlike a
    UniqueMmioPointer, a SharedMmioPointer can be cloned. UniqueMmioPointer derefs to
    SharedMmioPointer and can also be converted to it.
  • Added get and split methods on UniqueMmioPointer<[T]> and UniqueMmioPointer<[T; _]>
    respectively, to go from a pointer to a slice or field to pointers to the individual elements.
  • Added field! and field_shared! macros to go from a pointer to a struct to a pointer to an
    individual field.
  • Added write_unsafe and read_unsafe methods on UniqueMmioPointer and SharedMmioPointer.
    These call write_volatile and read_volatile on most platforms, but on aarch64 are implemented
    with inline assembly instead to work around
    a bug with how volatile writes and reads are implemented.
  • Added wrapper types ReadOnly, ReadPure, WriteOnly, ReadWrite and ReadPureWrite to
    indicate whether a field can safely be written or read (with or without side-effects). Added safe
    write and read methods on UniqueMmioPointer or SharedMmioPointer for these.

0.1.0

17 Mar 18:14

Choose a tag to compare

Initial release.