ia64/xen-unstable
changeset 8921:5b4ff470dcc6
Add include/asm-{i386,x86_64}/apic.h to sparse tree.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author | cl349@firebug.cl.cam.ac.uk |
---|---|
date | Mon Feb 20 10:26:39 2006 +0000 (2006-02-20) |
parents | 20b95517cbf1 |
children | 832649128a0c |
files | linux-2.6-xen-sparse/include/asm-i386/apic.h linux-2.6-xen-sparse/include/asm-x86_64/apic.h |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/apic.h Mon Feb 20 10:26:39 2006 +0000 1.3 @@ -0,0 +1,145 @@ 1.4 +#ifndef __ASM_APIC_H 1.5 +#define __ASM_APIC_H 1.6 + 1.7 +#include <linux/config.h> 1.8 +#include <linux/pm.h> 1.9 +#include <asm/fixmap.h> 1.10 +#include <asm/apicdef.h> 1.11 +#include <asm/processor.h> 1.12 +#include <asm/system.h> 1.13 + 1.14 +#define Dprintk(x...) 1.15 + 1.16 +/* 1.17 + * Debugging macros 1.18 + */ 1.19 +#define APIC_QUIET 0 1.20 +#define APIC_VERBOSE 1 1.21 +#define APIC_DEBUG 2 1.22 + 1.23 +extern int enable_local_apic; 1.24 +extern int apic_verbosity; 1.25 + 1.26 +static inline void lapic_disable(void) 1.27 +{ 1.28 + enable_local_apic = -1; 1.29 + clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability); 1.30 +} 1.31 + 1.32 +static inline void lapic_enable(void) 1.33 +{ 1.34 + enable_local_apic = 1; 1.35 +} 1.36 + 1.37 +/* 1.38 + * Define the default level of output to be very little 1.39 + * This can be turned up by using apic=verbose for more 1.40 + * information and apic=debug for _lots_ of information. 1.41 + * apic_verbosity is defined in apic.c 1.42 + */ 1.43 +#define apic_printk(v, s, a...) do { \ 1.44 + if ((v) <= apic_verbosity) \ 1.45 + printk(s, ##a); \ 1.46 + } while (0) 1.47 + 1.48 + 1.49 +#ifdef CONFIG_X86_LOCAL_APIC 1.50 + 1.51 +/* 1.52 + * Basic functions accessing APICs. 1.53 + */ 1.54 + 1.55 +static __inline void apic_write(unsigned long reg, unsigned long v) 1.56 +{ 1.57 + *((volatile unsigned long *)(APIC_BASE+reg)) = v; 1.58 +} 1.59 + 1.60 +static __inline void apic_write_atomic(unsigned long reg, unsigned long v) 1.61 +{ 1.62 + xchg((volatile unsigned long *)(APIC_BASE+reg), v); 1.63 +} 1.64 + 1.65 +static __inline unsigned long apic_read(unsigned long reg) 1.66 +{ 1.67 + return *((volatile unsigned long *)(APIC_BASE+reg)); 1.68 +} 1.69 + 1.70 +static __inline__ void apic_wait_icr_idle(void) 1.71 +{ 1.72 + while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY ) 1.73 + cpu_relax(); 1.74 +} 1.75 + 1.76 +int get_physical_broadcast(void); 1.77 + 1.78 +#ifdef CONFIG_X86_GOOD_APIC 1.79 +# define FORCE_READ_AROUND_WRITE 0 1.80 +# define apic_read_around(x) 1.81 +# define apic_write_around(x,y) apic_write((x),(y)) 1.82 +#else 1.83 +# define FORCE_READ_AROUND_WRITE 1 1.84 +# define apic_read_around(x) apic_read(x) 1.85 +# define apic_write_around(x,y) apic_write_atomic((x),(y)) 1.86 +#endif 1.87 + 1.88 +static inline void ack_APIC_irq(void) 1.89 +{ 1.90 + /* 1.91 + * ack_APIC_irq() actually gets compiled as a single instruction: 1.92 + * - a single rmw on Pentium/82489DX 1.93 + * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC) 1.94 + * ... yummie. 1.95 + */ 1.96 + 1.97 + /* Docs say use 0 for future compatibility */ 1.98 + apic_write_around(APIC_EOI, 0); 1.99 +} 1.100 + 1.101 +extern void (*wait_timer_tick)(void); 1.102 + 1.103 +extern int get_maxlvt(void); 1.104 +extern void clear_local_APIC(void); 1.105 +extern void connect_bsp_APIC (void); 1.106 +extern void disconnect_bsp_APIC (int virt_wire_setup); 1.107 +extern void disable_local_APIC (void); 1.108 +extern void lapic_shutdown (void); 1.109 +extern int verify_local_APIC (void); 1.110 +extern void cache_APIC_registers (void); 1.111 +extern void sync_Arb_IDs (void); 1.112 +extern void init_bsp_APIC (void); 1.113 +extern void setup_local_APIC (void); 1.114 +extern void init_apic_mappings (void); 1.115 +extern void smp_local_timer_interrupt (struct pt_regs * regs); 1.116 +extern void setup_boot_APIC_clock (void); 1.117 +extern void setup_secondary_APIC_clock (void); 1.118 +extern void setup_apic_nmi_watchdog (void); 1.119 +extern int reserve_lapic_nmi(void); 1.120 +extern void release_lapic_nmi(void); 1.121 +extern void disable_timer_nmi_watchdog(void); 1.122 +extern void enable_timer_nmi_watchdog(void); 1.123 +extern void nmi_watchdog_tick (struct pt_regs * regs); 1.124 +extern int APIC_init_uniprocessor (void); 1.125 +extern void disable_APIC_timer(void); 1.126 +extern void enable_APIC_timer(void); 1.127 + 1.128 +extern void enable_NMI_through_LVT0 (void * dummy); 1.129 + 1.130 +extern unsigned int nmi_watchdog; 1.131 +#define NMI_NONE 0 1.132 +#define NMI_IO_APIC 1 1.133 +#define NMI_LOCAL_APIC 2 1.134 +#define NMI_INVALID 3 1.135 + 1.136 +extern int disable_timer_pin_1; 1.137 + 1.138 +void smp_send_timer_broadcast_ipi(struct pt_regs *regs); 1.139 +void switch_APIC_timer_to_ipi(void *cpumask); 1.140 +void switch_ipi_to_APIC_timer(void *cpumask); 1.141 +#define ARCH_APICTIMER_STOPS_ON_C3 1 1.142 + 1.143 +#else /* !CONFIG_X86_LOCAL_APIC */ 1.144 +static inline void lapic_shutdown(void) { } 1.145 + 1.146 +#endif /* !CONFIG_X86_LOCAL_APIC */ 1.147 + 1.148 +#endif /* __ASM_APIC_H */
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/apic.h Mon Feb 20 10:26:39 2006 +0000 2.3 @@ -0,0 +1,118 @@ 2.4 +#ifndef __ASM_APIC_H 2.5 +#define __ASM_APIC_H 2.6 + 2.7 +#include <linux/config.h> 2.8 +#include <linux/pm.h> 2.9 +#include <asm/fixmap.h> 2.10 +#include <asm/apicdef.h> 2.11 +#include <asm/system.h> 2.12 + 2.13 +#define Dprintk(x...) 2.14 + 2.15 +/* 2.16 + * Debugging macros 2.17 + */ 2.18 +#define APIC_QUIET 0 2.19 +#define APIC_VERBOSE 1 2.20 +#define APIC_DEBUG 2 2.21 + 2.22 +extern int apic_verbosity; 2.23 +extern int apic_runs_main_timer; 2.24 + 2.25 +/* 2.26 + * Define the default level of output to be very little 2.27 + * This can be turned up by using apic=verbose for more 2.28 + * information and apic=debug for _lots_ of information. 2.29 + * apic_verbosity is defined in apic.c 2.30 + */ 2.31 +#define apic_printk(v, s, a...) do { \ 2.32 + if ((v) <= apic_verbosity) \ 2.33 + printk(s, ##a); \ 2.34 + } while (0) 2.35 + 2.36 +#ifdef CONFIG_X86_LOCAL_APIC 2.37 + 2.38 +struct pt_regs; 2.39 + 2.40 +/* 2.41 + * Basic functions accessing APICs. 2.42 + */ 2.43 + 2.44 +static __inline void apic_write(unsigned long reg, unsigned int v) 2.45 +{ 2.46 + *((volatile unsigned int *)(APIC_BASE+reg)) = v; 2.47 +} 2.48 + 2.49 +static __inline unsigned int apic_read(unsigned long reg) 2.50 +{ 2.51 + return *((volatile unsigned int *)(APIC_BASE+reg)); 2.52 +} 2.53 + 2.54 +static __inline__ void apic_wait_icr_idle(void) 2.55 +{ 2.56 + while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY ); 2.57 +} 2.58 + 2.59 +static inline void ack_APIC_irq(void) 2.60 +{ 2.61 + /* 2.62 + * ack_APIC_irq() actually gets compiled as a single instruction: 2.63 + * - a single rmw on Pentium/82489DX 2.64 + * - a single write on P6+ cores (CONFIG_X86_GOOD_APIC) 2.65 + * ... yummie. 2.66 + */ 2.67 + 2.68 + /* Docs say use 0 for future compatibility */ 2.69 + apic_write(APIC_EOI, 0); 2.70 +} 2.71 + 2.72 +extern int get_maxlvt (void); 2.73 +extern void clear_local_APIC (void); 2.74 +extern void connect_bsp_APIC (void); 2.75 +extern void disconnect_bsp_APIC (int virt_wire_setup); 2.76 +extern void disable_local_APIC (void); 2.77 +extern int verify_local_APIC (void); 2.78 +extern void cache_APIC_registers (void); 2.79 +extern void sync_Arb_IDs (void); 2.80 +extern void init_bsp_APIC (void); 2.81 +extern void setup_local_APIC (void); 2.82 +extern void init_apic_mappings (void); 2.83 +extern void smp_local_timer_interrupt (struct pt_regs * regs); 2.84 +extern void setup_boot_APIC_clock (void); 2.85 +extern void setup_secondary_APIC_clock (void); 2.86 +extern void setup_apic_nmi_watchdog (void); 2.87 +extern int reserve_lapic_nmi(void); 2.88 +extern void release_lapic_nmi(void); 2.89 +extern void disable_timer_nmi_watchdog(void); 2.90 +extern void enable_timer_nmi_watchdog(void); 2.91 +extern void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason); 2.92 +extern int APIC_init_uniprocessor (void); 2.93 +extern void disable_APIC_timer(void); 2.94 +extern void enable_APIC_timer(void); 2.95 +extern void clustered_apic_check(void); 2.96 + 2.97 +extern void nmi_watchdog_default(void); 2.98 +extern int setup_nmi_watchdog(char *); 2.99 + 2.100 +extern unsigned int nmi_watchdog; 2.101 +#define NMI_DEFAULT -1 2.102 +#define NMI_NONE 0 2.103 +#define NMI_IO_APIC 1 2.104 +#define NMI_LOCAL_APIC 2 2.105 +#define NMI_INVALID 3 2.106 + 2.107 +extern int disable_timer_pin_1; 2.108 + 2.109 +extern void setup_threshold_lvt(unsigned long lvt_off); 2.110 + 2.111 +void smp_send_timer_broadcast_ipi(void); 2.112 +void switch_APIC_timer_to_ipi(void *cpumask); 2.113 +void switch_ipi_to_APIC_timer(void *cpumask); 2.114 + 2.115 +#define ARCH_APICTIMER_STOPS_ON_C3 1 2.116 + 2.117 +#endif /* CONFIG_X86_LOCAL_APIC */ 2.118 + 2.119 +extern unsigned boot_cpu_id; 2.120 + 2.121 +#endif /* __ASM_APIC_H */