Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 21 of 21) sorted by relevance

/littlefs-3.5.0-3.4.0/tests/
Dtest_attrs.toml12 memset(buffer, 0, sizeof(buffer));
16 lfs_getattr(&lfs, "hello", 'A', buffer, 4) => 4;
17 lfs_getattr(&lfs, "hello", 'B', buffer+4, 6) => 6;
18 lfs_getattr(&lfs, "hello", 'C', buffer+10, 5) => 5;
19 memcmp(buffer, "aaaa", 4) => 0;
20 memcmp(buffer+4, "bbbbbb", 6) => 0;
21 memcmp(buffer+10, "ccccc", 5) => 0;
24 lfs_getattr(&lfs, "hello", 'A', buffer, 4) => 4;
25 lfs_getattr(&lfs, "hello", 'B', buffer+4, 6) => 0;
26 lfs_getattr(&lfs, "hello", 'C', buffer+10, 5) => 5;
[all …]
Dtest_seek.toml17 memcpy(buffer, "kittycatcat", size);
19 lfs_file_write(&lfs, &file, buffer, size);
30 lfs_file_read(&lfs, &file, buffer, size) => size;
31 memcmp(buffer, "kittycatcat", size) => 0;
37 lfs_file_read(&lfs, &file, buffer, size) => size;
38 memcmp(buffer, "kittycatcat", size) => 0;
41 lfs_file_read(&lfs, &file, buffer, size) => size;
42 memcmp(buffer, "kittycatcat", size) => 0;
45 lfs_file_read(&lfs, &file, buffer, size) => size;
46 memcmp(buffer, "kittycatcat", size) => 0;
[all …]
Dtest_badblocks.toml27 buffer[j] = '0'+i;
29 buffer[NAMEMULT] = '\0';
30 lfs_mkdir(&lfs, (char*)buffer) => 0;
32 buffer[NAMEMULT] = '/';
34 buffer[j+NAMEMULT+1] = '0'+i;
36 buffer[2*NAMEMULT+1] = '\0';
37 lfs_file_open(&lfs, &file, (char*)buffer,
42 lfs_file_write(&lfs, &file, buffer, size) => size;
52 buffer[j] = '0'+i;
54 buffer[NAMEMULT] = '\0';
[all …]
Dtest_truncate.toml10 strcpy((char*)buffer, "hair");
11 size = strlen((char*)buffer);
13 lfs_file_write(&lfs, &file, buffer, size) => size;
36 lfs_file_read(&lfs, &file, buffer, size) => size;
37 memcmp(buffer, "hair", size) => 0;
39 lfs_file_read(&lfs, &file, buffer, size) => 0;
54 strcpy((char*)buffer, "hair");
55 size = strlen((char*)buffer);
57 lfs_file_write(&lfs, &file, buffer, size) => size;
73 lfs_file_read(&lfs, &file, buffer, size) => size;
[all …]
Dtest_files.toml9 strcpy((char*)buffer, "Hello World!");
10 lfs_file_write(&lfs, &file, buffer, size) => size;
16 lfs_file_read(&lfs, &file, buffer, size) => size;
17 assert(strcmp((char*)buffer, "Hello World!") == 0);
36 buffer[b] = rand() & 0xff;
38 lfs_file_write(&lfs, &file, buffer, chunk) => chunk;
50 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
52 assert(buffer[b] == (rand() & 0xff));
55 lfs_file_read(&lfs, &file, buffer, CHUNKSIZE) => 0;
75 buffer[b] = rand() & 0xff;
[all …]
Dtest_alloc.toml40 lfs_file_read(&lfs, &file, buffer, size) => size;
41 assert(memcmp(buffer, names[n], size) == 0);
65 memcpy(buffer, names[n], size);
67 lfs_file_write(&lfs, &file, buffer, size) => size;
79 lfs_file_read(&lfs, &file, buffer, size) => size;
80 assert(memcmp(buffer, names[n], size) == 0);
125 lfs_file_read(&lfs, &file, buffer, size) => size;
126 assert(memcmp(buffer, names[n], size) == 0);
162 memcpy(buffer, names[n], size);
164 lfs_file_write(&lfs, &file, buffer, size) => size;
[all …]
Dtest_move.toml47 lfs_file_read(&lfs, &file, buffer, 5) => 5;
48 memcmp(buffer, "hola\n", 5) => 0;
49 lfs_file_read(&lfs, &file, buffer, 8) => 8;
50 memcmp(buffer, "bonjour\n", 8) => 0;
51 lfs_file_read(&lfs, &file, buffer, 6) => 6;
52 memcmp(buffer, "ohayo\n", 6) => 0;
138 lfs_file_read(&lfs, &file, buffer, 5) => 5;
139 memcmp(buffer, "hola\n", 5) => 0;
140 lfs_file_read(&lfs, &file, buffer, 8) => 8;
141 memcmp(buffer, "bonjour\n", 8) => 0;
[all …]
Dtest_interspersed.toml50 lfs_file_read(&lfs, &files[j], buffer, 1) => 1;
51 assert(buffer[0] == alphas[j]);
107 lfs_file_read(&lfs, &file, buffer, 1) => 1;
108 assert(buffer[0] == '~');
164 lfs_file_read(&lfs, &files[0], buffer, 1) => 1;
165 assert(buffer[0] == 'e');
166 lfs_file_read(&lfs, &files[1], buffer, 1) => 1;
167 assert(buffer[0] == 'g');
234 lfs_file_read(&lfs, &files[j], buffer, 1) => 1;
235 assert(buffer[0] == alphas[j]);
Dtest_evil.toml47 LFS_MKTAG(LFS_TYPE_NAME, 1, strlen("dir_here")), buffer)
49 assert(memcmp((char*)buffer, "dir_here", strlen("dir_here")) == 0);
95 LFS_MKTAG(LFS_TYPE_NAME, 1, strlen("file_here")), buffer)
97 assert(memcmp((char*)buffer, "file_here", strlen("file_here")) == 0);
113 lfs_file_read(&lfs, &file, buffer, SIZE) => LFS_ERR_CORRUPT;
146 LFS_MKTAG(LFS_TYPE_NAME, 1, strlen("file_here")), buffer)
148 assert(memcmp((char*)buffer, "file_here", strlen("file_here")) == 0);
174 lfs_file_read(&lfs, &file, buffer, SIZE) => LFS_ERR_CORRUPT;
Dtest_relocations.toml11 memset(buffer, 0, 512);
13 lfs_file_write(&lfs, &file, buffer, 512) => 512;
77 memset(buffer, 0, 512);
79 lfs_file_write(&lfs, &file, buffer, 512) => 512;
/littlefs-3.5.0-3.4.0/bd/
Dlfs_rambd.c21 (void*)bdcfg, bdcfg->erase_value, bdcfg->buffer); in lfs_rambd_createcfg()
26 if (bd->cfg->buffer) { in lfs_rambd_createcfg()
27 bd->buffer = bd->cfg->buffer; in lfs_rambd_createcfg()
29 bd->buffer = lfs_malloc(cfg->block_size * cfg->block_count); in lfs_rambd_createcfg()
30 if (!bd->buffer) { in lfs_rambd_createcfg()
38 memset(bd->buffer, bd->cfg->erase_value, in lfs_rambd_createcfg()
41 memset(bd->buffer, 0, cfg->block_size * cfg->block_count); in lfs_rambd_createcfg()
67 if (!bd->cfg->buffer) { in lfs_rambd_destroy()
68 lfs_free(bd->buffer); in lfs_rambd_destroy()
75 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_rambd_read() argument
[all …]
Dlfs_testbd.c30 bdcfg->buffer, bdcfg->wear_buffer); in lfs_testbd_createcfg()
63 .buffer = bd->cfg->buffer, in lfs_testbd_createcfg()
108 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_testbd_rawread() argument
111 return lfs_filebd_read(cfg, block, off, buffer, size); in lfs_testbd_rawread()
113 return lfs_rambd_read(cfg, block, off, buffer, size); in lfs_testbd_rawread()
118 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_testbd_rawprog() argument
121 return lfs_filebd_prog(cfg, block, off, buffer, size); in lfs_testbd_rawprog()
123 return lfs_rambd_prog(cfg, block, off, buffer, size); in lfs_testbd_rawprog()
148 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_testbd_read() argument
151 (void*)cfg, block, off, buffer, size); in lfs_testbd_read()
[all …]
Dlfs_filebd.c82 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_filebd_read() argument
85 (void*)cfg, block, off, buffer, size); in lfs_filebd_read()
95 memset(buffer, bd->cfg->erase_value, size); in lfs_filebd_read()
107 ssize_t res2 = read(bd->fd, buffer, size); in lfs_filebd_read()
119 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_filebd_prog() argument
121 (void*)cfg, block, off, buffer, size); in lfs_filebd_prog()
161 ssize_t res2 = write(bd->fd, buffer, size); in lfs_filebd_prog()
Dlfs_rambd.h34 void *buffer; member
39 uint8_t *buffer; member
54 lfs_off_t off, void *buffer, lfs_size_t size);
60 lfs_off_t off, const void *buffer, lfs_size_t size);
Dlfs_testbd.h67 void *buffer; member
109 lfs_off_t off, void *buffer, lfs_size_t size);
115 lfs_off_t off, const void *buffer, lfs_size_t size);
Dlfs_filebd.h52 lfs_off_t off, void *buffer, lfs_size_t size);
58 lfs_off_t off, const void *buffer, lfs_size_t size);
/littlefs-3.5.0-3.4.0/
Dlfs.c44 memset(pcache->buffer, 0xff, lfs->cfg->cache_size); in lfs_cache_zero()
51 void *buffer, lfs_size_t size) { in lfs_bd_read() argument
52 uint8_t *data = buffer; in lfs_bd_read()
66 memcpy(data, &pcache->buffer[off-pcache->off], diff); in lfs_bd_read()
83 memcpy(data, &rcache->buffer[off-rcache->off], diff); in lfs_bd_read()
121 rcache->off, rcache->buffer, rcache->size); in lfs_bd_read()
134 const void *buffer, lfs_size_t size) { in lfs_bd_cmp() argument
135 const uint8_t *data = buffer; in lfs_bd_cmp()
165 pcache->off, pcache->buffer, diff); in lfs_bd_flush()
176 pcache->block, pcache->off, pcache->buffer, diff); in lfs_bd_flush()
[all …]
Dlfs.h166 lfs_off_t off, void *buffer, lfs_size_t size);
172 lfs_off_t off, const void *buffer, lfs_size_t size);
291 void *buffer; member
301 void *buffer; member
326 uint8_t *buffer; member
409 uint32_t *buffer; member
491 uint8_t type, void *buffer, lfs_size_t size);
502 uint8_t type, const void *buffer, lfs_size_t size);
564 void *buffer, lfs_size_t size);
574 const void *buffer, lfs_size_t size);
Dlfs_util.c15 uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size) { in lfs_crc() argument
23 const uint8_t *data = buffer; in lfs_crc()
Dlfs_util.h217 uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size);
DDESIGN.md303 Why two blocks? Well, logs work by appending entries to a circular buffer
306 block at a time. This means that in order for our circular buffer to work, we
920 of a small, fixed-size bitmap called the lookahead buffer. During block
921 allocation, we take blocks from the lookahead buffer. If the lookahead buffer
923 buffer. In each scan we use an increasing offset, circling the storage as
956 size of the lookahead buffer, trading either write granularity or RAM for