~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/x86/kernel/apic/bigsmp_32.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        return 1;
46
46
}
47
47
 
 
48
static int bigsmp_early_logical_apicid(int cpu)
 
49
{
 
50
        /* on bigsmp, logical apicid is the same as physical */
 
51
        return early_per_cpu(x86_cpu_to_apicid, cpu);
 
52
}
 
53
 
48
54
static inline unsigned long calculate_ldr(int cpu)
49
55
{
50
56
        unsigned long val, id;
80
86
                nr_ioapics);
81
87
}
82
88
 
83
 
static int bigsmp_apicid_to_node(int logical_apicid)
84
 
{
85
 
        return apicid_2_node[hard_smp_processor_id()];
86
 
}
87
 
 
88
89
static int bigsmp_cpu_present_to_apicid(int mps_cpu)
89
90
{
90
91
        if (mps_cpu < nr_cpu_ids)
93
94
        return BAD_APICID;
94
95
}
95
96
 
96
 
/* Mapping from cpu number to logical apicid */
97
 
static inline int bigsmp_cpu_to_logical_apicid(int cpu)
98
 
{
99
 
        if (cpu >= nr_cpu_ids)
100
 
                return BAD_APICID;
101
 
        return cpu_physical_id(cpu);
102
 
}
103
 
 
104
97
static void bigsmp_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
105
98
{
106
99
        /* For clustered we don't have a good way to do this yet - hack */
115
108
/* As we are using single CPU as destination, pick only one CPU here */
116
109
static unsigned int bigsmp_cpu_mask_to_apicid(const struct cpumask *cpumask)
117
110
{
118
 
        return bigsmp_cpu_to_logical_apicid(cpumask_first(cpumask));
 
111
        int cpu = cpumask_first(cpumask);
 
112
 
 
113
        if (cpu < nr_cpu_ids)
 
114
                return cpu_physical_id(cpu);
 
115
        return BAD_APICID;
119
116
}
120
117
 
121
118
static unsigned int bigsmp_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
129
126
         */
130
127
        for_each_cpu_and(cpu, cpumask, andmask) {
131
128
                if (cpumask_test_cpu(cpu, cpu_online_mask))
132
 
                        break;
 
129
                        return cpu_physical_id(cpu);
133
130
        }
134
 
        return bigsmp_cpu_to_logical_apicid(cpu);
 
131
        return BAD_APICID;
135
132
}
136
133
 
137
134
static int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb)
196
193
        return dmi_bigsmp;
197
194
}
198
195
 
199
 
struct apic apic_bigsmp = {
 
196
static struct apic apic_bigsmp = {
200
197
 
201
198
        .name                           = "bigsmp",
202
199
        .probe                          = probe_bigsmp,
219
216
        .ioapic_phys_id_map             = bigsmp_ioapic_phys_id_map,
220
217
        .setup_apic_routing             = bigsmp_setup_apic_routing,
221
218
        .multi_timer_check              = NULL,
222
 
        .apicid_to_node                 = bigsmp_apicid_to_node,
223
 
        .cpu_to_logical_apicid          = bigsmp_cpu_to_logical_apicid,
224
219
        .cpu_present_to_apicid          = bigsmp_cpu_present_to_apicid,
225
220
        .apicid_to_cpu_present          = physid_set_mask_of_physid,
226
221
        .setup_portio_remap             = NULL,
256
251
        .icr_write                      = native_apic_icr_write,
257
252
        .wait_icr_idle                  = native_apic_wait_icr_idle,
258
253
        .safe_wait_icr_idle             = native_safe_apic_wait_icr_idle,
 
254
 
 
255
        .x86_32_early_logical_apicid    = bigsmp_early_logical_apicid,
259
256
};
 
257
 
 
258
struct apic * __init generic_bigsmp_probe(void)
 
259
{
 
260
        if (probe_bigsmp())
 
261
                return &apic_bigsmp;
 
262
 
 
263
        return NULL;
 
264
}
 
265
 
 
266
apic_driver(apic_bigsmp);