All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: travis@sgi.com, linux-kernel@vger.kernel.org
Subject: [patch 4/9] x86: common thread_info definitions
Date: Mon, 28 Apr 2008 18:52:35 -0700	[thread overview]
Message-ID: <20080429015300.946774085@sgi.com> (raw)
In-Reply-To: 20080429015231.908196699@sgi.com

[-- Attachment #1: merge_threadinfo2 --]
[-- Type: text/plain, Size: 3402 bytes --]

Merge the thread_info definition into one structure definition for both arches.

The __u32 is equal to unsigned long for 32 bit.

sysenter_return is used both for the IA32 emulation for 64 and x86_32.
Avoid complicated #ifdef by simply always including it.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

---
 include/asm-x86/thread_info.h |   55 +++++++++---------------------------------
 1 file changed, 12 insertions(+), 43 deletions(-)

Index: linux-2.6/include/asm-x86/thread_info.h
===================================================================
--- linux-2.6.orig/include/asm-x86/thread_info.h	2008-04-28 17:47:10.563649517 -0700
+++ linux-2.6/include/asm-x86/thread_info.h	2008-04-28 17:47:14.822390659 -0700
@@ -11,47 +11,42 @@
 #include <asm/page.h>
 #include <asm/types.h>
 
-#ifdef CONFIG_X86_32
-
-#ifndef __ASSEMBLY__
-#include <asm/processor.h>
-#endif
-
 /*
  * low level task data that entry.S needs immediate access to
  * - this struct should fit entirely inside of one cache line
  * - this struct shares the supervisor stack pages
- * - if the contents of this structure are changed,
- *   the assembly constants must also be changed
  */
 #ifndef __ASSEMBLY__
+struct task_struct;
+struct exec_domain;
+#include <asm/processor.h>
 
 struct thread_info {
 	struct task_struct	*task;		/* main task structure */
 	struct exec_domain	*exec_domain;	/* execution domain */
-	unsigned long		flags;		/* low level flags */
-	unsigned long		status;		/* thread-synchronous flags */
+	__u32			flags;		/* low level flags */
+	__u32			status;		/* thread synchronous flags */
 	__u32			cpu;		/* current CPU */
-	int			preempt_count;	/* 0 => preemptable,
+	int 			preempt_count;	/* 0 => preemptable,
 						   <0 => BUG */
-	mm_segment_t		addr_limit;	/* thread address space:
-						   0-0xBFFFFFFF user-thread
-						   0-0xFFFFFFFF kernel-thread
-						*/
-	void			*sysenter_return;
+	mm_segment_t		addr_limit;
 	struct restart_block    restart_block;
+	void __user		*sysenter_return;
+#ifdef CONFIG_X86_32
 	unsigned long           previous_esp;   /* ESP of the previous stack in
 						   case of nested (IRQ) stacks
 						*/
 	__u8			supervisor_stack[0];
+#endif
 };
-
 #else /* !__ASSEMBLY__ */
 
 #include <asm/asm-offsets.h>
 
 #endif
 
+#ifdef CONFIG_X86_32
+
 #define PREEMPT_ACTIVE		0x10000000
 #ifdef CONFIG_4KSTACKS
 #define THREAD_SIZE            (4096)
@@ -182,32 +177,6 @@ static inline struct thread_info *curren
 #include <asm/pda.h>
 
 /*
- * low level task data that entry.S needs immediate access to
- * - this struct should fit entirely inside of one cache line
- * - this struct shares the supervisor stack pages
- */
-#ifndef __ASSEMBLY__
-struct task_struct;
-struct exec_domain;
-#include <asm/processor.h>
-
-struct thread_info {
-	struct task_struct	*task;		/* main task structure */
-	struct exec_domain	*exec_domain;	/* execution domain */
-	__u32			flags;		/* low level flags */
-	__u32			status;		/* thread synchronous flags */
-	__u32			cpu;		/* current CPU */
-	int 			preempt_count;	/* 0 => preemptable,
-						   <0 => BUG */
-	mm_segment_t		addr_limit;
-	struct restart_block    restart_block;
-#ifdef CONFIG_IA32_EMULATION
-	void __user		*sysenter_return;
-#endif
-};
-#endif
-
-/*
  * macros/functions for gaining access to the thread information structure
  * preempt_count needs to be 1 initially, until the scheduler is functional.
  */

-- 

  parent reply	other threads:[~2008-04-29  1:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29  1:52 [patch 0/9] [RFC] x86: Merge thread_info_32/64 to thread_info.h Christoph Lameter
2008-04-29  1:52 ` [patch 1/9] x86: merge thread_info.h Christoph Lameter
2008-04-29  1:52 ` [patch 2/9] x86: threadinfo: Common include files Christoph Lameter
2008-04-29  1:52 ` [patch 3/9] x86: threadinfo: Merge thread sync state definitions Christoph Lameter
2008-04-29  1:52 ` Christoph Lameter [this message]
2008-04-29  1:52 ` [patch 5/9] x86: threadinfo: Merge INIT_THREAD_INFO Christoph Lameter
2008-04-29  1:52 ` [patch 6/9] x86: thread_info: PREEMPT_ACTIVE Christoph Lameter
2008-04-29  1:52 ` [patch 7/9] x86: thread_info: Merget TIF_ flags Christoph Lameter
2008-04-29  1:52 ` [patch 8/9] x86: thread_info: merge tif masks Christoph Lameter
2008-04-29  1:52 ` [patch 9/9] x86: thread_info: Merge thread_info allocation Christoph Lameter
2008-04-29  9:40 ` [patch 0/9] [RFC] x86: Merge thread_info_32/64 to thread_info.h 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=20080429015300.946774085@sgi.com \
    --to=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=travis@sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.