[discuss] [PATCH] [2/3] x86_64: apic support for extended apic interrupt LVT

Andi Kleen ak at suse.de
Thu May 18 00:17:36 CEST 2006


On Wednesday 17 May 2006 20:22, shin, jacob wrote:
> Add support for extended APIC LVT found in future AMD
> processors.
> 
> Signed-off-by: Jacob Shin <jacob.shin at amd.com>
> 
> ---
> 
>  arch/x86_64/kernel/apic.c |   10 ++++------
>  include/asm-x86_64/apic.h |   13 ++++++++++++-
>  2 files changed, 16 insertions(+), 7 deletions(-)
> 
> ---
> 
> diff -uparN linux.orig/arch/x86_64/kernel/apic.c linux/arch/x86_64/kernel/apic.c
> --- linux.orig/arch/x86_64/kernel/apic.c	2006-05-11 18:31:53.000000000 -0500
> +++ linux/arch/x86_64/kernel/apic.c	2006-05-17 11:10:12.000000000 -0500
> @@ -909,15 +909,13 @@ int setup_profiling_timer(unsigned int m
>  	return -EINVAL;
>  }
>  
> -#ifdef CONFIG_X86_MCE_AMD
> -void setup_threshold_lvt(unsigned long lvt_off)
> +void setup_APIC_extened_lvt(unsigned char lvt_off, unsigned char vector,
> +			    unsigned char msg_type, unsigned char mask)
>  {
> -	unsigned int v = 0;
> -	unsigned long reg = (lvt_off << 4) + 0x500;
> -	v |= THRESHOLD_APIC_VECTOR;
> +	unsigned long reg = (lvt_off << 4) + APIC_EXT_LVT_BASE;
> +	unsigned int  v   = (mask << 16) | (msg_type << 8) | vector;
>  	apic_write(reg, v);
>  }
> -#endif /* CONFIG_X86_MCE_AMD */
>  
>  #undef APIC_DIVISOR
>  
> diff -uparN linux.orig/include/asm-x86_64/apic.h linux/include/asm-x86_64/apic.h
> --- linux.orig/include/asm-x86_64/apic.h	2006-05-11 18:31:53.000000000 -0500
> +++ linux/include/asm-x86_64/apic.h	2006-05-17 11:11:18.000000000 -0500
> @@ -103,7 +103,18 @@ extern unsigned int nmi_watchdog;
>  
>  extern int disable_timer_pin_1;
>  
> -extern void setup_threshold_lvt(unsigned long lvt_off);
> +/* x86_64 extened APIC LVT */

K8 

> +#define APIC_EXT_LVT_BASE    0x500
> +
> +#define APIC_EXT_INT_MSG_FIX 0x0
> +#define APIC_EXT_INT_MSG_SMI 0x2
> +#define APIC_EXT_INT_MSG_NMI 0x4
> +#define APIC_EXT_INT_MSG_EXT 0x7

Can you please add _K8_ somewhere. CPU specific constants should have
such a tag. I think 3/3 had the same problem.

-Andi 



More information about the discuss mailing list