Commit 00d1a39e authored by Thomas Gleixner's avatar Thomas Gleixner

preempt: Make PREEMPT_ACTIVE generic

No point in having this bit defined by architecture.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20130917183629.090698799@linutronix.de
parent 9385d949
...@@ -58,8 +58,6 @@ register struct thread_info *__current_thread_info __asm__("$8"); ...@@ -58,8 +58,6 @@ register struct thread_info *__current_thread_info __asm__("$8");
#define THREAD_SIZE_ORDER 1 #define THREAD_SIZE_ORDER 1
#define THREAD_SIZE (2*PAGE_SIZE) #define THREAD_SIZE (2*PAGE_SIZE)
#define PREEMPT_ACTIVE 0x40000000
/* /*
* Thread information flags: * Thread information flags:
* - these are process state flags and used from assembly * - these are process state flags and used from assembly
......
...@@ -80,8 +80,6 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void) ...@@ -80,8 +80,6 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void)
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#define PREEMPT_ACTIVE 0x10000000
/* /*
* thread information flags * thread information flags
* - these are process state flags that various assembly files may need to * - these are process state flags that various assembly files may need to
......
...@@ -140,12 +140,6 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, ...@@ -140,12 +140,6 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
struct user_vfp_exc __user *); struct user_vfp_exc __user *);
#endif #endif
/*
* We use bit 30 of the preempt_count to indicate that kernel
* preemption is occurring. See <asm/hardirq.h>.
*/
#define PREEMPT_ACTIVE 0x40000000
/* /*
* thread information flags: * thread information flags:
* TIF_SYSCALL_TRACE - syscall trace active * TIF_SYSCALL_TRACE - syscall trace active
......
...@@ -88,12 +88,6 @@ static inline struct thread_info *current_thread_info(void) ...@@ -88,12 +88,6 @@ static inline struct thread_info *current_thread_info(void)
#endif #endif
/*
* We use bit 30 of the preempt_count to indicate that kernel
* preemption is occurring. See <asm/hardirq.h>.
*/
#define PREEMPT_ACTIVE 0x40000000
/* /*
* thread information flags: * thread information flags:
* TIF_SYSCALL_TRACE - syscall trace active * TIF_SYSCALL_TRACE - syscall trace active
......
...@@ -66,8 +66,6 @@ static inline struct thread_info *current_thread_info(void) ...@@ -66,8 +66,6 @@ static inline struct thread_info *current_thread_info(void)
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#define PREEMPT_ACTIVE 0x40000000
/* /*
* Thread information flags * Thread information flags
* - these are process state flags that various assembly files may need to access * - these are process state flags that various assembly files may need to access
......
...@@ -88,8 +88,6 @@ static inline struct thread_info *current_thread_info(void) ...@@ -88,8 +88,6 @@ static inline struct thread_info *current_thread_info(void)
#define TI_CPU 12 #define TI_CPU 12
#define TI_PREEMPT 16 #define TI_PREEMPT 16
#define PREEMPT_ACTIVE 0x4000000
/* /*
* thread information flag bit numbers * thread information flag bit numbers
*/ */
......
...@@ -84,8 +84,6 @@ struct thread_info *current_thread_info(void) ...@@ -84,8 +84,6 @@ struct thread_info *current_thread_info(void)
#define put_thread_info(ti) put_task_struct((ti)->task) #define put_thread_info(ti) put_task_struct((ti)->task)
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#define PREEMPT_ACTIVE 0x10000000
/* /*
* thread information flag bit numbers * thread information flag bit numbers
* - pending work-to-be-done flags are in LSW * - pending work-to-be-done flags are in LSW
......
...@@ -44,8 +44,6 @@ struct thread_info { ...@@ -44,8 +44,6 @@ struct thread_info {
#endif #endif
#define PREEMPT_ACTIVE 0x10000000
/* /*
* macros/functions for gaining access to the thread information structure * macros/functions for gaining access to the thread information structure
*/ */
......
...@@ -52,8 +52,6 @@ struct thread_info { ...@@ -52,8 +52,6 @@ struct thread_info {
#endif #endif
#define PREEMPT_ACTIVE 0x10000000
/* /*
* macros/functions for gaining access to the thread information structure * macros/functions for gaining access to the thread information structure
*/ */
......
...@@ -73,10 +73,6 @@ struct thread_info { ...@@ -73,10 +73,6 @@ struct thread_info {
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
/* looks like "linux/hardirq.h" uses this. */
#define PREEMPT_ACTIVE 0x10000000
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#define INIT_THREAD_INFO(tsk) \ #define INIT_THREAD_INFO(tsk) \
......
...@@ -11,9 +11,6 @@ ...@@ -11,9 +11,6 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#define PREEMPT_ACTIVE_BIT 30
#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/* /*
......
...@@ -53,8 +53,6 @@ struct thread_info { ...@@ -53,8 +53,6 @@ struct thread_info {
#endif #endif
#define PREEMPT_ACTIVE 0x10000000
#define THREAD_SIZE (PAGE_SIZE << 1) #define THREAD_SIZE (PAGE_SIZE << 1)
#define THREAD_SIZE_ORDER 1 #define THREAD_SIZE_ORDER 1
/* /*
......
...@@ -35,8 +35,6 @@ struct thread_info { ...@@ -35,8 +35,6 @@ struct thread_info {
}; };
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#define PREEMPT_ACTIVE 0x4000000
#define INIT_THREAD_INFO(tsk) \ #define INIT_THREAD_INFO(tsk) \
{ \ { \
.task = &tsk, \ .task = &tsk, \
......
...@@ -46,8 +46,6 @@ struct thread_info { ...@@ -46,8 +46,6 @@ struct thread_info {
#endif #endif
#define PREEMPT_ACTIVE 0x10000000
#ifdef CONFIG_4KSTACKS #ifdef CONFIG_4KSTACKS
#define THREAD_SHIFT 12 #define THREAD_SHIFT 12
#else #else
......
...@@ -106,8 +106,6 @@ static inline struct thread_info *current_thread_info(void) ...@@ -106,8 +106,6 @@ static inline struct thread_info *current_thread_info(void)
/* thread information allocation */ /* thread information allocation */
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#define PREEMPT_ACTIVE 0x10000000
/* /*
* thread information flags * thread information flags
* - these are process state flags that various assembly files may * - these are process state flags that various assembly files may
......
...@@ -92,8 +92,6 @@ static inline struct thread_info *current_thread_info(void) ...@@ -92,8 +92,6 @@ static inline struct thread_info *current_thread_info(void)
#define STACK_WARN (THREAD_SIZE / 8) #define STACK_WARN (THREAD_SIZE / 8)
#define PREEMPT_ACTIVE 0x10000000
/* /*
* thread information flags * thread information flags
* - these are process state flags that various assembly files may need to * - these are process state flags that various assembly files may need to
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <asm/page.h> #include <asm/page.h>
#define PREEMPT_ACTIVE 0x10000000
#ifdef CONFIG_4KSTACKS #ifdef CONFIG_4KSTACKS
#define THREAD_SIZE (4096) #define THREAD_SIZE (4096)
#define THREAD_SIZE_ORDER (0) #define THREAD_SIZE_ORDER (0)
......
...@@ -46,9 +46,6 @@ struct thread_info { ...@@ -46,9 +46,6 @@ struct thread_info {
#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
#define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER) #define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER)
#define PREEMPT_ACTIVE_BIT 28
#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT)
/* /*
* thread information flags * thread information flags
*/ */
......
...@@ -82,8 +82,6 @@ static inline struct thread_info *current_thread_info(void) ...@@ -82,8 +82,6 @@ static inline struct thread_info *current_thread_info(void)
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#define PREEMPT_ACTIVE 0x10000000
/* /*
* thread information flag bit numbers * thread information flag bit numbers
*/ */
......
...@@ -111,6 +111,4 @@ static inline struct thread_info *current_thread_info(void) ...@@ -111,6 +111,4 @@ static inline struct thread_info *current_thread_info(void)
#define is_32bit_task() (1) #define is_32bit_task() (1)
#endif #endif
#define PREEMPT_ACTIVE 0x4000000
#endif /* _ASM_THREAD_INFO_H */ #endif /* _ASM_THREAD_INFO_H */
...@@ -72,8 +72,6 @@ register struct thread_info *__current_thread_info __asm__("r28"); ...@@ -72,8 +72,6 @@ register struct thread_info *__current_thread_info __asm__("r28");
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#define PREEMPT_ACTIVE 0x10000000
/* /*
* thread information flags * thread information flags
* - these are process state flags that various assembly files may need to * - these are process state flags that various assembly files may need to
......
...@@ -41,8 +41,6 @@ struct thread_info { ...@@ -41,8 +41,6 @@ struct thread_info {
#endif #endif
#define PREEMPT_ACTIVE 0x10000000
#if defined(CONFIG_4KSTACKS) #if defined(CONFIG_4KSTACKS)
#define THREAD_SHIFT 12 #define THREAD_SHIFT 12
#else #else
......
...@@ -108,7 +108,7 @@ need_resched: ...@@ -108,7 +108,7 @@ need_resched:
and #(0xf0>>1), r0 ! interrupts off (exception path)? and #(0xf0>>1), r0 ! interrupts off (exception path)?
cmp/eq #(0xf0>>1), r0 cmp/eq #(0xf0>>1), r0
bt noresched bt noresched
mov.l 3f, r0 mov.l 1f, r0
jsr @r0 ! call preempt_schedule_irq jsr @r0 ! call preempt_schedule_irq
nop nop
bra need_resched bra need_resched
...@@ -119,9 +119,7 @@ noresched: ...@@ -119,9 +119,7 @@ noresched:
nop nop
.align 2 .align 2
1: .long PREEMPT_ACTIVE 1: .long preempt_schedule_irq
2: .long schedule
3: .long preempt_schedule_irq
#endif #endif
ENTRY(resume_userspace) ENTRY(resume_userspace)
......
...@@ -105,8 +105,6 @@ register struct thread_info *current_thread_info_reg asm("g6"); ...@@ -105,8 +105,6 @@ register struct thread_info *current_thread_info_reg asm("g6");
#define TI_W_SAVED 0x250 #define TI_W_SAVED 0x250
/* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */ /* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */
#define PREEMPT_ACTIVE 0x4000000
/* /*
* thread information flag bit numbers * thread information flag bit numbers
*/ */
......
...@@ -111,8 +111,6 @@ struct thread_info { ...@@ -111,8 +111,6 @@ struct thread_info {
#define THREAD_SHIFT PAGE_SHIFT #define THREAD_SHIFT PAGE_SHIFT
#endif /* PAGE_SHIFT == 13 */ #endif /* PAGE_SHIFT == 13 */
#define PREEMPT_ACTIVE 0x10000000
/* /*
* macros/functions for gaining access to the thread information structure * macros/functions for gaining access to the thread information structure
*/ */
......
...@@ -113,8 +113,6 @@ extern void _cpu_idle(void); ...@@ -113,8 +113,6 @@ extern void _cpu_idle(void);
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#define PREEMPT_ACTIVE 0x10000000
/* /*
* Thread information flags that various assembly files may need to access. * Thread information flags that various assembly files may need to access.
* Keep flags accessed frequently in low bits, particular since it makes * Keep flags accessed frequently in low bits, particular since it makes
......
...@@ -60,8 +60,6 @@ static inline struct thread_info *current_thread_info(void) ...@@ -60,8 +60,6 @@ static inline struct thread_info *current_thread_info(void)
#endif #endif
#define PREEMPT_ACTIVE 0x10000000
#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
#define TIF_SIGPENDING 1 /* signal pending */ #define TIF_SIGPENDING 1 /* signal pending */
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */ #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
......
...@@ -117,12 +117,6 @@ static inline struct thread_info *current_thread_info(void) ...@@ -117,12 +117,6 @@ static inline struct thread_info *current_thread_info(void)
#endif #endif
/*
* We use bit 30 of the preempt_count to indicate that kernel
* preemption is occurring. See <asm/hardirq.h>.
*/
#define PREEMPT_ACTIVE 0x40000000
/* /*
* thread information flags: * thread information flags:
* TIF_SYSCALL_TRACE - syscall trace active * TIF_SYSCALL_TRACE - syscall trace active
......
...@@ -153,8 +153,6 @@ struct thread_info { ...@@ -153,8 +153,6 @@ struct thread_info {
#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY) #define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW) #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW)
#define PREEMPT_ACTIVE 0x10000000
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
#define STACK_WARN (THREAD_SIZE/8) #define STACK_WARN (THREAD_SIZE/8)
......
...@@ -76,8 +76,6 @@ struct thread_info { ...@@ -76,8 +76,6 @@ struct thread_info {
#endif #endif
#define PREEMPT_ACTIVE 0x10000000
/* /*
* macros/functions for gaining access to the thread information structure * macros/functions for gaining access to the thread information structure
*/ */
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* SOFTIRQ_MASK: 0x0000ff00 * SOFTIRQ_MASK: 0x0000ff00
* HARDIRQ_MASK: 0x000f0000 * HARDIRQ_MASK: 0x000f0000
* NMI_MASK: 0x00100000 * NMI_MASK: 0x00100000
* PREEMPT_ACTIVE: 0x00200000
*/ */
#define PREEMPT_BITS 8 #define PREEMPT_BITS 8
#define SOFTIRQ_BITS 8 #define SOFTIRQ_BITS 8
...@@ -46,15 +47,9 @@ ...@@ -46,15 +47,9 @@
#define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET)
#ifndef PREEMPT_ACTIVE
#define PREEMPT_ACTIVE_BITS 1 #define PREEMPT_ACTIVE_BITS 1
#define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS)
#define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT) #define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
#endif
#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS))
#error PREEMPT_ACTIVE is too low!
#endif
#define hardirq_count() (preempt_count() & HARDIRQ_MASK) #define hardirq_count() (preempt_count() & HARDIRQ_MASK)
#define softirq_count() (preempt_count() & SOFTIRQ_MASK) #define softirq_count() (preempt_count() & SOFTIRQ_MASK)
......
...@@ -22,7 +22,7 @@ struct sched_param { ...@@ -22,7 +22,7 @@ struct sched_param {
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/nodemask.h> #include <linux/nodemask.h>
#include <linux/mm_types.h> #include <linux/mm_types.h>
#include <linux/preempt.h> #include <linux/preempt_mask.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment