Skip to contentSkip to conversation

kbuild: full dependency check on asm-offsets.h

PATCH In review Sam Ravnborg 3 participants 18 messages Sep 9, 2005 – Sep 11, 2005

Subsystems (14)
Arm (32-bit) PowerPC Kbuild MIPS +10 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH 1/12 kbuild: full dependency check on asm-offsets.h

Building asm-offsets.h has been moved to a seperate Kbuild file located in the top-level directory. This allow us to share the functionality across the architectures.

The old rules in architecture specific Makefiles will die in subsequent patches.

Furhtermore the usual kbuild dependency tracking is now used when deciding to rebuild asm-offsets.s. So we no longer risk to fail a rebuild caused by asm-offsets.c dependencies being touched.

With this common rule-set we now force the same name across all architectures. Following patches will fix the rest.

---

 Kbuild                                |   41 +++++++++++++++++++++++++++++++++
 Makefile                              |   39 +++++++++----------------------
 arch/i386/Makefile                    |    9 -------
 arch/i386/kernel/head.S               |    2 +-
 arch/i386/kernel/vsyscall-sigreturn.S |    2 +-
 arch/i386/kernel/vsyscall.lds.S       |    2 +-
 arch/i386/power/swsusp.S              |    2 +-
 include/asm-i386/thread_info.h        |    2 +-
 8 files changed, 57 insertions(+), 42 deletions(-)
 create mode 100644 Kbuild

86feeaa8120bb1b0ab21efed49e9754039395ef1

Kbuild new file +41 -0
new file mode 100644
@@ -0,0 +1,41 @@
+#
+# Kbuild for top-level directory of the kernel
+# This file takes care of the following:
+# 1) Generate asm-offsets.h
+
+#####
+# 1) Generate asm-offsets.h 
+#
+
+offsets-file := include/asm-$(ARCH)/asm-offsets.h
+
+always  := $(offsets-file)
+targets := $(offsets-file)
+targets += arch/$(ARCH)/kernel/asm-offsets.s
+
+quiet_cmd_offsets = GEN     $@
+define cmd_offsets
+	cat $< | \
+	(set -e; \
+	 echo "#ifndef __ASM_OFFSETS_H__"; \
+	 echo "#define __ASM_OFFSETS_H__"; \
+	 echo "/*"; \
+	 echo " * DO NOT MODIFY."; \
+	 echo " *"; \
+	 echo " * This file was generated by $(srctree)/Kbuild"; \
+	 echo " *"; \
+	 echo " */"; \
+	 echo ""; \
+	 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
+	 echo ""; \
+	 echo "#endif" ) > $@
+endef
+
+# We use internal kbuild rules to avoid the "is up to date" message from make
+arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE
+	$(Q)mkdir -p $(dir $@)
+	$(call if_changed_dep,cc_s_c)
+
+$(srctree)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
+	$(call cmd,offsets)
+
Makefile +11 -28
@@ -776,14 +776,14 @@ $(vmlinux-dirs): prepare-all scripts
 # A multi level approach is used. prepare1 is updated first, then prepare0.
 # prepare-all is the collection point for the prepare targets.
 
-.PHONY: prepare-all prepare prepare0 prepare1 prepare2
+.PHONY: prepare-all prepare prepare0 prepare1 prepare2 prepare3
 
-# prepare2 is used to check if we are building in a separate output directory,
+# prepare3 is used to check if we are building in a separate output directory,
 # and if so do:
 # 1) Check that make has not been executed in the kernel src $(srctree)
 # 2) Create the include2 directory, used for the second asm symlink
 
-prepare2:
+prepare3:
 ifneq ($(KBUILD_SRC),)
 	@echo '  Using $(srctree) as source for kernel'
 	$(Q)if [ -f $(srctree)/.config ]; then \
@@ -795,18 +795,21 @@ ifneq ($(KBUILD_SRC),)
 	$(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm
 endif
 
-# prepare1 creates a makefile if using a separate output directory
-prepare1: prepare2 outputmakefile
+# prepare2 creates a makefile if using a separate output directory
+prepare2: prepare3 outputmakefile
 
-prepare0: prepare1 include/linux/version.h include/asm \
+prepare1: prepare2 include/linux/version.h include/asm \
                    include/config/MARKER
 ifneq ($(KBUILD_MODULES),)
 	$(Q)rm -rf $(MODVERDIR)
 	$(Q)mkdir -p $(MODVERDIR)
 endif
 
+prepare0: prepare prepare1 FORCE
+	$(Q)$(MAKE) $(build)=$(srctree)
+
 # All the preparing..
-prepare-all: prepare0 prepare
+prepare-all: prepare0
 
 #	Leave this as default for preprocessing vmlinux.lds.S, which is now
 #	done in arch/$(ARCH)/kernel/Makefile
@@ -949,26 +952,6 @@ modules modules_install: FORCE
 
 endif # CONFIG_MODULES
 
-# Generate asm-offsets.h 
-# ---------------------------------------------------------------------------
-
-define filechk_gen-asm-offsets
-	(set -e; \
-	 echo "#ifndef __ASM_OFFSETS_H__"; \
-	 echo "#define __ASM_OFFSETS_H__"; \
-	 echo "/*"; \
-	 echo " * DO NOT MODIFY."; \
-	 echo " *"; \
-	 echo " * This file was generated by arch/$(ARCH)/Makefile"; \
-	 echo " *"; \
-	 echo " */"; \
-	 echo ""; \
-	 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
-	 echo ""; \
-	 echo "#endif" )
-endef
-
-
 ###
 # Cleaning is done on three levels.
 # make clean     Delete most generated files
@@ -991,7 +974,7 @@ MRPROPER_FILES += .config .config.old in
 #
 clean: rm-dirs  := $(CLEAN_DIRS)
 clean: rm-files := $(CLEAN_FILES)
-clean-dirs      := $(addprefix _clean_,$(vmlinux-alldirs))
+clean-dirs      := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs))
 
 .PHONY: $(clean-dirs) clean archclean
 $(clean-dirs):
arch/i386/Makefile +0 -9
@@ -156,15 +156,6 @@ install: vmlinux
 install kernel_install:
 	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
 
-prepare: include/asm-$(ARCH)/asm_offsets.h
-CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
-
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
 archclean:
 	$(Q)$(MAKE) $(clean)=arch/i386/boot
 
arch/i386/kernel/head.S +1 -1
@@ -17,7 +17,7 @@
 #include <asm/desc.h>
 #include <asm/cache.h>
 #include <asm/thread_info.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/setup.h>
 
 /*
arch/i386/kernel/vsyscall-sigreturn.S +1 -1
@@ -7,7 +7,7 @@
  */
 
 #include <asm/unistd.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 
 
 /* XXX
arch/i386/kernel/vsyscall.lds.S +1 -1
@@ -3,7 +3,7 @@
  * object prelinked to its virtual address, and with only one read-only
  * segment (that fits in one page).  This script controls its layout.
  */
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 
 SECTIONS
 {
arch/i386/power/swsusp.S +1 -1
@@ -12,7 +12,7 @@
 #include <linux/linkage.h>
 #include <asm/segment.h>
 #include <asm/page.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 
 	.text
 
include/asm-i386/thread_info.h +1 -1
@@ -48,7 +48,7 @@ struct thread_info {
 
 #else /* !__ASSEMBLY__ */
 
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 
 #endif
 
#2 lore raw

PATCH 3/12 kbuild: arm26,sparc use generic asm-offset support

In reply to Sam Ravnborg

Rename all includes to use asm-offsets.h to match generic name

---

 arch/arm26/Makefile                  |   10 ----------
 arch/arm26/kernel/entry.S            |    2 +-
 arch/arm26/lib/copy_page.S           |    2 +-
 arch/arm26/lib/csumpartialcopyuser.S |    2 +-
 arch/arm26/lib/getuser.S             |    2 +-
 arch/arm26/lib/putuser.S             |    2 +-
 arch/arm26/mm/proc-funcs.S           |    2 +-
 arch/arm26/nwfpe/entry.S             |    2 +-
 arch/sparc/Makefile                  |   12 +-----------
 arch/sparc/kernel/entry.S            |    2 +-
 arch/sparc/kernel/sclow.S            |    2 +-
 arch/sparc/mm/hypersparc.S           |    2 +-
 arch/sparc/mm/swift.S                |    2 +-
 arch/sparc/mm/tsunami.S              |    2 +-
 arch/sparc/mm/viking.S               |    2 +-
 include/asm-sparc/ptrace.h           |    4 ++--
 16 files changed, 16 insertions(+), 36 deletions(-)

47003497dd819b10874a2291e54df7dc5cf8be57

arch/arm26/Makefile +0 -10
@@ -49,10 +49,6 @@ all: zImage
 
 boot := arch/arm26/boot
 
-prepare: include/asm-$(ARCH)/asm_offsets.h
-CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
-
-
 .PHONY: maketools FORCE
 maketools: FORCE
 	
@@ -94,12 +90,6 @@ zi:;	$(Q)$(MAKE) $(build)=$(boot) zinsta
 	fi; \
 	)
 
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
 define archhelp
   echo  '* zImage        - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
   echo  '  Image         - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
arch/arm26/kernel/entry.S +1 -1
@@ -10,7 +10,7 @@
 #include <linux/linkage.h>
 
 #include <asm/assembler.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/errno.h>
 #include <asm/hardware.h>
 #include <asm/sysirq.h>
arch/arm26/lib/copy_page.S +1 -1
@@ -11,7 +11,7 @@
  */
 #include <linux/linkage.h>
 #include <asm/assembler.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 
 		.text
 		.align	5
arch/arm26/lib/csumpartialcopyuser.S +1 -1
@@ -11,7 +11,7 @@
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/errno.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 
 		.text
 
arch/arm26/lib/getuser.S +1 -1
@@ -26,7 +26,7 @@
  * Note that ADDR_LIMIT is either 0 or 0xc0000000.
  * Note also that it is intended that __get_user_bad is not global.
  */
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 #include <asm/errno.h>
 
arch/arm26/lib/putuser.S +1 -1
@@ -26,7 +26,7 @@
  * Note that ADDR_LIMIT is either 0 or 0xc0000000
  * Note also that it is intended that __put_user_bad is not global.
  */
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 #include <asm/errno.h>
 
arch/arm26/mm/proc-funcs.S +1 -1
@@ -14,7 +14,7 @@
  */
 #include <linux/linkage.h>
 #include <asm/assembler.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
 
arch/arm26/nwfpe/entry.S +1 -1
@@ -20,7 +20,7 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 
 /* This is the kernel's entry point into the floating point emulator.
 It is called from the kernel with code similar to this:
arch/sparc/Makefile +1 -11
@@ -59,17 +59,7 @@ image tftpboot.img: vmlinux
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-prepare: include/asm-$(ARCH)/asm_offsets.h
-
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
-CLEAN_FILES +=	include/asm-$(ARCH)/asm_offsets.h	\
-		arch/$(ARCH)/kernel/asm-offsets.s	\
-		arch/$(ARCH)/boot/System.map
+CLEAN_FILES += arch/$(ARCH)/boot/System.map
 
 # Don't use tabs in echo arguments.
 define archhelp
arch/sparc/kernel/entry.S +1 -1
@@ -17,7 +17,7 @@
 #include <asm/kgdb.h>
 #include <asm/contregs.h>
 #include <asm/ptrace.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/psr.h>
 #include <asm/vaddrs.h>
 #include <asm/memreg.h>
arch/sparc/kernel/sclow.S +1 -1
@@ -7,7 +7,7 @@
  */
 
 #include <asm/ptrace.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/errno.h>
 #include <asm/winmacro.h>
 #include <asm/thread_info.h>
arch/sparc/mm/hypersparc.S +1 -1
@@ -6,7 +6,7 @@
 
 #include <asm/ptrace.h>
 #include <asm/psr.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/asi.h>
 #include <asm/page.h>
 #include <asm/pgtsrmmu.h>
arch/sparc/mm/swift.S +1 -1
@@ -9,7 +9,7 @@
 #include <asm/asi.h>
 #include <asm/page.h>
 #include <asm/pgtsrmmu.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 
 	.text
 	.align	4
arch/sparc/mm/tsunami.S +1 -1
@@ -6,7 +6,7 @@
 
 #include <linux/config.h>
 #include <asm/ptrace.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/psr.h>
 #include <asm/asi.h>
 #include <asm/page.h>
arch/sparc/mm/viking.S +1 -1
@@ -9,7 +9,7 @@
 #include <linux/config.h>
 #include <asm/ptrace.h>
 #include <asm/psr.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/asi.h>
 #include <asm/mxcc.h>
 #include <asm/page.h>
include/asm-sparc/ptrace.h +2 -2
@@ -73,11 +73,11 @@ extern void show_regs(struct pt_regs *);
 #endif
 
 /*
- * The asm_offsets.h is a generated file, so we cannot include it.
+ * The asm-offsets.h is a generated file, so we cannot include it.
  * It may be OK for glibc headers, but it's utterly pointless for C code.
  * The assembly code using those offsets has to include it explicitly.
  */
-/* #include <asm/asm_offsets.h> */
+/* #include <asm/asm-offsets.h> */
 
 /* These are for pt_regs. */
 #define PT_PSR    0x0
#1 lore raw

PATCH 2/12 kbuild: h8300,m68knommu,sh,sh64 use generic asm-offsets.h support

In reply to Sam Ravnborg

h8300, m68knommu, sh and sh64 all used the name asm-offsets.h so minimal changes required.

---

 arch/h8300/Makefile     |    8 --------
 arch/m68knommu/Makefile |   10 ----------
 arch/sh/Makefile        |   11 ++---------
 arch/sh64/Makefile      |    8 ++------
 4 files changed, 4 insertions(+), 33 deletions(-)

cca6e6f5f473ec63e85c87dfc77279ce1ca114e6

arch/h8300/Makefile +0 -8
@@ -61,12 +61,6 @@ archmrproper:
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-prepare: include/asm-$(ARCH)/asm-offsets.h
-
-include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \
-				   include/asm include/linux/version.h
-	$(call filechk,gen-asm-offsets)
-
 vmlinux.srec vmlinux.bin: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
@@ -74,5 +68,3 @@ define archhelp
   echo  'vmlinux.bin  - Create raw binary'
   echo  'vmlinux.srec - Create srec binary'
 endef
-
-CLEAN_FILES += include/asm-$(ARCH)/asm-offsets.h
arch/m68knommu/Makefile +0 -10
@@ -102,21 +102,11 @@ CFLAGS += -DUTS_SYSNAME=\"uClinux\"
 
 head-y := arch/m68knommu/platform/$(cpuclass-y)/head.o
 
-CLEAN_FILES := include/asm-$(ARCH)/asm-offsets.h \
-	       arch/$(ARCH)/kernel/asm-offsets.s
-
 core-y	+= arch/m68knommu/kernel/ \
 	   arch/m68knommu/mm/ \
 	   $(CLASSDIR) \
 	   arch/m68knommu/platform/$(PLATFORM)/
 libs-y	+= arch/m68knommu/lib/
 
-prepare: include/asm-$(ARCH)/asm-offsets.h
-
 archclean:
 	$(Q)$(MAKE) $(clean)=arch/m68knommu/boot
-
-include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \
-				   include/asm include/linux/version.h \
-				   include/config/MARKER
-	$(call filechk,gen-asm-offsets)
arch/sh/Makefile +2 -9
@@ -155,7 +155,7 @@ endif
 prepare: maketools include/asm-sh/.cpu include/asm-sh/.mach
 
 .PHONY: maketools FORCE
-maketools: include/asm-sh/asm-offsets.h include/linux/version.h FORCE
+maketools:  include/linux/version.h FORCE
 	$(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
 
 all: zImage
@@ -168,14 +168,7 @@ compressed: zImage
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-CLEAN_FILES += include/asm-sh/machtypes.h include/asm-sh/asm-offsets.h
-
-arch/sh/kernel/asm-offsets.s: include/asm include/linux/version.h \
-			      include/asm-sh/.cpu include/asm-sh/.mach
-
-include/asm-sh/asm-offsets.h: arch/sh/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
+CLEAN_FILES += include/asm-sh/machtypes.h
 
 define archhelp
 	@echo '  zImage 	           - Compressed kernel image (arch/sh/boot/zImage)'
arch/sh64/Makefile +2 -6
@@ -73,11 +73,7 @@ compressed: zImage
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-prepare: include/asm-$(ARCH)/asm-offsets.h arch/$(ARCH)/lib/syscalltab.h
-
-include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \
-				   include/asm include/linux/version.h
-	$(call filechk,gen-asm-offsets)
+prepare: arch/$(ARCH)/lib/syscalltab.h
 
 define filechk_gen-syscalltab
        (set -e; \
@@ -108,7 +104,7 @@ endef
 arch/$(ARCH)/lib/syscalltab.h: arch/sh64/kernel/syscalls.S
 	$(call filechk,gen-syscalltab)
 
-CLEAN_FILES += include/asm-$(ARCH)/asm-offsets.h arch/$(ARCH)/lib/syscalltab.h
+CLEAN_FILES += arch/$(ARCH)/lib/syscalltab.h
 
 define archhelp
 	@echo '  zImage 	           - Compressed kernel image (arch/sh64/boot/zImage)'
#4 lore raw

PATCH 5/12 kbuild: arm - use generic asm-offsets.h support

In reply to Sam Ravnborg

Delete obsoleted stuff from arch Makefile and rename constants.h to asm-offsets.h

---

 arch/arm/Makefile                  |    9 ++-------
 arch/arm/kernel/entry-header.S     |    2 +-
 arch/arm/kernel/head.S             |    2 +-
 arch/arm/kernel/iwmmxt.S           |    2 +-
 arch/arm/lib/copy_page.S           |    2 +-
 arch/arm/lib/csumpartialcopyuser.S |    2 +-
 arch/arm/lib/getuser.S             |    2 +-
 arch/arm/lib/putuser.S             |    2 +-
 arch/arm/mm/copypage-v3.S          |    2 +-
 arch/arm/mm/copypage-v4wb.S        |    2 +-
 arch/arm/mm/copypage-v4wt.S        |    2 +-
 arch/arm/mm/proc-arm1020.S         |    2 +-
 arch/arm/mm/proc-arm1020e.S        |    2 +-
 arch/arm/mm/proc-arm1022.S         |    2 +-
 arch/arm/mm/proc-arm1026.S         |    2 +-
 arch/arm/mm/proc-arm6_7.S          |    2 +-
 arch/arm/mm/proc-arm720.S          |    2 +-
 arch/arm/mm/proc-macros.S          |    2 +-
 arch/arm/mm/proc-sa110.S           |    2 +-
 arch/arm/mm/proc-sa1100.S          |    2 +-
 arch/arm/mm/proc-v6.S              |    2 +-
 arch/arm/mm/tlb-v3.S               |    2 +-
 arch/arm/mm/tlb-v4.S               |    2 +-
 arch/arm/mm/tlb-v4wb.S             |    2 +-
 arch/arm/mm/tlb-v4wbi.S            |    2 +-
 arch/arm/mm/tlb-v6.S               |    2 +-
 arch/arm/nwfpe/entry26.S           |    2 +-
 arch/arm/vfp/entry.S               |    2 +-
 28 files changed, 29 insertions(+), 34 deletions(-)

e6ae744dd2eae8e00af328b11b1fe77cb0931136

arch/arm/Makefile +2 -7
@@ -178,7 +178,7 @@ endif
 prepare: maketools include/asm-arm/.arch
 
 .PHONY: maketools FORCE
-maketools: include/asm-arm/constants.h include/linux/version.h FORCE
+maketools: include/linux/version.h FORCE
 	$(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h
 
 # Convert bzImage to zImage
@@ -190,7 +190,7 @@ zImage Image xipImage bootpImage uImage:
 zinstall install: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
 
-CLEAN_FILES += include/asm-arm/constants.h* include/asm-arm/mach-types.h \
+CLEAN_FILES += include/asm-arm/mach-types.h \
 	       include/asm-arm/arch include/asm-arm/.arch
 
 # We use MRPROPER_FILES and CLEAN_FILES now
@@ -201,11 +201,6 @@ archclean:
 bp:;	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/bootpImage
 i zi:;	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
 
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/asm-arm/.arch
-
-include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
 
 define archhelp
   echo  '* zImage        - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
arch/arm/kernel/entry-header.S +1 -1
@@ -3,7 +3,7 @@
 #include <linux/linkage.h>
 
 #include <asm/assembler.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/errno.h>
 #include <asm/thread_info.h>
 
arch/arm/kernel/head.S +1 -1
@@ -20,7 +20,7 @@
 #include <asm/mach-types.h>
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 #include <asm/system.h>
 
arch/arm/kernel/iwmmxt.S +1 -1
@@ -17,7 +17,7 @@
 #include <linux/linkage.h>
 #include <asm/ptrace.h>
 #include <asm/thread_info.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 
 #define MMX_WR0		 	(0x00)
 #define MMX_WR1		 	(0x08)
arch/arm/lib/copy_page.S +1 -1
@@ -11,7 +11,7 @@
  */
 #include <linux/linkage.h>
 #include <asm/assembler.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 
 #define COPY_COUNT (PAGE_SZ/64 PLD( -1 ))
 
arch/arm/lib/csumpartialcopyuser.S +1 -1
@@ -13,7 +13,7 @@
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/errno.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 
 		.text
 
arch/arm/lib/getuser.S +1 -1
@@ -26,7 +26,7 @@
  * Note that ADDR_LIMIT is either 0 or 0xc0000000.
  * Note also that it is intended that __get_user_bad is not global.
  */
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 #include <asm/errno.h>
 
arch/arm/lib/putuser.S +1 -1
@@ -26,7 +26,7 @@
  * Note that ADDR_LIMIT is either 0 or 0xc0000000
  * Note also that it is intended that __put_user_bad is not global.
  */
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 #include <asm/errno.h>
 
arch/arm/mm/copypage-v3.S +1 -1
@@ -12,7 +12,7 @@
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 
 		.text
 		.align	5
arch/arm/mm/copypage-v4wb.S +1 -1
@@ -11,7 +11,7 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 
 	.text
 	.align	5
arch/arm/mm/copypage-v4wt.S +1 -1
@@ -14,7 +14,7 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 
 	.text
 	.align	5
arch/arm/mm/proc-arm1020.S +1 -1
@@ -28,7 +28,7 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/pgtable.h>
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
arch/arm/mm/proc-arm1020e.S +1 -1
@@ -28,7 +28,7 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/pgtable.h>
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
arch/arm/mm/proc-arm1022.S +1 -1
@@ -17,7 +17,7 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/pgtable.h>
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
arch/arm/mm/proc-arm1026.S +1 -1
@@ -17,7 +17,7 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/pgtable.h>
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
arch/arm/mm/proc-arm6_7.S +1 -1
@@ -13,7 +13,7 @@
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/pgtable.h>
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
arch/arm/mm/proc-arm720.S +1 -1
@@ -33,7 +33,7 @@
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/pgtable.h>
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
arch/arm/mm/proc-macros.S +1 -1
@@ -4,7 +4,7 @@
  *  VMA_VM_FLAGS
  *  VM_EXEC
  */
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 
 /*
arch/arm/mm/proc-sa110.S +1 -1
@@ -15,7 +15,7 @@
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/procinfo.h>
 #include <asm/hardware.h>
 #include <asm/pgtable.h>
arch/arm/mm/proc-sa1100.S +1 -1
@@ -20,7 +20,7 @@
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/assembler.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/procinfo.h>
 #include <asm/hardware.h>
 #include <asm/pgtable.h>
arch/arm/mm/proc-v6.S +1 -1
@@ -11,7 +11,7 @@
  */
 #include <linux/linkage.h>
 #include <asm/assembler.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/procinfo.h>
 #include <asm/pgtable.h>
 
arch/arm/mm/tlb-v3.S +1 -1
@@ -13,7 +13,7 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/tlbflush.h>
 #include "proc-macros.S"
 
arch/arm/mm/tlb-v4.S +1 -1
@@ -14,7 +14,7 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/tlbflush.h>
 #include "proc-macros.S"
 
arch/arm/mm/tlb-v4wb.S +1 -1
@@ -14,7 +14,7 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/tlbflush.h>
 #include "proc-macros.S"
 
arch/arm/mm/tlb-v4wbi.S +1 -1
@@ -14,7 +14,7 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/tlbflush.h>
 #include "proc-macros.S"
 
arch/arm/mm/tlb-v6.S +1 -1
@@ -11,7 +11,7 @@
  *  These assume a split I/D TLB.
  */
 #include <linux/linkage.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/page.h>
 #include <asm/tlbflush.h>
 #include "proc-macros.S"
arch/arm/nwfpe/entry26.S +1 -1
@@ -20,7 +20,7 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 
 /* This is the kernel's entry point into the floating point emulator.
 It is called from the kernel with code similar to this:
arch/arm/vfp/entry.S +1 -1
@@ -17,7 +17,7 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
-#include <asm/constants.h>
+#include <asm/asm-offsets.h>
 #include <asm/vfpmacros.h>
 
 	.globl	do_vfp
#8 lore raw

PATCH 9/12 kbuild: mips use generic asm-offsets.h support

In reply to Sam Ravnborg

Removed obsolete stuff from arch makefile.
mips had a special rule for generating asm-offsets.h so preserved it using an architecture specific hook in top-level Kbuild file. Renamed .h file to asm-offsets.h

---

 Kbuild                          |    9 ++++++++-
 arch/mips/Makefile              |   33 +--------------------------------
 arch/mips/kernel/r2300_fpu.S    |    2 +-
 arch/mips/kernel/r2300_switch.S |    2 +-
 arch/mips/kernel/r4k_fpu.S      |    2 +-
 arch/mips/kernel/r4k_switch.S   |    2 +-
 arch/mips/kernel/r6000_fpu.S    |    2 +-
 arch/mips/kernel/scall32-o32.S  |    2 +-
 arch/mips/kernel/scall64-64.S   |    2 +-
 arch/mips/kernel/syscall.c      |    2 +-
 arch/mips/lib-32/memset.S       |    2 +-
 arch/mips/lib-64/memset.S       |    2 +-
 arch/mips/lib/memcpy.S          |    2 +-
 arch/mips/lib/strlen_user.S     |    2 +-
 arch/mips/lib/strncpy_user.S    |    2 +-
 arch/mips/lib/strnlen_user.S    |    2 +-
 include/asm-mips/asmmacro-32.h  |    2 +-
 include/asm-mips/asmmacro-64.h  |    2 +-
 include/asm-mips/sim.h          |    2 +-
 include/asm-mips/stackframe.h   |    2 +-
 20 files changed, 27 insertions(+), 51 deletions(-)

048eb582f3f89737d4a29668de9935e6feea7c36

Kbuild +8 -1
@@ -13,6 +13,13 @@ always  := $(offsets-file)
 targets := $(offsets-file)
 targets += arch/$(ARCH)/kernel/asm-offsets.s
 
+# Default sed regexp - multiline due to syntax constraints
+define sed-y
+	"/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
+endef
+# Override default regexp for specific architectures
+sed-$(CONFIG_MIPS) := "/^@@@/s///p"
+
 quiet_cmd_offsets = GEN     $@
 define cmd_offsets
 	cat $< | \
@@ -26,7 +33,7 @@ define cmd_offsets
 	 echo " *"; \
 	 echo " */"; \
 	 echo ""; \
-	 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
+	 sed -ne $(sed-y); \
 	 echo ""; \
 	 echo "#endif" ) > $@
 endef
arch/mips/Makefile +1 -32
@@ -720,38 +720,7 @@ archclean:
 	@$(MAKE) $(clean)=arch/mips/boot
 	@$(MAKE) $(clean)=arch/mips/lasat
 
-# Generate <asm/offset.h
-#
-# The default rule is suffering from funny problems on MIPS so we using our
-# own ...
-#
-# ---------------------------------------------------------------------------
 
-define filechk_gen-asm-offset.h
-	(set -e; \
-	 echo "#ifndef _ASM_OFFSET_H"; \
-	 echo "#define _ASM_OFFSET_H"; \
-	 echo "/*"; \
-	 echo " * DO NOT MODIFY."; \
-	 echo " *"; \
-	 echo " * This file was generated by arch/$(ARCH)/Makefile"; \
-	 echo " *"; \
-	 echo " */"; \
-	 echo ""; \
-	 sed -ne "/^@@@/s///p"; \
-	 echo "#endif /* _ASM_OFFSET_H */" )
-endef
-
-prepare: include/asm-$(ARCH)/offset.h
-
-arch/$(ARCH)/kernel/offset.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/offset.s
-	$(call filechk,gen-asm-offset.h)
-
-CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \
-	       include/asm-$(ARCH)/offset.h \
-	       vmlinux.32 \
+CLEAN_FILES += vmlinux.32 \
 	       vmlinux.64 \
 	       vmlinux.ecoff
arch/mips/kernel/r2300_fpu.S +1 -1
@@ -15,7 +15,7 @@
 #include <asm/errno.h>
 #include <asm/fpregdef.h>
 #include <asm/mipsregs.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/regdef.h>
 
 #define EX(a,b)							\
arch/mips/kernel/r2300_switch.S +1 -1
@@ -15,7 +15,7 @@
 #include <asm/cachectl.h>
 #include <asm/fpregdef.h>
 #include <asm/mipsregs.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/page.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
arch/mips/kernel/r4k_fpu.S +1 -1
@@ -17,7 +17,7 @@
 #include <asm/errno.h>
 #include <asm/fpregdef.h>
 #include <asm/mipsregs.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/regdef.h>
 
 	.macro	EX insn, reg, src
arch/mips/kernel/r4k_switch.S +1 -1
@@ -15,7 +15,7 @@
 #include <asm/cachectl.h>
 #include <asm/fpregdef.h>
 #include <asm/mipsregs.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/page.h>
 #include <asm/pgtable-bits.h>
 #include <asm/regdef.h>
arch/mips/kernel/r6000_fpu.S +1 -1
@@ -13,7 +13,7 @@
 #include <asm/asm.h>
 #include <asm/fpregdef.h>
 #include <asm/mipsregs.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/regdef.h>
 
 	.set	noreorder
arch/mips/kernel/scall32-o32.S +1 -1
@@ -19,7 +19,7 @@
 #include <asm/thread_info.h>
 #include <asm/unistd.h>
 #include <asm/war.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 
 /* Highest syscall used of any syscall flavour */
 #define MAX_SYSCALL_NO	__NR_O32_Linux + __NR_O32_Linux_syscalls
arch/mips/kernel/scall64-64.S +1 -1
@@ -14,7 +14,7 @@
 #include <asm/mipsregs.h>
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/sysmips.h>
 #include <asm/thread_info.h>
 #include <asm/unistd.h>
arch/mips/kernel/syscall.c +1 -1
@@ -31,7 +31,7 @@
 #include <asm/cachectl.h>
 #include <asm/cacheflush.h>
 #include <asm/ipc.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/signal.h>
 #include <asm/sim.h>
 #include <asm/shmparam.h>
arch/mips/lib-32/memset.S +1 -1
@@ -7,7 +7,7 @@
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
 #include <asm/asm.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/regdef.h>
 
 #define EX(insn,reg,addr,handler)			\
arch/mips/lib-64/memset.S +1 -1
@@ -7,7 +7,7 @@
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
 #include <asm/asm.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/regdef.h>
 
 #define EX(insn,reg,addr,handler)			\
arch/mips/lib/memcpy.S +1 -1
@@ -14,7 +14,7 @@
  */
 #include <linux/config.h>
 #include <asm/asm.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/regdef.h>
 
 #define dst a0
arch/mips/lib/strlen_user.S +1 -1
@@ -7,7 +7,7 @@
  * Copyright (c) 1999 Silicon Graphics, Inc.
  */
 #include <asm/asm.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/regdef.h>
 
 #define EX(insn,reg,addr,handler)			\
arch/mips/lib/strncpy_user.S +1 -1
@@ -7,7 +7,7 @@
  */
 #include <linux/errno.h>
 #include <asm/asm.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/regdef.h>
 
 #define EX(insn,reg,addr,handler)			\
arch/mips/lib/strnlen_user.S +1 -1
@@ -7,7 +7,7 @@
  * Copyright (c) 1999 Silicon Graphics, Inc.
  */
 #include <asm/asm.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/regdef.h>
 
 #define EX(insn,reg,addr,handler)			\
include/asm-mips/asmmacro-32.h +1 -1
@@ -7,7 +7,7 @@
 #ifndef _ASM_ASMMACRO_32_H
 #define _ASM_ASMMACRO_32_H
 
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/regdef.h>
 #include <asm/fpregdef.h>
 #include <asm/mipsregs.h>
include/asm-mips/asmmacro-64.h +1 -1
@@ -8,7 +8,7 @@
 #ifndef _ASM_ASMMACRO_64_H
 #define _ASM_ASMMACRO_64_H
 
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/regdef.h>
 #include <asm/fpregdef.h>
 #include <asm/mipsregs.h>
include/asm-mips/sim.h +1 -1
@@ -11,7 +11,7 @@
 
 #include <linux/config.h>
 
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 
 #define __str2(x) #x
 #define __str(x) __str2(x)
include/asm-mips/stackframe.h +1 -1
@@ -15,7 +15,7 @@
 
 #include <asm/asm.h>
 #include <asm/mipsregs.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 
 		.macro	SAVE_AT
 		.set	push
#10 lore raw

PATCH 11/12 kbuild: frv,m32r,sparc64 introduce fake asm-offsets.h file

In reply to Sam Ravnborg

Needed to get them to build.
And a hint to avoid hardcoding to many constants in assembler.

---

 arch/frv/kernel/asm-offsets.c     |    1 +
 arch/m32r/kernel/asm-offsets.c    |    1 +
 arch/sparc64/kernel/asm-offsets.c |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)
 create mode 100644 arch/frv/kernel/asm-offsets.c
 create mode 100644 arch/m32r/kernel/asm-offsets.c
 create mode 100644 arch/sparc64/kernel/asm-offsets.c

0037c78a96bb391635bff103d401c24459c5092d

arch/frv/kernel/asm-offsets.c new file +1 -0
new file mode 100644
@@ -0,0 +1 @@
+/* Dummy asm-offsets.c file. Required by kbuild and ready to be used - hint! */
arch/m32r/kernel/asm-offsets.c new file +1 -0
new file mode 100644
@@ -0,0 +1 @@
+/* Dummy asm-offsets.c file. Required by kbuild and ready to be used - hint! */
arch/sparc64/kernel/asm-offsets.c new file +1 -0
new file mode 100644
@@ -0,0 +1 @@
+/* Dummy asm-offsets.c file. Required by kbuild and ready to be used - hint! */
#11 lore raw

PATCH 12/12 kbuild: um fix so it compile with generic asm-offsets.h support

um has it own set of files for asm-offsets. So for now the gen-asm-offset macro is just duplicated in the um Makefile.

This may well be the final solution since um is a bit special compared to other architectures - time will tell.

Also added a dummy arch/um/kernel/asm-offsets.h file to keep kbuild happy.

---

 arch/um/Makefile             |   16 ++++++++++++++++
 arch/um/kernel/asm-offsets.c |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)
 create mode 100644 arch/um/kernel/asm-offsets.c

f64a227b6b5cc1f8cc7f6ef9cc3351343636bac9

arch/um/Makefile +16 -0
@@ -197,6 +197,22 @@ define filechk_umlconfig
 	sed 's/ CONFIG/ UML_CONFIG/'
 endef
 
+define filechk_gen-asm-offsets
+        (set -e; \
+         echo "#ifndef __ASM_OFFSETS_H__"; \
+         echo "#define __ASM_OFFSETS_H__"; \
+         echo "/*"; \
+         echo " * DO NOT MODIFY."; \
+         echo " *"; \
+         echo " * This file was generated by arch/$(ARCH)/Makefile"; \
+         echo " *"; \
+         echo " */"; \
+         echo ""; \
+         sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
+         echo ""; \
+         echo "#endif" )
+endef
+
 $(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h
 	$(call filechk,umlconfig)
 
arch/um/kernel/asm-offsets.c new file +1 -0
new file mode 100644
@@ -0,0 +1 @@
+/* Dummy file to make kbuild happy - unused! */
#5 lore raw

PATCH 6/12 kbuild: alpha,x86_64 use generic asm-offsets.h support

In reply to Sam Ravnborg

Delete obsolete stuff from arch makefiles
Rename .h file to asm-offsets.h

---

 arch/alpha/Makefile                  |   11 -----------
 arch/alpha/kernel/entry.S            |    2 +-
 arch/alpha/kernel/head.S             |    2 +-
 arch/alpha/lib/dbg_stackcheck.S      |    2 +-
 arch/alpha/lib/dbg_stackkill.S       |    2 +-
 arch/x86_64/Makefile                 |   10 ----------
 arch/x86_64/ia32/ia32entry.S         |    2 +-
 arch/x86_64/ia32/vsyscall-syscall.S  |    2 +-
 arch/x86_64/ia32/vsyscall-sysenter.S |    2 +-
 arch/x86_64/kernel/entry.S           |    2 +-
 arch/x86_64/kernel/suspend_asm.S     |    2 +-
 arch/x86_64/lib/copy_user.S          |    2 +-
 arch/x86_64/lib/getuser.S            |    2 +-
 arch/x86_64/lib/putuser.S            |    2 +-
 include/asm-x86_64/current.h         |    2 +-
 15 files changed, 13 insertions(+), 34 deletions(-)

e2d5df935d8a82cb7a2c50726628fa928aa89b9b

arch/alpha/Makefile +0 -11
@@ -108,20 +108,9 @@ $(boot)/vmlinux.gz: vmlinux
 bootimage bootpfile bootpzfile: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
-
-prepare: include/asm-$(ARCH)/asm_offsets.h
-
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
-
 define archhelp
   echo '* boot		- Compressed kernel image (arch/alpha/boot/vmlinux.gz)'
   echo '  bootimage	- SRM bootable image (arch/alpha/boot/bootimage)'
arch/alpha/kernel/entry.S +1 -1
@@ -5,7 +5,7 @@
  */
 
 #include <linux/config.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 #include <asm/pal.h>
 #include <asm/errno.h>
arch/alpha/kernel/head.S +1 -1
@@ -9,7 +9,7 @@
 
 #include <linux/config.h>
 #include <asm/system.h>
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 
 .globl swapper_pg_dir
 .globl _stext
arch/alpha/lib/dbg_stackcheck.S +1 -1
@@ -5,7 +5,7 @@
  * Verify that we have not overflowed the stack.  Oops if we have.
  */
 
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 
 	.text
 	.set noat
arch/alpha/lib/dbg_stackkill.S +1 -1
@@ -6,7 +6,7 @@
  * uninitialized local variables in the act.
  */
 
-#include <asm/asm_offsets.h>
+#include <asm/asm-offsets.h>
 
 	.text
 	.set noat
arch/x86_64/Makefile +0 -10
@@ -86,16 +86,6 @@ install fdimage fdimage144 fdimage288: v
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-prepare: include/asm-$(ARCH)/offset.h
-
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
-CLEAN_FILES += include/asm-$(ARCH)/offset.h
-
 define archhelp
   echo  '* bzImage	- Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
   echo  '  install	- Install kernel using'
arch/x86_64/ia32/ia32entry.S +1 -1
@@ -6,7 +6,7 @@
 
 #include <asm/dwarf2.h>
 #include <asm/calling.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/current.h>
 #include <asm/errno.h>
 #include <asm/ia32_unistd.h>	
arch/x86_64/ia32/vsyscall-syscall.S +1 -1
@@ -3,7 +3,7 @@
  */
 
 #include <asm/ia32_unistd.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/segment.h>
 
 	.text
arch/x86_64/ia32/vsyscall-sysenter.S +1 -1
@@ -3,7 +3,7 @@
  */
 
 #include <asm/ia32_unistd.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 
 	.text
 	.section .text.vsyscall,"ax"
arch/x86_64/kernel/entry.S +1 -1
@@ -36,7 +36,7 @@
 #include <asm/errno.h>
 #include <asm/dwarf2.h>
 #include <asm/calling.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/msr.h>
 #include <asm/unistd.h>
 #include <asm/thread_info.h>
arch/x86_64/kernel/suspend_asm.S +1 -1
@@ -14,7 +14,7 @@
 #include <linux/linkage.h>
 #include <asm/segment.h>
 #include <asm/page.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 
 ENTRY(swsusp_arch_suspend)
 
arch/x86_64/lib/copy_user.S +1 -1
@@ -7,7 +7,7 @@
 #define FIX_ALIGNMENT 1
 		
 	#include <asm/current.h>
-	#include <asm/offset.h>
+	#include <asm/asm-offsets.h>
 	#include <asm/thread_info.h>
 	#include <asm/cpufeature.h>
 
arch/x86_64/lib/getuser.S +1 -1
@@ -29,7 +29,7 @@
 #include <linux/linkage.h>
 #include <asm/page.h>
 #include <asm/errno.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 
 	.text
arch/x86_64/lib/putuser.S +1 -1
@@ -27,7 +27,7 @@
 #include <linux/linkage.h>
 #include <asm/page.h>
 #include <asm/errno.h>
-#include <asm/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 
 	.text
include/asm-x86_64/current.h +1 -1
@@ -17,7 +17,7 @@ static inline struct task_struct *get_cu
 #else
 
 #ifndef ASM_OFFSET_H
-#include <asm/offset.h> 
+#include <asm/asm-offsets.h> 
 #endif
 
 #define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg
#7 lore raw

PATCH 8/12 kbuild: ia64 use generic asm-offsets.h support

In reply to Sam Ravnborg

Delete obsolete stuff from arch Makefile
Rename file to asm-offsets.h
The trick used in the arch Makefile to circumvent the circular dependency is kept.

---

 arch/ia64/Makefile          |   21 +++++++--------------
 arch/ia64/ia32/ia32_entry.S |    2 +-
 arch/ia64/kernel/entry.S    |    2 +-
 arch/ia64/kernel/fsys.S     |    2 +-
 arch/ia64/kernel/gate.S     |    2 +-
 arch/ia64/kernel/head.S     |    2 +-
 arch/ia64/kernel/ivt.S      |    2 +-
 7 files changed, 13 insertions(+), 20 deletions(-)

39e01cb874cbf694bd0b0c44f54c4f270e2aa556

arch/ia64/Makefile +7 -14
@@ -82,25 +82,18 @@ unwcheck: vmlinux
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-CLEAN_FILES += include/asm-ia64/.offsets.h.stamp vmlinux.gz bootloader
-
-MRPROPER_FILES += include/asm-ia64/offsets.h
-
-prepare: include/asm-ia64/offsets.h
-
-arch/ia64/kernel/asm-offsets.s: include/asm include/linux/version.h include/config/MARKER
-
-include/asm-ia64/offsets.h: arch/ia64/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
-arch/ia64/kernel/asm-offsets.s: include/asm-ia64/.offsets.h.stamp
+prepare:  include/asm-ia64/.offsets.h.stamp
 
 include/asm-ia64/.offsets.h.stamp:
 	mkdir -p include/asm-ia64
-	[ -s include/asm-ia64/offsets.h ] \
-	 || echo "#define IA64_TASK_SIZE 0" > include/asm-ia64/offsets.h
+	[ -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
+
 boot:	lib/lib.a vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) $@
 
arch/ia64/ia32/ia32_entry.S +1 -1
@@ -1,6 +1,6 @@
 #include <asm/asmmacro.h>
 #include <asm/ia32.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/signal.h>
 #include <asm/thread_info.h>
 
arch/ia64/kernel/entry.S +1 -1
@@ -37,7 +37,7 @@
 #include <asm/cache.h>
 #include <asm/errno.h>
 #include <asm/kregs.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/pgtable.h>
 #include <asm/percpu.h>
 #include <asm/processor.h>
arch/ia64/kernel/fsys.S +1 -1
@@ -14,7 +14,7 @@
 
 #include <asm/asmmacro.h>
 #include <asm/errno.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/percpu.h>
 #include <asm/thread_info.h>
 #include <asm/sal.h>
arch/ia64/kernel/gate.S +1 -1
@@ -10,7 +10,7 @@
 
 #include <asm/asmmacro.h>
 #include <asm/errno.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/sigcontext.h>
 #include <asm/system.h>
 #include <asm/unistd.h>
arch/ia64/kernel/head.S +1 -1
@@ -25,7 +25,7 @@
 #include <asm/fpu.h>
 #include <asm/kregs.h>
 #include <asm/mmu_context.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/pal.h>
 #include <asm/pgtable.h>
 #include <asm/processor.h>
arch/ia64/kernel/ivt.S +1 -1
@@ -44,7 +44,7 @@
 #include <asm/break.h>
 #include <asm/ia32.h>
 #include <asm/kregs.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
#3 lore raw

PATCH 4/12 kbuild: m68k,parisc,ppc,ppc64,s390,xtensa use generic asm-offsets.h support

In reply to Sam Ravnborg

Delete obsoleted parts form arch makefiles and rename to asm-offsets.h

---

 arch/m68k/Makefile                      |    9 ---------
 arch/m68k/fpsp040/skeleton.S            |    2 +-
 arch/m68k/ifpsp060/iskeleton.S          |    2 +-
 arch/m68k/kernel/entry.S                |    2 +-
 arch/m68k/kernel/head.S                 |    2 +-
 arch/m68k/math-emu/fp_emu.h             |    2 +-
 arch/parisc/Makefile                    |   10 +---------
 arch/parisc/hpux/gate.S                 |    2 +-
 arch/parisc/hpux/wrappers.S             |    2 +-
 arch/parisc/kernel/entry.S              |    2 +-
 arch/parisc/kernel/head.S               |    2 +-
 arch/parisc/kernel/process.c            |    2 +-
 arch/parisc/kernel/ptrace.c             |    2 +-
 arch/parisc/kernel/signal.c             |    2 +-
 arch/parisc/kernel/syscall.S            |    2 +-
 arch/parisc/lib/fixup.S                 |    2 +-
 arch/ppc/Makefile                       |   12 ++----------
 arch/ppc/kernel/cpu_setup_6xx.S         |    2 +-
 arch/ppc/kernel/cpu_setup_power4.S      |    2 +-
 arch/ppc/kernel/entry.S                 |    2 +-
 arch/ppc/kernel/fpu.S                   |    2 +-
 arch/ppc/kernel/head.S                  |    2 +-
 arch/ppc/kernel/head_44x.S              |    2 +-
 arch/ppc/kernel/head_4xx.S              |    2 +-
 arch/ppc/kernel/head_8xx.S              |    2 +-
 arch/ppc/kernel/head_fsl_booke.S        |    2 +-
 arch/ppc/kernel/idle_6xx.S              |    2 +-
 arch/ppc/kernel/idle_power4.S           |    2 +-
 arch/ppc/kernel/misc.S                  |    2 +-
 arch/ppc/kernel/swsusp.S                |    2 +-
 arch/ppc/mm/hashtable.S                 |    2 +-
 arch/ppc/platforms/pmac_sleep.S         |    2 +-
 arch/ppc64/Makefile                     |    9 ---------
 arch/ppc64/kernel/cpu_setup_power4.S    |    2 +-
 arch/ppc64/kernel/entry.S               |    2 +-
 arch/ppc64/kernel/head.S                |    2 +-
 arch/ppc64/kernel/idle_power4.S         |    2 +-
 arch/ppc64/kernel/misc.S                |    2 +-
 arch/ppc64/kernel/vdso32/cacheflush.S   |    2 +-
 arch/ppc64/kernel/vdso32/datapage.S     |    2 +-
 arch/ppc64/kernel/vdso32/gettimeofday.S |    2 +-
 arch/ppc64/kernel/vdso64/cacheflush.S   |    2 +-
 arch/ppc64/kernel/vdso64/datapage.S     |    2 +-
 arch/ppc64/kernel/vdso64/gettimeofday.S |    2 +-
 arch/ppc64/mm/hash_low.S                |    2 +-
 arch/ppc64/mm/slb_low.S                 |    2 +-
 arch/s390/Makefile                      |   10 ----------
 arch/s390/kernel/entry.S                |    2 +-
 arch/s390/kernel/entry64.S              |    2 +-
 arch/s390/kernel/head.S                 |    2 +-
 arch/s390/kernel/head64.S               |    2 +-
 arch/s390/lib/uaccess.S                 |    2 +-
 arch/s390/lib/uaccess64.S               |    2 +-
 arch/xtensa/Makefile                    |   10 ++--------
 arch/xtensa/kernel/align.S              |    2 +-
 arch/xtensa/kernel/entry.S              |    2 +-
 arch/xtensa/kernel/process.c            |    2 +-
 arch/xtensa/kernel/vectors.S            |    2 +-
 include/asm-ia64/ptrace.h               |    2 +-
 include/asm-ia64/thread_info.h          |    2 +-
 include/asm-parisc/assembly.h           |    2 +-
 include/asm-xtensa/ptrace.h             |    2 +-
 include/asm-xtensa/uaccess.h            |    2 +-
 63 files changed, 62 insertions(+), 112 deletions(-)

0013a85454c281faaf064ccb576e373a2881aac8

arch/m68k/Makefile +0 -9
@@ -113,14 +113,5 @@ else
 	bzip2 -1c vmlinux >vmlinux.bz2
 endif
 
-prepare: include/asm-$(ARCH)/offsets.h
-CLEAN_FILES += include/asm-$(ARCH)/offsets.h
-
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
 archclean:
 	rm -f vmlinux.gz vmlinux.bz2
arch/m68k/fpsp040/skeleton.S +1 -1
@@ -40,7 +40,7 @@
 
 #include <linux/linkage.h>
 #include <asm/entry.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 |SKELETON	idnt    2,1 | Motorola 040 Floating Point Software Package
 
arch/m68k/ifpsp060/iskeleton.S +1 -1
@@ -36,7 +36,7 @@
 
 #include <linux/linkage.h>
 #include <asm/entry.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 
 |################################
arch/m68k/kernel/entry.S +1 -1
@@ -42,7 +42,7 @@
 #include <asm/traps.h>
 #include <asm/unistd.h>
 
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 .globl system_call, buserr, trap
 .globl resume, ret_from_exception
arch/m68k/kernel/head.S +1 -1
@@ -263,7 +263,7 @@
 #include <asm/entry.h>
 #include <asm/pgtable.h>
 #include <asm/page.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 #ifdef CONFIG_MAC
 
arch/m68k/math-emu/fp_emu.h +1 -1
@@ -39,7 +39,7 @@
 #define _FP_EMU_H
 
 #ifdef __ASSEMBLY__
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #endif
 #include <asm/math-emu.h>
 
arch/parisc/Makefile +1 -9
@@ -100,15 +100,7 @@ kernel_install: vmlinux
 
 install: kernel_install modules_install
 
-prepare: include/asm-parisc/offsets.h
-
-arch/parisc/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
-CLEAN_FILES	+= lifimage include/asm-parisc/offsets.h
+CLEAN_FILES	+= lifimage
 MRPROPER_FILES	+= palo.conf
 
 define archhelp
arch/parisc/hpux/gate.S +1 -1
@@ -9,7 +9,7 @@
  */
 
 #include <asm/assembly.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/unistd.h>
 #include <asm/errno.h>
 
arch/parisc/hpux/wrappers.S +1 -1
@@ -24,7 +24,7 @@
 #warning PA64 support needs more work...did first cut
 #endif
 
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/assembly.h>
 #include <asm/signal.h>
 
arch/parisc/kernel/entry.S +1 -1
@@ -23,7 +23,7 @@
  */
 
 #include <linux/config.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 /* we have the following possibilities to act on an interruption:
  *  - handle in assembly and use shadowed registers only
arch/parisc/kernel/head.S +1 -1
@@ -14,7 +14,7 @@
 
 #include <linux/autoconf.h>	/* for CONFIG_SMP */
 
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/psw.h>
 #include <asm/pdc.h>
 	
arch/parisc/kernel/process.c +1 -1
@@ -47,7 +47,7 @@
 #include <linux/kallsyms.h>
 
 #include <asm/io.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/pdc.h>
 #include <asm/pdc_chassis.h>
 #include <asm/pgalloc.h>
arch/parisc/kernel/ptrace.c +1 -1
@@ -23,7 +23,7 @@
 #include <asm/pgtable.h>
 #include <asm/system.h>
 #include <asm/processor.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 /* PSW bits we allow the debugger to modify */
 #define USER_PSW_BITS	(PSW_N | PSW_V | PSW_CB)
arch/parisc/kernel/signal.c +1 -1
@@ -32,7 +32,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
 #include <asm/cacheflush.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 #ifdef CONFIG_COMPAT
 #include <linux/compat.h>
arch/parisc/kernel/syscall.S +1 -1
@@ -7,7 +7,7 @@
  * sorry about the wall, puffin..
  */
 
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/unistd.h>
 #include <asm/errno.h>
 #include <asm/psw.h>
arch/parisc/lib/fixup.S +1 -1
@@ -20,7 +20,7 @@
  * Fixup routines for kernel exception handling.
  */
 #include <linux/config.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/assembly.h>
 #include <asm/errno.h>
 
arch/ppc/Makefile +2 -10
@@ -105,13 +105,7 @@ archclean:
 	$(Q)$(MAKE) $(clean)=arch/ppc/boot
 	$(Q)rm -rf include3
 
-prepare: include/asm-$(ARCH)/offsets.h checkbin
-
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
+prepare: checkbin
 
 # Temporary hack until we have migrated to asm-powerpc
 include/asm: include3/asm
@@ -143,7 +137,5 @@ checkbin:
 		false ; \
 	fi
 
-CLEAN_FILES +=	include/asm-$(ARCH)/offsets.h \
-		arch/$(ARCH)/kernel/asm-offsets.s \
-		$(TOUT)
+CLEAN_FILES += $(TOUT)
 
arch/ppc/kernel/cpu_setup_6xx.S +1 -1
@@ -15,7 +15,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/cputable.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/cache.h>
 
 _GLOBAL(__setup_cpu_601)
arch/ppc/kernel/cpu_setup_power4.S +1 -1
@@ -15,7 +15,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/cputable.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/cache.h>
 
 _GLOBAL(__970_cpu_preinit)
arch/ppc/kernel/entry.S +1 -1
@@ -29,7 +29,7 @@
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/unistd.h>
 
 #undef SHOW_SYSCALLS
arch/ppc/kernel/fpu.S +1 -1
@@ -18,7 +18,7 @@
 #include <asm/cache.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 /*
  * This task wants to use the FPU now.
arch/ppc/kernel/head.S +1 -1
@@ -31,7 +31,7 @@
 #include <asm/cache.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 #ifdef CONFIG_APUS
 #include <asm/amigappc.h>
arch/ppc/kernel/head_44x.S +1 -1
@@ -40,7 +40,7 @@
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include "head_booke.h"
 
 
arch/ppc/kernel/head_4xx.S +1 -1
@@ -40,7 +40,7 @@
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 /* As with the other PowerPC ports, it is expected that when code
  * execution begins here, the following registers contain valid, yet
arch/ppc/kernel/head_8xx.S +1 -1
@@ -30,7 +30,7 @@
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 /* Macro to make the code more readable. */
 #ifdef CONFIG_8xx_CPU6
arch/ppc/kernel/head_fsl_booke.S +1 -1
@@ -41,7 +41,7 @@
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include "head_booke.h"
 
 /* As with the other PowerPC ports, it is expected that when code
arch/ppc/kernel/idle_6xx.S +1 -1
@@ -20,7 +20,7 @@
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 #undef DEBUG
 
arch/ppc/kernel/idle_power4.S +1 -1
@@ -20,7 +20,7 @@
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 #undef DEBUG
 
arch/ppc/kernel/misc.S +1 -1
@@ -23,7 +23,7 @@
 #include <asm/mmu.h>
 #include <asm/ppc_asm.h>
 #include <asm/thread_info.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 	.text
 
arch/ppc/kernel/swsusp.S +1 -1
@@ -5,7 +5,7 @@
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 
 /*
arch/ppc/mm/hashtable.S +1 -1
@@ -30,7 +30,7 @@
 #include <asm/cputable.h>
 #include <asm/ppc_asm.h>
 #include <asm/thread_info.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 #ifdef CONFIG_SMP
 	.comm	mmu_hash_lock,4
arch/ppc/platforms/pmac_sleep.S +1 -1
@@ -17,7 +17,7 @@
 #include <asm/cputable.h>
 #include <asm/cache.h>
 #include <asm/thread_info.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 #define MAGIC	0x4c617273	/* 'Lars' */
 
arch/ppc64/Makefile +0 -9
@@ -116,13 +116,6 @@ archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 	$(Q)rm -rf include3
 
-prepare: include/asm-ppc64/offsets.h
-
-arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
 
 # Temporary hack until we have migrated to asm-powerpc
 include/asm: include3/asm
@@ -136,5 +129,3 @@ define archhelp
   echo  '		   sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
   echo  '		   (arch/$(ARCH)/boot/zImage.initrd)'
 endef
-
-CLEAN_FILES += include/asm-ppc64/offsets.h
arch/ppc64/kernel/cpu_setup_power4.S +1 -1
@@ -15,7 +15,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/cputable.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/cache.h>
 
 _GLOBAL(__970_cpu_preinit)
arch/ppc64/kernel/entry.S +1 -1
@@ -28,7 +28,7 @@
 #include <asm/mmu.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/cputable.h>
 
 #ifdef CONFIG_PPC_ISERIES
arch/ppc64/kernel/head.S +1 -1
@@ -30,7 +30,7 @@
 #include <asm/mmu.h>
 #include <asm/systemcfg.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/bug.h>
 #include <asm/cputable.h>
 #include <asm/setup.h>
arch/ppc64/kernel/idle_power4.S +1 -1
@@ -20,7 +20,7 @@
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 #undef DEBUG
 
arch/ppc64/kernel/misc.S +1 -1
@@ -26,7 +26,7 @@
 #include <asm/page.h>
 #include <asm/cache.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/cputable.h>
 
 	.text
arch/ppc64/kernel/vdso32/cacheflush.S +1 -1
@@ -13,7 +13,7 @@
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/vdso.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 	.text
 
arch/ppc64/kernel/vdso32/datapage.S +1 -1
@@ -12,7 +12,7 @@
 #include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/unistd.h>
 #include <asm/vdso.h>
 
arch/ppc64/kernel/vdso32/gettimeofday.S +1 -1
@@ -13,7 +13,7 @@
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/vdso.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/unistd.h>
 
 	.text
arch/ppc64/kernel/vdso64/cacheflush.S +1 -1
@@ -13,7 +13,7 @@
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/vdso.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 	.text
 
arch/ppc64/kernel/vdso64/datapage.S +1 -1
@@ -12,7 +12,7 @@
 #include <linux/config.h>
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/unistd.h>
 #include <asm/vdso.h>
 
arch/ppc64/kernel/vdso64/gettimeofday.S +1 -1
@@ -14,7 +14,7 @@
 #include <asm/processor.h>
 #include <asm/ppc_asm.h>
 #include <asm/vdso.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 	.text
 /*
arch/ppc64/mm/hash_low.S +1 -1
@@ -16,7 +16,7 @@
 #include <asm/page.h>
 #include <asm/types.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/cputable.h>
 
 	.text
arch/ppc64/mm/slb_low.S +1 -1
@@ -21,7 +21,7 @@
 #include <asm/page.h>
 #include <asm/mmu.h>
 #include <asm/ppc_asm.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/cputable.h>
 
 /* void slb_allocate(unsigned long ea);
arch/s390/Makefile +0 -10
@@ -100,16 +100,6 @@ image: vmlinux
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-prepare: include/asm-$(ARCH)/offsets.h
-
-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
-CLEAN_FILES += include/asm-$(ARCH)/offsets.h
-
 # Don't use tabs in echo arguments
 define archhelp
   echo  '* image           - Kernel image for IPL ($(boot)/image)'
arch/s390/kernel/entry.S +1 -1
@@ -18,7 +18,7 @@
 #include <asm/errno.h>
 #include <asm/ptrace.h>
 #include <asm/thread_info.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/unistd.h>
 #include <asm/page.h>
 
arch/s390/kernel/entry64.S +1 -1
@@ -18,7 +18,7 @@
 #include <asm/errno.h>
 #include <asm/ptrace.h>
 #include <asm/thread_info.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/unistd.h>
 #include <asm/page.h>
 
arch/s390/kernel/head.S +1 -1
@@ -30,7 +30,7 @@
 #include <linux/config.h>
 #include <asm/setup.h>
 #include <asm/lowcore.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 #include <asm/page.h>
 
arch/s390/kernel/head64.S +1 -1
@@ -30,7 +30,7 @@
 #include <linux/config.h>
 #include <asm/setup.h>
 #include <asm/lowcore.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 #include <asm/page.h>
 
arch/s390/lib/uaccess.S +1 -1
@@ -11,7 +11,7 @@
 
 #include <linux/errno.h>
 #include <asm/lowcore.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
         .text
         .align 4
arch/s390/lib/uaccess64.S +1 -1
@@ -11,7 +11,7 @@
 
 #include <linux/errno.h>
 #include <asm/lowcore.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
         .text
         .align 4
arch/xtensa/Makefile +2 -8
@@ -66,13 +66,7 @@ boot		:= arch/xtensa/boot
 
 archinc		:= include/asm-xtensa
 
-arch/xtensa/kernel/asm-offsets.s: \
-	arch/xtensa/kernel/asm-offsets.c $(archinc)/.platform
-
-include/asm-xtensa/offsets.h: arch/xtensa/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
-
-prepare: $(archinc)/.platform $(archinc)/offsets.h
+prepare: $(archinc)/.platform
 
 # Update machine cpu and platform symlinks if something which affects
 # them changed.
@@ -94,7 +88,7 @@ bzImage : zImage
 zImage zImage.initrd: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) $@
 
-CLEAN_FILES	+= arch/xtensa/vmlinux.lds $(archinc)/offset.h \
+CLEAN_FILES	+= arch/xtensa/vmlinux.lds                      \
 		   $(archinc)/platform $(archinc)/xtensa/config \
 		   $(archinc)/.platform
 
arch/xtensa/kernel/align.S +1 -1
@@ -19,7 +19,7 @@
 #include <asm/ptrace.h>
 #include <asm/ptrace.h>
 #include <asm/current.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/page.h>
arch/xtensa/kernel/entry.S +1 -1
@@ -14,7 +14,7 @@
  */
 
 #include <linux/linkage.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/processor.h>
 #include <asm/thread_info.h>
 #include <asm/uaccess.h>
arch/xtensa/kernel/process.c +1 -1
@@ -43,7 +43,7 @@
 #include <asm/mmu.h>
 #include <asm/irq.h>
 #include <asm/atomic.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/coprocessor.h>
 
 extern void ret_from_fork(void);
arch/xtensa/kernel/vectors.S +1 -1
@@ -46,7 +46,7 @@
 #include <asm/ptrace.h>
 #include <asm/ptrace.h>
 #include <asm/current.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/page.h>
include/asm-ia64/ptrace.h +1 -1
@@ -57,7 +57,7 @@
 #include <linux/config.h>
 
 #include <asm/fpu.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 
 /*
  * Base-2 logarithm of number of pages to allocate per task structure
include/asm-ia64/thread_info.h +1 -1
@@ -5,7 +5,7 @@
 #ifndef _ASM_IA64_THREAD_INFO_H
 #define _ASM_IA64_THREAD_INFO_H
 
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 
include/asm-parisc/assembly.h +1 -1
@@ -63,7 +63,7 @@
 	.level 2.0w
 #endif
 
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/page.h>
 
 #include <asm/asmregs.h>
include/asm-xtensa/ptrace.h +1 -1
@@ -127,7 +127,7 @@ extern void show_regs(struct pt_regs *);
 #else	/* __ASSEMBLY__ */
 
 #ifdef __KERNEL__
-# include <asm/offsets.h>
+# include <asm/asm-offsets.h>
 #define PT_REGS_OFFSET	  (KERNEL_STACK_SIZE - PT_USER_SIZE)
 #endif
 
include/asm-xtensa/uaccess.h +1 -1
@@ -25,7 +25,7 @@
 
 #define _ASMLANGUAGE
 #include <asm/current.h>
-#include <asm/offsets.h>
+#include <asm/asm-offsets.h>
 #include <asm/processor.h>
 
 /*
#6 lore raw

PATCH 7/12 kbuild: v850 use generic asm-offsets.h support

In reply to Sam Ravnborg

Deleted obsolete stuff from arch makefile
Renamed .c file to asm-offsets.h
Fix include of asm-offsets.h to use new name

---

 arch/v850/Makefile             |   14 +--------
 arch/v850/kernel/asm-consts.c  |   61 ----------------------------------------
 arch/v850/kernel/asm-offsets.c |   61 ++++++++++++++++++++++++++++++++++++++++
 arch/v850/kernel/entry.S       |    2 +
 4 files changed, 63 insertions(+), 75 deletions(-)
 delete mode 100644 arch/v850/kernel/asm-consts.c
 create mode 100644 arch/v850/kernel/asm-offsets.c

fb61a8615fce15f30b1bb1cf265ed05e251b9ed8

arch/v850/Makefile +1 -13
@@ -51,16 +51,4 @@ root_fs_image_force: $(ROOT_FS_IMAGE)
 	$(OBJCOPY) $(OBJCOPY_FLAGS_BLOB) --rename-section .data=.root,alloc,load,readonly,data,contents $< root_fs_image.o
 endif
 
-
-prepare: include/asm-$(ARCH)/asm-consts.h
-
-# Generate constants from C code for use by asm files
-arch/$(ARCH)/kernel/asm-consts.s: include/asm include/linux/version.h \
-				   include/config/MARKER
-
-include/asm-$(ARCH)/asm-consts.h: arch/$(ARCH)/kernel/asm-consts.s
-	$(call filechk,gen-asm-offsets)
-
-CLEAN_FILES += include/asm-$(ARCH)/asm-consts.h \
-	       arch/$(ARCH)/kernel/asm-consts.s \
-	       root_fs_image.o
+CLEAN_FILES += root_fs_image.o
arch/v850/kernel/asm-consts.c deleted +0 -61

61 lines not on this page · raw message

arch/v850/kernel/asm-offsets.c new file +61 -0

61 lines not on this page · raw message

arch/v850/kernel/entry.S +1 -1
@@ -22,7 +22,7 @@
 #include <asm/irq.h>
 #include <asm/errno.h>
 
-#include <asm/asm-consts.h>
+#include <asm/asm-offsets.h>
 
 
 /* Make a slightly more convenient alias for C_SYMBOL_NAME.  */
#9 lore raw

PATCH 10/12 kbuild: cris use generic asm-offsets.h support

In reply to Sam Ravnborg

Cris has a dedicated asm-offsets.c file per subarchitecture. So a symlink is created to put the desired asm-offsets.c file in $(ARCH)/kernel
This is absolutely not good practice, but it was the trick used in the rest of the cris code.

---

 arch/cris/Makefile                |   10 ++--------
 arch/cris/arch-v10/kernel/entry.S |    2 +-
 arch/cris/arch-v32/kernel/entry.S |    2 +-
 3 files changed, 4 insertions(+), 10 deletions(-)

5a0773698c51fdcec7eb361b6b819669ed1d249e

arch/cris/Makefile +2 -8
@@ -107,8 +107,7 @@ archclean:
 	rm -f timage vmlinux.bin decompress.bin rescue.bin cramfs.img
 	rm -rf $(LD_SCRIPT).tmp
 
-prepare: $(SRC_ARCH)/.links $(srctree)/include/asm-$(ARCH)/.arch \
-	 include/asm-$(ARCH)/$(SARCH)/offset.h
+prepare: $(SRC_ARCH)/.links $(srctree)/include/asm-$(ARCH)/.arch
 
 # Create some links to make all tools happy
 $(SRC_ARCH)/.links:
@@ -120,6 +119,7 @@ $(SRC_ARCH)/.links:
 	@ln -sfn $(SRC_ARCH)/$(SARCH)/lib $(SRC_ARCH)/lib
 	@ln -sfn $(SRC_ARCH)/$(SARCH) $(SRC_ARCH)/arch
 	@ln -sfn $(SRC_ARCH)/$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S
+	@ln -sfn $(SRC_ARCH)/$(SARCH)/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c
 	@touch $@
 
 # Create link to sub arch includes
@@ -128,9 +128,3 @@ $(srctree)/include/asm-$(ARCH)/.arch: $(
 	@rm -f include/asm-$(ARCH)/arch
 	@ln -sf $(srctree)/include/asm-$(ARCH)/$(SARCH) $(srctree)/include/asm-$(ARCH)/arch
 	@touch $@
-
-arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
-					include/config/MARKER
-
-include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s
-	$(call filechk,gen-asm-offsets)
arch/cris/arch-v10/kernel/entry.S +1 -1
@@ -270,7 +270,7 @@
 #include <asm/arch/sv_addr_ag.h>
 #include <asm/errno.h>
 #include <asm/thread_info.h>
-#include <asm/arch/offset.h>
+#include <asm/asm-offsets.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
 
arch/cris/arch-v32/kernel/entry.S +1 -1
@@ -23,7 +23,7 @@
 #include <asm/unistd.h>
 #include <asm/errno.h>
 #include <asm/thread_info.h>
-#include <asm/arch/offset.h>
+#include <asm/asm-offsets.h>
 
 #include <asm/arch/hwregs/asm/reg_map_asm.h>
 #include <asm/arch/hwregs/asm/intr_vect_defs_asm.h>
#12 lore raw

Re: [PATCH 9/12] kbuild: mips use generic asm-offsets.h support

In reply to Sam Ravnborg

Hi,

Quoted 1 line · Sam Ravnborg
 Kbuild                          |    9 ++++++++-

What's that file good for?
I know you want us to start using Kbuild, but Makefile works just fine and that's what everyone is used to.

bye, Roman

#13 lore raw

Re: [PATCH 9/12] kbuild: mips use generic asm-offsets.h support

Hi Roman.

Quoted 3 lines
Quoted 1 line
 Kbuild                          |    9 ++++++++-

What's that file good for?

kbuild looks for the Kbuild file before it looks for Makefile. In a desire to move some of the functionality away form the top-level Makefile and in to a kbuild file this is needed.

In this particular case the Kbuild file is located in the top-level directory because it is used to read a file down in arch/$(ARCH) and store the result file in include/asm-$(ARCH).
Here it come in handy that kbuild prefer the Kbuild name, since it would not be good to try to use the top-level Makefile as a kbuild file. It is full of conditionals and one more spanning-the-whole-file conditional was too ugly.
It also come in handy that the full kbuild functionality is available making it possible to do full dependency checking.

The Kbuild file in the top-level directory will take over more and more functionality from the top-level Makefile to the extent that I hope to end up with two readable files.

Sam

#14 lore raw

Re: [PATCH 9/12] kbuild: mips use generic asm-offsets.h support

Hi,

Quoted 7 lines · Sam Ravnborg
Quoted 3 lines
Quoted 1 line
 Kbuild                          |    9 ++++++++-

What's that file good for?

kbuild looks for the Kbuild file before it looks for Makefile. In a desire to move some of the functionality away form the top-level Makefile and in to a kbuild file this is needed.

Why don't you put it into scripts/Makefile...?

Quoted 4 lines

The Kbuild file in the top-level directory will take over more and more functionality from the top-level Makefile to the extent that I hope to end up with two readable files.

If the top-level Makefile gets to big, we can move things into scripts/, that's really no reason to start using Kbuild, in the end it's still a Makefile and I'd prefer to call it like that.

bye, Roman

#15 lore raw

Re: [PATCH 9/12] kbuild: mips use generic asm-offsets.h support

Hi Roman.

Quoted 5 lines
Quoted 3 lines

kbuild looks for the Kbuild file before it looks for Makefile. In a desire to move some of the functionality away form the top-level Makefile and in to a kbuild file this is needed.

Why don't you put it into scripts/Makefile...?

Because it does not build a build-support program. That would be the last place where one would look for rules to build asm-offsets.h for example.
When the functionalty to start the recursive build of all kernel directories are moved to top-level Kbuild the location in the top-level directory makes even more sense.

Same goes when the post processing steps are moved to the top-level Kbuild file. Here we again will benefit form having the full kbuild funtionality available.

Quoted 8 lines
Quoted 4 lines

The Kbuild file in the top-level directory will take over more and more functionality from the top-level Makefile to the extent that I hope to end up with two readable files.

If the top-level Makefile gets to big, we can move things into scripts/, that's really no reason to start using Kbuild, in the end it's still a Makefile and I'd prefer to call it like that.

A makefile is a file that does something intelligent when used as input to make. It is long time since this property did not hold for the kernel.
The Kbuild name is a much more natural name in the respect that it tells you this file contain kbuild info. So one know when browsing a directory structure that a Kbuild file is input to kbuild, and follow a much more strict syntax than ordinary Makefiles.

Sam

#16 lore raw

Re: [PATCH 9/12] kbuild: mips use generic asm-offsets.h support

Hi,

Quoted 4 lines · Sam Ravnborg
Quoted 1 line

Why don't you put it into scripts/Makefile...?

Because it does not build a build-support program. That would be the last place where one would look for rules to build asm-offsets.h for example.

Weird, why are the rules to build *.o files in scripts/Makefile.build?

Quoted 3 lines

Same goes when the post processing steps are moved to the top-level Kbuild file. Here we again will benefit form having the full kbuild funtionality available.

So why is this benefit only available via Kbuild?
If the toplevel Makefile is to crowded, why don't you move things into scripts/?

Quoted 10 lines
Quoted 3 lines

If the top-level Makefile gets to big, we can move things into scripts/, that's really no reason to start using Kbuild, in the end it's still a Makefile and I'd prefer to call it like that.

A makefile is a file that does something intelligent when used as input to make. It is long time since this property did not hold for the kernel.
The Kbuild name is a much more natural name in the respect that it tells you this file contain kbuild info. So one know when browsing a directory structure that a Kbuild file is input to kbuild, and follow a much more strict syntax than ordinary Makefiles.

If we continue in this direction, it would be even more natural to merge the Makefile with Kconfig, so I don't see the point in introducing Kbuild in first place, if we later remove it again anyway.

bye, Roman

#17 lore raw

Re: [PATCH 9/12] kbuild: mips use generic asm-offsets.h support

In reply to Sam Ravnborg

Hi,

Quoted 4 lines · On Sat, 10 Sep 2005 00:41:46 +0200 Sam Ravnborg <[email protected]> wrote:

Removed obsolete stuff from arch makefile.
mips had a special rule for generating asm-offsets.h so preserved it using an architecture specific hook in top-level Kbuild file. Renamed .h file to asm-offsets.h

Cannot build MIPS now.
We need to change offset.c to asm-offsets.c.

Yoichi

arch/mips/kernel/asm-offsets.c +314 -0
diff -urN -X dontdiff git10-orig/arch/mips/kernel/asm-offsets.c git10/arch/mips/kernel/asm-offsets.c
@@ -0,0 +1,314 @@
+/*
+ * offset.c: Calculate pt_regs and task_struct offsets.
+ *
+ * Copyright (C) 1996 David S. Miller
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ *
+ * Kevin Kissell, [email protected] and Carsten Langgaard, [email protected]
+ * Copyright (C) 2000 MIPS Technologies, Inc.
+ */
+#include <linux/config.h>
+#include <linux/compat.h>
+#include <linux/types.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/interrupt.h>
+
+#include <asm/ptrace.h>
+#include <asm/processor.h>
+
+#define text(t) __asm__("\n@@@" t)
+#define _offset(type, member) (&(((type *)NULL)->member))
+#define offset(string, ptr, member) \
+	__asm__("\n@@@" string "%0" : : "i" (_offset(ptr, member)))
+#define constant(string, member) \
+	__asm__("\n@@@" string "%x0" : : "ri" (member))
+#define size(string, size) \
+	__asm__("\n@@@" string "%0" : : "i" (sizeof(size)))
+#define linefeed text("")
+
+void output_ptreg_defines(void)
+{
+	text("/* MIPS pt_regs offsets. */");
+	offset("#define PT_R0     ", struct pt_regs, regs[0]);
+	offset("#define PT_R1     ", struct pt_regs, regs[1]);
+	offset("#define PT_R2     ", struct pt_regs, regs[2]);
+	offset("#define PT_R3     ", struct pt_regs, regs[3]);
+	offset("#define PT_R4     ", struct pt_regs, regs[4]);
+	offset("#define PT_R5     ", struct pt_regs, regs[5]);
+	offset("#define PT_R6     ", struct pt_regs, regs[6]);
+	offset("#define PT_R7     ", struct pt_regs, regs[7]);
+	offset("#define PT_R8     ", struct pt_regs, regs[8]);
+	offset("#define PT_R9     ", struct pt_regs, regs[9]);
+	offset("#define PT_R10    ", struct pt_regs, regs[10]);
+	offset("#define PT_R11    ", struct pt_regs, regs[11]);
+	offset("#define PT_R12    ", struct pt_regs, regs[12]);
+	offset("#define PT_R13    ", struct pt_regs, regs[13]);
+	offset("#define PT_R14    ", struct pt_regs, regs[14]);
+	offset("#define PT_R15    ", struct pt_regs, regs[15]);
+	offset("#define PT_R16    ", struct pt_regs, regs[16]);
+	offset("#define PT_R17    ", struct pt_regs, regs[17]);
+	offset("#define PT_R18    ", struct pt_regs, regs[18]);
+	offset("#define PT_R19    ", struct pt_regs, regs[19]);
+	offset("#define PT_R20    ", struct pt_regs, regs[20]);
+	offset("#define PT_R21    ", struct pt_regs, regs[21]);
+	offset("#define PT_R22    ", struct pt_regs, regs[22]);
+	offset("#define PT_R23    ", struct pt_regs, regs[23]);
+	offset("#define PT_R24    ", struct pt_regs, regs[24]);
+	offset("#define PT_R25    ", struct pt_regs, regs[25]);
+	offset("#define PT_R26    ", struct pt_regs, regs[26]);
+	offset("#define PT_R27    ", struct pt_regs, regs[27]);
+	offset("#define PT_R28    ", struct pt_regs, regs[28]);
+	offset("#define PT_R29    ", struct pt_regs, regs[29]);
+	offset("#define PT_R30    ", struct pt_regs, regs[30]);
+	offset("#define PT_R31    ", struct pt_regs, regs[31]);
+	offset("#define PT_LO     ", struct pt_regs, lo);
+	offset("#define PT_HI     ", struct pt_regs, hi);
+	offset("#define PT_EPC    ", struct pt_regs, cp0_epc);
+	offset("#define PT_BVADDR ", struct pt_regs, cp0_badvaddr);
+	offset("#define PT_STATUS ", struct pt_regs, cp0_status);
+	offset("#define PT_CAUSE  ", struct pt_regs, cp0_cause);
+	size("#define PT_SIZE   ", struct pt_regs);
+	linefeed;
+}
+
+void output_task_defines(void)
+{
+	text("/* MIPS task_struct offsets. */");
+	offset("#define TASK_STATE         ", struct task_struct, state);
+	offset("#define TASK_THREAD_INFO   ", struct task_struct, thread_info);
+	offset("#define TASK_FLAGS         ", struct task_struct, flags);
+	offset("#define TASK_MM            ", struct task_struct, mm);
+	offset("#define TASK_PID           ", struct task_struct, pid);
+	size(  "#define TASK_STRUCT_SIZE   ", struct task_struct);
+	linefeed;
+}
+
+void output_thread_info_defines(void)
+{
+	text("/* MIPS thread_info offsets. */");
+	offset("#define TI_TASK            ", struct thread_info, task);
+	offset("#define TI_EXEC_DOMAIN     ", struct thread_info, exec_domain);
+	offset("#define TI_FLAGS           ", struct thread_info, flags);
+	offset("#define TI_CPU             ", struct thread_info, cpu);
+	offset("#define TI_PRE_COUNT       ", struct thread_info, preempt_count);
+	offset("#define TI_ADDR_LIMIT      ", struct thread_info, addr_limit);
+	offset("#define TI_RESTART_BLOCK   ", struct thread_info, restart_block);
+	constant("#define _THREAD_SIZE_ORDER ", THREAD_SIZE_ORDER);
+	constant("#define _THREAD_SIZE       ", THREAD_SIZE);
+	constant("#define _THREAD_MASK       ", THREAD_MASK);
+	linefeed;
+}
+
+void output_thread_defines(void)
+{
+	text("/* MIPS specific thread_struct offsets. */");
+	offset("#define THREAD_REG16   ", struct task_struct, thread.reg16);
+	offset("#define THREAD_REG17   ", struct task_struct, thread.reg17);
+	offset("#define THREAD_REG18   ", struct task_struct, thread.reg18);
+	offset("#define THREAD_REG19   ", struct task_struct, thread.reg19);
+	offset("#define THREAD_REG20   ", struct task_struct, thread.reg20);
+	offset("#define THREAD_REG21   ", struct task_struct, thread.reg21);
+	offset("#define THREAD_REG22   ", struct task_struct, thread.reg22);
+	offset("#define THREAD_REG23   ", struct task_struct, thread.reg23);
+	offset("#define THREAD_REG29   ", struct task_struct, thread.reg29);
+	offset("#define THREAD_REG30   ", struct task_struct, thread.reg30);
+	offset("#define THREAD_REG31   ", struct task_struct, thread.reg31);
+	offset("#define THREAD_STATUS  ", struct task_struct,
+	       thread.cp0_status);
+	offset("#define THREAD_FPU     ", struct task_struct, thread.fpu);
+
+	offset("#define THREAD_BVADDR  ", struct task_struct, \
+	       thread.cp0_badvaddr);
+	offset("#define THREAD_BUADDR  ", struct task_struct, \
+	       thread.cp0_baduaddr);
+	offset("#define THREAD_ECODE   ", struct task_struct, \
+	       thread.error_code);
+	offset("#define THREAD_TRAPNO  ", struct task_struct, thread.trap_no);
+	offset("#define THREAD_MFLAGS  ", struct task_struct, thread.mflags);
+	offset("#define THREAD_TRAMP   ", struct task_struct, \
+	       thread.irix_trampoline);
+	offset("#define THREAD_OLDCTX  ", struct task_struct, \
+	       thread.irix_oldctx);
+	linefeed;
+}
+
+void output_thread_fpu_defines(void)
+{
+	offset("#define THREAD_FPR0    ",
+	       struct task_struct, thread.fpu.hard.fpr[0]);
+	offset("#define THREAD_FPR1    ",
+	       struct task_struct, thread.fpu.hard.fpr[1]);
+	offset("#define THREAD_FPR2    ",
+	       struct task_struct, thread.fpu.hard.fpr[2]);
+	offset("#define THREAD_FPR3    ",
+	       struct task_struct, thread.fpu.hard.fpr[3]);
+	offset("#define THREAD_FPR4    ",
+	       struct task_struct, thread.fpu.hard.fpr[4]);
+	offset("#define THREAD_FPR5    ",
+	       struct task_struct, thread.fpu.hard.fpr[5]);
+	offset("#define THREAD_FPR6    ",
+	       struct task_struct, thread.fpu.hard.fpr[6]);
+	offset("#define THREAD_FPR7    ",
+	       struct task_struct, thread.fpu.hard.fpr[7]);
+	offset("#define THREAD_FPR8    ",
+	       struct task_struct, thread.fpu.hard.fpr[8]);
+	offset("#define THREAD_FPR9    ",
+	       struct task_struct, thread.fpu.hard.fpr[9]);
+	offset("#define THREAD_FPR10   ",
+	       struct task_struct, thread.fpu.hard.fpr[10]);
+	offset("#define THREAD_FPR11   ",
+	       struct task_struct, thread.fpu.hard.fpr[11]);
+	offset("#define THREAD_FPR12   ",
+	       struct task_struct, thread.fpu.hard.fpr[12]);
+	offset("#define THREAD_FPR13   ",
+	       struct task_struct, thread.fpu.hard.fpr[13]);
+	offset("#define THREAD_FPR14   ",
+	       struct task_struct, thread.fpu.hard.fpr[14]);
+	offset("#define THREAD_FPR15   ",
+	       struct task_struct, thread.fpu.hard.fpr[15]);
+	offset("#define THREAD_FPR16   ",
+	       struct task_struct, thread.fpu.hard.fpr[16]);
+	offset("#define THREAD_FPR17   ",
+	       struct task_struct, thread.fpu.hard.fpr[17]);
+	offset("#define THREAD_FPR18   ",
+	       struct task_struct, thread.fpu.hard.fpr[18]);
+	offset("#define THREAD_FPR19   ",
+	       struct task_struct, thread.fpu.hard.fpr[19]);
+	offset("#define THREAD_FPR20   ",
+	       struct task_struct, thread.fpu.hard.fpr[20]);
+	offset("#define THREAD_FPR21   ",
+	       struct task_struct, thread.fpu.hard.fpr[21]);
+	offset("#define THREAD_FPR22   ",
+	       struct task_struct, thread.fpu.hard.fpr[22]);
+	offset("#define THREAD_FPR23   ",
+	       struct task_struct, thread.fpu.hard.fpr[23]);
+	offset("#define THREAD_FPR24   ",
+	       struct task_struct, thread.fpu.hard.fpr[24]);
+	offset("#define THREAD_FPR25   ",
+	       struct task_struct, thread.fpu.hard.fpr[25]);
+	offset("#define THREAD_FPR26   ",
+	       struct task_struct, thread.fpu.hard.fpr[26]);
+	offset("#define THREAD_FPR27   ",
+	       struct task_struct, thread.fpu.hard.fpr[27]);
+	offset("#define THREAD_FPR28   ",
+	       struct task_struct, thread.fpu.hard.fpr[28]);
+	offset("#define THREAD_FPR29   ",
+	       struct task_struct, thread.fpu.hard.fpr[29]);
+	offset("#define THREAD_FPR30   ",
+	       struct task_struct, thread.fpu.hard.fpr[30]);
+	offset("#define THREAD_FPR31   ",
+	       struct task_struct, thread.fpu.hard.fpr[31]);
+
+	offset("#define THREAD_FCR31   ",
+	       struct task_struct, thread.fpu.hard.fcr31);
+	linefeed;
+}
+
+void output_mm_defines(void)
+{
+	text("/* Size of struct page  */");
+	size("#define STRUCT_PAGE_SIZE   ", struct page);
+	linefeed;
+	text("/* Linux mm_struct offsets. */");
+	offset("#define MM_USERS      ", struct mm_struct, mm_users);
+	offset("#define MM_PGD        ", struct mm_struct, pgd);
+	offset("#define MM_CONTEXT    ", struct mm_struct, context);
+	linefeed;
+	constant("#define _PAGE_SIZE     ", PAGE_SIZE);
+	constant("#define _PAGE_SHIFT    ", PAGE_SHIFT);
+	linefeed;
+	constant("#define _PGD_T_SIZE    ", sizeof(pgd_t));
+	constant("#define _PMD_T_SIZE    ", sizeof(pmd_t));
+	constant("#define _PTE_T_SIZE    ", sizeof(pte_t));
+	linefeed;
+	constant("#define _PGD_T_LOG2    ", PGD_T_LOG2);
+	constant("#define _PMD_T_LOG2    ", PMD_T_LOG2);
+	constant("#define _PTE_T_LOG2    ", PTE_T_LOG2);
+	linefeed;
+	constant("#define _PMD_SHIFT     ", PMD_SHIFT);
+	constant("#define _PGDIR_SHIFT   ", PGDIR_SHIFT);
+	linefeed;
+	constant("#define _PGD_ORDER     ", PGD_ORDER);
+	constant("#define _PMD_ORDER     ", PMD_ORDER);
+	constant("#define _PTE_ORDER     ", PTE_ORDER);
+	linefeed;
+	constant("#define _PTRS_PER_PGD  ", PTRS_PER_PGD);
+	constant("#define _PTRS_PER_PMD  ", PTRS_PER_PMD);
+	constant("#define _PTRS_PER_PTE  ", PTRS_PER_PTE);
+	linefeed;
+}
+
+void output_sc_defines(void)
+{
+	text("/* Linux sigcontext offsets. */");
+	offset("#define SC_REGS       ", struct sigcontext, sc_regs);
+	offset("#define SC_FPREGS     ", struct sigcontext, sc_fpregs);
+	offset("#define SC_MDHI       ", struct sigcontext, sc_mdhi);
+	offset("#define SC_MDLO       ", struct sigcontext, sc_mdlo);
+	offset("#define SC_PC         ", struct sigcontext, sc_pc);
+	offset("#define SC_STATUS     ", struct sigcontext, sc_status);
+	offset("#define SC_FPC_CSR    ", struct sigcontext, sc_fpc_csr);
+	offset("#define SC_FPC_EIR    ", struct sigcontext, sc_fpc_eir);
+	offset("#define SC_CAUSE      ", struct sigcontext, sc_cause);
+	offset("#define SC_BADVADDR   ", struct sigcontext, sc_badvaddr);
+	linefeed;
+}
+
+#ifdef CONFIG_MIPS32_COMPAT
+void output_sc32_defines(void)
+{
+	text("/* Linux 32-bit sigcontext offsets. */");
+	offset("#define SC32_FPREGS     ", struct sigcontext32, sc_fpregs);
+	offset("#define SC32_FPC_CSR    ", struct sigcontext32, sc_fpc_csr);
+	offset("#define SC32_FPC_EIR    ", struct sigcontext32, sc_fpc_eir);
+	linefeed;
+}
+#endif
+
+void output_signal_defined(void)
+{
+	text("/* Linux signal numbers. */");
+	constant("#define _SIGHUP     ", SIGHUP);
+	constant("#define _SIGINT     ", SIGINT);
+	constant("#define _SIGQUIT    ", SIGQUIT);
+	constant("#define _SIGILL     ", SIGILL);
+	constant("#define _SIGTRAP    ", SIGTRAP);
+	constant("#define _SIGIOT     ", SIGIOT);
+	constant("#define _SIGABRT    ", SIGABRT);
+	constant("#define _SIGEMT     ", SIGEMT);
+	constant("#define _SIGFPE     ", SIGFPE);
+	constant("#define _SIGKILL    ", SIGKILL);
+	constant("#define _SIGBUS     ", SIGBUS);
+	constant("#define _SIGSEGV    ", SIGSEGV);
+	constant("#define _SIGSYS     ", SIGSYS);
+	constant("#define _SIGPIPE    ", SIGPIPE);
+	constant("#define _SIGALRM    ", SIGALRM);
+	constant("#define _SIGTERM    ", SIGTERM);
+	constant("#define _SIGUSR1    ", SIGUSR1);
+	constant("#define _SIGUSR2    ", SIGUSR2);
+	constant("#define _SIGCHLD    ", SIGCHLD);
+	constant("#define _SIGPWR     ", SIGPWR);
+	constant("#define _SIGWINCH   ", SIGWINCH);
+	constant("#define _SIGURG     ", SIGURG);
+	constant("#define _SIGIO      ", SIGIO);
+	constant("#define _SIGSTOP    ", SIGSTOP);
+	constant("#define _SIGTSTP    ", SIGTSTP);
+	constant("#define _SIGCONT    ", SIGCONT);
+	constant("#define _SIGTTIN    ", SIGTTIN);
+	constant("#define _SIGTTOU    ", SIGTTOU);
+	constant("#define _SIGVTALRM  ", SIGVTALRM);
+	constant("#define _SIGPROF    ", SIGPROF);
+	constant("#define _SIGXCPU    ", SIGXCPU);
+	constant("#define _SIGXFSZ    ", SIGXFSZ);
+	linefeed;
+}
+
+void output_irq_cpustat_t_defines(void)
+{
+	text("/* Linux irq_cpustat_t offsets. */");
+	offset("#define IC_SOFTIRQ_PENDING ", irq_cpustat_t, __softirq_pending);
+	size("#define IC_IRQ_CPUSTAT_T   ", irq_cpustat_t);
+	linefeed;
+}
arch/mips/kernel/offset.c +0 -314

314 lines not on this page · raw message