aboutsummaryrefslogtreecommitdiff
path: root/arch/alpha/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha/kernel')
-rw-r--r--arch/alpha/kernel/asm-offsets.c1
-rw-r--r--arch/alpha/kernel/entry.S16
-rw-r--r--arch/alpha/kernel/irq.c43
-rw-r--r--arch/alpha/kernel/smp.c25
4 files changed, 36 insertions, 49 deletions
diff --git a/arch/alpha/kernel/asm-offsets.c b/arch/alpha/kernel/asm-offsets.c
index 8f2e5c718b5..6c56c754a0b 100644
--- a/arch/alpha/kernel/asm-offsets.c
+++ b/arch/alpha/kernel/asm-offsets.c
@@ -28,6 +28,7 @@ void foo(void)
DEFINE(TASK_GID, offsetof(struct task_struct, gid));
DEFINE(TASK_EGID, offsetof(struct task_struct, egid));
DEFINE(TASK_REAL_PARENT, offsetof(struct task_struct, real_parent));
+ DEFINE(TASK_GROUP_LEADER, offsetof(struct task_struct, group_leader));
DEFINE(TASK_TGID, offsetof(struct task_struct, tgid));
BLANK();
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index e38671c922b..7af15bf7e5a 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -879,17 +879,19 @@ sys_getxpid:
/* See linux/kernel/timer.c sys_getppid for discussion
about this loop. */
- ldq $3, TASK_REAL_PARENT($2)
-1: ldl $1, TASK_TGID($3)
+ ldq $3, TASK_GROUP_LEADER($2)
+ ldq $4, TASK_REAL_PARENT($3)
+ ldl $0, TASK_TGID($2)
+1: ldl $1, TASK_TGID($4)
#ifdef CONFIG_SMP
- mov $3, $4
+ mov $4, $5
mb
- ldq $3, TASK_REAL_PARENT($2)
- cmpeq $3, $4, $4
- beq $4, 1b
+ ldq $3, TASK_GROUP_LEADER($2)
+ ldq $4, TASK_REAL_PARENT($3)
+ cmpeq $4, $5, $5
+ beq $5, 1b
#endif
stq $1, 80($sp)
- ldl $0, TASK_TGID($2)
ret
.end sys_getxpid
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index 76be5cf0de1..da677f829f7 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -68,34 +68,32 @@ show_interrupts(struct seq_file *p, void *v)
#ifdef CONFIG_SMP
int j;
#endif
- int i = *(loff_t *) v;
+ int irq = *(loff_t *) v;
struct irqaction * action;
unsigned long flags;
#ifdef CONFIG_SMP
- if (i == 0) {
+ if (irq == 0) {
seq_puts(p, " ");
- for (i = 0; i < NR_CPUS; i++)
- if (cpu_online(i))
- seq_printf(p, "CPU%d ", i);
+ for_each_online_cpu(j)
+ seq_printf(p, "CPU%d ", j);
seq_putc(p, '\n');
}
#endif
- if (i < ACTUAL_NR_IRQS) {
- spin_lock_irqsave(&irq_desc[i].lock, flags);
- action = irq_desc[i].action;
+ if (irq < ACTUAL_NR_IRQS) {
+ spin_lock_irqsave(&irq_desc[irq].lock, flags);
+ action = irq_desc[irq].action;
if (!action)
goto unlock;
- seq_printf(p, "%3d: ",i);
+ seq_printf(p, "%3d: ", irq);
#ifndef CONFIG_SMP
- seq_printf(p, "%10u ", kstat_irqs(i));
+ seq_printf(p, "%10u ", kstat_irqs(irq));
#else
- for (j = 0; j < NR_CPUS; j++)
- if (cpu_online(j))
- seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
+ for_each_online_cpu(j)
+ seq_printf(p, "%10u ", kstat_cpu(j).irqs[irq]);
#endif
- seq_printf(p, " %14s", irq_desc[i].handler->typename);
+ seq_printf(p, " %14s", irq_desc[irq].handler->typename);
seq_printf(p, " %c%s",
(action->flags & SA_INTERRUPT)?'+':' ',
action->name);
@@ -108,13 +106,12 @@ show_interrupts(struct seq_file *p, void *v)
seq_putc(p, '\n');
unlock:
- spin_unlock_irqrestore(&irq_desc[i].lock, flags);
- } else if (i == ACTUAL_NR_IRQS) {
+ spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
+ } else if (irq == ACTUAL_NR_IRQS) {
#ifdef CONFIG_SMP
seq_puts(p, "IPI: ");
- for (i = 0; i < NR_CPUS; i++)
- if (cpu_online(i))
- seq_printf(p, "%10lu ", cpu_data[i].ipi_count);
+ for_each_online_cpu(j)
+ seq_printf(p, "%10lu ", cpu_data[j].ipi_count);
seq_putc(p, '\n');
#endif
seq_printf(p, "ERR: %10lu\n", irq_err_count);
@@ -122,7 +119,6 @@ unlock:
return 0;
}
-
/*
* handle_irq handles all normal device IRQ's (the special
* SMP cross-CPU interrupts have their own specific
@@ -155,8 +151,13 @@ handle_irq(int irq, struct pt_regs * regs)
}
irq_enter();
+ /*
+ * __do_IRQ() must be called with IPL_MAX. Note that we do not
+ * explicitly enable interrupts afterwards - some MILO PALcode
+ * (namely LX164 one) seems to have severe problems with RTI
+ * at IPL 0.
+ */
local_irq_disable();
__do_IRQ(irq, regs);
- local_irq_enable();
irq_exit();
}
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 4b873527ce1..02c2db08114 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -73,9 +73,6 @@ cpumask_t cpu_online_map;
EXPORT_SYMBOL(cpu_online_map);
-/* cpus reported in the hwrpb */
-static unsigned long hwrpb_cpu_present_mask __initdata = 0;
-
int smp_num_probed; /* Internal processor count */
int smp_num_cpus = 1; /* Number that came online. */
@@ -442,7 +439,7 @@ setup_smp(void)
if ((cpu->flags & 0x1cc) == 0x1cc) {
smp_num_probed++;
/* Assume here that "whami" == index */
- hwrpb_cpu_present_mask |= (1UL << i);
+ cpu_set(i, cpu_possible_map);
cpu->pal_revision = boot_cpu_palrev;
}
@@ -453,12 +450,12 @@ setup_smp(void)
}
} else {
smp_num_probed = 1;
- hwrpb_cpu_present_mask = (1UL << boot_cpuid);
+ cpu_set(boot_cpuid, cpu_possible_map);
}
cpu_present_mask = cpumask_of_cpu(boot_cpuid);
printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n",
- smp_num_probed, hwrpb_cpu_present_mask);
+ smp_num_probed, cpu_possible_map.bits[0]);
}
/*
@@ -467,8 +464,6 @@ setup_smp(void)
void __init
smp_prepare_cpus(unsigned int max_cpus)
{
- int cpu_count, i;
-
/* Take care of some initial bookkeeping. */
memset(ipi_data, 0, sizeof(ipi_data));
@@ -486,19 +481,7 @@ smp_prepare_cpus(unsigned int max_cpus)
printk(KERN_INFO "SMP starting up secondaries.\n");
- cpu_count = 1;
- for (i = 0; (i < NR_CPUS) && (cpu_count < max_cpus); i++) {
- if (i == boot_cpuid)
- continue;
-
- if (((hwrpb_cpu_present_mask >> i) & 1) == 0)
- continue;
-
- cpu_set(i, cpu_possible_map);
- cpu_count++;
- }
-
- smp_num_cpus = cpu_count;
+ smp_num_cpus = smp_num_probed;
}
void __devinit