Re: [PATCH 1/1] i386: Geode's TSC is not neccessary to mark tu unstable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 15 Jul 2007 21:06:27 +0200
Juergen Beisert <[email protected]> wrote:

> Replace NSC/Cyrix specific chipset access macros by inlined functions.
> With the macros a line like this fails (and does nothing):
> 	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
> With inlined functions this line will work as expected.

I don't get it.  Why would the macros behave differently from inlined
functions?

diff -puN /dev/null include/asm-i386/processor-cyrix.h
> --- /dev/null
> +++ a/include/asm-i386/processor-cyrix.h
> @@ -0,0 +1,20 @@
> +#ifndef __ASM_I386_PROCESSOR_CYRIX_H
> +#define __ASM_I386_PROCESSOR_CYRIX
> +
> +#include <asm/processor-flags.h>
> +/*
> + * NSC/Cyrix CPU indexed register access
> + */
> +static inline u8 getCx86(u8 reg)
> +{
> +	outb(reg, 0x22);
> +	return inb(0x23);
> +}
> +
> +static inline void setCx86(u8 reg, u8 data)
> +{
> +	outb(reg, 0x22);
> +	outb(data, 0x23);
> +}
> +
> +#endif
> diff -puN include/asm-i386/processor.h~i386-geodes-tsc-is-not-neccessary-to-mark-tu-unstable include/asm-i386/processor.h
> --- a/include/asm-i386/processor.h~i386-geodes-tsc-is-not-neccessary-to-mark-tu-unstable
> +++ a/include/asm-i386/processor.h
> @@ -168,17 +168,6 @@ static inline void clear_in_cr4 (unsigne
>  	write_cr4(cr4);
>  }
>  
> -/*
> - *      NSC/Cyrix CPU indexed register access macros
> - */
> -
> -#define getCx86(reg) ({ outb((reg), 0x22); inb(0x23); })
> -
> -#define setCx86(reg, data) do { \
> -	outb((reg), 0x22); \
> -	outb((data), 0x23); \
> -} while (0)
> -
>  /* Stop speculative execution */
>  static inline void sync_core(void)
>  {
> diff -puN include/asm-x86_64/processor.h~i386-geodes-tsc-is-not-neccessary-to-mark-tu-unstable include/asm-x86_64/processor.h
> --- a/include/asm-x86_64/processor.h~i386-geodes-tsc-is-not-neccessary-to-mark-tu-unstable
> +++ a/include/asm-x86_64/processor.h
> @@ -389,17 +389,6 @@ static inline void prefetchw(void *x) 
>  
>  #define cpu_relax()   rep_nop()
>  
> -/*
> - *      NSC/Cyrix CPU indexed register access macros
> - */
> -
> -#define getCx86(reg) ({ outb((reg), 0x22); inb(0x23); })
> -
> -#define setCx86(reg, data) do { \
> -	outb((reg), 0x22); \
> -	outb((data), 0x23); \
> -} while (0)
> -
>  static inline void serialize_cpu(void)
>  {
>  	__asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx");
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux