From: Christoph Lameter <clameter@sgi.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org
Cc: travis@sgi.com
Subject: [patch 1/6] x86: Unify current.h
Date: Fri, 09 May 2008 19:09:48 -0700 [thread overview]
Message-ID: <20080510021015.319814569@sgi.com> (raw)
In-Reply-To: 20080510020947.803480649@sgi.com
[-- Attachment #1: x86_unify_current_h --]
[-- Type: text/plain, Size: 2995 bytes --]
Simply stitch these together. There are just two definitions that are shared
but the file is resonably small and putting these things together shows that
further unifications requires a unification of the per cpu / pda handling
between both arches.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
include/asm-x86/current.h | 42 ++++++++++++++++++++++++++++++++++++++----
include/asm-x86/current_32.h | 17 -----------------
include/asm-x86/current_64.h | 27 ---------------------------
3 files changed, 38 insertions(+), 48 deletions(-)
Index: linux-2.6/include/asm-x86/current.h
===================================================================
--- linux-2.6.orig/include/asm-x86/current.h 2008-05-07 16:33:51.126164691 -0700
+++ linux-2.6/include/asm-x86/current.h 2008-05-09 18:28:05.666268549 -0700
@@ -1,5 +1,39 @@
+#ifndef _X86_CURRENT_H
+#define _X86_CURRENT_H
+
#ifdef CONFIG_X86_32
-# include "current_32.h"
-#else
-# include "current_64.h"
-#endif
+#include <linux/compiler.h>
+#include <asm/percpu.h>
+
+struct task_struct;
+
+DECLARE_PER_CPU(struct task_struct *, current_task);
+static __always_inline struct task_struct *get_current(void)
+{
+ return x86_read_percpu(current_task);
+}
+
+#else /* X86_32 */
+
+#ifndef __ASSEMBLY__
+#include <asm/pda.h>
+
+struct task_struct;
+
+static __always_inline struct task_struct *get_current(void)
+{
+ return read_pda(pcurrent);
+}
+
+#else /* __ASSEMBLY__ */
+
+#include <asm/asm-offsets.h>
+#define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* X86_32 */
+
+#define current get_current()
+
+#endif /* X86_CURRENT_H */
Index: linux-2.6/include/asm-x86/current_32.h
===================================================================
--- linux-2.6.orig/include/asm-x86/current_32.h 2008-05-07 16:33:51.130164801 -0700
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,17 +0,0 @@
-#ifndef _I386_CURRENT_H
-#define _I386_CURRENT_H
-
-#include <linux/compiler.h>
-#include <asm/percpu.h>
-
-struct task_struct;
-
-DECLARE_PER_CPU(struct task_struct *, current_task);
-static __always_inline struct task_struct *get_current(void)
-{
- return x86_read_percpu(current_task);
-}
-
-#define current get_current()
-
-#endif /* !(_I386_CURRENT_H) */
Index: linux-2.6/include/asm-x86/current_64.h
===================================================================
--- linux-2.6.orig/include/asm-x86/current_64.h 2008-05-07 16:33:51.138164773 -0700
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,27 +0,0 @@
-#ifndef _X86_64_CURRENT_H
-#define _X86_64_CURRENT_H
-
-#if !defined(__ASSEMBLY__)
-struct task_struct;
-
-#include <asm/pda.h>
-
-static inline struct task_struct *get_current(void)
-{
- struct task_struct *t = read_pda(pcurrent);
- return t;
-}
-
-#define current get_current()
-
-#else
-
-#ifndef ASM_OFFSET_H
-#include <asm/asm-offsets.h>
-#endif
-
-#define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg
-
-#endif
-
-#endif /* !(_X86_64_CURRENT_H) */
--
next prev parent reply other threads:[~2008-05-10 2:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-10 2:09 [patch 0/6] x86: Unification patches etc Christoph Lameter
2008-05-10 2:09 ` Christoph Lameter [this message]
2008-05-13 12:28 ` [patch 1/6] x86: Unify current.h Ingo Molnar
2008-05-10 2:09 ` [patch 2/6] x86: e820.h unification Christoph Lameter
2008-05-10 2:09 ` [patch 3/6] x86: e820 unification: Extract shared comments Christoph Lameter
2008-05-10 2:09 ` [patch 4/6] x86: e820 unification: Common #ifdef __ASSEMBLY Christoph Lameter
2008-05-10 2:09 ` [patch 5/6] x86: e820 unification: Extract common functions Christoph Lameter
2008-05-10 2:09 ` [patch 6/6] x86: Add checks for virtual addresses in __phys_addr() Christoph Lameter
2008-05-10 2:23 ` Sam Ravnborg
2008-05-10 2:33 ` Christoph Lameter
2008-05-10 3:07 ` Christoph Lameter
2008-05-13 12:27 ` Ingo Molnar
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=20080510021015.319814569@sgi.com \
--to=clameter@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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