Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1416749

[PATCH 10/10] x86, asm, boot: Use CC_SET()/CC_OUT() in arch/x86/boot/boot.h

From "H. Peter Anvin" <hpa@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH 10/10] x86, asm, boot: Use CC_SET()/CC_OUT() in arch/x86/boot/boot.h
Date 2016-06-08 01:40 +0200
Message-ID <rHyLg-GT-39@gated-at.bofh.it> (permalink)
References <rHyLf-GT-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Remove open-coded uses of set instructions to use CC_SET()/CC_OUT() in
arch/x86/boot/boot.h.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/boot/boot.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
index 2edb2d5..7c1495f 100644
--- a/arch/x86/boot/boot.h
+++ b/arch/x86/boot/boot.h
@@ -24,6 +24,7 @@
 #include <linux/types.h>
 #include <linux/edd.h>
 #include <asm/setup.h>
+#include <asm/asm.h>
 #include "bitops.h"
 #include "ctype.h"
 #include "cpuflags.h"
@@ -179,15 +180,15 @@ static inline void wrgs32(u32 v, addr_t addr)
 static inline bool memcmp_fs(const void *s1, addr_t s2, size_t len)
 {
 	bool diff;
-	asm volatile("fs; repe; cmpsb; setnz %0"
-		     : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len));
+	asm volatile("fs; repe; cmpsb" CC_SET(nz)
+		     : CC_OUT(nz) (diff), "+D" (s1), "+S" (s2), "+c" (len));
 	return diff;
 }
 static inline bool memcmp_gs(const void *s1, addr_t s2, size_t len)
 {
 	bool diff;
-	asm volatile("gs; repe; cmpsb; setnz %0"
-		     : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len));
+	asm volatile("gs; repe; cmpsb" CC_SET(nz)
+		     : CC_OUT(nz) (diff), "+D" (s1), "+S" (s2), "+c" (len));
 	return diff;
 }
 
-- 
2.7.3.0.11.gd79db92

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/10] x86: use gcc 6+ asm flag output feature "H. Peter Anvin" <hpa@linux.intel.com> - 2016-06-08 01:40 +0200
  [PATCH 10/10] x86, asm, boot: Use CC_SET()/CC_OUT() in arch/x86/boot/boot.h "H. Peter Anvin" <hpa@linux.intel.com> - 2016-06-08 01:40 +0200
    [tip:x86/asm] x86, asm, boot: Use CC_SET()/CC_OUT() in  arch/x86/boot/boot.h "tip-bot for H. Peter Anvin" <tipbot@zytor.com> - 2016-06-08 01:50 +0200
  Re: [PATCH 00/10] x86: use gcc 6+ asm flag output feature Peter Zijlstra <peterz@infradead.org> - 2016-06-08 10:10 +0200
    Re: [PATCH 00/10] x86: use gcc 6+ asm flag output feature "H. Peter Anvin" <hpa@zytor.com> - 2016-06-08 11:00 +0200

csiph-web