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

Function elog_write

util/cbfstool/elogtool.c:110–126  ·  view source on GitHub ↗

* If filename is NULL, it saves the buffer using flashrom. * Otherwise, it saves the buffer in the given filename. */

Source from the content-addressed store, hash-verified

108 * Otherwise, it saves the buffer in the given filename.
109 */
110static int elog_write(struct buffer *buffer, const char *filename)
111{
112 if (filename == NULL) {
113 if (flashrom_host_write(buffer, ELOG_RW_REGION_NAME) != 0) {
114 fprintf(stderr,
115 "Failed to write to RW_ELOG region using flashrom\n");
116 return ELOGTOOL_EXIT_WRITE_ERROR;
117 }
118 return ELOGTOOL_EXIT_SUCCESS;
119 }
120
121 if (buffer_write_file(buffer, filename) != 0) {
122 fprintf(stderr, "Failed to write to file %s\n", filename);
123 return ELOGTOOL_EXIT_WRITE_ERROR;
124 }
125 return ELOGTOOL_EXIT_SUCCESS;
126}
127
128/* Buffer offset must point to a valid event_header struct */
129static size_t next_available_event_offset(const struct buffer *buf)

Callers 1

mainFunction · 0.85

Calls 3

flashrom_host_writeFunction · 0.85
fprintfFunction · 0.85
buffer_write_fileFunction · 0.85

Tested by

no test coverage detected