Lines Matching refs:num_sectors

133 static int read_sector(uint8_t *buf, uint32_t start, uint32_t num_sectors)  in read_sector()  argument
138 buf[num_sectors * disk_sector_size] = OVERFLOW_CANARY; in read_sector()
139 rc = disk_access_read(disk_pdrv, buf, start, num_sectors); in read_sector()
141 zassert_equal(buf[num_sectors * disk_sector_size], OVERFLOW_CANARY, in read_sector()
147 static void test_sector_read(uint8_t *buf, uint32_t num_sectors) in test_sector_read() argument
151 TC_PRINT("Testing reads of %u sectors\n", num_sectors); in test_sector_read()
153 rc = read_sector(buf, 0, num_sectors); in test_sector_read()
156 if (disk_sector_count / 2 > num_sectors) { in test_sector_read()
157 sector = disk_sector_count / 2 - num_sectors; in test_sector_read()
162 rc = read_sector(buf, sector, num_sectors); in test_sector_read()
165 rc = read_sector(buf, disk_sector_count - 1, num_sectors); in test_sector_read()
166 if (num_sectors == 1) { in test_sector_read()
177 uint32_t start, uint32_t num_sectors) in write_sector_checked() argument
182 for (i = 0; i < num_sectors * disk_sector_size; i++) { in write_sector_checked()
183 wbuf[i] = (i & (~num_sectors)); in write_sector_checked()
186 rc = disk_access_write(disk_pdrv, wbuf, start, num_sectors); in write_sector_checked()
191 memset(rbuf, 0, num_sectors * disk_sector_size); in write_sector_checked()
192 rc = read_sector(rbuf, start, num_sectors); in write_sector_checked()
197 zassert_mem_equal(wbuf, rbuf, num_sectors * disk_sector_size, in write_sector_checked()
205 static void test_sector_write(uint8_t *wbuf, uint8_t *rbuf, uint32_t num_sectors) in test_sector_write() argument
209 TC_PRINT("Testing writes of %u sectors\n", num_sectors); in test_sector_write()
211 rc = write_sector_checked(wbuf, rbuf, 0, num_sectors); in test_sector_write()
214 if (disk_sector_count / 2 > num_sectors) { in test_sector_write()
215 sector = disk_sector_count / 2 - num_sectors; in test_sector_write()
220 rc = write_sector_checked(wbuf, rbuf, sector, num_sectors); in test_sector_write()
223 rc = write_sector_checked(wbuf, rbuf, disk_sector_count - 1, num_sectors); in test_sector_write()
224 if (num_sectors == 1) { in test_sector_write()