mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: blaisorblade_spam@yahoo.it
To: akpm@osdl.org
Cc: jdike@addtoit.com, linux-kernel@vger.kernel.org,
	user-mode-linux-devel@lists.sourceforge.net, cw@f00f.org,
	blaisorblade_spam@yahoo.it
Subject: [patch 07/20] uml: no duplicate current_thread definition
Date: Thu, 04 Nov 2004 00:17:30 +0100	[thread overview]
Message-ID: <20041103231730.B2F3155C75@zion.localdomain> (raw)


From: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>, Jeff Dike <jdike@addtoit.com>

Currently there are two distinct definitions of current_thread_info (which has
its usual meaning) and current_thread (which is the same thing); so define the
second to be the first (for UML compatibility). If needed, a search & replace
\<current_thread\> to current_thread_info and removing current_thread can be
done (that would be a separate, low-priority patch, however).

Also, since the involved headers include each other very deeply, we must fix
somehow this recursive inclusion or things won't compile.

Jeff Dike noted that this can be done easily, since the nasty chain of includes
can be broken by eliminating an include of current.h, and implemented this.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
---

 vanilla-linux-2.6.9-paolo/include/asm-um/current.h        |   13 ++++---------
 vanilla-linux-2.6.9-paolo/include/asm-um/ptrace-generic.h |    2 --
 vanilla-linux-2.6.9-paolo/include/asm-um/thread_info.h    |    1 +
 3 files changed, 5 insertions(+), 11 deletions(-)

diff -puN include/asm-um/current.h~uml-no-duplicate-current-thread include/asm-um/current.h
--- vanilla-linux-2.6.9/include/asm-um/current.h~uml-no-duplicate-current-thread	2004-11-03 23:44:58.558657848 +0100
+++ vanilla-linux-2.6.9-paolo/include/asm-um/current.h	2004-11-03 23:44:58.563657088 +0100
@@ -8,18 +8,13 @@
 
 #ifndef __ASSEMBLY__
 
-struct thread_info;
-
-#include "linux/config.h"
 #include "asm/page.h"
+#include "linux/thread_info.h"
 
-#define CURRENT_THREAD(dummy) (((unsigned long) &dummy) & \
-			        (PAGE_MASK << CONFIG_KERNEL_STACK_ORDER))
-
-#define current_thread \
-	({ int dummy; ((struct thread_info *) CURRENT_THREAD(dummy)); })
+#define current (current_thread_info()->task)
 
-#define current (current_thread->task)
+/*Backward compatibility - it's used inside arch/um.*/
+#define current_thread current_thread_info()
 
 #endif /* __ASSEMBLY__ */
 
diff -puN include/asm-um/ptrace-generic.h~uml-no-duplicate-current-thread include/asm-um/ptrace-generic.h
--- vanilla-linux-2.6.9/include/asm-um/ptrace-generic.h~uml-no-duplicate-current-thread	2004-11-03 23:44:58.559657696 +0100
+++ vanilla-linux-2.6.9-paolo/include/asm-um/ptrace-generic.h	2004-11-03 23:44:58.564656936 +0100
@@ -10,8 +10,6 @@
 
 #include "linux/config.h"
 
-#include "asm/current.h"
-
 #define pt_regs pt_regs_subarch
 #define show_regs show_regs_subarch
 
diff -puN include/asm-um/thread_info.h~uml-no-duplicate-current-thread include/asm-um/thread_info.h
--- vanilla-linux-2.6.9/include/asm-um/thread_info.h~uml-no-duplicate-current-thread	2004-11-03 23:44:58.561657392 +0100
+++ vanilla-linux-2.6.9-paolo/include/asm-um/thread_info.h	2004-11-03 23:44:58.564656936 +0100
@@ -8,6 +8,7 @@
 
 #ifndef __ASSEMBLY__
 
+#include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/types.h>
 
_

                 reply	other threads:[~2004-11-04  2:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20041103231730.B2F3155C75@zion.localdomain \
    --to=blaisorblade_spam@yahoo.it \
    --cc=akpm@osdl.org \
    --cc=cw@f00f.org \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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

all inboxes | Powered by JetHome®