Re: [PATCH][RESENT] remove hardcoded offsets from ppc asm

From: Vincent Hanquez
Date: Sun Aug 08 2004 - 05:53:49 EST


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@xxxxxxxxx>

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

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/