Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenSK
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
koenigl2
OpenSK
Commits
4a9cc3ce
Commit
4a9cc3ce
authored
5 years ago
by
Julien Cretin
Browse files
Options
Downloads
Patches
Plain Diff
Add more details to the store documentation
parent
b798b195
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/embedded_flash/store/format.rs
+5
-2
5 additions, 2 deletions
src/embedded_flash/store/format.rs
src/embedded_flash/store/mod.rs
+22
-0
22 additions, 0 deletions
src/embedded_flash/store/mod.rs
with
27 additions
and
2 deletions
src/embedded_flash/store/format.rs
+
5
−
2
View file @
4a9cc3ce
...
@@ -61,10 +61,13 @@ pub struct Format {
...
@@ -61,10 +61,13 @@ pub struct Format {
/// Whether a user entry has sensitive data.
/// Whether a user entry has sensitive data.
///
///
/// When a user entry with sensitive data is deleted, the data is overwritten with zeroes.
///
/// - 0 for sensitive data.
/// - 0 for sensitive data.
/// - 1 for non-sensitive data.
/// - 1 for non-sensitive data.
///
/// When a user entry with sensitive data is deleted, the data is overwritten with zeroes. This
/// feature is subject to the same guarantees as all other features of the store, in particular
/// deleting a sensitive entry is atomic. See the store module-level documentation for more
/// information.
sensitive_bit
:
usize
,
sensitive_bit
:
usize
,
/// The data length of a user entry.
/// The data length of a user entry.
...
...
This diff is collapsed.
Click to expand it.
src/embedded_flash/store/mod.rs
+
22
−
0
View file @
4a9cc3ce
...
@@ -43,6 +43,28 @@
...
@@ -43,6 +43,28 @@
//! The data-structure can be configured with the `StoreConfig` trait. By implementing this trait,
//! The data-structure can be configured with the `StoreConfig` trait. By implementing this trait,
//! the number of possible tags and the association between keys and entries are defined.
//! the number of possible tags and the association between keys and entries are defined.
//!
//!
//! # Properties
//!
//! The data-structure provides the following properties:
//! - When an operation returns success, then the represented multi-set is updated accordingly. For
//! example, an inserted entry can be find with alteration until replaced or deleted.
//! - When an operation returns an error, the resulting multi-set state is described in the error
//! documentation.
//! - When power is lost before an operation returns, the operation will either succeed or be
//! rolled-back on the next initialization. So the multi-set would be either left unchanged or
//! updated accordingly.
//!
//! Those properties rely on the following assumptions:
//! - Writing a word to flash is atomic. When power is lost, the word is either fully written or not
//! written at all.
//! - Reading a word from flash is deterministic. When power is lost while writing or erasing a word
//! (erasing a page containing that word), reading that word repeatedly returns the same result
//! (until it is written or its page is erased).
//! - To decide whether a page has been erased, it is enough to test if all its bits are equal to 1.
//!
//! The properties still hold outside those assumptions but with weaker probabilities as the usage
//! diverges from the assumptions.
//!
//! # Implementation
//! # Implementation
//!
//!
//! The store is a page-aligned sequence of bits. It matches the following grammar:
//! The store is a page-aligned sequence of bits. It matches the following grammar:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment