Skip to contentSkip to conversation

get_thread_area macros

PATCH New Adam Lackorzynski 1 participant 1 message May 4, 2004 ptrace support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 get_thread_area macros

Hi,

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

arch/i386/kernel/process.c +1 -1
diff -urN linux-2.6.6-rc3/arch/i386/kernel/process.c linux-2.6.6-rc3-a/arch/i386/kernel/process.c
@@ -740,7 +740,7 @@
 	((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)
arch/i386/kernel/ptrace.c +1 -1
diff -urN linux-2.6.6-rc3/arch/i386/kernel/ptrace.c linux-2.6.6-rc3-a/arch/i386/kernel/ptrace.c
@@ -174,7 +174,7 @@
 	((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)

Furthermore I'd suggest to put these macros into desc.h, mainly to avoid the duplication in the two files.

Adam

Signature · 2 lines
Adam                 [email protected]
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/