~ubuntu-branches/ubuntu/lucid/linux-rt/lucid

« back to all changes in this revision

Viewing changes to arch/mips/kernel/smp-cmp.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-08-05 23:00:52 UTC
  • Revision ID: james.westby@ubuntu.com-20090805230052-7xedvqcyk9dnnxb2
Tags: 2.6.31-1.1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include <linux/kernel.h>
22
22
#include <linux/sched.h>
 
23
#include <linux/smp.h>
23
24
#include <linux/cpumask.h>
24
25
#include <linux/interrupt.h>
25
26
#include <linux/compiler.h>
36
37
#include <asm/mipsregs.h>
37
38
#include <asm/mipsmtregs.h>
38
39
#include <asm/mips_mt.h>
39
 
 
40
 
/*
41
 
 * Crude manipulation of the CPU masks to control which
42
 
 * which CPU's are brought online during initialisation
43
 
 *
44
 
 * Beware... this needs to be called after CPU discovery
45
 
 * but before CPU bringup
46
 
 */
47
 
static int __init allowcpus(char *str)
48
 
{
49
 
        cpumask_t cpu_allow_map;
50
 
        char buf[256];
51
 
        int len;
52
 
 
53
 
        cpus_clear(cpu_allow_map);
54
 
        if (cpulist_parse(str, &cpu_allow_map) == 0) {
55
 
                cpu_set(0, cpu_allow_map);
56
 
                cpus_and(cpu_possible_map, cpu_possible_map, cpu_allow_map);
57
 
                len = cpulist_scnprintf(buf, sizeof(buf)-1, &cpu_possible_map);
58
 
                buf[len] = '\0';
59
 
                pr_debug("Allowable CPUs: %s\n", buf);
60
 
                return 1;
61
 
        } else
62
 
                return 0;
63
 
}
64
 
__setup("allowcpus=", allowcpus);
 
40
#include <asm/amon.h>
 
41
#include <asm/gic.h>
65
42
 
66
43
static void ipi_call_function(unsigned int cpu)
67
44
{
68
 
        unsigned int action = 0;
69
 
 
70
45
        pr_debug("CPU%d: %s cpu %d status %08x\n",
71
46
                 smp_processor_id(), __func__, cpu, read_c0_status());
72
47
 
73
 
        switch (cpu) {
74
 
        case 0:
75
 
                action = GIC_IPI_EXT_INTR_CALLFNC_VPE0;
76
 
                break;
77
 
        case 1:
78
 
                action = GIC_IPI_EXT_INTR_CALLFNC_VPE1;
79
 
                break;
80
 
        case 2:
81
 
                action = GIC_IPI_EXT_INTR_CALLFNC_VPE2;
82
 
                break;
83
 
        case 3:
84
 
                action = GIC_IPI_EXT_INTR_CALLFNC_VPE3;
85
 
                break;
86
 
        }
87
 
        gic_send_ipi(action);
 
48
        gic_send_ipi(plat_ipi_call_int_xlate(cpu));
88
49
}
89
50
 
90
51
 
91
52
static void ipi_resched(unsigned int cpu)
92
53
{
93
 
        unsigned int action = 0;
94
 
 
95
54
        pr_debug("CPU%d: %s cpu %d status %08x\n",
96
55
                 smp_processor_id(), __func__, cpu, read_c0_status());
97
56
 
98
 
        switch (cpu) {
99
 
        case 0:
100
 
                action = GIC_IPI_EXT_INTR_RESCHED_VPE0;
101
 
                break;
102
 
        case 1:
103
 
                action = GIC_IPI_EXT_INTR_RESCHED_VPE1;
104
 
                break;
105
 
        case 2:
106
 
                action = GIC_IPI_EXT_INTR_RESCHED_VPE2;
107
 
                break;
108
 
        case 3:
109
 
                action = GIC_IPI_EXT_INTR_RESCHED_VPE3;
110
 
                break;
111
 
        }
112
 
        gic_send_ipi(action);
 
57
        gic_send_ipi(plat_ipi_resched_int_xlate(cpu));
113
58
}
114
59
 
115
60
/*
205
150
                           (unsigned long)(gp + sizeof(struct thread_info)));
206
151
#endif
207
152
 
208
 
        amon_cpu_start(cpu, pc, sp, gp, a0);
 
153
        amon_cpu_start(cpu, pc, sp, (unsigned long)gp, a0);
209
154
}
210
155
 
211
156
/*