Lines Matching defs:size
115 static int load_xbc_fd(int fd, char **buf, int size)
119 *buf = malloc(size + 1);
123 ret = read(fd, *buf, size);
126 (*buf)[size] = '\0';
131 /* Return the read size or -errno */
161 u32 size = 0, csum = 0, rcsum;
183 return pr_errno("Failed to lseek for size", -errno);
185 if (read(fd, &size, sizeof(u32)) < 0)
186 return pr_errno("Failed to read size", -errno);
187 size = le32toh(size);
193 /* Wrong size error */
194 if (stat.st_size < size + 8 + BOOTCONFIG_MAGIC_LEN) {
195 pr_err("bootconfig size is too big\n");
199 if (lseek(fd, stat.st_size - (size + 8 + BOOTCONFIG_MAGIC_LEN),
203 ret = load_xbc_fd(fd, buf, size);
208 rcsum = checksum((unsigned char *)*buf, size);
221 return size;
312 int ret = 0, fd, size;
322 size = load_xbc_from_initrd(fd, &buf);
323 if (size < 0) {
324 ret = size;
326 } else if (size > 0) {
330 - size - 8 - BOOTCONFIG_MAGIC_LEN);
347 u32 size, csum;
356 size = strlen(buf) + 1;
357 csum = checksum((unsigned char *)buf, size);
360 data = calloc(size + BOOTCONFIG_ALIGN +
364 memcpy(data, buf, size);
377 printf("\tSize: %u bytes\n", (unsigned int)size);
403 pr_err("Failed to get the size of %s\n", path);
407 /* To align up the total size to BOOTCONFIG_ALIGN, get padding size */
408 total_size = stat.st_size + size + sizeof(u32) * 2 + BOOTCONFIG_MAGIC_LEN;
410 size += pad;
413 p = data + size;
414 *(u32 *)p = htole32(size);