# From: Bodo Stroesser # # To support different subarches, UML must not use the same # address for jiffies and jiffies_64 in a hardcoded way. # I added JIFFIES_OFFSET to handle different arches. For # current arches, it is set to 0, for s390 it will be set to 4. # # Signed-off-by: Bodo Stroesser Index: linux-2.6.17/arch/um/Makefile =================================================================== --- linux-2.6.17.orig/arch/um/Makefile 2007-11-19 10:56:56.000000000 -0500 +++ linux-2.6.17/arch/um/Makefile 2007-11-19 11:12:16.000000000 -0500 @@ -125,7 +125,8 @@ ifndef START endif CPPFLAGS_vmlinux.lds = -U$(SUBARCH) -DSTART=$(START) -DELF_ARCH=$(ELF_ARCH) \ - -DELF_FORMAT="$(ELF_FORMAT)" -DKERNEL_STACK_SIZE=$(STACK_SIZE) + -DELF_FORMAT="$(ELF_FORMAT)" -DKERNEL_STACK_SIZE=$(STACK_SIZE) \ + -DJIFFIES_OFS=$(JIFFIES_OFS) # The wrappers will select whether using "malloc" or the kernel allocator. LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc Index: linux-2.6.17/arch/um/Makefile-i386 =================================================================== --- linux-2.6.17.orig/arch/um/Makefile-i386 2007-11-19 10:40:56.000000000 -0500 +++ linux-2.6.17/arch/um/Makefile-i386 2007-11-19 11:11:44.000000000 -0500 @@ -7,6 +7,7 @@ START := 0x8048000 LDFLAGS += -m elf_i386 ELF_ARCH := $(SUBARCH) ELF_FORMAT := elf32-$(SUBARCH) +JIFFIES_OFS := 0 OBJCOPYFLAGS := -O binary -R .note -R .comment -S HEADER_ARCH := x86 CHECKFLAGS += -D__i386__ Index: linux-2.6.17/arch/um/Makefile-x86_64 =================================================================== --- linux-2.6.17.orig/arch/um/Makefile-x86_64 2007-11-19 10:40:56.000000000 -0500 +++ linux-2.6.17/arch/um/Makefile-x86_64 2007-11-19 11:12:40.000000000 -0500 @@ -15,6 +15,7 @@ KBUILD_CPPFLAGS += -m64 ELF_ARCH := i386:x86-64 ELF_FORMAT := elf64-x86-64 +JIFFIES_OFS := 0 HEADER_ARCH := x86 # Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example. Index: linux-2.6.17/arch/um/kernel/dyn.lds.S =================================================================== --- linux-2.6.17.orig/arch/um/kernel/dyn.lds.S 2007-10-24 10:04:50.000000000 -0400 +++ linux-2.6.17/arch/um/kernel/dyn.lds.S 2007-11-19 11:11:44.000000000 -0500 @@ -3,7 +3,7 @@ OUTPUT_FORMAT(ELF_FORMAT) OUTPUT_ARCH(ELF_ARCH) ENTRY(_start) -jiffies = jiffies_64; +jiffies = jiffies_64 + JIFFIES_OFS; SECTIONS { Index: linux-2.6.17/arch/um/kernel/uml.lds.S =================================================================== --- linux-2.6.17.orig/arch/um/kernel/uml.lds.S 2007-10-24 10:04:50.000000000 -0400 +++ linux-2.6.17/arch/um/kernel/uml.lds.S 2007-11-19 11:11:44.000000000 -0500 @@ -3,7 +3,7 @@ OUTPUT_FORMAT(ELF_FORMAT) OUTPUT_ARCH(ELF_ARCH) ENTRY(_start) -jiffies = jiffies_64; +jiffies = jiffies_64 + JIFFIES_OFS; SECTIONS {