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

Function timestamp_reinit

src/lib/timestamp.c:210–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210static void timestamp_reinit(int is_recovery)
211{
212 struct timestamp_table *ts_cbmem_table;
213
214 if (!timestamp_should_run())
215 return;
216
217 /* First time into romstage we make a clean new table. For platforms that travel
218 through this path on resume, ARCH_X86 S3, timestamps are also reset. */
219 if (ENV_CREATES_CBMEM) {
220 ts_cbmem_table = timestamp_alloc_cbmem_table();
221 } else {
222 /* Find existing table in cbmem. */
223 ts_cbmem_table = cbmem_find(CBMEM_ID_TIMESTAMP);
224 }
225
226 if (ts_cbmem_table == NULL) {
227 printk(BIOS_ERR, "No timestamp table allocated\n");
228 timestamp_table_set(NULL);
229 return;
230 }
231
232 if (ENV_CREATES_CBMEM)
233 timestamp_sync_cache_to_cbmem(ts_cbmem_table);
234
235 /* Seed the timestamp tick frequency in ENV_PAYLOAD_LOADER. */
236 if (ENV_PAYLOAD_LOADER)
237 ts_cbmem_table->tick_freq_mhz = timestamp_tick_freq_mhz();
238
239 timestamp_table_set(ts_cbmem_table);
240}
241
242void timestamp_rescale_table(uint16_t N, uint16_t M)
243{

Callers

nothing calls this directly

Calls 7

timestamp_should_runFunction · 0.85
timestamp_table_setFunction · 0.85
cbmem_findFunction · 0.70
timestamp_tick_freq_mhzFunction · 0.70
printkFunction · 0.50

Tested by

no test coverage detected