arch/mips/sgi-ip27/ip27-smp.c
Source file repositories/reference/linux-study-clean/arch/mips/sgi-ip27/ip27-smp.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/sgi-ip27/ip27-smp.c- Extension
.c- Size
- 4451 bytes
- Lines
- 192
- Domain
- Architecture Layer
- Bucket
- arch/mips
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/sched.hlinux/sched/task_stack.hlinux/topology.hlinux/nodemask.hasm/page.hasm/processor.hasm/ptrace.hasm/sn/agent.hasm/sn/arch.hasm/sn/gda.hasm/sn/intr.hasm/sn/klconfig.hasm/sn/launch.hasm/sn/mapped_kernel.hasm/sn/types.hip27-common.h
Detected Declarations
function Copyrightfunction cpu_node_probefunction intr_clear_allfunction ip27_send_ipi_singlefunction ip27_send_ipi_maskfunction ip27_init_cpufunction ip27_smp_finishfunction smp_bootstrapfunction ip27_smp_setupfunction for_each_online_nodefunction ip27_prepare_cpus
Annotated Snippet
while (acpu) {
cpuid = acpu->cpu_info.virtid;
/* Only let it join in if it's marked enabled */
if ((acpu->cpu_info.flags & KLINFO_ENABLE) &&
(cpus_found != NR_CPUS)) {
if (cpuid > highest)
highest = cpuid;
set_cpu_possible(cpuid, true);
cputonasid(cpus_found) = nasid;
cputoslice(cpus_found) = acpu->cpu_info.physid;
sn_cpu_info[cpus_found].p_speed =
acpu->cpu_speed;
cpus_found++;
}
acpu = (klcpu_t *)find_component(brd, (klinfo_t *)acpu,
KLSTRUCT_CPU);
}
brd = KLCF_NEXT(brd);
if (!brd)
break;
brd = find_lboard(brd, KLTYPE_IP27);
} while (brd);
return highest;
}
void cpu_node_probe(void)
{
int i, highest = 0;
gda_t *gdap = GDA;
nodes_clear(node_online_map);
nodes_clear(node_possible_map);
for (i = 0; i < MAX_NUMNODES; i++) {
nasid_t nasid = gdap->g_nasidtable[i];
if (nasid == INVALID_NASID)
break;
node_set_online(nasid);
node_set(nasid, node_possible_map);
highest = node_scan_cpus(nasid, highest);
}
printk("Discovered %d cpus on %d nodes\n", highest + 1, num_online_nodes());
}
static __init void intr_clear_all(nasid_t nasid)
{
int i;
REMOTE_HUB_S(nasid, PI_INT_MASK0_A, 0);
REMOTE_HUB_S(nasid, PI_INT_MASK0_B, 0);
REMOTE_HUB_S(nasid, PI_INT_MASK1_A, 0);
REMOTE_HUB_S(nasid, PI_INT_MASK1_B, 0);
for (i = 0; i < 128; i++)
REMOTE_HUB_CLR_INTR(nasid, i);
}
static void ip27_send_ipi_single(int destid, unsigned int action)
{
int irq;
switch (action) {
case SMP_RESCHEDULE_YOURSELF:
irq = CPU_RESCHED_A_IRQ;
break;
case SMP_CALL_FUNCTION:
irq = CPU_CALL_A_IRQ;
break;
default:
panic("sendintr");
}
irq += cputoslice(destid);
/*
* Set the interrupt bit associated with the CPU we want to
* send the interrupt to.
*/
REMOTE_HUB_SEND_INTR(cpu_to_node(destid), irq);
}
static void ip27_send_ipi_mask(const struct cpumask *mask, unsigned int action)
{
unsigned int i;
for_each_cpu(i, mask)
ip27_send_ipi_single(i, action);
}
Annotation
- Immediate include surface: `linux/init.h`, `linux/sched.h`, `linux/sched/task_stack.h`, `linux/topology.h`, `linux/nodemask.h`, `asm/page.h`, `asm/processor.h`, `asm/ptrace.h`.
- Detected declarations: `function Copyright`, `function cpu_node_probe`, `function intr_clear_all`, `function ip27_send_ipi_single`, `function ip27_send_ipi_mask`, `function ip27_init_cpu`, `function ip27_smp_finish`, `function smp_bootstrap`, `function ip27_smp_setup`, `function for_each_online_node`.
- Atlas domain: Architecture Layer / arch/mips.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.