From: tip-bot for Ingo Molnar <mingo@elte.hu>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
brgerst@gmail.com, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:x86/asm] x86: Clean up the loadsegment() macro
Date: Thu, 26 Nov 2009 09:56:10 GMT [thread overview]
Message-ID: <tip-64b028b22616946a05bf9580f7f7f7ee2ac070b4@git.kernel.org> (raw)
In-Reply-To: <1259176706-5908-1-git-send-email-brgerst@gmail.com>
Commit-ID: 64b028b22616946a05bf9580f7f7f7ee2ac070b4
Gitweb: http://git.kernel.org/tip/64b028b22616946a05bf9580f7f7f7ee2ac070b4
Author: Ingo Molnar <mingo@elte.hu>
AuthorDate: Thu, 26 Nov 2009 10:37:55 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 26 Nov 2009 10:38:52 +0100
x86: Clean up the loadsegment() macro
Make it readable in the source too, not just in the assembly output.
No change in functionality.
Cc: Brian Gerst <brgerst@gmail.com>
LKML-Reference: <1259176706-5908-1-git-send-email-brgerst@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/system.h | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
index 537395a..022a843 100644
--- a/arch/x86/include/asm/system.h
+++ b/arch/x86/include/asm/system.h
@@ -155,19 +155,21 @@ extern void native_load_gs_index(unsigned);
* Load a segment. Fall back on loading the zero
* segment if something goes wrong..
*/
-#define loadsegment(seg, value) \
-do { \
- unsigned short __val = value; \
- asm volatile("\n" \
- "1:\t" \
- "movl %k0,%%" #seg "\n" \
- ".section .fixup,\"ax\"\n" \
- "2:\t" \
- "xorl %k0,%k0\n\t" \
- "jmp 1b\n" \
- ".previous\n" \
- _ASM_EXTABLE(1b, 2b) \
- : "+r" (__val) : : "memory"); \
+#define loadsegment(seg, value) \
+do { \
+ unsigned short __val = (value); \
+ \
+ asm volatile(" \n" \
+ "1: movl %k0,%%" #seg " \n" \
+ \
+ ".section .fixup,\"ax\" \n" \
+ "2: xorl %k0,%k0 \n" \
+ " jmp 1b \n" \
+ ".previous \n" \
+ \
+ _ASM_EXTABLE(1b, 2b) \
+ \
+ : "+r" (__val) : : "memory"); \
} while (0)
/*
prev parent reply other threads:[~2009-11-26 9:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 19:18 [PATCH] x86: loadsegment() optimization Brian Gerst
2009-11-26 9:55 ` [tip:x86/asm] x86: Optimize loadsegment() tip-bot for Brian Gerst
2009-11-26 9:56 ` tip-bot for Ingo Molnar [this message]
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=tip-64b028b22616946a05bf9580f7f7f7ee2ac070b4@git.kernel.org \
--to=mingo@elte.hu \
--cc=brgerst@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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