Commit e54f8548 authored by Sam Ravnborg's avatar Sam Ravnborg Committed by David S. Miller

sparc32,sun4d: irq, smp files cleanup

- drop filename in file header
- drop unused includes
- add description of sun4d interrupts (from davem)
- add KERN_* to printk
- fix spaces => tabs
- add spaces after reserved words
- fix indent of a whole code block in smp4d_boot_one_cpu()
  Note: two printk() was updated from debug to KERN_INFO in this code block
- drop all externs, they are now in header files

This is partly based on a patch from: David Miller <davem@davemloft.net>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aba20a82
/* /*
* arch/sparc/kernel/sun4d_irq.c:
* SS1000/SC2000 interrupt handling. * SS1000/SC2000 interrupt handling.
* *
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
* Heavily based on arch/sparc/kernel/irq.c. * Heavily based on arch/sparc/kernel/irq.c.
*/ */
#include <linux/errno.h>
#include <linux/linkage.h>
#include <linux/kernel_stat.h> #include <linux/kernel_stat.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/ptrace.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/random.h>
#include <linux/init.h>
#include <linux/smp.h>
#include <linux/spinlock.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <asm/ptrace.h>
#include <asm/processor.h>
#include <asm/system.h>
#include <asm/psr.h>
#include <asm/smp.h>
#include <asm/vaddrs.h>
#include <asm/timer.h> #include <asm/timer.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
#include <asm/traps.h> #include <asm/traps.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/sbi.h> #include <asm/sbi.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/irq_regs.h>
#include "kernel.h" #include "kernel.h"
#include "irq.h" #include "irq.h"
/* If you trust current SCSI layer to handle different SCSI IRQs, enable this. I don't trust it... -jj */ /* Sun4d interrupts fall roughly into two categories. SBUS and
* cpu local. CPU local interrupts cover the timer interrupts
* and whatnot, and we encode those as normal PILs between
* 0 and 15.
*
* SBUS interrupts are encoded integers including the board number
* (plus one), the SBUS level, and the SBUS slot number. Sun4D
* IRQ dispatch is done by:
*
* 1) Reading the BW local interrupt table in order to get the bus
* interrupt mask.
*
* This table is indexed by SBUS interrupt level which can be
* derived from the PIL we got interrupted on.
*
* 2) For each bus showing interrupt pending from #1, read the
* SBI interrupt state register. This will indicate which slots
* have interrupts pending for that SBUS interrupt level.
*/
/*
* If you trust current SCSI layer to handle different
* SCSI IRQs, enable this.
* I don't trust it... -jj
*/
/* #define DISTRIBUTE_IRQS */ /* #define DISTRIBUTE_IRQS */
struct sun4d_timer_regs { struct sun4d_timer_regs {
...@@ -59,11 +58,9 @@ static struct sun4d_timer_regs __iomem *sun4d_timers; ...@@ -59,11 +58,9 @@ static struct sun4d_timer_regs __iomem *sun4d_timers;
#define TIMER_IRQ 10 #define TIMER_IRQ 10
#define MAX_STATIC_ALLOC 4 #define MAX_STATIC_ALLOC 4
extern int static_irq_count;
static unsigned char sbus_tid[32]; static unsigned char sbus_tid[32];
static struct irqaction *irq_action[NR_IRQS]; static struct irqaction *irq_action[NR_IRQS];
extern spinlock_t irq_action_lock;
static struct sbus_action { static struct sbus_action {
struct irqaction *action; struct irqaction *action;
...@@ -71,11 +68,33 @@ static struct sbus_action { ...@@ -71,11 +68,33 @@ static struct sbus_action {
} *sbus_actions; } *sbus_actions;
static int pil_to_sbus[] = { static int pil_to_sbus[] = {
0, 0, 1, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 0, 0,
0,
1,
2,
0,
3,
0,
4,
0,
5,
0,
6,
0,
7,
0,
0,
}; };
static int sbus_to_pil[] = { static int sbus_to_pil[] = {
0, 2, 3, 5, 7, 9, 11, 13, 0,
2,
3,
5,
7,
9,
11,
13,
}; };
static int nsbi; static int nsbi;
...@@ -86,7 +105,7 @@ DEFINE_SPINLOCK(sun4d_imsk_lock); ...@@ -86,7 +105,7 @@ DEFINE_SPINLOCK(sun4d_imsk_lock);
int show_sun4d_interrupts(struct seq_file *p, void *v) int show_sun4d_interrupts(struct seq_file *p, void *v)
{ {
int i = *(loff_t *) v, j = 0, k = 0, sbusl; int i = *(loff_t *) v, j = 0, k = 0, sbusl;
struct irqaction * action; struct irqaction *action;
unsigned long flags; unsigned long flags;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
int x; int x;
...@@ -102,7 +121,8 @@ int show_sun4d_interrupts(struct seq_file *p, void *v) ...@@ -102,7 +121,8 @@ int show_sun4d_interrupts(struct seq_file *p, void *v)
} else { } else {
for (j = 0; j < nsbi; j++) { for (j = 0; j < nsbi; j++) {
for (k = 0; k < 4; k++) for (k = 0; k < 4; k++)
if ((action = sbus_actions [(j << 5) + (sbusl << 2) + k].action)) action = sbus_actions[(j << 5) + (sbusl << 2) + k].action;
if (action)
goto found_it; goto found_it;
} }
goto out_unlock; goto out_unlock;
...@@ -125,15 +145,17 @@ found_it: seq_printf(p, "%3d: ", i); ...@@ -125,15 +145,17 @@ found_it: seq_printf(p, "%3d: ", i);
(action->flags & IRQF_DISABLED) ? " +" : "", (action->flags & IRQF_DISABLED) ? " +" : "",
action->name); action->name);
} }
if (!sbusl) break; if (!sbusl)
break;
k++; k++;
if (k < 4) if (k < 4) {
action = sbus_actions [(j << 5) + (sbusl << 2) + k].action; action = sbus_actions[(j << 5) + (sbusl << 2) + k].action;
else { } else {
j++; j++;
if (j == nsbi) break; if (j == nsbi)
break;
k = 0; k = 0;
action = sbus_actions [(j << 5) + (sbusl << 2)].action; action = sbus_actions[(j << 5) + (sbusl << 2)].action;
} }
} }
seq_putc(p, '\n'); seq_putc(p, '\n');
...@@ -156,7 +178,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id) ...@@ -156,7 +178,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id)
actionp = &(sbus_actions[irq - (1 << 5)].action); actionp = &(sbus_actions[irq - (1 << 5)].action);
action = *actionp; action = *actionp;
if (!action) { if (!action) {
printk("Trying to free free IRQ%d\n",irq); printk(KERN_ERR "Trying to free free IRQ%d\n", irq);
goto out_unlock; goto out_unlock;
} }
if (dev_id) { if (dev_id) {
...@@ -166,19 +188,21 @@ void sun4d_free_irq(unsigned int irq, void *dev_id) ...@@ -166,19 +188,21 @@ void sun4d_free_irq(unsigned int irq, void *dev_id)
tmp = action; tmp = action;
} }
if (!action) { if (!action) {
printk("Trying to free free shared IRQ%d\n",irq); printk(KERN_ERR "Trying to free free shared IRQ%d\n",
irq);
goto out_unlock; goto out_unlock;
} }
} else if (action->flags & IRQF_SHARED) { } else if (action->flags & IRQF_SHARED) {
printk("Trying to free shared IRQ%d with NULL device ID\n", irq); printk(KERN_ERR "Trying to free shared IRQ%d with NULL device ID\n",
irq);
goto out_unlock; goto out_unlock;
} }
if (action->flags & SA_STATIC_ALLOC) if (action->flags & SA_STATIC_ALLOC) {
{ /*
/* This interrupt is marked as specially allocated * This interrupt is marked as specially allocated
* so it is a bad idea to free it. * so it is a bad idea to free it.
*/ */
printk("Attempt to free statically allocated IRQ%d (%s)\n", printk(KERN_ERR "Attempt to free statically allocated IRQ%d (%s)\n",
irq, action->name); irq, action->name);
goto out_unlock; goto out_unlock;
} }
...@@ -203,12 +227,10 @@ void sun4d_free_irq(unsigned int irq, void *dev_id) ...@@ -203,12 +227,10 @@ void sun4d_free_irq(unsigned int irq, void *dev_id)
spin_unlock_irqrestore(&irq_action_lock, flags); spin_unlock_irqrestore(&irq_action_lock, flags);
} }
extern void unexpected_irq(int, void *, struct pt_regs *); void sun4d_handler_irq(int pil, struct pt_regs *regs)
void sun4d_handler_irq(int pil, struct pt_regs * regs)
{ {
struct pt_regs *old_regs; struct pt_regs *old_regs;
struct irqaction * action; struct irqaction *action;
int cpu = smp_processor_id(); int cpu = smp_processor_id();
/* SBUS IRQ level (1 - 7) */ /* SBUS IRQ level (1 - 7) */
int sbusl = pil_to_sbus[pil]; int sbusl = pil_to_sbus[pil];
...@@ -266,13 +288,13 @@ void sun4d_handler_irq(int pil, struct pt_regs * regs) ...@@ -266,13 +288,13 @@ void sun4d_handler_irq(int pil, struct pt_regs * regs)
int sun4d_request_irq(unsigned int irq, int sun4d_request_irq(unsigned int irq,
irq_handler_t handler, irq_handler_t handler,
unsigned long irqflags, const char * devname, void *dev_id) unsigned long irqflags, const char *devname, void *dev_id)
{ {
struct irqaction *action, *tmp = NULL, **actionp; struct irqaction *action, *tmp = NULL, **actionp;
unsigned long flags; unsigned long flags;
int ret; int ret;
if(irq > 14 && irq < (1 << 5)) { if (irq > 14 && irq < (1 << 5)) {
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
...@@ -298,7 +320,8 @@ int sun4d_request_irq(unsigned int irq, ...@@ -298,7 +320,8 @@ int sun4d_request_irq(unsigned int irq,
goto out_unlock; goto out_unlock;
} }
if ((action->flags & IRQF_DISABLED) ^ (irqflags & IRQF_DISABLED)) { if ((action->flags & IRQF_DISABLED) ^ (irqflags & IRQF_DISABLED)) {
printk("Attempt to mix fast and slow interrupts on IRQ%d denied\n", irq); printk(KERN_ERR "Attempt to mix fast and slow interrupts on IRQ%d denied\n",
irq);
ret = -EBUSY; ret = -EBUSY;
goto out_unlock; goto out_unlock;
} }
...@@ -312,12 +335,12 @@ int sun4d_request_irq(unsigned int irq, ...@@ -312,12 +335,12 @@ int sun4d_request_irq(unsigned int irq,
if (static_irq_count < MAX_STATIC_ALLOC) if (static_irq_count < MAX_STATIC_ALLOC)
action = &static_irqaction[static_irq_count++]; action = &static_irqaction[static_irq_count++];
else else
printk("Request for IRQ%d (%s) SA_STATIC_ALLOC failed using kmalloc\n", irq, devname); printk(KERN_ERR "Request for IRQ%d (%s) SA_STATIC_ALLOC failed using kmalloc\n",
irq, devname);
} }
if (action == NULL) if (action == NULL)
action = kmalloc(sizeof(struct irqaction), action = kmalloc(sizeof(struct irqaction), GFP_ATOMIC);
GFP_ATOMIC);
if (!action) { if (!action) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -423,7 +446,8 @@ void __init sun4d_distribute_irqs(void) ...@@ -423,7 +446,8 @@ void __init sun4d_distribute_irqs(void)
for_each_node_by_name(dp, "sbi") { for_each_node_by_name(dp, "sbi") {
int devid = of_getintprop_default(dp, "device-id", 0); int devid = of_getintprop_default(dp, "device-id", 0);
int board = of_getintprop_default(dp, "board#", 0); int board = of_getintprop_default(dp, "board#", 0);
printk("sbus%d IRQs directed to CPU%d\n", board, sbus_tid[board]); printk(KERN_ERR "sbus%d IRQs directed to CPU%d\n",
board, sbus_tid[board]);
set_sbi_tid(devid, sbus_tid[board] << 3); set_sbi_tid(devid, sbus_tid[board] << 3);
} }
#else #else
...@@ -437,7 +461,7 @@ void __init sun4d_distribute_irqs(void) ...@@ -437,7 +461,7 @@ void __init sun4d_distribute_irqs(void)
sbus_tid[board] = cpuid; sbus_tid[board] = cpuid;
set_sbi_tid(devid, cpuid << 3); set_sbi_tid(devid, cpuid << 3);
} }
printk("All sbus IRQs directed to CPU%d\n", cpuid); printk(KERN_ERR "All sbus IRQs directed to CPU%d\n", cpuid);
#endif #endif
} }
#endif #endif
...@@ -466,10 +490,7 @@ static void __init sun4d_fixup_trap_table(void) ...@@ -466,10 +490,7 @@ static void __init sun4d_fixup_trap_table(void)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
unsigned long flags; unsigned long flags;
extern unsigned long lvl14_save[4];
struct tt_entry *trap_table = &sparc_ttable[SP_TRAP_IRQ1 + (14 - 1)]; struct tt_entry *trap_table = &sparc_ttable[SP_TRAP_IRQ1 + (14 - 1)];
extern unsigned int real_irq_entry[], smp4d_ticker[];
extern unsigned int patchme_maybe_smp_msg[];
/* Adjust so that we jump directly to smp4d_ticker */ /* Adjust so that we jump directly to smp4d_ticker */
lvl14_save[2] += smp4d_ticker - real_irq_entry; lvl14_save[2] += smp4d_ticker - real_irq_entry;
...@@ -531,7 +552,8 @@ static void __init sun4d_init_timers(irq_handler_t counter_fn) ...@@ -531,7 +552,8 @@ static void __init sun4d_init_timers(irq_handler_t counter_fn)
(IRQF_DISABLED | SA_STATIC_ALLOC), (IRQF_DISABLED | SA_STATIC_ALLOC),
"timer", NULL); "timer", NULL);
if (err) { if (err) {
prom_printf("sun4d_init_timers: request_irq() failed with %d\n", err); prom_printf("sun4d_init_timers: request_irq() failed with %d\n",
err);
prom_halt(); prom_halt();
} }
sun4d_load_profile_irqs(); sun4d_load_profile_irqs();
...@@ -550,7 +572,7 @@ void __init sun4d_init_sbi_irq(void) ...@@ -550,7 +572,7 @@ void __init sun4d_init_sbi_irq(void)
nsbi = 0; nsbi = 0;
for_each_node_by_name(dp, "sbi") for_each_node_by_name(dp, "sbi")
nsbi++; nsbi++;
sbus_actions = kzalloc (nsbi * 8 * 4 * sizeof(struct sbus_action), GFP_ATOMIC); sbus_actions = kzalloc(nsbi * 8 * 4 * sizeof(struct sbus_action), GFP_ATOMIC);
if (!sbus_actions) { if (!sbus_actions) {
prom_printf("SUN4D: Cannot allocate sbus_actions, halting.\n"); prom_printf("SUN4D: Cannot allocate sbus_actions, halting.\n");
prom_halt(); prom_halt();
...@@ -566,7 +588,8 @@ void __init sun4d_init_sbi_irq(void) ...@@ -566,7 +588,8 @@ void __init sun4d_init_sbi_irq(void)
/* Get rid of pending irqs from PROM */ /* Get rid of pending irqs from PROM */
mask = acquire_sbi(devid, 0xffffffff); mask = acquire_sbi(devid, 0xffffffff);
if (mask) { if (mask) {
printk ("Clearing pending IRQs %08x on SBI %d\n", mask, board); printk(KERN_ERR "Clearing pending IRQs %08x on SBI %d\n",
mask, board);
release_sbi(devid, mask); release_sbi(devid, mask);
} }
} }
......
/* sun4d_smp.c: Sparc SS1000/SC2000 SMP support. /* Sparc SS1000/SC2000 SMP support.
* *
* Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
* *
...@@ -6,59 +6,23 @@ ...@@ -6,59 +6,23 @@
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
*/ */
#include <asm/head.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/threads.h>
#include <linux/smp.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/kernel_stat.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/profile.h> #include <linux/profile.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <asm/ptrace.h>
#include <asm/atomic.h>
#include <asm/irq_regs.h>
#include <asm/irq.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/sbi.h> #include <asm/sbi.h>
#include <asm/mmu.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/cpudata.h>
#include "kernel.h"
#include "irq.h" #include "irq.h"
#define IRQ_CROSS_CALL 15
extern ctxd_t *srmmu_ctx_table_phys; #define IRQ_CROSS_CALL 15
static volatile int smp_processors_ready = 0; static volatile int smp_processors_ready;
static int smp_highest_cpu; static int smp_highest_cpu;
extern volatile unsigned long cpu_callin_map[NR_CPUS];
extern cpuinfo_sparc cpu_data[NR_CPUS];
extern unsigned char boot_cpu_id;
extern volatile int smp_process_available;
extern cpumask_t smp_commenced_mask;
extern int __smp4d_processor_id(void);
/* #define SMP_DEBUG */
#ifdef SMP_DEBUG
#define SMP_PRINTK(x) printk x
#else
#define SMP_PRINTK(x)
#endif
static inline unsigned long sun4d_swap(volatile unsigned long *ptr, unsigned long val) static inline unsigned long sun4d_swap(volatile unsigned long *ptr, unsigned long val)
{ {
...@@ -69,8 +33,6 @@ static inline unsigned long sun4d_swap(volatile unsigned long *ptr, unsigned lon ...@@ -69,8 +33,6 @@ static inline unsigned long sun4d_swap(volatile unsigned long *ptr, unsigned lon
} }
static void smp_setup_percpu_timer(void); static void smp_setup_percpu_timer(void);
extern void cpu_probe(void);
extern void sun4d_distribute_irqs(void);
static unsigned char cpu_leds[32]; static unsigned char cpu_leds[32];
...@@ -86,7 +48,6 @@ static inline void show_leds(int cpuid) ...@@ -86,7 +48,6 @@ static inline void show_leds(int cpuid)
void __cpuinit smp4d_callin(void) void __cpuinit smp4d_callin(void)
{ {
int cpuid = hard_smp4d_processor_id(); int cpuid = hard_smp4d_processor_id();
extern spinlock_t sun4d_imsk_lock;
unsigned long flags; unsigned long flags;
/* Show we are alive */ /* Show we are alive */
...@@ -121,10 +82,10 @@ void __cpuinit smp4d_callin(void) ...@@ -121,10 +82,10 @@ void __cpuinit smp4d_callin(void)
cpu_probe(); cpu_probe();
while((unsigned long)current_set[cpuid] < PAGE_OFFSET) while ((unsigned long)current_set[cpuid] < PAGE_OFFSET)
barrier(); barrier();
while(current_set[cpuid]->cpu != cpuid) while (current_set[cpuid]->cpu != cpuid)
barrier(); barrier();
/* Fix idle thread fields. */ /* Fix idle thread fields. */
...@@ -154,15 +115,9 @@ void __cpuinit smp4d_callin(void) ...@@ -154,15 +115,9 @@ void __cpuinit smp4d_callin(void)
} }
extern void init_IRQ(void);
extern void cpu_panic(void);
/* /*
* Cycle through the processors asking the PROM to start each one. * Cycle through the processors asking the PROM to start each one.
*/ */
extern struct linux_prom_registers smp_penguin_ctable;
void __init smp4d_boot_cpus(void) void __init smp4d_boot_cpus(void)
{ {
if (boot_cpu_id) if (boot_cpu_id)
...@@ -173,13 +128,12 @@ void __init smp4d_boot_cpus(void) ...@@ -173,13 +128,12 @@ void __init smp4d_boot_cpus(void)
int __cpuinit smp4d_boot_one_cpu(int i) int __cpuinit smp4d_boot_one_cpu(int i)
{ {
extern unsigned long sun4d_cpu_startup;
unsigned long *entry = &sun4d_cpu_startup; unsigned long *entry = &sun4d_cpu_startup;
struct task_struct *p; struct task_struct *p;
int timeout; int timeout;
int cpu_node; int cpu_node;
cpu_find_by_instance(i, &cpu_node,NULL); cpu_find_by_instance(i, &cpu_node, NULL);
/* Cook up an idler for this guy. */ /* Cook up an idler for this guy. */
p = fork_idle(i); p = fork_idle(i);
current_set[i] = task_thread_info(p); current_set[i] = task_thread_info(p);
...@@ -194,22 +148,22 @@ int __cpuinit smp4d_boot_one_cpu(int i) ...@@ -194,22 +148,22 @@ int __cpuinit smp4d_boot_one_cpu(int i)
smp_penguin_ctable.reg_size = 0; smp_penguin_ctable.reg_size = 0;
/* whirrr, whirrr, whirrrrrrrrr... */ /* whirrr, whirrr, whirrrrrrrrr... */
SMP_PRINTK(("Starting CPU %d at %p\n", i, entry)); printk(KERN_INFO "Starting CPU %d at %p\n", i, entry);
local_flush_cache_all(); local_flush_cache_all();
prom_startcpu(cpu_node, prom_startcpu(cpu_node,
&smp_penguin_ctable, 0, (char *)entry); &smp_penguin_ctable, 0, (char *)entry);
SMP_PRINTK(("prom_startcpu returned :)\n")); printk(KERN_INFO "prom_startcpu returned :)\n");
/* wheee... it's going... */ /* wheee... it's going... */
for(timeout = 0; timeout < 10000; timeout++) { for (timeout = 0; timeout < 10000; timeout++) {
if(cpu_callin_map[i]) if (cpu_callin_map[i])
break; break;
udelay(200); udelay(200);
} }
if (!(cpu_callin_map[i])) { if (!(cpu_callin_map[i])) {
printk("Processor %d is stuck.\n", i); printk(KERN_ERR "Processor %d is stuck.\n", i);
return -ENODEV; return -ENODEV;
} }
...@@ -255,14 +209,17 @@ static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, ...@@ -255,14 +209,17 @@ static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
unsigned long arg2, unsigned long arg3, unsigned long arg2, unsigned long arg3,
unsigned long arg4) unsigned long arg4)
{ {
if(smp_processors_ready) { if (smp_processors_ready) {
register int high = smp_highest_cpu; register int high = smp_highest_cpu;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&cross_call_lock, flags); spin_lock_irqsave(&cross_call_lock, flags);
{ {
/* If you make changes here, make sure gcc generates proper code... */ /*
* If you make changes here, make sure
* gcc generates proper code...
*/
register smpfunc_t f asm("i0") = func; register smpfunc_t f asm("i0") = func;
register unsigned long a1 asm("i1") = arg1; register unsigned long a1 asm("i1") = arg1;
register unsigned long a2 asm("i2") = arg2; register unsigned long a2 asm("i2") = arg2;
...@@ -284,7 +241,7 @@ static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, ...@@ -284,7 +241,7 @@ static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
cpu_clear(smp_processor_id(), mask); cpu_clear(smp_processor_id(), mask);
cpus_and(mask, cpu_online_map, mask); cpus_and(mask, cpu_online_map, mask);
for(i = 0; i <= high; i++) { for (i = 0; i <= high; i++) {
if (cpu_isset(i, mask)) { if (cpu_isset(i, mask)) {
ccall_info.processors_in[i] = 0; ccall_info.processors_in[i] = 0;
ccall_info.processors_out[i] = 0; ccall_info.processors_out[i] = 0;
...@@ -300,17 +257,17 @@ static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, ...@@ -300,17 +257,17 @@ static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
do { do {
if (!cpu_isset(i, mask)) if (!cpu_isset(i, mask))
continue; continue;
while(!ccall_info.processors_in[i]) while (!ccall_info.processors_in[i])
barrier(); barrier();
} while(++i <= high); } while (++i <= high);
i = 0; i = 0;
do { do {
if (!cpu_isset(i, mask)) if (!cpu_isset(i, mask))
continue; continue;
while(!ccall_info.processors_out[i]) while (!ccall_info.processors_out[i])
barrier(); barrier();
} while(++i <= high); } while (++i <= high);
} }
spin_unlock_irqrestore(&cross_call_lock, flags); spin_unlock_irqrestore(&cross_call_lock, flags);
...@@ -349,7 +306,7 @@ void smp4d_percpu_timer_interrupt(struct pt_regs *regs) ...@@ -349,7 +306,7 @@ void smp4d_percpu_timer_interrupt(struct pt_regs *regs)
profile_tick(CPU_PROFILING); profile_tick(CPU_PROFILING);
if(!--prof_counter(cpu)) { if (!--prof_counter(cpu)) {
int user = user_mode(regs); int user = user_mode(regs);
irq_enter(); irq_enter();
...@@ -361,8 +318,6 @@ void smp4d_percpu_timer_interrupt(struct pt_regs *regs) ...@@ -361,8 +318,6 @@ void smp4d_percpu_timer_interrupt(struct pt_regs *regs)
set_irq_regs(old_regs); set_irq_regs(old_regs);
} }
extern unsigned int lvl14_resolution;
static void __cpuinit smp_setup_percpu_timer(void) static void __cpuinit smp_setup_percpu_timer(void)
{ {
int cpu = hard_smp4d_processor_id(); int cpu = hard_smp4d_processor_id();
...@@ -392,7 +347,6 @@ void __init smp4d_blackbox_current(unsigned *addr) ...@@ -392,7 +347,6 @@ void __init smp4d_blackbox_current(unsigned *addr)
void __init sun4d_init_smp(void) void __init sun4d_init_smp(void)
{ {
int i; int i;
extern unsigned int t_nmi[], linux_trap_ipi15_sun4d[], linux_trap_ipi15_sun4m[];
/* Patch ipi15 trap table */ /* Patch ipi15 trap table */
t_nmi[1] = t_nmi[1] + (linux_trap_ipi15_sun4d - linux_trap_ipi15_sun4m); t_nmi[1] = t_nmi[1] + (linux_trap_ipi15_sun4d - linux_trap_ipi15_sun4m);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment