MCPcopy Create free account
hub / github.com/coreboot/coreboot / write_image

Function write_image

util/ifdtool/ifdtool.c:1267–1281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1265}
1266
1267static void write_image(const char *filename, char *image, int size)
1268{
1269 int new_fd;
1270 printf("Writing new image to %s\n", filename);
1271
1272 // Now write out new image
1273 new_fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
1274 if (new_fd < 0) {
1275 perror("Error while trying to open file");
1276 exit(EXIT_FAILURE);
1277 }
1278 if (write(new_fd, image, size) != size)
1279 perror("Error while writing");
1280 close(new_fd);
1281}
1282
1283static void set_spi_frequency(const char *filename, char *image, int size,
1284 enum spi_frequency freq)

Callers 10

set_spi_frequencyFunction · 0.85
set_chipdensityFunction · 0.85
lock_descriptorFunction · 0.85
enable_cpu_read_meFunction · 0.85
unlock_descriptorFunction · 0.85
disable_gpr0Function · 0.85
enable_gpr0Function · 0.85
inject_regionFunction · 0.85
new_layoutFunction · 0.85
mainFunction · 0.85

Calls 4

printfFunction · 0.85
perrorFunction · 0.85
exitFunction · 0.85
writeFunction · 0.85

Tested by

no test coverage detected