Commit ed59cb75 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] get_thread_area macro fixes

From: Adam Lackorzynski <adam@os.inf.tu-dresden.de>

one of the macros for get_thread_area extracts the wrong bit.  The
"32bit" field is in bit 22, not 23 (as can be seen in desc.h). 

[ Fix ia64/x86-64 too, while we're at it. Linus ]
parent 5034465f
......@@ -737,7 +737,7 @@ asmlinkage int sys_set_thread_area(struct user_desc __user *u_info)
((desc)->a & 0x0ffff) | \
((desc)->b & 0xf0000) )
#define GET_32BIT(desc) (((desc)->b >> 23) & 1)
#define GET_32BIT(desc) (((desc)->b >> 22) & 1)
#define GET_CONTENTS(desc) (((desc)->b >> 10) & 3)
#define GET_WRITABLE(desc) (((desc)->b >> 9) & 1)
#define GET_LIMIT_PAGES(desc) (((desc)->b >> 23) & 1)
......
......@@ -174,7 +174,7 @@ ptrace_get_thread_area(struct task_struct *child,
((desc)->a & 0x0ffff) | \
((desc)->b & 0xf0000) )
#define GET_32BIT(desc) (((desc)->b >> 23) & 1)
#define GET_32BIT(desc) (((desc)->b >> 22) & 1)
#define GET_CONTENTS(desc) (((desc)->b >> 10) & 3)
#define GET_WRITABLE(desc) (((desc)->b >> 9) & 1)
#define GET_LIMIT_PAGES(desc) (((desc)->b >> 23) & 1)
......
......@@ -2073,7 +2073,7 @@ sys32_set_thread_area (struct ia32_user_desc *u_info)
((desc)->a & 0x0ffff) | \
((desc)->b & 0xf0000) )
#define GET_32BIT(desc) (((desc)->b >> 23) & 1)
#define GET_32BIT(desc) (((desc)->b >> 22) & 1)
#define GET_CONTENTS(desc) (((desc)->b >> 10) & 3)
#define GET_WRITABLE(desc) (((desc)->b >> 9) & 1)
#define GET_LIMIT_PAGES(desc) (((desc)->b >> 23) & 1)
......
......@@ -94,7 +94,7 @@ asmlinkage long sys32_set_thread_area(struct user_desc *u_info)
((desc)->a & 0x0ffff) | \
((desc)->b & 0xf0000) )
#define GET_32BIT(desc) (((desc)->b >> 23) & 1)
#define GET_32BIT(desc) (((desc)->b >> 22) & 1)
#define GET_CONTENTS(desc) (((desc)->b >> 10) & 3)
#define GET_WRITABLE(desc) (((desc)->b >> 9) & 1)
#define GET_LIMIT_PAGES(desc) (((desc)->b >> 23) & 1)
......
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