/littlefs-2.7.6/scripts/ |
D | readtree.py | 35 blocks[id(data[-1])] = block 107 print("%-47s%s" % ("littlefs v%s.%s" % version, 112 print("gstate 0x%s" % ''.join('%02x' % c for c in gstate)) 118 print(" move dir {%#x, %#x} id %d" % ( 127 print("mdir {%#x, %#x} rev %d (was %d)%s%s" % ( 130 ' -> {%#x, %#x}' % struct.unpack('<II', mdir.tail.data) 144 ' ' if j == len(dir)-1 else 145 'v' if k == len(lines)-1 else 152 print("*** corrupted mdir {%#x, %#x}! ***" % ( 157 print("*** cycle detected {%#x, %#x}! ***" % ( [all …]
|
D | readmdir.py | 40 id = int(args[1], 0) if args[1] not in 'x.' else 0x3ff 45 size = int(args[2], str) if args[2] not in 'x.' else 0x3ff 123 mask = 0x7ff & ~((1 << prefix)-1) 127 return '%s %#0*x' % ( 128 type, prefix//4, self.type & ((1 << prefix)-1)) 132 return '%02x' % self.type 138 return repr(self.size) if self.size != 0x3ff else 'x' 182 while len(block) - off >= 4: 240 return not ((other.rev - self.rev) & 0x80000000) 258 tag.id <= gtag.id - gdiff): [all …]
|
D | readblock.py | 12 print("%-8s %-s" % ('off', 'data')) 13 return sp.run(['xxd', '-g1', '-'], input=block).returncode 22 parser.add_argument('block_size', type=lambda x: int(x, 0), 24 parser.add_argument('block', type=lambda x: int(x, 0),
|
D | explode_asserts.py | 93 printf("\\\\x%02x", s[i]); 188 'op': ['strcmp', 'memcmp', '->'], 377 parser.add_argument('-o', '--output', required=True, 379 parser.add_argument('-p', '--pattern', action='append', 381 parser.add_argument('--maxwidth', default=MAXWIDTH, type=int,
|
D | test.py | 27 ./scripts/explode_asserts.py $$< -o $$@ 31 -include tests/*.d 35 $(CC) $(CFLAGS) $^ $(LFLAGS) -o $@ 50 'LFS_BLOCK_CYCLES': -1, 188 key=lambda x: len(x[0]), reverse=True): 217 print('truncate --size=0', disk) 223 # simulate power-loss after n cycles? 231 ncmd.extend(['-ex', 'r']) 233 ncmd.extend(['-ex', 'up 2']) 236 '-ex', 'b %s:%d' % (self.suite.path, self.code_lineno), [all …]
|
/littlefs-2.7.6/ |
D | lfs_util.h | 5 * SPDX-License-Identifier: BSD-3-Clause 11 // LFS_CONFIG as a header file to include (-DLFS_CONFIG=lfs_config.h). 17 #define LFS_STRINGIZE(x) LFS_STRINGIZE2(x) argument 18 #define LFS_STRINGIZE2(x) #x argument 65 // macros must not have side-effects as the macros can be removed for a smaller 130 // toolchain-specific implementations. LFS_NO_INTRINSICS falls back to a more 133 // Min/max functions for unsigned 32-bit numbers 144 return a - (a % alignment); in lfs_aligndown() 148 return lfs_aligndown(a + alignment-1, alignment); in lfs_alignup() 154 return 32 - __builtin_clz(a-1); in lfs_npw2() [all …]
|
D | lfs.c | 5 * SPDX-License-Identifier: BSD-3-Clause 10 #define LFS_BLOCK_NULL ((lfs_block_t)-1) 11 #define LFS_BLOCK_INLINE ((lfs_block_t)-2) 18 rcache->block = LFS_BLOCK_NULL; in lfs_cache_drop() 23 memset(pcache->buffer, 0xff, lfs->cfg->cache_size); in lfs_cache_zero() 24 pcache->block = LFS_BLOCK_NULL; in lfs_cache_zero() 32 if (block >= lfs->cfg->block_count || in lfs_bd_read() 33 off+size > lfs->cfg->block_size) { in lfs_bd_read() 40 if (pcache && block == pcache->block && in lfs_bd_read() 41 off < pcache->off + pcache->size) { in lfs_bd_read() [all …]
|
D | .travis.yml | 4 - CFLAGS=-Werror 5 - MAKEFLAGS=-j 11 - $HOME/.cache/apt 14 _: &install-common 16 - sudo apt-get install python3 python3-pip 17 - sudo pip3 install toml 18 # setup a ram-backed disk to speed up reentrant tests 19 - mkdir disks 20 - sudo mount -t tmpfs -o size=100m tmpfs disks 21 - export TFLAGS="$TFLAGS --disk=disks/disk" [all …]
|
D | DESIGN.md | 3 A little fail-safe filesystem designed for microcontrollers. 6 | | | .---._____ 7 .-----. | | 8 --|o |---| littlefs | 9 --| |---| | 10 '-----' '----------' 16 filesystem that is resilient to power-loss and flash wear without using 19 This document covers the high-level design of littlefs, how it is different 21 low-level details covering every bit on disk, check out [SPEC.md](SPEC.md). 25 The embedded systems littlefs targets are usually 32-bit microcontrollers with [all …]
|
/littlefs-2.7.6/bd/ |
D | lfs_rambd.c | 5 * SPDX-License-Identifier: BSD-3-Clause 16 (void*)cfg, cfg->context, in lfs_rambd_createcfg() 17 (void*)(uintptr_t)cfg->read, (void*)(uintptr_t)cfg->prog, in lfs_rambd_createcfg() 18 (void*)(uintptr_t)cfg->erase, (void*)(uintptr_t)cfg->sync, in lfs_rambd_createcfg() 19 cfg->read_size, cfg->prog_size, cfg->block_size, cfg->block_count, in lfs_rambd_createcfg() 20 (void*)bdcfg, bdcfg->erase_value, bdcfg->buffer); in lfs_rambd_createcfg() 21 lfs_rambd_t *bd = cfg->context; in lfs_rambd_createcfg() 22 bd->cfg = bdcfg; in lfs_rambd_createcfg() 25 if (bd->cfg->buffer) { in lfs_rambd_createcfg() 26 bd->buffer = bd->cfg->buffer; in lfs_rambd_createcfg() [all …]
|
D | lfs_filebd.c | 5 * SPDX-License-Identifier: BSD-3-Clause 21 (void*)cfg, cfg->context, in lfs_filebd_createcfg() 22 (void*)(uintptr_t)cfg->read, (void*)(uintptr_t)cfg->prog, in lfs_filebd_createcfg() 23 (void*)(uintptr_t)cfg->erase, (void*)(uintptr_t)cfg->sync, in lfs_filebd_createcfg() 24 cfg->read_size, cfg->prog_size, cfg->block_size, cfg->block_count, in lfs_filebd_createcfg() 25 path, (void*)bdcfg, bdcfg->erase_value); in lfs_filebd_createcfg() 26 lfs_filebd_t *bd = cfg->context; in lfs_filebd_createcfg() 27 bd->cfg = bdcfg; in lfs_filebd_createcfg() 30 bd->fd = open(path, O_RDWR | O_CREAT, 0666); in lfs_filebd_createcfg() 31 if (bd->fd < 0) { in lfs_filebd_createcfg() [all …]
|
D | lfs_testbd.c | 6 * SPDX-License-Identifier: BSD-3-Clause 23 (void*)cfg, cfg->context, in lfs_testbd_createcfg() 24 (void*)(uintptr_t)cfg->read, (void*)(uintptr_t)cfg->prog, in lfs_testbd_createcfg() 25 (void*)(uintptr_t)cfg->erase, (void*)(uintptr_t)cfg->sync, in lfs_testbd_createcfg() 26 cfg->read_size, cfg->prog_size, cfg->block_size, cfg->block_count, in lfs_testbd_createcfg() 27 path, (void*)bdcfg, bdcfg->erase_value, bdcfg->erase_cycles, in lfs_testbd_createcfg() 28 bdcfg->badblock_behavior, bdcfg->power_cycles, in lfs_testbd_createcfg() 29 bdcfg->buffer, bdcfg->wear_buffer); in lfs_testbd_createcfg() 30 lfs_testbd_t *bd = cfg->context; in lfs_testbd_createcfg() 31 bd->cfg = bdcfg; in lfs_testbd_createcfg() [all …]
|
/littlefs-2.7.6/tests/ |
D | test_exhaustion.toml | 167 # These are a sort of high-level litmus test for wear-leveling. One definition 168 # of wear-leveling is that increasing a block device's space translates directly 172 [[case]] # wear-level test running a filesystem to exhaustion 260 // check we increased the lifetime by 2x with ~10% error 264 [[case]] # wear-level test + expanding superblock 349 // check we increased the lifetime by 2x with ~10% error 432 lfs_testbd_wear_t minwear = -1; 438 printf("%08x: wear %d\n", b, wear); 458 lfs_testbd_swear_t diff = wear - avgwear;
|