Adopted erase_size config changes in block devices and test runners
This ended up needing a bit of API rework since littlefs no longer needs to know the actual erase_count. We can no longer rely on lfs_config to contain all the information necessary to configure the block devices. Changing the lfs_bd_config structs to be required is probably a good idea anyways as it moves us more towards separating the bds from littlefs, though we can't quite get rid of the lfs_config parameter because of the block-device API in lfs_config. Eventually it would be nice to get rid of it, but that would require API breakage.
This commit is contained in:
+19
-13
@@ -82,18 +82,22 @@ intmax_t test_define(size_t define);
|
||||
|
||||
#define READ_SIZE_i 0
|
||||
#define PROG_SIZE_i 1
|
||||
#define BLOCK_SIZE_i 2
|
||||
#define BLOCK_COUNT_i 3
|
||||
#define CACHE_SIZE_i 4
|
||||
#define LOOKAHEAD_SIZE_i 5
|
||||
#define BLOCK_CYCLES_i 6
|
||||
#define ERASE_VALUE_i 7
|
||||
#define ERASE_CYCLES_i 8
|
||||
#define BADBLOCK_BEHAVIOR_i 9
|
||||
#define POWERLOSS_BEHAVIOR_i 10
|
||||
#define ERASE_SIZE_i 2
|
||||
#define ERASE_COUNT_i 3
|
||||
#define BLOCK_SIZE_i 4
|
||||
#define BLOCK_COUNT_i 5
|
||||
#define CACHE_SIZE_i 6
|
||||
#define LOOKAHEAD_SIZE_i 7
|
||||
#define BLOCK_CYCLES_i 8
|
||||
#define ERASE_VALUE_i 9
|
||||
#define ERASE_CYCLES_i 10
|
||||
#define BADBLOCK_BEHAVIOR_i 11
|
||||
#define POWERLOSS_BEHAVIOR_i 12
|
||||
|
||||
#define READ_SIZE TEST_DEFINE(READ_SIZE_i)
|
||||
#define PROG_SIZE TEST_DEFINE(PROG_SIZE_i)
|
||||
#define ERASE_SIZE TEST_DEFINE(ERASE_SIZE_i)
|
||||
#define ERASE_COUNT TEST_DEFINE(ERASE_COUNT_i)
|
||||
#define BLOCK_SIZE TEST_DEFINE(BLOCK_SIZE_i)
|
||||
#define BLOCK_COUNT TEST_DEFINE(BLOCK_COUNT_i)
|
||||
#define CACHE_SIZE TEST_DEFINE(CACHE_SIZE_i)
|
||||
@@ -106,9 +110,11 @@ intmax_t test_define(size_t define);
|
||||
|
||||
#define TEST_IMPLICIT_DEFINES \
|
||||
TEST_DEF(READ_SIZE, PROG_SIZE) \
|
||||
TEST_DEF(PROG_SIZE, BLOCK_SIZE) \
|
||||
TEST_DEF(BLOCK_SIZE, 0) \
|
||||
TEST_DEF(BLOCK_COUNT, (1024*1024)/BLOCK_SIZE) \
|
||||
TEST_DEF(PROG_SIZE, ERASE_SIZE) \
|
||||
TEST_DEF(ERASE_SIZE, 0) \
|
||||
TEST_DEF(ERASE_COUNT, (1024*1024)/ERASE_SIZE) \
|
||||
TEST_DEF(BLOCK_SIZE, ERASE_SIZE) \
|
||||
TEST_DEF(BLOCK_COUNT, ERASE_COUNT/lfs_max(BLOCK_SIZE/ERASE_SIZE,1)) \
|
||||
TEST_DEF(CACHE_SIZE, lfs_max(64,lfs_max(READ_SIZE,PROG_SIZE))) \
|
||||
TEST_DEF(LOOKAHEAD_SIZE, 16) \
|
||||
TEST_DEF(BLOCK_CYCLES, -1) \
|
||||
@@ -117,8 +123,8 @@ intmax_t test_define(size_t define);
|
||||
TEST_DEF(BADBLOCK_BEHAVIOR, LFS_EMUBD_BADBLOCK_PROGERROR) \
|
||||
TEST_DEF(POWERLOSS_BEHAVIOR, LFS_EMUBD_POWERLOSS_NOOP)
|
||||
|
||||
#define TEST_IMPLICIT_DEFINE_COUNT 11
|
||||
#define TEST_GEOMETRY_DEFINE_COUNT 4
|
||||
#define TEST_IMPLICIT_DEFINE_COUNT 13
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user