Skip to content

Commit

Permalink
add smalldb flag, which builds a PDDB with a size of 4MiB
Browse files Browse the repository at this point in the history
do not interchange this on devices with the full sized
PDDB, you may corrupt the database
  • Loading branch information
bunnie committed Nov 3, 2022
1 parent 6c2e86d commit b04dcc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions services/pddb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,6 @@ hwtest = []
# routines to help with performance profiling of the PDDB in hosted mode
pddb-flamegraph = ["hex"]
perfcounter = ["perflib"]
# make the PDDB very small (4MiB). Note that booting a device with an incompatible `smalldb` setting will break the PDDB image. Use with caution.
smalldb = []
default = ["mbbb"]
4 changes: 2 additions & 2 deletions services/pddb/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ pub(crate) const PDDB_VERSION: u32 = 0x00_00_02_01;
#[allow(dead_code)]
// PDDB_A_LEN may be shorter than xous::PDDB_LEN, to speed up testing.
#[allow(dead_code)]
#[cfg(not(any(feature="pddbtest",feature="autobasis",feature="ci")))]
#[cfg(not(any(feature="pddbtest",feature="autobasis",feature="ci",feature="smalldb")))]
pub(crate) const PDDB_A_LEN: usize = xous::PDDB_LEN as usize;
#[allow(dead_code)]
#[cfg(any(feature="pddbtest",feature="autobasis",feature="ci"))]
#[cfg(any(feature="pddbtest",feature="autobasis",feature="ci",feature="smalldb"))]
pub const PDDB_A_LEN: usize = 4 * 1024 * 1024;

/// range for the starting point of a journal number, picked from a random seed
Expand Down

0 comments on commit b04dcc2

Please sign in to comment.