void __init prom_prepare_cpus(unsigned int max_cpus) { cnodeid_t cnode; for_each_online_node(cnode) intr_clear_all(COMPACT_TO_NASID_NODEID(cnode)); replicate_kernel_text(); /* * Assumption to be fixed: we're always booted on logical / physical * processor 0. While we're always running on logical processor 0 * this still means this is physical processor zero; it might for * example be disabled in the firwware. */ alloc_cpupda(0, 0); }
void __init prom_prepare_cpus(unsigned int max_cpus) { cnodeid_t cnode; for (cnode = 0; cnode < numnodes; cnode++) intr_clear_all(COMPACT_TO_NASID_NODEID(cnode)); /* Master has already done per_cpu_init() */ install_ipi(); replicate_kernel_text(numnodes); /* * Assumption to be fixed: we're always booted on logical / physical * processor 0. While we're always running on logical processor 0 * this still means this is physical processor zero; it might for * example be disabled in the firwware. */ alloc_cpupda(0, 0); }
static void __init ip27_smp_setup(void) { cnodeid_t cnode; for_each_online_node(cnode) { if (cnode == 0) continue; intr_clear_all(COMPACT_TO_NASID_NODEID(cnode)); } replicate_kernel_text(); /* * Assumption to be fixed: we're always booted on logical / physical * processor 0. While we're always running on logical processor 0 * this still means this is physical processor zero; it might for * example be disabled in the firmware. */ alloc_cpupda(0, 0); }
/* * One-time setup for MP SN. * Allocate per-node data, slurp prom klconfig information and * convert it to hwgraph information. */ void sn_mp_setup(void) { cnodeid_t cnode; extern int maxnodes; cpuid_t cpu; DBG("sn_mp_setup: Entered.\n"); /* * NODEPDA(x) Macro depends on nodepda * subnodepda is also statically set to calias space which we * do not currently support yet .. just a hack for now. */ #ifdef NUMA_BASE maxnodes = numnodes; DBG("sn_mp_setup(): maxnodes= %d numnodes= %d\n", maxnodes,numnodes); printk("sn_mp_setup(): Allocating backing store for *Nodepdaindr[%2d] \n", maxnodes); /* * Initialize Nodpdaindr and per-node nodepdaindr array */ *Nodepdaindr = (nodepda_t *) kmalloc(sizeof(nodepda_t *)*numnodes, GFP_KERNEL); for (cnode=0; cnode<maxnodes; cnode++) { Nodepdaindr[cnode] = (nodepda_t *) kmalloc(sizeof(struct nodepda_s), GFP_KERNEL); Synergy_da_indr[cnode * 2] = (synergy_da_t *) kmalloc( sizeof(synergy_da_t), GFP_KERNEL); Synergy_da_indr[(cnode * 2) + 1] = (synergy_da_t *) kmalloc( sizeof(synergy_da_t), GFP_KERNEL); Nodepdaindr[cnode]->pernode_pdaindr = Nodepdaindr; subnodepda = &Nodepdaindr[cnode]->snpda[cnode]; } nodepda = Nodepdaindr[0]; #else Nodepdaindr = (nodepda_t *) kmalloc(sizeof(struct nodepda_s), GFP_KERNEL); nodepda = Nodepdaindr[0]; subnodepda = &Nodepdaindr[0]->snpda[0]; #endif /* NUMA_BASE */ /* * Before we let the other processors run, set up the platform specific * stuff in the nodepda. * * ???? maxnodes set in mlreset .. who sets it now ???? * ???? cpu_node_probe() called in mlreset to set up the following: * compact_to_nasid_node[] - cnode id gives nasid * nasid_to_compact_node[] - nasid gives cnode id * * do_cpumask() sets the following: * cpuid_to_compact_node[] - cpuid gives cnode id * * nasid comes from gdap->g_nasidtable[] * ml/SN/promif.c */ #ifdef CONFIG_IA64_SGI_SN1 for (cpu = 0; cpu < smp_num_cpus; cpu++) { /* Skip holes in CPU space */ if (cpu_enabled(cpu)) { init_platform_pda(cpu); } } #endif for (cnode = 0; cnode < maxnodes; cnode++) { /* * Set up platform-dependent nodepda fields. * The following routine actually sets up the hubinfo struct * in nodepda. */ DBG("sn_mp_io_setup: calling init_platform_nodepda(%2d)\n",cnode); init_platform_nodepda(Nodepdaindr[cnode], cnode); } /* * Initialize platform-dependent vertices in the hwgraph: * module * node * cpu * memory * slot * hub * router * xbow */ DBG("sn_mp_io_setup: calling io_module_init()\n"); io_module_init(); /* Use to be called module_init() .. */ DBG("sn_mp_setup: calling klhwg_add_all_modules()\n"); klhwg_add_all_modules(hwgraph_root); DBG("sn_mp_setup: calling klhwg_add_all_nodes()\n"); klhwg_add_all_nodes(hwgraph_root); for (cnode = 0; cnode < maxnodes; cnode++) { /* * This routine clears the Hub's Interrupt registers. */ #ifdef CONFIG_IA64_SGI_SN1 /* * We need to move this intr_clear_all() routine * from SN/intr.c to a more appropriate file. * Talk to Al Mayer. */ intr_clear_all(COMPACT_TO_NASID_NODEID(cnode)); /* now init the hub */ // per_hub_init(cnode); #endif } #if defined(CONFIG_IA64_SGI_SYNERGY_PERF) synergy_perf_init(); #endif /* CONFIG_IA64_SGI_SYNERGY_PERF */ }