/* The main machine-dep calls structure
*/ struct machdep_calls ppc_md;
EXPORT_SYMBOL(ppc_md); struct machdep_calls *machine_id;
EXPORT_SYMBOL(machine_id);
int boot_cpuid = -1;
EXPORT_SYMBOL_GPL(boot_cpuid); int __initdata boot_core_hwid = -1;
#ifdef CONFIG_PPC64 int boot_cpu_hwid = -1; #endif
/* *Theseareusedinbinfmt_elf.ctoputauxentriesonthestack *foreachelfexecutablebeingstarted.
*/ int dcache_bsize; int icache_bsize;
/* Variables required to store legacy IO irq routing */ int of_i8042_kbd_irq;
EXPORT_SYMBOL_GPL(of_i8042_kbd_irq); int of_i8042_aux_irq;
EXPORT_SYMBOL_GPL(of_i8042_aux_irq);
#ifdef __DO_IRQ_CANON /* XXX should go elsewhere eventually */ int ppc_do_canonicalize_irqs;
EXPORT_SYMBOL(ppc_do_canonicalize_irqs); #endif
#ifdef CONFIG_CRASH_DUMP /* This keeps a track of which one is the crashing cpu. */ int crashing_cpu = -1; #endif
/* also used by kexec */ void machine_shutdown(void)
{ /* *iffadumpisactive,cleanupthefadumpregistrationbeforewe *shutdown.
*/
fadump_cleanup();
if (ppc_md.machine_shutdown)
ppc_md.machine_shutdown();
}
staticvoid machine_hang(void)
{
pr_emerg("System Halted, OK to turn off power\n");
local_irq_disable(); while (1)
;
}
void machine_restart(char *cmd)
{
machine_shutdown(); if (ppc_md.restart)
ppc_md.restart(cmd);
smp_send_stop();
do_kernel_restart(cmd);
mdelay(1000);
machine_hang();
}
void machine_power_off(void)
{
machine_shutdown();
do_kernel_power_off();
smp_send_stop();
machine_hang();
} /* Used by the G5 thermal driver */
EXPORT_SYMBOL_GPL(machine_power_off);
/* If this is the last cpu, print the summary */ if (cpumask_next(cpu_id, cpu_online_mask) >= nr_cpu_ids)
show_cpuinfo_summary(m);
return0;
}
staticvoid *c_start(struct seq_file *m, loff_t *pos)
{ if (*pos == 0) /* just in case, cpu 0 is not the first */
*pos = cpumask_first(cpu_online_mask); else
*pos = cpumask_next(*pos - 1, cpu_online_mask); if ((*pos) < nr_cpu_ids) return (void *)(unsignedlong)(*pos + 1); return NULL;
}
/* If we were passed an initrd, set the ROOT_DEV properly if the values *looksensible.Ifnot,clearinitrdreference.
*/ if (is_kernel_addr(initrd_start) && is_kernel_addr(initrd_end) &&
initrd_end > initrd_start)
ROOT_DEV = Root_RAM0; else
initrd_start = initrd_end = 0;
if (initrd_start)
pr_info("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
/* This implementation only supports power of 2 number of threads *forsimplicityandperformance
*/
threads_shift = ilog2(tpc);
BUG_ON(tpc != (1 << threads_shift));
for (i = 0; i < tpc; i++)
cpumask_set_cpu(i, &threads_core_mask);
printk(KERN_INFO "CPU maps initialized for %d thread%s per core\n",
tpc, str_plural(tpc));
printk(KERN_DEBUG " (thread shift is %d)\n", threads_shift);
}
u32 *cpu_to_phys_id = NULL;
staticint assign_threads(unsignedint cpu, unsignedint nthreads, bool present, const __be32 *hw_ids)
{ for (int i = 0; i < nthreads && cpu < nr_cpu_ids; i++) {
__be32 hwid;
hwid = be32_to_cpu(hw_ids[i]);
DBG(" thread %d -> cpu %d (hard id %d)\n", i, cpu, hwid);
/* *Iterateallppc_mdstructuresuntilwefindtheproper *oneforthecurrentmachinetype
*/
DBG("Probing machine type ...\n");
/* *Checkppc_mdisempty,ifnotwehaveabug,ie,wesetupan *entrybeforeprobe_machine()whichwillbeoverwritten
*/ for (i = 0; i < (sizeof(ppc_md) / sizeof(void *)); i++) { if (((void **)&ppc_md)[i]) {
printk(KERN_ERR "Entry %d in ppc_md non empty before" " machine probe !\n", i);
}
}
for (machine_id = &__machine_desc_start;
machine_id < &__machine_desc_end;
machine_id++) {
DBG(" %s ...\n", machine_id->name); if (machine_id->compatible && !of_machine_is_compatible(machine_id->compatible)) continue; if (machine_id->compatibles && !of_machine_compatible_match(machine_id->compatibles)) continue;
memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls)); if (ppc_md.probe && !ppc_md.probe()) continue;
DBG(" %s match !\n", machine_id->name); break;
} /* What can we do if we didn't find ? */ if (machine_id >= &__machine_desc_end) {
pr_err("No suitable machine description found !\n"); for (;;);
}
// Append the machine name to other info we've gathered
seq_buf_puts(&ppc_hw_desc, ppc_md.name);
// Set the generic hardware description shown in oopses
dump_stack_set_arch_desc(ppc_hw_desc.buffer);
/* Match a class of boards, not a specific device configuration. */ int check_legacy_ioport(unsignedlong base_port)
{ struct device_node *parent, *np = NULL; int ret = -ENODEV;
switch(base_port) { case I8042_DATA_REG: if (!(np = of_find_compatible_node(NULL, NULL, "pnpPNP,303")))
np = of_find_compatible_node(NULL, NULL, "pnpPNP,f03"); if (np) {
parent = of_get_parent(np);
of_i8042_kbd_irq = irq_of_parse_and_map(parent, 0); if (!of_i8042_kbd_irq)
of_i8042_kbd_irq = 1;
of_i8042_aux_irq = irq_of_parse_and_map(parent, 1); if (!of_i8042_aux_irq)
of_i8042_aux_irq = 12;
of_node_put(np);
np = parent; break;
}
np = of_find_node_by_type(NULL, "8042"); /* Pegasos has no device_type on its 8042 node, look for the
* name instead */ if (!np)
np = of_find_node_by_name(NULL, "8042"); if (np) {
of_i8042_kbd_irq = 1;
of_i8042_aux_irq = 12;
} break; case FDC_BASE: /* FDC1 */
np = of_find_node_by_type(NULL, "fdc"); break; default: /* ipmi is supposed to fail here */ break;
} if (!np) return ret;
parent = of_get_parent(np); if (parent) { if (of_node_is_type(parent, "isa"))
ret = 0;
of_node_put(parent);
}
of_node_put(np); return ret;
}
EXPORT_SYMBOL(check_legacy_ioport);
staticstruct notifier_block ppc_panic_block = {
.notifier_call = ppc_panic_platform_handler,
.priority = INT_MIN, /* may not return; must be done last */
};
if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && kaslr_offset() > 0)
atomic_notifier_chain_register(&panic_notifier_list,
&kernel_offset_notifier);
/* Low-level platform-specific routines that should run on panic */ if (ppc_md.panic)
atomic_notifier_chain_register(&panic_notifier_list,
&ppc_panic_block);
}
/* On BookE, setup per-core TLB data structures. */
setup_tlb_core_data(); #endif
/* Print various info about the machine that has been gathered so far. */
print_system_info();
klp_init_thread_info(&init_task);
setup_initial_init_mm(_stext, _etext, _edata, _end); /* sched_init() does the mmgrab(&init_mm) for the primary CPU */
VM_WARN_ON(cpumask_test_cpu(smp_processor_id(), mm_cpumask(&init_mm)));
cpumask_set_cpu(smp_processor_id(), mm_cpumask(&init_mm));
inc_mm_active_cpus(&init_mm);
mm_iommu_init(&init_mm);
/* Initialize the MMU context management stuff. */
mmu_context_init();
/* Interrupt code needs to be 64K-aligned. */ if (IS_ENABLED(CONFIG_PPC64) && (unsignedlong)_stext & 0xffff)
panic("Kernelbase not 64K-aligned (0x%lx)!\n",
(unsignedlong)_stext);
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.20Bemerkung:
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.