2005-04-17 06:20:36 +08:00
|
|
|
# This file is included by the global makefile so that you can add your own
|
|
|
|
# architecture-specific flags and dependencies. Remember to do have actions
|
|
|
|
# for "archclean" and "archdep" for cleaning up and making dependencies for
|
|
|
|
# this architecture
|
|
|
|
#
|
|
|
|
# This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
# License. See the file "COPYING" in the main directory of this archive
|
|
|
|
# for more details.
|
|
|
|
#
|
|
|
|
# Copyright (C) 1994 by Linus Torvalds
|
|
|
|
# Changes for PPC by Gary Thomas
|
|
|
|
# Rewritten by Cort Dougan and Paul Mackerras
|
|
|
|
# Adjusted for PPC64 by Tom Gall
|
|
|
|
#
|
|
|
|
|
|
|
|
KERNELLOAD := 0xc000000000000000
|
|
|
|
|
|
|
|
# Set default 32 bits cross compilers for vdso and boot wrapper
|
|
|
|
CROSS32_COMPILE ?=
|
|
|
|
|
|
|
|
CROSS32CC := $(CROSS32_COMPILE)gcc
|
|
|
|
CROSS32AS := $(CROSS32_COMPILE)as
|
|
|
|
CROSS32LD := $(CROSS32_COMPILE)ld
|
|
|
|
CROSS32OBJCOPY := $(CROSS32_COMPILE)objcopy
|
|
|
|
|
|
|
|
# If we have a biarch compiler, use it for 32 bits cross compile if
|
|
|
|
# CROSS32_COMPILE wasn't explicitely defined, and add proper explicit
|
|
|
|
# target type to target compilers
|
|
|
|
|
|
|
|
HAS_BIARCH := $(call cc-option-yn, -m64)
|
|
|
|
ifeq ($(HAS_BIARCH),y)
|
|
|
|
ifeq ($(CROSS32_COMPILE),)
|
|
|
|
CROSS32CC := $(CC) -m32
|
|
|
|
CROSS32AS := $(AS) -a32
|
|
|
|
CROSS32LD := $(LD) -m elf32ppc
|
|
|
|
CROSS32OBJCOPY := $(OBJCOPY)
|
|
|
|
endif
|
2005-06-22 08:15:32 +08:00
|
|
|
override AS += -a64
|
|
|
|
override LD += -m elf64ppc
|
|
|
|
override CC += -m64
|
2005-04-17 06:20:36 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY
|
|
|
|
|
|
|
|
new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
|
|
|
|
|
|
|
|
ifeq ($(new_nm),y)
|
|
|
|
NM := $(NM) --synthetic
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2005-09-08 06:28:32 +08:00
|
|
|
CHECKFLAGS += -m64 -D__powerpc__ -D__powerpc64__
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
LDFLAGS := -m elf64ppc
|
|
|
|
LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
|
|
|
|
CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback=none \
|
|
|
|
-mcall-aixdesc
|
2005-08-29 11:15:50 +08:00
|
|
|
# Temporary hack until we have migrated to asm-powerpc
|
2005-09-10 22:00:14 +08:00
|
|
|
CPPFLAGS += -Iarch/$(ARCH)/include
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-05-03 13:34:58 +08:00
|
|
|
GCC_VERSION := $(call cc-version)
|
|
|
|
GCC_BROKEN_VEC := $(shell if [ $(GCC_VERSION) -lt 0400 ] ; then echo "y"; fi ;)
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
ifeq ($(CONFIG_POWER4_ONLY),y)
|
|
|
|
ifeq ($(CONFIG_ALTIVEC),y)
|
2005-05-03 13:34:58 +08:00
|
|
|
ifeq ($(GCC_BROKEN_VEC),y)
|
2005-04-17 06:20:36 +08:00
|
|
|
CFLAGS += $(call cc-option,-mcpu=970)
|
|
|
|
else
|
|
|
|
CFLAGS += $(call cc-option,-mcpu=power4)
|
|
|
|
endif
|
2005-05-03 13:34:58 +08:00
|
|
|
else
|
|
|
|
CFLAGS += $(call cc-option,-mcpu=power4)
|
|
|
|
endif
|
2005-04-17 06:20:36 +08:00
|
|
|
else
|
|
|
|
CFLAGS += $(call cc-option,-mtune=power4)
|
|
|
|
endif
|
|
|
|
|
2005-10-29 08:46:09 +08:00
|
|
|
# No AltiVec instruction when building kernel
|
|
|
|
CFLAGS += $(call cc-option, -mno-altivec)
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
# Enable unit-at-a-time mode when possible. It shrinks the
|
|
|
|
# kernel considerably.
|
|
|
|
CFLAGS += $(call cc-option,-funit-at-a-time)
|
|
|
|
|
|
|
|
head-y := arch/ppc64/kernel/head.o
|
[PATCH] powerpc: Fix handling of fpscr on 64-bit
The recent merge of fpu.S broken the handling of fpscr for
ARCH=powerpc and CONFIG_PPC64=y. FP registers could be corrupted,
leading to strange random application crashes.
The confusion arises, because the thread_struct has (and requires) a
64-bit area to save the fpscr, because we use load/store double
instructions to get it in to/out of the FPU. However, only the low
32-bits are actually used, so we want to treat it as a 32-bit quantity
when manipulating its bits to avoid extra load/stores on 32-bit. This
patch replaces the current definition with a structure of two 32-bit
quantities (pad and val), to clarify things as much as is possible.
The 'val' field is used when manipulating bits, the structure itself
is used when obtaining the address for loading/unloading the value
from the FPU.
While we're at it, consolidate the 4 (!) almost identical versions of
cvt_fd() and cvt_df() (arch/ppc/kernel/misc.S,
arch/ppc64/kernel/misc.S, arch/powerpc/kernel/misc_32.S,
arch/powerpc/kernel/misc_64.S) into a single version in fpu.S. The
new version takes a pointer to thread_struct and applies the correct
offset itself, rather than a pointer to the fpscr field itself, again
to avoid confusion as to which is the correct field to use.
Finally, this patch makes ARCH=ppc64 also use the consolidated fpu.S
code, which it previously did not.
Built for G5 (ARCH=ppc64 and ARCH=powerpc), 32-bit powermac (ARCH=ppc
and ARCH=powerpc) and Walnut (ARCH=ppc, CONFIG_MATH_EMULATION=y).
Booted on G5 (ARCH=powerpc) and things which previously fell over no
longer do.
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-27 14:27:25 +08:00
|
|
|
head-y += arch/powerpc/kernel/fpu.o
|
2005-10-28 10:51:45 +08:00
|
|
|
head-y += arch/powerpc/kernel/entry_64.o
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-09-30 11:51:25 +08:00
|
|
|
core-y += arch/ppc64/kernel/ arch/powerpc/kernel/
|
2005-10-10 19:58:35 +08:00
|
|
|
core-y += arch/powerpc/mm/
|
2005-10-20 19:06:44 +08:00
|
|
|
core-y += arch/powerpc/sysdev/
|
2005-09-23 11:15:51 +08:00
|
|
|
core-y += arch/powerpc/platforms/
|
2005-10-27 14:25:05 +08:00
|
|
|
core-y += arch/powerpc/lib/
|
2005-10-28 20:53:37 +08:00
|
|
|
core-$(CONFIG_XMON) += arch/powerpc/xmon/
|
2005-09-19 21:24:08 +08:00
|
|
|
drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
boot := arch/ppc64/boot
|
|
|
|
|
2005-08-16 04:59:13 +08:00
|
|
|
boottargets-$(CONFIG_PPC_PSERIES) += zImage zImage.initrd
|
|
|
|
boottargets-$(CONFIG_PPC_PMAC) += zImage.vmode zImage.initrd.vmode
|
|
|
|
boottargets-$(CONFIG_PPC_MAPLE) += zImage zImage.initrd
|
|
|
|
boottargets-$(CONFIG_PPC_ISERIES) += vmlinux.sminitrd vmlinux.initrd vmlinux.sm
|
|
|
|
boottargets-$(CONFIG_PPC_BPA) += zImage zImage.initrd
|
|
|
|
$(boottargets-y): vmlinux
|
2005-04-17 06:20:36 +08:00
|
|
|
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
|
|
|
|
|
|
|
|
bootimage-$(CONFIG_PPC_PSERIES) := $(boot)/zImage
|
|
|
|
bootimage-$(CONFIG_PPC_PMAC) := vmlinux
|
|
|
|
bootimage-$(CONFIG_PPC_MAPLE) := $(boot)/zImage
|
2005-10-29 08:46:55 +08:00
|
|
|
bootimage-$(CONFIG_PPC_BPA) := $(boot)/zImage
|
2005-04-17 06:20:36 +08:00
|
|
|
bootimage-$(CONFIG_PPC_ISERIES) := vmlinux
|
|
|
|
BOOTIMAGE := $(bootimage-y)
|
|
|
|
install: vmlinux
|
|
|
|
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
|
|
|
|
|
|
|
|
defaultimage-$(CONFIG_PPC_PSERIES) := zImage
|
2005-09-22 00:55:34 +08:00
|
|
|
defaultimage-$(CONFIG_PPC_PMAC) := zImage.vmode
|
2005-04-17 06:20:36 +08:00
|
|
|
defaultimage-$(CONFIG_PPC_MAPLE) := zImage
|
|
|
|
defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
|
|
|
|
KBUILD_IMAGE := $(defaultimage-y)
|
|
|
|
all: $(KBUILD_IMAGE)
|
|
|
|
|
|
|
|
archclean:
|
|
|
|
$(Q)$(MAKE) $(clean)=$(boot)
|
2005-09-10 22:00:14 +08:00
|
|
|
# Temporary hack until we have migrated to asm-powerpc
|
|
|
|
$(Q)rm -rf arch/$(ARCH)/include
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
|
2005-08-29 11:15:50 +08:00
|
|
|
# Temporary hack until we have migrated to asm-powerpc
|
2005-09-10 22:00:14 +08:00
|
|
|
include/asm: arch/$(ARCH)/include/asm
|
|
|
|
arch/$(ARCH)/include/asm:
|
|
|
|
$(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
|
|
|
|
$(Q)ln -fsn $(srctree)/include/asm-powerpc arch/$(ARCH)/include/asm
|
2005-08-29 11:15:50 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
define archhelp
|
2005-08-16 04:59:13 +08:00
|
|
|
echo ' zImage.vmode - Compressed kernel image (arch/$(ARCH)/boot/zImage.vmode)'
|
|
|
|
echo ' zImage.initrd.vmode - Compressed kernel image with initrd attached,'
|
|
|
|
echo ' sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
|
|
|
|
echo ' (arch/$(ARCH)/boot/zImage.initrd.vmode)'
|
|
|
|
echo ' zImage - zImage for pSeries machines'
|
|
|
|
echo ' zImage.initrd - zImage with initrd for pSeries machines'
|
2005-04-17 06:20:36 +08:00
|
|
|
endef
|