mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] get_thread_area macros
Date: Tue, 4 May 2004 13:36:41 +0200	[thread overview]
Message-ID: <20040504113641.GI2801@os.inf.tu-dresden.de> (raw)

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).

diff -urN linux-2.6.6-rc3/arch/i386/kernel/process.c linux-2.6.6-rc3-a/arch/i386/kernel/process.c
--- linux-2.6.6-rc3/arch/i386/kernel/process.c	2004-05-03 22:28:42.000000000 +0200
+++ linux-2.6.6-rc3-a/arch/i386/kernel/process.c	2004-05-03 22:32:19.000000000 +0200
@@ -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)
diff -urN linux-2.6.6-rc3/arch/i386/kernel/ptrace.c linux-2.6.6-rc3-a/arch/i386/kernel/ptrace.c
--- linux-2.6.6-rc3/arch/i386/kernel/ptrace.c	2004-05-03 22:28:42.000000000 +0200
+++ linux-2.6.6-rc3-a/arch/i386/kernel/ptrace.c	2004-05-03 22:33:43.000000000 +0200
@@ -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
-- 
Adam                 adam@os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/

                 reply	other threads:[~2004-05-04 11:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040504113641.GI2801@os.inf.tu-dresden.de \
    --to=adam@os.inf.tu-dresden.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®