Lines Matching refs:block

2 # sure the underlying block device is working.
37 lfs_block_t block;
39 // write block 0
40 block = 0;
41 cfg->erase(cfg, block) => 0;
44 buffer[j] = (block+i+j) % 251;
46 cfg->prog(cfg, block, i, buffer, PROG) => 0;
49 // read block 0
50 block = 0;
52 cfg->read(cfg, block, i, buffer, READ) => 0;
55 LFS_ASSERT(buffer[j] == (block+i+j) % 251);
59 // write block 1
60 block = 1;
61 cfg->erase(cfg, block) => 0;
64 buffer[j] = (block+i+j) % 251;
66 cfg->prog(cfg, block, i, buffer, PROG) => 0;
69 // read block 1
70 block = 1;
72 cfg->read(cfg, block, i, buffer, READ) => 0;
75 LFS_ASSERT(buffer[j] == (block+i+j) % 251);
79 // read block 0 again
80 block = 0;
82 cfg->read(cfg, block, i, buffer, READ) => 0;
85 LFS_ASSERT(buffer[j] == (block+i+j) % 251);
95 lfs_block_t block;
97 // write block 0
98 block = 0;
99 cfg->erase(cfg, block) => 0;
102 buffer[j] = (block+i+j) % 251;
104 cfg->prog(cfg, block, i, buffer, PROG) => 0;
107 // read block 0
108 block = 0;
110 cfg->read(cfg, block, i, buffer, READ) => 0;
113 LFS_ASSERT(buffer[j] == (block+i+j) % 251);
117 // write block n-1
118 block = cfg->block_count-1;
119 cfg->erase(cfg, block) => 0;
122 buffer[j] = (block+i+j) % 251;
124 cfg->prog(cfg, block, i, buffer, PROG) => 0;
127 // read block n-1
128 block = cfg->block_count-1;
130 cfg->read(cfg, block, i, buffer, READ) => 0;
133 LFS_ASSERT(buffer[j] == (block+i+j) % 251);
137 // read block 0 again
138 block = 0;
140 cfg->read(cfg, block, i, buffer, READ) => 0;
143 LFS_ASSERT(buffer[j] == (block+i+j) % 251);
155 lfs_block_t block = 1;
156 while (block < cfg->block_count) {
158 cfg->erase(cfg, block) => 0;
161 buffer[j] = (block+i+j) % 251;
163 cfg->prog(cfg, block, i, buffer, PROG) => 0;
168 cfg->read(cfg, block, i, buffer, READ) => 0;
171 LFS_ASSERT(buffer[j] == (block+i+j) % 251);
175 block *= 2;
179 block = 1;
180 while (block < cfg->block_count) {
183 cfg->read(cfg, block, i, buffer, READ) => 0;
186 LFS_ASSERT(buffer[j] == (block+i+j) % 251);
190 block *= 2;
201 lfs_block_t block = 1;
203 while (block < cfg->block_count) {
205 cfg->erase(cfg, block) => 0;
208 buffer[j] = (block+i+j) % 251;
210 cfg->prog(cfg, block, i, buffer, PROG) => 0;
215 cfg->read(cfg, block, i, buffer, READ) => 0;
218 LFS_ASSERT(buffer[j] == (block+i+j) % 251);
222 lfs_block_t nblock = block + block_;
223 block_ = block;
224 block = nblock;
228 block = 1;
230 while (block < cfg->block_count) {
233 cfg->read(cfg, block, i, buffer, READ) => 0;
236 LFS_ASSERT(buffer[j] == (block+i+j) % 251);
240 lfs_block_t nblock = block + block_;
241 block_ = block;
242 block = nblock;