| 208 | } |
| 209 | |
| 210 | static 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 | |
| 242 | void timestamp_rescale_table(uint16_t N, uint16_t M) |
| 243 | { |
nothing calls this directly
no test coverage detected