public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vincent Hanquez <tab@snarc.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][RESENT] remove hardcoded offsets from ppc asm
Date: Sun, 8 Aug 2004 12:52:36 +0200	[thread overview]
Message-ID: <20040808105236.GB13798@snarc.org> (raw)
In-Reply-To: <1091960741.14105.22.camel@gaston>

On Sun, Aug 08, 2004 at 08:25:42PM +1000, Benjamin Herrenschmidt wrote:
> On Sun, 2004-08-08 at 20:25, Vincent Hanquez wrote:
> 
> > Hi Benjamin, it seems to be the 'convention'. I did the same comment
> > some time ago to Brian Gerst with his patch for i386.
> > 
> > http://marc.theaimsgroup.com/?l=linux-kernel&m=108454158825656&w=2
> > 
> > But if you prefer a smaller patch, without changing the constant
> > name, I can do that too.
> 
> I don't know about this "convention", we certainly don't apply it
> on ppc, I'd suggest doing the simpler patch instead.

ok thanks, here it is:

Signed-off-by: Vincent Hanquez <tab@snarc.org>

diff -Naur linux-2.6.8-rc3.orig/arch/ppc/kernel/asm-offsets.c linux-2.6.8-rc3/arch/ppc/kernel/asm-offsets.c
--- linux-2.6.8-rc3.orig/arch/ppc/kernel/asm-offsets.c	2004-08-07 16:19:55.000000000 +0200
+++ linux-2.6.8-rc3/arch/ppc/kernel/asm-offsets.c	2004-08-07 16:26:06.000000000 +0200
@@ -129,6 +129,13 @@
 	DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
 	DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
 
+	DEFINE(TI_TASK, offsetof(struct thread_info, task));
+	DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
+	DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
+	DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
+	DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
+	DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
+	
 	DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
 	return 0;
 }
diff -Naur linux-2.6.8-rc3.orig/include/asm-ppc/thread_info.h linux-2.6.8-rc3/include/asm-ppc/thread_info.h
--- linux-2.6.8-rc3.orig/include/asm-ppc/thread_info.h	2004-08-07 16:20:00.000000000 +0200
+++ linux-2.6.8-rc3/include/asm-ppc/thread_info.h	2004-08-07 16:26:06.000000000 +0200
@@ -65,16 +65,6 @@
  */
 #define THREAD_SIZE		8192	/* 2 pages */
 
-/*
- * Offsets in thread_info structure, used in assembly code
- */
-#define TI_TASK		0
-#define TI_EXECDOMAIN	4
-#define TI_FLAGS	8
-#define TI_LOCAL_FLAGS	12
-#define TI_CPU		16
-#define TI_PREEMPT	20
-
 #define PREEMPT_ACTIVE		0x4000000
 
 /*

      reply	other threads:[~2004-08-08 10:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-07 15:18 [PATCH][RESENT] remove hardcoded offsets from ppc asm Vincent Hanquez
2004-08-07 23:32 ` Benjamin Herrenschmidt
2004-08-08 10:25   ` Vincent Hanquez
2004-08-08 10:25     ` Benjamin Herrenschmidt
2004-08-08 10:52       ` Vincent Hanquez [this message]

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=20040808105236.GB13798@snarc.org \
    --to=tab@snarc.org \
    --cc=benh@kernel.crashing.org \
    --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