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

Function cmd_list

util/cbfstool/elogtool.c:196–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196static int cmd_list(const struct buffer *buf, enum elogtool_flag flags)
197{
198 enum eventlog_timezone tz = EVENTLOG_TIMEZONE_LOCALTIME;
199 const struct event_header *event;
200 unsigned int count = 0;
201
202 if (flags & ELOGTOOL_FLAG_UTC)
203 tz = EVENTLOG_TIMEZONE_UTC;
204
205 /* Point to the first event */
206 event = buffer_get(buf) + sizeof(struct elog_header);
207
208 while ((const void *)(event) < buffer_end(buf)) {
209 if (((const void *)event + sizeof(*event)) >= buffer_end(buf)
210 || event->length <= sizeof(*event)
211 || event->length > ELOG_MAX_EVENT_SIZE
212 || ((const void *)event + event->length) >= buffer_end(buf)
213 || event->type == ELOG_TYPE_EOL)
214 break;
215
216 eventlog_print_event(event, count, tz);
217 event = elog_get_next_event(event);
218 count++;
219 }
220
221 return ELOGTOOL_EXIT_SUCCESS;
222}
223
224/*
225 * Clears the elog events from the given buffer, which is a valid RW_ELOG region.

Callers

nothing calls this directly

Calls 4

buffer_getFunction · 0.85
buffer_endFunction · 0.85
eventlog_print_eventFunction · 0.85
elog_get_next_eventFunction · 0.85

Tested by

no test coverage detected