* [PATCH] x86, asm, boot: Use CC_SET()/CC_OUT() in arch/x86/boot/
@ 2018-06-29 14:28 Uros Bizjak
2018-08-02 12:33 ` [tip:x86/boot] x86/boot: Use CC_SET()/CC_OUT() instead of open coding it tip-bot for Uros Bizjak
0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2018-06-29 14:28 UTC (permalink / raw)
To: linux-kernel; +Cc: x86, Uros Bizjak
Remove open-coded uses of set instructions to use CC_SET()/CC_OUT() in arch/x86/boot/.
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
arch/x86/boot/bitops.h | 3 ++-
arch/x86/boot/string.c | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/boot/bitops.h b/arch/x86/boot/bitops.h
index 0d41d68131cc..2e1382486e91 100644
--- a/arch/x86/boot/bitops.h
+++ b/arch/x86/boot/bitops.h
@@ -17,6 +17,7 @@
#define _LINUX_BITOPS_H /* Inhibit inclusion of <linux/bitops.h> */
#include <linux/types.h>
+#include <asm/asm.h>
static inline bool constant_test_bit(int nr, const void *addr)
{
@@ -28,7 +29,7 @@ static inline bool variable_test_bit(int nr, const void *addr)
bool v;
const u32 *p = (const u32 *)addr;
- asm("btl %2,%1; setc %0" : "=qm" (v) : "m" (*p), "Ir" (nr));
+ asm("btl %2,%1" CC_SET(c) : CC_OUT(c) (v) : "m" (*p), "Ir" (nr));
return v;
}
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 16f49123d747..c4428a176973 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -13,6 +13,7 @@
*/
#include <linux/types.h>
+#include <asm/asm.h>
#include "ctype.h"
#include "string.h"
@@ -28,8 +29,8 @@
int memcmp(const void *s1, const void *s2, size_t len)
{
bool diff;
- asm("repe; cmpsb; setnz %0"
- : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len));
+ asm("repe; cmpsb" CC_SET(nz)
+ : CC_OUT(nz) (diff), "+D" (s1), "+S" (s2), "+c" (len));
return diff;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip:x86/boot] x86/boot: Use CC_SET()/CC_OUT() instead of open coding it
2018-06-29 14:28 [PATCH] x86, asm, boot: Use CC_SET()/CC_OUT() in arch/x86/boot/ Uros Bizjak
@ 2018-08-02 12:33 ` tip-bot for Uros Bizjak
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Uros Bizjak @ 2018-08-02 12:33 UTC (permalink / raw)
To: linux-tip-commits; +Cc: tglx, ubizjak, mingo, linux-kernel, hpa
Commit-ID: 216a37202f10b7d78f2f98e26a6681f367165f05
Gitweb: https://git.kernel.org/tip/216a37202f10b7d78f2f98e26a6681f367165f05
Author: Uros Bizjak <ubizjak@gmail.com>
AuthorDate: Fri, 29 Jun 2018 16:28:44 +0200
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 2 Aug 2018 14:30:42 +0200
x86/boot: Use CC_SET()/CC_OUT() instead of open coding it
Remove open-coded uses of set instructions with CC_SET()/CC_OUT().
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20180629142844.15200-1-ubizjak@gmail.com
---
arch/x86/boot/bitops.h | 3 ++-
arch/x86/boot/string.c | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/boot/bitops.h b/arch/x86/boot/bitops.h
index 0d41d68131cc..2e1382486e91 100644
--- a/arch/x86/boot/bitops.h
+++ b/arch/x86/boot/bitops.h
@@ -17,6 +17,7 @@
#define _LINUX_BITOPS_H /* Inhibit inclusion of <linux/bitops.h> */
#include <linux/types.h>
+#include <asm/asm.h>
static inline bool constant_test_bit(int nr, const void *addr)
{
@@ -28,7 +29,7 @@ static inline bool variable_test_bit(int nr, const void *addr)
bool v;
const u32 *p = (const u32 *)addr;
- asm("btl %2,%1; setc %0" : "=qm" (v) : "m" (*p), "Ir" (nr));
+ asm("btl %2,%1" CC_SET(c) : CC_OUT(c) (v) : "m" (*p), "Ir" (nr));
return v;
}
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 16f49123d747..c4428a176973 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -13,6 +13,7 @@
*/
#include <linux/types.h>
+#include <asm/asm.h>
#include "ctype.h"
#include "string.h"
@@ -28,8 +29,8 @@
int memcmp(const void *s1, const void *s2, size_t len)
{
bool diff;
- asm("repe; cmpsb; setnz %0"
- : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len));
+ asm("repe; cmpsb" CC_SET(nz)
+ : CC_OUT(nz) (diff), "+D" (s1), "+S" (s2), "+c" (len));
return diff;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-02 12:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-29 14:28 [PATCH] x86, asm, boot: Use CC_SET()/CC_OUT() in arch/x86/boot/ Uros Bizjak
2018-08-02 12:33 ` [tip:x86/boot] x86/boot: Use CC_SET()/CC_OUT() instead of open coding it tip-bot for Uros Bizjak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).