Commit graph

3 commits

Author SHA1 Message Date
Zach Reizner
34959d42c1 data_model: add volatile_memory module for volatile access
This includes both VolatileRef, for accessing DataInit, and
VolatileSlice, for accessing bulk raw memory.

BUG=None
TEST=cargo test

Change-Id: I356c7e6f05361fa711dc91555f68e4323667884a
Reviewed-on: https://chromium-review.googlesource.com/547050
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2017-06-27 10:55:45 -07:00
Zach Reizner
8c04d70b7d data_model: add unsigned endian types
These types are just like normal unsigned primitives, except their
endian is explicit.

TEST=cargo test
BUG=None

Change-Id: I3d0a7f7ccbf276e2cfdb34310f173df193c70c79
Reviewed-on: https://chromium-review.googlesource.com/544692
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
2017-06-27 06:39:56 -07:00
Dylan Reid
045c7133dd Add data_model with DataInit trait
The data_model crate is created to hold the DataInit trait.  Types
implementing this unsafe trait must guarantee that the type can be
initialized with random data and the resulting object will be valid.

Change-Id: Id6314d114805ec502adabe50a8bd6aa42fdb2c52
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/541681
Reviewed-by: Zach Reizner <zachr@chromium.org>
2017-06-26 15:28:36 -07:00