mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Juergen Beisert <juergen127@kreuzholzen.de>
Cc: TAKADA Yoshihito <takada@mbf.nifty.com>,
	linux-kernel@vger.kernel.org,
	Jordan Crouse <jordan.crouse@amd.com>,
	Andres Salomon <dilinger@debian.org>, Andi Kleen <ak@suse.de>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH 1/1] i386: Geode's TSC is not neccessary to mark tu unstable
Date: Wed, 18 Jul 2007 18:02:23 -0700	[thread overview]
Message-ID: <20070718180223.e1dad55d.akpm@linux-foundation.org> (raw)
In-Reply-To: <200707152106.28437.juergen127@kreuzholzen.de>

On Sun, 15 Jul 2007 21:06:27 +0200
Juergen Beisert <juergen127@kreuzholzen.de> 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");
>


  parent reply	other threads:[~2007-07-19  1:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-15 12:00 TAKADA Yoshihito
2007-07-15 19:06 ` Juergen Beisert
2007-07-15 23:59   ` TAKADA Yoshihito
2007-07-19  1:02   ` Andrew Morton [this message]
2007-07-19  6:49     ` Juergen Beisert
2007-07-19  7:17       ` Andres Salomon
2007-07-19  8:22         ` Andi Kleen
2007-07-19  8:52           ` Juergen Beisert
2007-07-19  9:25             ` Andi Kleen
2007-07-19 10:25               ` Juergen Beisert
2007-07-19 13:56                 ` Andi Kleen
2007-07-20 18:21                   ` Andrew Morton
2007-07-20 21:16                     ` Andi Kleen
2007-07-22 16:17           ` Satyam Sharma
2007-07-19  8:52         ` Juergen Beisert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070718180223.e1dad55d.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ak@suse.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dilinger@debian.org \
    --cc=jordan.crouse@amd.com \
    --cc=juergen127@kreuzholzen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=takada@mbf.nifty.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome