Skip to contentSkip to conversation

ia64 circular dependency on asm-offsets.h

PATCH Luck, Tony 3 participants 3 messages Sep 13, 2005

lore
Share & tools
lore

Luck, Tony

author
#0 lore raw

I am not proud of this patch (but Linus has already declared that I have no taste :-). More of a case of changing out one ugly hack for a new ugly hack. It's only merit is that this ugly hack works, where the old one has run into terminal problems.

But unless someone can see a better way to fix this (in a simple patch suitable for merging in -rc1 ... I'll be ecstatic to entertain better patches for 2.6.15) then I'm going to submit it to Linus.

-Tony

arch/ia64/Makefile +1 -11
@@ -82,17 +82,7 @@ unwcheck: vmlinux
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-archprepare:  include/asm-ia64/.offsets.h.stamp
-
-include/asm-ia64/.offsets.h.stamp:
-	mkdir -p include/asm-ia64
-	[ -s include/asm-ia64/asm-offsets.h ] \
-	|| echo "#define IA64_TASK_SIZE 0" > include/asm-ia64/asm-offsets.h
-	touch $@
-
-
-
-CLEAN_FILES += vmlinux.gz bootloader include/asm-ia64/.offsets.h.stamp
+CLEAN_FILES += vmlinux.gz bootloader
 
 boot:	lib/lib.a vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) $@
arch/ia64/kernel/asm-offsets.c +1 -0
@@ -4,6 +4,7 @@
  * to extract and format the required data.
  */
 
+#define ASM_OFFSETS_C 1
 #include <linux/config.h>
 
 #include <linux/sched.h>
include/asm-ia64/ptrace.h +2 -0
@@ -57,7 +57,9 @@
 #include <linux/config.h>
 
 #include <asm/fpu.h>
+#ifndef ASM_OFFSETS_C
 #include <asm/asm-offsets.h>
+#endif
 
 /*
  * Base-2 logarithm of number of pages to allocate per task structure
include/asm-ia64/thread_info.h +7 -0
@@ -5,7 +5,9 @@
 #ifndef _ASM_IA64_THREAD_INFO_H
 #define _ASM_IA64_THREAD_INFO_H
 
+#ifndef ASM_OFFSETS_C
 #include <asm/asm-offsets.h>
+#endif
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 
@@ -51,9 +53,14 @@ struct thread_info {
 	},					\
 }
 
+#ifndef ASM_OFFSETS_C
 /* how to get the thread information struct from C */
 #define current_thread_info()	((struct thread_info *) ((char *) current + IA64_TASK_SIZE))
 #define alloc_thread_info(tsk)	((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE))
+#else
+#define current_thread_info()	((struct thread_info *) 0)
+#define alloc_thread_info(tsk)	((struct thread_info *) 0)
+#endif
 #define free_thread_info(ti)	/* nothing */
 
 #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
#1 lore raw
Quoted 4 lines · Tony

I am not proud of this patch (but Linus has already declared that I have no taste :-). More of a case of changing out one ugly hack for a new ugly hack. It's only merit is that this ugly hack works, where the old one has run into terminal problems.

I have no better ideas than this one.

Matthew Wilcox once suggested a much more fundamental change.
See: http://www.gelato.unsw.edu.au/archives/linux-ia64/0211/4114.html

Absolutely not 2.6.14 material - just wanted to bring the idea back again.

Sam