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

« back to all changes in this revision

Viewing changes to arch/x86/include/asm/apic.h

  • 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:
2
2
#define _ASM_X86_APIC_H
3
3
 
4
4
#include <linux/cpumask.h>
5
 
#include <linux/delay.h>
6
5
#include <linux/pm.h>
7
6
 
8
7
#include <asm/alternative.h>
220
219
 
221
220
extern int get_physical_broadcast(void);
222
221
 
223
 
extern void apic_disable(void);
224
222
extern int lapic_get_maxlvt(void);
225
223
extern void clear_local_APIC(void);
226
224
extern void connect_bsp_APIC(void);
228
226
extern void disable_local_APIC(void);
229
227
extern void lapic_shutdown(void);
230
228
extern int verify_local_APIC(void);
231
 
extern void cache_APIC_registers(void);
232
229
extern void sync_Arb_IDs(void);
233
230
extern void init_bsp_APIC(void);
234
231
extern void setup_local_APIC(void);
239
236
extern void setup_boot_APIC_clock(void);
240
237
extern void setup_secondary_APIC_clock(void);
241
238
extern int APIC_init_uniprocessor(void);
242
 
extern void enable_NMI_through_LVT0(void);
243
 
extern int apic_force_enable(void);
 
239
extern int apic_force_enable(unsigned long addr);
244
240
 
245
241
/*
246
242
 * On 32bit this is mach-xxx local
261
257
#define local_apic_timer_c2_ok          1
262
258
static inline void init_apic_mappings(void) { }
263
259
static inline void disable_local_APIC(void) { }
264
 
static inline void apic_disable(void) { }
265
260
# define setup_boot_APIC_clock x86_init_noop
266
261
# define setup_secondary_APIC_clock x86_init_noop
267
262
#endif /* !CONFIG_X86_LOCAL_APIC */
307
302
 
308
303
        void (*setup_apic_routing)(void);
309
304
        int (*multi_timer_check)(int apic, int irq);
310
 
        int (*apicid_to_node)(int logical_apicid);
311
 
        int (*cpu_to_logical_apicid)(int cpu);
312
305
        int (*cpu_present_to_apicid)(int mps_cpu);
313
306
        void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap);
314
307
        void (*setup_portio_remap)(void);
356
349
        void (*icr_write)(u32 low, u32 high);
357
350
        void (*wait_icr_idle)(void);
358
351
        u32 (*safe_wait_icr_idle)(void);
 
352
 
 
353
#ifdef CONFIG_X86_32
 
354
        /*
 
355
         * Called very early during boot from get_smp_config().  It should
 
356
         * return the logical apicid.  x86_[bios]_cpu_to_apicid is
 
357
         * initialized before this function is called.
 
358
         *
 
359
         * If logical apicid can't be determined that early, the function
 
360
         * may return BAD_APICID.  Logical apicid will be configured after
 
361
         * init_apic_ldr() while bringing up CPUs.  Note that NUMA affinity
 
362
         * won't be applied properly during early boot in this case.
 
363
         */
 
364
        int (*x86_32_early_logical_apicid)(int cpu);
 
365
 
 
366
        /*
 
367
         * Optional method called from setup_local_APIC() after logical
 
368
         * apicid is guaranteed to be known to initialize apicid -> node
 
369
         * mapping if NUMA initialization hasn't done so already.  Don't
 
370
         * add new users.
 
371
         */
 
372
        int (*x86_32_numa_cpu_node)(int cpu);
 
373
#endif
359
374
};
360
375
 
361
376
/*
366
381
extern struct apic *apic;
367
382
 
368
383
/*
 
384
 * APIC drivers are probed based on how they are listed in the .apicdrivers
 
385
 * section. So the order is important and enforced by the ordering
 
386
 * of different apic driver files in the Makefile.
 
387
 *
 
388
 * For the files having two apic drivers, we use apic_drivers()
 
389
 * to enforce the order with in them.
 
390
 */
 
391
#define apic_driver(sym)                                        \
 
392
        static struct apic *__apicdrivers_##sym __used          \
 
393
        __aligned(sizeof(struct apic *))                        \
 
394
        __section(.apicdrivers) = { &sym }
 
395
 
 
396
#define apic_drivers(sym1, sym2)                                        \
 
397
        static struct apic *__apicdrivers_##sym1##sym2[2] __used        \
 
398
        __aligned(sizeof(struct apic *))                                \
 
399
        __section(.apicdrivers) = { &sym1, &sym2 }
 
400
 
 
401
extern struct apic *__apicdrivers[], *__apicdrivers_end[];
 
402
 
 
403
/*
369
404
 * APIC functionality to boot other CPUs - only used on SMP:
370
405
 */
371
406
#ifdef CONFIG_SMP
443
478
#define DEFAULT_TRAMPOLINE_PHYS_HIGH            0x469
444
479
 
445
480
#ifdef CONFIG_X86_64
446
 
extern struct apic apic_flat;
447
 
extern struct apic apic_physflat;
448
 
extern struct apic apic_x2apic_cluster;
449
 
extern struct apic apic_x2apic_phys;
450
481
extern int default_acpi_madt_oem_check(char *, char *);
451
482
 
452
483
extern void apic_send_IPI_self(int vector);
453
484
 
454
 
extern struct apic apic_x2apic_uv_x;
455
485
DECLARE_PER_CPU(int, x2apic_extra_bits);
456
486
 
457
487
extern int default_cpu_present_to_apicid(int mps_cpu);
465
495
        return;
466
496
}
467
497
 
468
 
extern void generic_bigsmp_probe(void);
 
498
extern struct apic *generic_bigsmp_probe(void);
469
499
 
470
500
 
471
501
#ifdef CONFIG_X86_LOCAL_APIC
501
531
 
502
532
#ifdef CONFIG_X86_32
503
533
 
504
 
extern struct apic apic_default;
 
534
static inline int noop_x86_32_early_logical_apicid(int cpu)
 
535
{
 
536
        return BAD_APICID;
 
537
}
505
538
 
506
539
/*
507
540
 * Set up the logical destination ID.
522
555
        return cpuid_apic >> index_msb;
523
556
}
524
557
 
525
 
extern int default_apicid_to_node(int logical_apicid);
526
 
 
527
558
#endif
528
559
 
529
560
static inline unsigned int
558
589
        *retmap = *phys_map;
559
590
}
560
591
 
561
 
/* Mapping from cpu number to logical apicid */
562
 
static inline int default_cpu_to_logical_apicid(int cpu)
563
 
{
564
 
        return 1 << cpu;
565
 
}
566
 
 
567
592
static inline int __default_cpu_present_to_apicid(int mps_cpu)
568
593
{
569
594
        if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu))
596
621
 
597
622
#endif /* CONFIG_X86_LOCAL_APIC */
598
623
 
599
 
#ifdef CONFIG_X86_32
600
 
extern u8 cpu_2_logical_apicid[NR_CPUS];
601
 
#endif
602
 
 
603
624
#endif /* _ASM_X86_APIC_H */