Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 006c484b authored by Christoph Lameter's avatar Christoph Lameter Committed by Ingo Molnar
Browse files

x86: common thread_info definitions



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: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent f2ea3b1d
Loading
Loading
Loading
Loading
+12 −43
Original line number Original line Diff line number Diff line
@@ -11,47 +11,42 @@
#include <asm/page.h>
#include <asm/page.h>
#include <asm/types.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
 * low level task data that entry.S needs immediate access to
 * - this struct should fit entirely inside of one cache line
 * - this struct should fit entirely inside of one cache line
 * - this struct shares the supervisor stack pages
 * - this struct shares the supervisor stack pages
 * - if the contents of this structure are changed,
 *   the assembly constants must also be changed
 */
 */
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLY__
struct task_struct;
struct exec_domain;
#include <asm/processor.h>


struct thread_info {
struct thread_info {
	struct task_struct	*task;		/* main task structure */
	struct task_struct	*task;		/* main task structure */
	struct exec_domain	*exec_domain;	/* execution domain */
	struct exec_domain	*exec_domain;	/* execution domain */
	unsigned long		flags;		/* low level flags */
	__u32			flags;		/* low level flags */
	unsigned long		status;		/* thread-synchronous flags */
	__u32			status;		/* thread synchronous flags */
	__u32			cpu;		/* current CPU */
	__u32			cpu;		/* current CPU */
	int 			preempt_count;	/* 0 => preemptable,
	int 			preempt_count;	/* 0 => preemptable,
						   <0 => BUG */
						   <0 => BUG */
	mm_segment_t		addr_limit;	/* thread address space:
	mm_segment_t		addr_limit;
						   0-0xBFFFFFFF user-thread
						   0-0xFFFFFFFF kernel-thread
						*/
	void			*sysenter_return;
	struct restart_block    restart_block;
	struct restart_block    restart_block;
	void __user		*sysenter_return;
#ifdef CONFIG_X86_32
	unsigned long           previous_esp;   /* ESP of the previous stack in
	unsigned long           previous_esp;   /* ESP of the previous stack in
						   case of nested (IRQ) stacks
						   case of nested (IRQ) stacks
						*/
						*/
	__u8			supervisor_stack[0];
	__u8			supervisor_stack[0];
#endif
};
};

#else /* !__ASSEMBLY__ */
#else /* !__ASSEMBLY__ */


#include <asm/asm-offsets.h>
#include <asm/asm-offsets.h>


#endif
#endif


#ifdef CONFIG_X86_32

#define PREEMPT_ACTIVE		0x10000000
#define PREEMPT_ACTIVE		0x10000000
#ifdef CONFIG_4KSTACKS
#ifdef CONFIG_4KSTACKS
#define THREAD_SIZE            (4096)
#define THREAD_SIZE            (4096)
@@ -181,32 +176,6 @@ static inline struct thread_info *current_thread_info(void)


#include <asm/pda.h>
#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
 * macros/functions for gaining access to the thread information structure
 * preempt_count needs to be 1 initially, until the scheduler is functional.
 * preempt_count needs to be 1 initially, until the scheduler is functional.