~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to xen/include/asm-i386/apic.h

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef __ASM_APIC_H
2
 
#define __ASM_APIC_H
3
 
 
4
 
#include <linux/config.h>
5
 
#include <asm/ptrace.h>
6
 
#include <asm/apicdef.h>
7
 
#include <asm/system.h>
8
 
 
9
 
#ifdef CONFIG_X86_LOCAL_APIC
10
 
 
11
 
#define APIC_DEBUG 0
12
 
 
13
 
#if APIC_DEBUG
14
 
#define Dprintk(x...) printk(x)
15
 
#else
16
 
#define Dprintk(x...)
17
 
#endif
18
 
 
19
 
/*
20
 
 * Basic functions accessing APICs.
21
 
 */
22
 
 
23
 
static __inline void apic_write(unsigned long reg, unsigned long v)
24
 
{
25
 
        *((volatile unsigned long *)(APIC_BASE+reg)) = v;
26
 
}
27
 
 
28
 
static __inline void apic_write_atomic(unsigned long reg, unsigned long v)
29
 
{
30
 
        xchg((volatile unsigned long *)(APIC_BASE+reg), v);
31
 
}
32
 
 
33
 
static __inline unsigned long apic_read(unsigned long reg)
34
 
{
35
 
        return *((volatile unsigned long *)(APIC_BASE+reg));
36
 
}
37
 
 
38
 
static __inline__ void apic_wait_icr_idle(void)
39
 
{
40
 
        do { } while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY );
41
 
}
42
 
 
43
 
#ifdef CONFIG_X86_GOOD_APIC
44
 
# define FORCE_READ_AROUND_WRITE 0
45
 
# define apic_read_around(x)
46
 
# define apic_write_around(x,y) apic_write((x),(y))
47
 
#else
48
 
# define FORCE_READ_AROUND_WRITE 1
49
 
# define apic_read_around(x) apic_read(x)
50
 
# define apic_write_around(x,y) apic_write_atomic((x),(y))
51
 
#endif
52
 
 
53
 
static inline void ack_APIC_irq(void)
54
 
{
55
 
        /*
56
 
         * ack_APIC_irq() actually gets compiled as a single instruction:
57
 
         * - a single rmw on Pentium/82489DX
58
 
         * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC)
59
 
         * ... yummie.
60
 
         */
61
 
 
62
 
        /* Docs say use 0 for future compatibility */
63
 
        apic_write_around(APIC_EOI, 0);
64
 
}
65
 
 
66
 
extern int get_maxlvt(void);
67
 
extern void connect_bsp_APIC (void);
68
 
extern void disconnect_bsp_APIC (void);
69
 
extern void disable_local_APIC (void);
70
 
extern int verify_local_APIC (void);
71
 
extern void sync_Arb_IDs (void);
72
 
extern void init_bsp_APIC (void);
73
 
extern void setup_local_APIC (void);
74
 
extern void init_apic_mappings (void);
75
 
extern void setup_APIC_clocks (void);
76
 
extern void setup_apic_nmi_watchdog (void);
77
 
extern inline void nmi_watchdog_tick (struct pt_regs * regs);
78
 
extern int APIC_init_uniprocessor (void);
79
 
extern void disable_APIC_timer(void);
80
 
extern void enable_APIC_timer(void);
81
 
 
82
 
//extern struct pm_dev *apic_pm_register(pm_dev_t, unsigned long, pm_callback);
83
 
//extern void apic_pm_unregister(struct pm_dev*);
84
 
 
85
 
extern unsigned int watchdog_on;
86
 
 
87
 
extern unsigned int apic_timer_irqs [NR_CPUS];
88
 
extern int check_nmi_watchdog (void);
89
 
 
90
 
extern unsigned int nmi_watchdog;
91
 
#define NMI_NONE        0
92
 
#define NMI_IO_APIC     1
93
 
#define NMI_LOCAL_APIC  2
94
 
#define NMI_INVALID     3
95
 
 
96
 
#endif /* CONFIG_X86_LOCAL_APIC */
97
 
 
98
 
#endif /* __ASM_APIC_H */