Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / include / arch-x86_64 / apic.h
1 #ifndef __ASM_APIC_H
2 #define __ASM_APIC_H
3
4 #include <lwk/init.h>
5 #include <arch/fixmap.h>
6 #include <arch/apicdef.h>
7 #include <arch/system.h>
8
9 /*
10  * Debugging macros
11  */
12 #define APIC_QUIET   0
13 #define APIC_VERBOSE 1
14 #define APIC_DEBUG   2
15
16 extern int apic_verbosity;
17 extern int apic_runs_main_timer;
18
19 extern unsigned long lapic_phys_addr;
20
21 /*
22  * Define the default level of output to be very little
23  * This can be turned up by using apic=verbose for more
24  * information and apic=debug for _lots_ of information.
25  * apic_verbosity is defined in apic.c
26  */
27 #define apic_printk(v, s, a...) do {       \
28                 if ((v) <= apic_verbosity) \
29                         printk(s, ##a);    \
30         } while (0)
31
32 struct pt_regs;
33
34 /*
35  * Basic functions accessing APICs.
36  */
37
38 static __inline void apic_write(unsigned long reg, uint32_t val)
39 {
40         *((volatile uint32_t *)(APIC_BASE+reg)) = val;
41 }
42
43 static __inline uint32_t apic_read(unsigned long reg)
44 {
45         return *((volatile uint32_t *)(APIC_BASE+reg));
46 }
47
48 static inline void lapic_ack_interrupt(void)
49 {
50         /*
51          * This gets compiled to a single instruction:
52          *      movl   $0x0,0xffffffffffdfe0b0
53          *
54          * Docs say use 0 for future compatibility.
55          */
56         apic_write(APIC_EOI, 0);
57 }
58
59 extern void clear_local_APIC (void);
60 extern void connect_bsp_APIC (void);
61 extern void disconnect_bsp_APIC (int virt_wire_setup);
62 extern void disable_local_APIC (void);
63 extern int verify_local_APIC (void);
64 extern void cache_APIC_registers (void);
65 extern void sync_Arb_IDs (void);
66 extern void init_bsp_APIC (void);
67 extern void setup_local_APIC (void);
68 extern void init_apic_mappings (void);
69 extern void smp_local_timer_interrupt (struct pt_regs * regs);
70 extern void setup_boot_APIC_clock (void);
71 extern void setup_secondary_APIC_clock (void);
72 extern void setup_apic_nmi_watchdog (void);
73 extern int reserve_lapic_nmi(void);
74 extern void release_lapic_nmi(void);
75 extern void disable_timer_nmi_watchdog(void);
76 extern void enable_timer_nmi_watchdog(void);
77 extern void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
78 extern int APIC_init_uniprocessor (void);
79 extern void disable_APIC_timer(void);
80 extern void enable_APIC_timer(void);
81 extern void clustered_apic_check(void);
82
83 extern void nmi_watchdog_default(void);
84 extern int setup_nmi_watchdog(char *);
85
86 extern unsigned int nmi_watchdog;
87 #define NMI_DEFAULT     -1
88 #define NMI_NONE        0
89 #define NMI_IO_APIC     1
90 #define NMI_LOCAL_APIC  2
91 #define NMI_INVALID     3
92
93 extern int disable_timer_pin_1;
94
95 extern void setup_threshold_lvt(unsigned long lvt_off);
96
97 void smp_send_timer_broadcast_ipi(void);
98 void switch_APIC_timer_to_ipi(void *cpumask);
99 void switch_ipi_to_APIC_timer(void *cpumask);
100
101 #define ARCH_APICTIMER_STOPS_ON_C3      1
102
103 extern unsigned boot_cpu_id;
104
105 extern void __init lapic_map(void);
106 extern void __init lapic_init(void);
107 extern void lapic_set_timer(uint32_t count);
108 extern unsigned int lapic_calibrate_timer(void);
109 extern void lapic_dump(void);
110 extern void lapic_send_init_ipi(unsigned int cpu);
111 extern void lapic_send_startup_ipi(unsigned int cpu, unsigned long start_rip);
112 extern void lapic_send_ipi(unsigned int cpu, unsigned int vector);
113
114 #endif /* __ASM_APIC_H */