Lines Matching refs:blocks
598 uint8_t header_size; /* blocks, size of ptn header. */
599 uint8_t tbl_offset; /* blocks, offset of index table. */
600 uint8_t tbl_entry_size; /* blocks, size of index table's entry. */
613 uint32_t content_offset; /* blocks, offset of resource content. */
632 uint32_t content_offset; /* blocks, offset of resource content. */
712 static bool StorageWriteLba(int offset_block, void *data, int blocks)
724 if (!fwrite(data, blocks * BLOCK_SIZE, 1, file)) {
735 static bool StorageReadLba(int offset_block, void *data, int blocks)
746 if (!fread(data, blocks * BLOCK_SIZE, 1, file)) {
761 int blocks = len / BLOCK_SIZE;
762 if (blocks && !StorageWriteLba(offset_block, data, blocks)) {
768 memcpy(buf, data + blocks * BLOCK_SIZE, left);
769 if (!StorageWriteLba(offset_block + blocks, buf, 1))
778 static int load_file(const char *file_path, int offset_block, int blocks);
788 int blocks = 0;
798 blocks = atoi(argv[0]);
800 return load_file(file_path, offset_block, blocks);
824 int blocks = fix_blocks(content->content_size);
825 content->load_addr = malloc(blocks * BLOCK_SIZE);
829 content->load_addr, blocks)) {
839 void *data, int blocks)
842 data, blocks)) {
845 tests_dump_file(content->path, data, blocks * BLOCK_SIZE);
923 static int load_file(const char *file_path, int offset_block, int blocks)
926 if (blocks) {
927 printf(", offset block:%d, blocks:%d\n", offset_block, blocks);
938 if (!blocks) {
943 void *data = malloc(blocks * BLOCK_SIZE);
946 if (!load_content_data(&content, offset_block, data, blocks)) {