MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mptable_setup_local

Function mptable_setup_local

freebsd/x86/x86/mptable.c:352–379  ·  view source on GitHub ↗

* Initialize the local APIC on the BSP. */

Source from the content-addressed store, hash-verified

350 * Initialize the local APIC on the BSP.
351 */
352static int
353mptable_setup_local(void)
354{
355 vm_paddr_t addr;
356 u_int cpu_mask;
357
358 /* Is this a pre-defined config? */
359 printf("MPTable: <");
360 if (mpfps->config_type != 0) {
361 lapic_create(0, 1);
362 lapic_create(1, 0);
363 addr = DEFAULT_APIC_BASE;
364 printf("Default Configuration %d", mpfps->config_type);
365
366 } else {
367 cpu_mask = 0;
368 mptable_walk_table(mptable_setup_cpus_handler, &cpu_mask);
369#ifdef MPTABLE_FORCE_HTT
370 mptable_hyperthread_fixup(cpu_mask);
371#endif
372 addr = mpct->apic_address;
373 printf("%.*s %.*s", (int)sizeof(mpct->oem_id), mpct->oem_id,
374 (int)sizeof(mpct->product_id), mpct->product_id);
375 }
376 printf(">\n");
377 lapic_init(addr);
378 return (0);
379}
380
381/*
382 * Run through the MP table enumerating I/O APICs.

Callers

nothing calls this directly

Calls 5

lapic_createFunction · 0.85
mptable_walk_tableFunction · 0.85
lapic_initFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected