Commit dcd497f9 authored by Jesper Juhl's avatar Jesper Juhl Committed by Linus Torvalds

[PATCH] streamline preempt_count type across archs

The preempt_count member of struct thread_info is currently either defined
as int, unsigned int or __s32 depending on arch.  This patch makes the type
of preempt_count an int on all archs.

Having preempt_count be an unsigned type prevents the catching of
preempt_count < 0 bugs, and using int on some archs and __s32 on others is
not exactely "neat" - much nicer when it's just int all over.

A previous version of this patch was already ACK'ed by Robert Love, and the
only change in this version of the patch compared to the one he ACK'ed is
that this one also makes sure the preempt_count member is consistently
commented.
Signed-off-by: default avatarJesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 35a82d1a
...@@ -49,7 +49,7 @@ struct cpu_context_save { ...@@ -49,7 +49,7 @@ struct cpu_context_save {
*/ */
struct thread_info { struct thread_info {
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
__s32 preempt_count; /* 0 => preemptable, <0 => bug */ int preempt_count; /* 0 => preemptable, <0 => bug */
mm_segment_t addr_limit; /* address limit */ mm_segment_t addr_limit; /* address limit */
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 */
......
...@@ -44,7 +44,7 @@ struct cpu_context_save { ...@@ -44,7 +44,7 @@ struct cpu_context_save {
*/ */
struct thread_info { struct thread_info {
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
__s32 preempt_count; /* 0 => preemptable, <0 => bug */ int preempt_count; /* 0 => preemptable, <0 => bug */
mm_segment_t addr_limit; /* address limit */ mm_segment_t addr_limit; /* address limit */
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 */
......
...@@ -31,7 +31,7 @@ struct thread_info { ...@@ -31,7 +31,7 @@ struct thread_info {
struct exec_domain *exec_domain; /* execution domain */ struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
__u32 cpu; /* current CPU */ __u32 cpu; /* current CPU */
__s32 preempt_count; /* 0 => preemptable, <0 => BUG */ int preempt_count; /* 0 => preemptable, <0 => BUG */
mm_segment_t addr_limit; /* thread address space: mm_segment_t addr_limit; /* thread address space:
0-0xBFFFFFFF for user-thead 0-0xBFFFFFFF for user-thead
......
...@@ -33,7 +33,7 @@ struct thread_info { ...@@ -33,7 +33,7 @@ struct thread_info {
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
unsigned long status; /* thread-synchronous flags */ unsigned long status; /* thread-synchronous flags */
__u32 cpu; /* current CPU */ __u32 cpu; /* current CPU */
__s32 preempt_count; /* 0 => preemptable, <0 => BUG */ int preempt_count; /* 0 => preemptable, <0 => BUG */
mm_segment_t addr_limit; /* thread address space: mm_segment_t addr_limit; /* thread address space:
0-0xBFFFFFFF for user-thead 0-0xBFFFFFFF for user-thead
......
...@@ -23,7 +23,7 @@ struct thread_info { ...@@ -23,7 +23,7 @@ struct thread_info {
struct exec_domain *exec_domain; /* execution domain */ struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
int cpu; /* cpu we're on */ int cpu; /* cpu we're on */
int preempt_count; /* 0 => preemptable, <0 => BUG*/ int preempt_count; /* 0 => preemptable, <0 => BUG */
struct restart_block restart_block; struct restart_block restart_block;
}; };
......
...@@ -31,7 +31,7 @@ struct thread_info { ...@@ -31,7 +31,7 @@ struct thread_info {
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
unsigned long status; /* thread-synchronous flags */ unsigned long status; /* thread-synchronous flags */
__u32 cpu; /* current CPU */ __u32 cpu; /* current CPU */
__s32 preempt_count; /* 0 => preemptable, <0 => BUG */ int preempt_count; /* 0 => preemptable, <0 => BUG */
mm_segment_t addr_limit; /* thread address space: mm_segment_t addr_limit; /* thread address space:
......
...@@ -25,7 +25,7 @@ struct thread_info { ...@@ -25,7 +25,7 @@ struct thread_info {
__u32 flags; /* thread_info flags (see TIF_*) */ __u32 flags; /* thread_info flags (see TIF_*) */
__u32 cpu; /* current CPU */ __u32 cpu; /* current CPU */
mm_segment_t addr_limit; /* user-level address space limit */ mm_segment_t addr_limit; /* user-level address space limit */
__s32 preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */
struct restart_block restart_block; struct restart_block restart_block;
struct { struct {
int signo; int signo;
......
...@@ -28,7 +28,7 @@ struct thread_info { ...@@ -28,7 +28,7 @@ struct thread_info {
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
unsigned long status; /* thread-synchronous flags */ unsigned long status; /* thread-synchronous flags */
__u32 cpu; /* current CPU */ __u32 cpu; /* current CPU */
__s32 preempt_count; /* 0 => preemptable, <0 => BUG */ int preempt_count; /* 0 => preemptable, <0 => BUG */
mm_segment_t addr_limit; /* thread address space: mm_segment_t addr_limit; /* thread address space:
0-0xBFFFFFFF for user-thread 0-0xBFFFFFFF for user-thread
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
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 */
__s32 preempt_count; /* 0 => preemptable, <0 => BUG */ int preempt_count; /* 0 => preemptable, <0 => BUG */
__u32 cpu; /* should always be 0 on m68k */ __u32 cpu; /* should always be 0 on m68k */
struct restart_block restart_block; struct restart_block restart_block;
......
...@@ -36,7 +36,7 @@ struct thread_info { ...@@ -36,7 +36,7 @@ struct thread_info {
struct exec_domain *exec_domain; /* execution domain */ struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
int cpu; /* cpu we're on */ int cpu; /* cpu we're on */
int preempt_count; /* 0 => preemptable, <0 => BUG*/ int preempt_count; /* 0 => preemptable, <0 => BUG */
struct restart_block restart_block; struct restart_block restart_block;
}; };
......
...@@ -27,7 +27,7 @@ struct thread_info { ...@@ -27,7 +27,7 @@ struct thread_info {
struct exec_domain *exec_domain; /* execution domain */ struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
__u32 cpu; /* current CPU */ __u32 cpu; /* current CPU */
__s32 preempt_count; /* 0 => preemptable, <0 => BUG */ int preempt_count; /* 0 => preemptable, <0 => BUG */
mm_segment_t addr_limit; /* thread address space: mm_segment_t addr_limit; /* thread address space:
0-0xBFFFFFFF for user-thead 0-0xBFFFFFFF for user-thead
......
...@@ -12,7 +12,7 @@ struct thread_info { ...@@ -12,7 +12,7 @@ struct thread_info {
unsigned long flags; /* thread_info flags (see TIF_*) */ unsigned long flags; /* thread_info flags (see TIF_*) */
mm_segment_t addr_limit; /* user-level address space limit */ mm_segment_t addr_limit; /* user-level address space limit */
__u32 cpu; /* current CPU */ __u32 cpu; /* current CPU */
__s32 preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */
struct restart_block restart_block; struct restart_block restart_block;
}; };
......
...@@ -20,7 +20,8 @@ struct thread_info { ...@@ -20,7 +20,8 @@ struct thread_info {
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
unsigned long local_flags; /* non-racy flags */ unsigned long local_flags; /* non-racy flags */
int cpu; /* cpu we're on */ int cpu; /* cpu we're on */
int preempt_count; int preempt_count; /* 0 => preemptable,
<0 => BUG */
struct restart_block restart_block; struct restart_block restart_block;
}; };
......
...@@ -24,7 +24,7 @@ struct thread_info { ...@@ -24,7 +24,7 @@ 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 */
int cpu; /* cpu we're on */ int cpu; /* cpu we're on */
int preempt_count; int preempt_count; /* 0 => preemptable, <0 => BUG */
struct restart_block restart_block; struct restart_block restart_block;
/* set by force_successful_syscall_return */ /* set by force_successful_syscall_return */
unsigned char syscall_noerror; unsigned char syscall_noerror;
......
...@@ -50,7 +50,7 @@ struct thread_info { ...@@ -50,7 +50,7 @@ struct thread_info {
struct exec_domain *exec_domain; /* execution domain */ struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
unsigned int cpu; /* current CPU */ unsigned int cpu; /* current CPU */
unsigned int preempt_count; /* 0 => preemptable */ int preempt_count; /* 0 => preemptable, <0 => BUG */
struct restart_block restart_block; struct restart_block restart_block;
}; };
......
...@@ -20,7 +20,7 @@ struct thread_info { ...@@ -20,7 +20,7 @@ struct thread_info {
struct exec_domain *exec_domain; /* execution domain */ struct exec_domain *exec_domain; /* execution domain */
__u32 flags; /* low level flags */ __u32 flags; /* low level flags */
__u32 cpu; __u32 cpu;
__s32 preempt_count; /* 0 => preemptable, <0 => BUG */ int preempt_count; /* 0 => preemptable, <0 => BUG */
struct restart_block restart_block; struct restart_block restart_block;
__u8 supervisor_stack[0]; __u8 supervisor_stack[0];
}; };
......
...@@ -22,7 +22,7 @@ struct thread_info { ...@@ -22,7 +22,7 @@ struct thread_info {
struct exec_domain *exec_domain; /* execution domain */ struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
/* Put the 4 32-bit fields together to make asm offsetting easier. */ /* Put the 4 32-bit fields together to make asm offsetting easier. */
__s32 preempt_count; /* 0 => preemptable, <0 => BUG */ int preempt_count; /* 0 => preemptable, <0 => BUG */
__u16 cpu; __u16 cpu;
mm_segment_t addr_limit; mm_segment_t addr_limit;
......
...@@ -30,9 +30,9 @@ struct thread_info { ...@@ -30,9 +30,9 @@ 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 */ unsigned long flags; /* low level flags */
int cpu; /* cpu we're on */ int cpu; /* cpu we're on */
int preempt_count; int preempt_count; /* 0 => preemptable,
<0 => BUG */
int softirq_count; int softirq_count;
int hardirq_count; int hardirq_count;
......
...@@ -46,7 +46,7 @@ struct thread_info { ...@@ -46,7 +46,7 @@ struct thread_info {
unsigned long fault_address; unsigned long fault_address;
struct pt_regs *kregs; struct pt_regs *kregs;
struct exec_domain *exec_domain; struct exec_domain *exec_domain;
int preempt_count; int preempt_count; /* 0 => preemptable, <0 => BUG */
int __pad; int __pad;
unsigned long *utraps; unsigned long *utraps;
......
...@@ -17,7 +17,7 @@ struct thread_info { ...@@ -17,7 +17,7 @@ struct thread_info {
struct exec_domain *exec_domain; /* execution domain */ struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
__u32 cpu; /* current CPU */ __u32 cpu; /* current CPU */
__s32 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; /* thread address space:
0-0xBFFFFFFF for user 0-0xBFFFFFFF for user
......
...@@ -30,7 +30,8 @@ struct thread_info { ...@@ -30,7 +30,8 @@ struct thread_info {
struct exec_domain *exec_domain; /* execution domain */ struct exec_domain *exec_domain; /* execution domain */
unsigned long flags; /* low level flags */ unsigned long flags; /* low level flags */
int cpu; /* cpu we're on */ int cpu; /* cpu we're on */
int preempt_count; int preempt_count; /* 0 => preemptable,
<0 => BUG */
struct restart_block restart_block; struct restart_block restart_block;
}; };
......
...@@ -29,7 +29,7 @@ struct thread_info { ...@@ -29,7 +29,7 @@ struct thread_info {
__u32 flags; /* low level flags */ __u32 flags; /* low level flags */
__u32 status; /* thread synchronous flags */ __u32 status; /* thread synchronous flags */
__u32 cpu; /* current CPU */ __u32 cpu; /* current CPU */
int preempt_count; int preempt_count; /* 0 => preemptable, <0 => BUG */
mm_segment_t addr_limit; mm_segment_t addr_limit;
struct restart_block restart_block; struct restart_block restart_block;
......
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