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

Function cpu_initialize

src/arch/x86/cpu.c:213–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void cpu_initialize(void)
214{
215 /* Because we busy wait at the printk spinlock.
216 * It is important to keep the number of printed messages
217 * from secondary cpus to a minimum, when debugging is
218 * disabled.
219 */
220 struct device *cpu;
221 struct cpu_info *info;
222 struct cpuinfo_x86 c;
223
224 info = cpu_info();
225
226 printk(BIOS_INFO, "Initializing CPU #%zd\n", info->index);
227
228 cpu = info->cpu;
229 if (!cpu)
230 die("CPU: missing CPU device structure");
231
232 if (cpu->initialized)
233 return;
234
235 post_log_path(cpu);
236
237 /* Find what type of CPU we are dealing with */
238 identify_cpu(cpu);
239 printk(BIOS_DEBUG, "CPU: vendor %s device %x\n",
240 cpu_vendor_name(cpu->vendor), cpu->device);
241
242 get_fms(&c, cpu->device);
243
244 printk(BIOS_DEBUG, "CPU: family %02x, model %02x, stepping %02x\n",
245 c.x86, c.x86_model, c.x86_mask);
246
247 /* Lookup the cpu's operations */
248 set_cpu_ops(cpu);
249
250 if (!cpu->ops) {
251 /* mask out the stepping and try again */
252 cpu->device -= c.x86_mask;
253 set_cpu_ops(cpu);
254 cpu->device += c.x86_mask;
255 if (!cpu->ops)
256 die("Unknown cpu");
257 printk(BIOS_DEBUG, "Using generic CPU ops (good)\n");
258 }
259
260 /* Initialize the CPU */
261 if (cpu->ops && cpu->ops->init) {
262 cpu->enabled = 1;
263 cpu->initialized = 1;
264 cpu->ops->init(cpu);
265 }
266 post_log_clear();
267
268 printk(BIOS_INFO, "CPU #%zd initialized\n", info->index);
269}
270

Callers

nothing calls this directly

Calls 10

post_log_pathFunction · 0.85
identify_cpuFunction · 0.85
cpu_vendor_nameFunction · 0.85
get_fmsFunction · 0.85
set_cpu_opsFunction · 0.85
post_log_clearFunction · 0.85
cpu_infoClass · 0.70
printkFunction · 0.50
dieFunction · 0.50
initMethod · 0.45

Tested by

no test coverage detected