add smalldb flag, which builds a PDDB with a size of 4MiB

do not interchange this on devices with the full sized
PDDB, you may corrupt the database
This commit is contained in:
bunnie 2022-11-03 21:04:14 +08:00
parent 6c2e86d876
commit b04dcc21ef
2 changed files with 4 additions and 2 deletions

View file

@ -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"]

View file

@ -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