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

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

x86: thread_info: merge thread_info allocation



Make them similar so that both use THREAD_ORDER and THREAD_FLAGS and have a
THREAD_SIZE definition that is setup in asm/page_xx.h

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 00c1bb13
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -13,6 +13,14 @@
 */
 */
#define __PAGE_OFFSET		_AC(CONFIG_PAGE_OFFSET, UL)
#define __PAGE_OFFSET		_AC(CONFIG_PAGE_OFFSET, UL)


#ifdef CONFIG_4KSTACKS
#define THREAD_ORDER	0
#else
#define THREAD_ORDER	1
#endif
#define THREAD_SIZE 	(PAGE_SIZE << THREAD_ORDER)


#ifdef CONFIG_X86_PAE
#ifdef CONFIG_X86_PAE
#define __PHYSICAL_MASK_SHIFT	36
#define __PHYSICAL_MASK_SHIFT	36
#define __VIRTUAL_MASK_SHIFT	32
#define __VIRTUAL_MASK_SHIFT	32
+11 −26
Original line number Original line Diff line number Diff line
@@ -132,6 +132,7 @@ struct thread_info {
/* work to do on any return to user space */
/* work to do on any return to user space */
#define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP)
#define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP)


/* Only used for 64 bit */
#define _TIF_DO_NOTIFY_MASK						\
#define _TIF_DO_NOTIFY_MASK						\
	(_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY|_TIF_HRTICK_RESCHED)
	(_TIF_SIGPENDING|_TIF_SINGLESTEP|_TIF_MCE_NOTIFY|_TIF_HRTICK_RESCHED)


@@ -143,17 +144,20 @@ struct thread_info {
#define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW
#define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW
#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG)
#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG)



#define PREEMPT_ACTIVE		0x10000000
#define PREEMPT_ACTIVE		0x10000000


#ifdef CONFIG_X86_32
/* thread information allocation */

#ifdef CONFIG_DEBUG_STACK_USAGE
#ifdef CONFIG_4KSTACKS
#define THREAD_FLAGS (GFP_KERNEL | __GFP_ZERO)
#define THREAD_SIZE            (4096)
#else
#else
#define THREAD_SIZE		(8192)
#define THREAD_FLAGS GFP_KERNEL
#endif
#endif


#define alloc_thread_info(tsk)						\
	((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER))

#ifdef CONFIG_X86_32

#define STACK_WARN	(THREAD_SIZE/8)
#define STACK_WARN	(THREAD_SIZE/8)
/*
/*
 * macros/functions for gaining access to the thread information structure
 * macros/functions for gaining access to the thread information structure
@@ -173,15 +177,6 @@ static inline struct thread_info *current_thread_info(void)
		(current_stack_pointer & ~(THREAD_SIZE - 1));
		(current_stack_pointer & ~(THREAD_SIZE - 1));
}
}


/* thread information allocation */
#ifdef CONFIG_DEBUG_STACK_USAGE
#define alloc_thread_info(tsk) ((struct thread_info *)			\
	__get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(THREAD_SIZE)))
#else
#define alloc_thread_info(tsk) ((struct thread_info *)			\
	__get_free_pages(GFP_KERNEL, get_order(THREAD_SIZE)))
#endif

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


/* how to get the thread information struct from ASM */
/* how to get the thread information struct from ASM */
@@ -219,16 +214,6 @@ static inline struct thread_info *stack_thread_info(void)
	return ti;
	return ti;
}
}


/* thread information allocation */
#ifdef CONFIG_DEBUG_STACK_USAGE
#define THREAD_FLAGS (GFP_KERNEL | __GFP_ZERO)
#else
#define THREAD_FLAGS GFP_KERNEL
#endif

#define alloc_thread_info(tsk)						\
	((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER))

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


/* how to get the thread information struct from ASM */
/* how to get the thread information struct from ASM */