projects/linux·commit 9daeaa37

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next

9daeaa37 · Linus Torvalds <[email protected]> · 2012-05-21 10:32:01 -07:00

Pull sparc updates from David Miller:

1) Kill off support for sun4c and Cypress sun4m chips.

   And as a result we were able to also kill off that ugly btfixup thing
   that required multi-stage links of the final vmlinux image in the
   Kbuild system.  This should make the kbuild maintainers really happy.

   Thanks a lot to Sam Ravnborg for his tireless efforts to get this
   going.

2) Convert sparc64 to nobootmem.  I suspect now with sparc32 being a lot
   cleaner, it should be able to fall in line and modernize in this area
   too.

3) Make sparc32 use generic clockevents, from Tkhai Kirill.

[ I fixed up the BPF rules, and tried to clean up the build rules too.
  But I don't have - or want - a sparc cross-build environment, so the
  BPF rule bug and the related build cleanup was all done with just a
  bare "make -n" pseudo-test.      - Linus ]

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next: (110 commits)
  sparc32: use flushi when run-time patching in per_cpu_patch
  sparc32: fix cpuid_patch run-time patching
  sparc32: drop unused inline functions in srmmu.c
  sparc32: drop unused functions in pgtsrmmu.h
  sparc32,leon: move leon mmu functions to leon_mm.c
  sparc32,leon: remove duplicate definitions in leon.h
  sparc32,leon: remove duplicate UART register definitions
  sparc32,leon: move leon ASI definitions to asi.h
  sparc32: move trap table to a separate file
  sparc64: renamed ttable.S to ttable_64.S
  sparc32: Remove asm/sysen.h header.
  sparc32: Delete asm/smpprim.h
  sparc32: Remove unused empty_bad_page{,_table} declarations.
  sparc32: Kill boot_cpu_id4
  sparc32: Move GET_PROCESSOR*_ID() out of asm/asmmacro.h
  sparc32: Remove completely unused code from asm/cache.h
  sparc32: Add ucmpdi2.o to obj-y instead of lib-y.
  sparc32: add ucmpdi2
  sparc: introduce arch/sparc/Kbuild
  sparc: remove obsolete documentation
  ...
Commit
9daeaa370526df1c19eba4780247bb7155541e38
Parents
cb62ab71 · 1edc1783

Merge commit. Changes below are compared with the first parent: cb62ab71.

Changes

137 files changed · +2242 −10772

FileStatusAddDelContent
Documentation/sparc/README-2.5deleted+0−46View before deletion
arch/sparc/Kbuildadded+8−0View file
arch/sparc/Kconfigmodified+4−8View file
arch/sparc/Makefilemodified+12−36View file
arch/sparc/boot/Makefilemodified+10−51View file
arch/sparc/boot/btfixupprep.cdeleted+0−386View before deletion
arch/sparc/include/asm/asi.hmodified+14−0View file
arch/sparc/include/asm/asmmacro.hmodified+0−17View file
arch/sparc/include/asm/btfixup.hdeleted+0−208View before deletion
arch/sparc/include/asm/cache.hmodified+0−114View file
arch/sparc/include/asm/cacheflush.hmodified+4−0View file
arch/sparc/include/asm/cacheflush_32.hmodified+18−55View file
arch/sparc/include/asm/cacheflush_64.hmodified+0−3View file
arch/sparc/include/asm/cachetlb_32.hadded+29−0View file
arch/sparc/include/asm/cmpxchg_32.hmodified+0−27View file
arch/sparc/include/asm/contregs.hmodified+0−22View file
arch/sparc/include/asm/cpu_type.hmodified+7−13View file
arch/sparc/include/asm/cpudata_32.hmodified+0−1View file
arch/sparc/include/asm/cypress.hdeleted+0−79View before deletion
arch/sparc/include/asm/dma.hmodified+28−24View file
arch/sparc/include/asm/elf_32.hmodified+3−10View file
arch/sparc/include/asm/floppy_32.hmodified+13−32View file
arch/sparc/include/asm/floppy_64.hmodified+1−5View file
arch/sparc/include/asm/head_32.hmodified+1−20View file
arch/sparc/include/asm/leon.hmodified+3−58View file
arch/sparc/include/asm/machines.hmodified+1−22View file
arch/sparc/include/asm/mbus.hmodified+0−4View file
arch/sparc/include/asm/memreg.hdeleted+0−51View before deletion
arch/sparc/include/asm/mmu_context_32.hmodified+3−8View file
arch/sparc/include/asm/obio.hmodified+0−13View file
arch/sparc/include/asm/oplib_32.hmodified+0−8View file
arch/sparc/include/asm/page_32.hmodified+1−12View file
arch/sparc/include/asm/pgalloc_32.hmodified+49−27View file
arch/sparc/include/asm/pgtable_32.hmodified+206−181View file
arch/sparc/include/asm/pgtable_64.hmodified+0−4View file
arch/sparc/include/asm/pgtsrmmu.hmodified+0−50View file
arch/sparc/include/asm/pgtsun4c.hdeleted+0−172View before deletion
arch/sparc/include/asm/processor_32.hmodified+0−1View file
arch/sparc/include/asm/setup.hmodified+0−3View file
arch/sparc/include/asm/shmparam_32.hmodified+1−3View file
arch/sparc/include/asm/smp_32.hmodified+31−83View file
arch/sparc/include/asm/smpprim.hdeleted+0−54View before deletion
arch/sparc/include/asm/string_32.hmodified+1−62View file
arch/sparc/include/asm/sysen.hdeleted+0−15View before deletion
arch/sparc/include/asm/thread_info_32.hmodified+2−6View file
arch/sparc/include/asm/timer_32.hmodified+28−5View file
arch/sparc/include/asm/timex_32.hmodified+0−1View file
arch/sparc/include/asm/tlbflush_32.hmodified+10−46View file
arch/sparc/include/asm/uaccess_32.hmodified+0−1View file
arch/sparc/include/asm/vac-ops.hdeleted+0−127View before deletion
arch/sparc/include/asm/vaddrs.hmodified+0−16View file
arch/sparc/include/asm/winmacro.hmodified+18−31View file
arch/sparc/kernel/Makefilemodified+1−2View file
arch/sparc/kernel/auxio_32.cmodified+3−10View file
arch/sparc/kernel/devices.cmodified+0−4View file
arch/sparc/kernel/ds.cmodified+1−1View file
arch/sparc/kernel/entry.Smodified+71−361View file
arch/sparc/kernel/etrap_32.Smodified+1−49View file
arch/sparc/kernel/head_32.Smodified+47−592View file
arch/sparc/kernel/head_64.Smodified+1−1View file
arch/sparc/kernel/idprom.cmodified+3−16View file
arch/sparc/kernel/ioport.cmodified+10−13View file
arch/sparc/kernel/irq.hmodified+28−32View file
arch/sparc/kernel/irq_32.cmodified+1−18View file
arch/sparc/kernel/irq_64.cmodified+1−1View file
arch/sparc/kernel/kernel.hmodified+0−10View file
arch/sparc/kernel/leon_kernel.cmodified+55−43View file
arch/sparc/kernel/leon_smp.cmodified+35−78View file
arch/sparc/kernel/module.cmodified+1−20View file
arch/sparc/kernel/muldiv.cdeleted+0−238View before deletion
arch/sparc/kernel/of_device_32.cmodified+2−2View file
arch/sparc/kernel/pcic.cmodified+29−26View file
arch/sparc/kernel/process_32.cmodified+0−116View file
arch/sparc/kernel/rtrap_32.Smodified+6−70View file
arch/sparc/kernel/rtrap_64.Smodified+1−11View file
arch/sparc/kernel/setup_32.cmodified+49−21View file
arch/sparc/kernel/signal_32.cmodified+2−5View file
arch/sparc/kernel/smp_32.cmodified+6−169View file
arch/sparc/kernel/sparc_ksyms_32.cmodified+0−14View file
arch/sparc/kernel/sun4c_irq.cdeleted+0−264View before deletion
arch/sparc/kernel/sun4d_irq.cmodified+20−28View file
arch/sparc/kernel/sun4d_smp.cmodified+52−67View file
arch/sparc/kernel/sun4m_irq.cmodified+20−38View file
arch/sparc/kernel/sun4m_smp.cmodified+42−75View file
arch/sparc/kernel/sys_sparc_32.cmodified+0−11View file
arch/sparc/kernel/time_32.cmodified+176−44View file
arch/sparc/kernel/trampoline_32.Smodified+2−20View file
arch/sparc/kernel/traps_32.cmodified+0−2View file
arch/sparc/kernel/ttable_32.Sadded+417−0View file
arch/sparc/kernel/ttable.S → arch/sparc/kernel/ttable_64.Srenamed+0−0View file
arch/sparc/kernel/unaligned_64.cmodified+0−1View file
arch/sparc/kernel/wof.Smodified+2−70View file
arch/sparc/kernel/wuf.Smodified+3−57View file
arch/sparc/lib/Makefilemodified+3−3View file
arch/sparc/lib/ashldi3.Smodified+4−3View file
arch/sparc/lib/ashrdi3.Smodified+4−3View file
arch/sparc/lib/atomic_32.Sdeleted+0−44View before deletion
arch/sparc/lib/atomic_64.Smodified+17−32View file
arch/sparc/lib/bitops.Smodified+13−24View file
arch/sparc/lib/blockops.Smodified+5−5View file
arch/sparc/lib/bzero.Smodified+8−12View file
arch/sparc/lib/divdi3.Smodified+2−2View file
arch/sparc/lib/ipcsum.Smodified+4−5View file
arch/sparc/lib/ksyms.cmodified+0−22View file
arch/sparc/lib/lshrdi3.Smodified+3−2View file
arch/sparc/lib/memmove.Smodified+4−5View file
arch/sparc/lib/mul.Sdeleted+0−137View before deletion
arch/sparc/lib/muldi3.Smodified+2−2View file
arch/sparc/lib/rem.Sdeleted+0−384View before deletion
arch/sparc/lib/sdiv.Sdeleted+0−381View before deletion
arch/sparc/lib/strlen_user_64.Smodified+5−3View file
arch/sparc/lib/strncmp_32.Smodified+4−4View file
arch/sparc/lib/strncmp_64.Smodified+3−5View file
arch/sparc/lib/strncpy_from_user_32.Smodified+3−3View file
arch/sparc/lib/strncpy_from_user_64.Smodified+3−5View file
arch/sparc/lib/ucmpdi2.cadded+19−0View file
arch/sparc/lib/udiv.Sdeleted+0−357View before deletion
arch/sparc/lib/udivdi3.Smodified+2−1View file
arch/sparc/lib/umul.Sdeleted+0−171View before deletion
arch/sparc/lib/urem.Sdeleted+0−357View before deletion
arch/sparc/lib/xor.Smodified+17−33View file
arch/sparc/mm/Makefilemodified+1−8View file
arch/sparc/mm/btfixup.cdeleted+0−328View before deletion
arch/sparc/mm/fault_32.cmodified+45−162View file
arch/sparc/mm/init_32.cmodified+0−51View file
arch/sparc/mm/init_64.cmodified+21−100View file
arch/sparc/mm/io-unit.cmodified+12−23View file
arch/sparc/mm/iommu.cmodified+23−48View file
arch/sparc/mm/leon_mm.cmodified+93−2View file
arch/sparc/mm/loadmmu.cdeleted+0−43View before deletion
arch/sparc/mm/nosun4c.cdeleted+0−77View before deletion
arch/sparc/mm/srmmu.cmodified+324−908View file
arch/sparc/mm/srmmu.hadded+4−0View file
arch/sparc/mm/sun4c.cdeleted+0−2166View before deletion
arch/sparc/mm/viking.Smodified+0−1View file
arch/sparc/prom/Makefilemodified+0−1View file
arch/sparc/prom/segment.cdeleted+0−28View before deletion

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/sparc/README-2.5

View before deletion
diff --git a/Documentation/sparc/README-2.5 b/Documentation/sparc/README-2.5
deleted file mode 100644
index 806fe49..0000000
--- a/Documentation/sparc/README-2.5
+++ /dev/null
@@ -1,46 +0,0 @@
-BTFIXUP
--------
-
-To build new kernels you have to issue "make image". The ready kernel
-in ELF format is placed in arch/sparc/boot/image. Explanation is below.
-
-BTFIXUP is a unique feature of Linux/sparc among other architectures,
-developed by Jakub Jelinek (I think... Obviously David S. Miller took
-part, too). It allows to boot the same kernel at different
-sub-architectures, such as sun4c, sun4m, sun4d, where SunOS uses
-different kernels. This feature is convinient for people who you move
-disks between boxes and for distrution builders.
-
-To function, BTFIXUP must link the kernel "in the draft" first,
-analyze the result, write a special stub code based on that, and
-build the final kernel with the stub (btfix.o).
-
-Kai Germaschewski improved the build system of the kernel in the 2.5 series
-significantly. Unfortunately, the traditional way of running the draft
-linking from architecture specific Makefile before the actual linking
-by generic Makefile is nearly impossible to support properly in the
-new build system. Therefore, the way we integrate BTFIXUP with the
-build system was changed in 2.5.40. Now, generic Makefile performs
-the draft linking and stores the result in file vmlinux. Architecture
-specific post-processing invokes BTFIXUP machinery and final linking
-in the same way as other architectures do bootstraps.
-
-Implications of that change are as follows.
-
-1. Hackers must type "make image" now, instead of just "make", in the same
- way as s390 people do now. It is analogous to "make bzImage" on i386.
- This does NOT affect sparc64, you continue to use "make" to build sparc64
- kernels.
-
-2. vmlinux is not the final kernel, so RPM builders have to adjust
- their spec files (if they delivered vmlinux for debugging).
- System.map generated for vmlinux is still valid.
-
-3. Scripts that produce a.out images have to be changed. First, if they
- invoke make, they have to use "make image". Second, they have to pick up
- the new kernel in arch/sparc/boot/image instead of vmlinux.
-
-4. Since we are compliant with Kai's build system now, make -j is permitted.
-
--- Pete Zaitcev

arch/sparc/Kbuild

View file
diff --git a/arch/sparc/Kbuild b/arch/sparc/Kbuild
new file mode 100644
index 0000000..5cd0116
--- /dev/null
+++ b/arch/sparc/Kbuild
@@ -0,0 +1,8 @@
+#
+# core part of the sparc kernel
+#
+
+obj-y += kernel/
+obj-y += mm/
+obj-y += math-emu/
+obj-y += net/

arch/sparc/Kconfig

View file
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 5f6acce..6c49ed2 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -30,7 +30,7 @@ config SPARC
select USE_GENERIC_SMP_HELPERS if SMP
select GENERIC_PCI_IOMAP
select HAVE_NMI_WATCHDOG if SPARC64
- select HAVE_BPF_JIT
+ select HAVE_BPF_JIT if NET
config SPARC32
def_bool !64BIT
@@ -62,6 +62,7 @@ config SPARC64
select IRQ_PREFLOW_FASTEOI
select ARCH_HAVE_NMI_SAFE_CMPXCHG
select HAVE_C_RECORDMCOUNT
+ select NO_BOOTMEM
config ARCH_DEFCONFIG
string
@@ -74,17 +75,12 @@ config BITS
default 32 if SPARC32
default 64 if SPARC64
-config ARCH_USES_GETTIMEOFFSET
- bool
- default y if SPARC32
-
config GENERIC_CMOS_UPDATE
bool
default y
config GENERIC_CLOCKEVENTS
- bool
- default y if SPARC64
+ def_bool y
config IOMMU_HELPER
bool
@@ -155,7 +151,7 @@ source "kernel/Kconfig.freezer"
menu "Processor type and features"
config SMP
- bool "Symmetric multi-processing support (does not work on sun4/sun4c)"
+ bool "Symmetric multi-processing support"
---help---
This enables support for systems with more than one CPU. If you have
a system with only one CPU, say N. If you have a system with more

arch/sparc/Makefile

View file
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index 0e5de13..b9a72e2 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -19,39 +19,27 @@ ifeq ($(CONFIG_SPARC32),y)
# sparc32
#
-#
-# Uncomment the first KBUILD_CFLAGS if you are doing kgdb source level
-# debugging of the kernel to get the proper debugging information.
-
-AS := $(AS) -32
-LDFLAGS := -m elf32_sparc
CHECKFLAGS += -D__sparc__
+LDFLAGS := -m elf32_sparc
export BITS := 32
UTS_MACHINE := sparc
-#KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7
-KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
-KBUILD_AFLAGS += -m32 -Wa,-Av8
-
-#LDFLAGS_vmlinux = -N -Ttext 0xf0004000
-# Since 2.5.40, the first stage is left not btfix-ed.
-# Actual linking is done with "make image".
-LDFLAGS_vmlinux = -r
+KBUILD_CFLAGS += -m32 -mcpu=v8 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
+KBUILD_AFLAGS += -m32 -Wa,-Av8
else
#####
# sparc64
#
-CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64
+CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64
+LDFLAGS := -m elf64_sparc
+export BITS := 64
+UTS_MACHINE := sparc64
-LDFLAGS := -m elf64_sparc
-export BITS := 64
-UTS_MACHINE := sparc64
-
-KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
- -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
- -Wa,--undeclared-regs
+KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow
+KBUILD_CFLAGS += -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare
+KBUILD_CFLAGS += -Wa,--undeclared-regs
KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3)
KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs
@@ -64,26 +52,14 @@ endif
head-y := arch/sparc/kernel/head_$(BITS).o
head-y += arch/sparc/kernel/init_task.o
-core-y += arch/sparc/kernel/
-core-y += arch/sparc/mm/ arch/sparc/math-emu/
-core-y += arch/sparc/net/
+# See arch/sparc/Kbuild for the core part of the kernel
+core-y += arch/sparc/
libs-y += arch/sparc/prom/
libs-y += arch/sparc/lib/
drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/
-# Export what is needed by arch/sparc/boot/Makefile
-export VMLINUX_INIT VMLINUX_MAIN
-VMLINUX_INIT := $(head-y) $(init-y)
-VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/
-VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y)
-VMLINUX_MAIN += $(drivers-y) $(net-y)
-
-ifdef CONFIG_KALLSYMS
-export kallsyms.o := .tmp_kallsyms2.o
-endif
-
boot := arch/sparc/boot
# Default target

arch/sparc/boot/Makefile

View file
diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile
index d56d199..6e63afb 100644
--- a/arch/sparc/boot/Makefile
+++ b/arch/sparc/boot/Makefile
@@ -6,8 +6,8 @@
ROOT_IMG := /usr/src/root.img
ELFTOAOUT := elftoaout
-hostprogs-y := piggyback btfixupprep
-targets := tftpboot.img btfix.o btfix.S image zImage vmlinux.aout
+hostprogs-y := piggyback
+targets := tftpboot.img image zImage vmlinux.aout
clean-files := System.map
quiet_cmd_elftoaout = ELFTOAOUT $@
@@ -17,58 +17,9 @@ quiet_cmd_piggy = PIGGY $@
quiet_cmd_strip = STRIP $@
cmd_strip = $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start $< -o $@
-ifeq ($(CONFIG_SPARC32),y)
-quiet_cmd_btfix = BTFIX $@
- cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@
-quiet_cmd_sysmap = SYSMAP $(obj)/System.map
- cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap
-quiet_cmd_image = LD $@
- cmd_image = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) -o $@
-
-define rule_image
- $(if $($(quiet)cmd_image), \
- echo ' $($(quiet)cmd_image)' &&) \
- $(cmd_image); \
- $(if $($(quiet)cmd_sysmap), \
- echo ' $($(quiet)cmd_sysmap)' &&) \
- $(cmd_sysmap) $@ $(obj)/System.map; \
- if [ $$? -ne 0 ]; then \
- rm -f $@; \
- /bin/false; \
- fi; \
- echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd
-endef
-
-BTOBJS := $(patsubst %/, %/built-in.o, $(VMLINUX_INIT))
-BTLIBS := $(patsubst %/, %/built-in.o, $(VMLINUX_MAIN))
-LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \
- --start-group $(BTLIBS) --end-group \
- $(kallsyms.o) $(obj)/btfix.o
-
-# Link the final image including btfixup'ed symbols.
-# This is a replacement for the link done in the top-level Makefile.
-# Note: No dependency on the prerequisite files since that would require
-# make to try check if they are updated - and due to changes
-# in gcc options (path for example) this would result in
-# these files being recompiled for each build.
-$(obj)/image: $(obj)/btfix.o FORCE
- $(call if_changed_rule,image)
-
-$(obj)/zImage: $(obj)/image
- $(call if_changed,strip)
- @echo ' kernel: $@ is ready'
-
-$(obj)/btfix.S: $(obj)/btfixupprep vmlinux FORCE
- $(call if_changed,btfix)
-
-endif
-
ifeq ($(CONFIG_SPARC64),y)
# Actual linking
-$(obj)/image: vmlinux FORCE
- $(call if_changed,strip)
- @echo ' kernel: $@ is ready'
$(obj)/zImage: $(obj)/image
$(call if_changed,gzip)
@@ -79,6 +30,10 @@ $(obj)/vmlinux.aout: vmlinux FORCE
@echo ' kernel: $@ is ready'
else
+$(obj)/zImage: $(obj)/image
+ $(call if_changed,strip)
+ @echo ' kernel: $@ is ready'
+
# The following lines make a readable image for U-Boot.
# uImage - Binary file read by U-boot
# uImage.o - object file of uImage for loading with a
@@ -107,6 +62,10 @@ $(obj)/uImage: $(obj)/image.gz
endif
+$(obj)/image: vmlinux FORCE
+ $(call if_changed,strip)
+ @echo ' kernel: $@ is ready'
+
$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback System.map $(ROOT_IMG) FORCE
$(call if_changed,elftoaout)
$(call if_changed,piggy)

arch/sparc/boot/btfixupprep.c

View before deletion
diff --git a/arch/sparc/boot/btfixupprep.c b/arch/sparc/boot/btfixupprep.c
deleted file mode 100644
index da03115..0000000
--- a/arch/sparc/boot/btfixupprep.c
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- Simple utility to prepare vmlinux image for sparc.
- Resolves all BTFIXUP uses and settings and creates
- a special .s object to link to the image.
-
- Copyright (C) 1998 Jakub Jelinek ([email protected])
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <malloc.h>
-
-#define MAXSYMS 1024
-
-static char *symtab = "SYMBOL TABLE:";
-static char *relrec = "RELOCATION RECORDS FOR [";
-static int rellen;
-static int symlen;
-int mode;
-
-struct _btfixup;
-
-typedef struct _btfixuprel {
- char *sect;
- unsigned long offset;
- struct _btfixup *f;
- int frel;
- struct _btfixuprel *next;
-} btfixuprel;
-
-typedef struct _btfixup {
- int type;
- int setinitval;
- unsigned int initval;
- char *initvalstr;
- char *name;
- btfixuprel *rel;
-} btfixup;
-
-btfixup array[MAXSYMS];
-int last = 0;
-char buffer[1024];
-unsigned long lastfoffset = -1;
-unsigned long lastfrelno;
-btfixup *lastf;
-
-static void fatal(void) __attribute__((noreturn));
-static void fatal(void)
-{
- fprintf(stderr, "Malformed output from objdump\n%s\n", buffer);
- exit(1);
-}
-
-static btfixup *find(int type, char *name)
-{
- int i;
- for (i = 0; i < last; i++) {
- if (array[i].type == type && !strcmp(array[i].name, name))
- return array + i;
- }
- array[last].type = type;
- array[last].name = strdup(name);
- array[last].setinitval = 0;
- if (!array[last].name) fatal();
- array[last].rel = NULL;
- last++;
- if (last >= MAXSYMS) {
- fprintf(stderr, "Ugh. Something strange. More than %d different BTFIXUP symbols\n", MAXSYMS);
- exit(1);
- }
- return array + last - 1;
-}
-
-static void set_mode (char *buffer)
-{
- for (mode = 0;; mode++)
- if (buffer[mode] < '0' || buffer[mode] > '9')
- break;
- if (mode != 8 && mode != 16)
- fatal();
-}
-
-
-int main(int argc,char **argv)
-{
- char *p, *q;
- char *sect;
- int i, j, k;
- unsigned int initval;
- int shift;
- btfixup *f;
- btfixuprel *r, **rr;
- unsigned long offset;
- char *initvalstr;
-
- symlen = strlen(symtab);
- while (fgets (buffer, 1024, stdin) != NULL)
- if (!strncmp (buffer, symtab, symlen))
- goto main0;
- fatal();
-main0:
- rellen = strlen(relrec);
- while (fgets (buffer, 1024, stdin) != NULL)
- if (!strncmp (buffer, relrec, rellen))
- goto main1;
- fatal();
-main1:
- sect = malloc(strlen (buffer + rellen) + 1);
- if (!sect) fatal();
- strcpy (sect, buffer + rellen);
- p = strchr (sect, ']');
- if (!p) fatal();
- *p = 0;
- if (fgets (buffer, 1024, stdin) == NULL)
- fatal();
- while (fgets (buffer, 1024, stdin) != NULL) {
- int nbase;
- if (!strncmp (buffer, relrec, rellen))
- goto main1;
- if (mode == 0)
- set_mode (buffer);
- p = strchr (buffer, '\n');
- if (p) *p = 0;
- if (strlen (buffer) < 22+mode)
- continue;
- if (strncmp (buffer + mode, " R_SPARC_", 9))
- continue;
- nbase = 27 - 8 + mode;
- if (buffer[nbase] != '_' || buffer[nbase+1] != '_' || buffer[nbase+2] != '_')
- continue;
- switch (buffer[nbase+3]) {
- case 'f': /* CALL */
- case 'b': /* BLACKBOX */
- case 's': /* SIMM13 */
- case 'a': /* HALF */
- case 'h': /* SETHI */
- case 'i': /* INT */
- break;
- default:
- continue;
- }
- p = strchr (buffer + nbase+5, '+');
- if (p) *p = 0;
- shift = nbase + 5;
- if (buffer[nbase+4] == 's' && buffer[nbase+5] == '_') {
- shift = nbase + 6;
- if (strcmp (sect, ".init.text")) {
- fprintf(stderr,
- "Wrong use of '%s' BTFIXUPSET in '%s' section.\n"
- "BTFIXUPSET_CALL can be used only in"
- " __init sections\n",
- buffer + shift, sect);
- exit(1);
- }
- } else if (buffer[nbase+4] != '_')
- continue;
- if (!strcmp (sect, ".text.exit"))
- continue;
- if (strcmp (sect, ".text") &&
- strcmp (sect, ".init.text") &&
- strcmp (sect, ".fixup") &&
- (strcmp (sect, "__ksymtab") || buffer[nbase+3] != 'f')) {
- if (buffer[nbase+3] == 'f')
- fprintf(stderr,
- "Wrong use of '%s' in '%s' section.\n"
- " It can be used only in .text, .init.text,"
- " .fixup and __ksymtab\n",
- buffer + shift, sect);
- else
- fprintf(stderr,
- "Wrong use of '%s' in '%s' section.\n"
- " It can be only used in .text, .init.text,"
- " and .fixup\n", buffer + shift, sect);
- exit(1);
- }
- p = strstr (buffer + shift, "__btset_");
- if (p && buffer[nbase+4] == 's') {
- fprintf(stderr, "__btset_ in BTFIXUP name can only be used when defining the variable, not for setting\n%s\n", buffer);
- exit(1);
- }
- initval = 0;
- initvalstr = NULL;
- if (p) {
- if (p[8] != '0' || p[9] != 'x') {
- fprintf(stderr, "Pre-initialized values can be only initialized with hexadecimal constants starting 0x\n%s\n", buffer);
- exit(1);
- }
- initval = strtoul(p + 10, &q, 16);
- if (*q || !initval) {
- fprintf(stderr, "Pre-initialized values can be only in the form name__btset_0xXXXXXXXX where X are hex digits.\nThey cannot be name__btset_0x00000000 though. Use BTFIXUPDEF_XX instead of BTFIXUPDEF_XX_INIT then.\n%s\n", buffer);
- exit(1);
- }
- initvalstr = p + 10;
- *p = 0;
- }
- f = find(buffer[nbase+3], buffer + shift);
- if (buffer[nbase+4] == 's')
- continue;
- switch (buffer[nbase+3]) {
- case 'f':
- if (initval) {
- fprintf(stderr, "Cannot use pre-initialized fixups for calls\n%s\n", buffer);
- exit(1);
- }
- if (!strcmp (sect, "__ksymtab")) {
- if (strncmp (buffer + mode+9, "32 ", 10)) {
- fprintf(stderr, "BTFIXUP_CALL in EXPORT_SYMBOL results in relocation other than R_SPARC_32\n\%s\n", buffer);
- exit(1);
- }
- } else if (strncmp (buffer + mode+9, "WDISP30 ", 10) &&
- strncmp (buffer + mode+9, "HI22 ", 10) &&
- strncmp (buffer + mode+9, "LO10 ", 10)) {
- fprintf(stderr, "BTFIXUP_CALL results in relocation other than R_SPARC_WDISP30, R_SPARC_HI22 or R_SPARC_LO10\n%s\n", buffer);
- exit(1);
- }
- break;
- case 'b':
- if (initval) {
- fprintf(stderr, "Cannot use pre-initialized fixups for blackboxes\n%s\n", buffer);
- exit(1);
- }
- if (strncmp (buffer + mode+9, "HI22 ", 10)) {
- fprintf(stderr, "BTFIXUP_BLACKBOX results in relocation other than R_SPARC_HI22\n%s\n", buffer);
- exit(1);
- }
- break;
- case 's':
- if (initval + 0x1000 >= 0x2000) {
- fprintf(stderr, "Wrong initializer for SIMM13. Has to be from $fffff000 to $00000fff\n%s\n", buffer);
- exit(1);
- }
- if (strncmp (buffer + mode+9, "13 ", 10)) {
- fprintf(stderr, "BTFIXUP_SIMM13 results in relocation other than R_SPARC_13\n%s\n", buffer);
- exit(1);
- }
- break;
- case 'a':
- if (initval + 0x1000 >= 0x2000 && (initval & 0x3ff)) {
- fprintf(stderr, "Wrong initializer for HALF.\n%s\n", buffer);
- exit(1);
- }
- if (strncmp (buffer + mode+9, "13 ", 10)) {
- fprintf(stderr, "BTFIXUP_HALF results in relocation other than R_SPARC_13\n%s\n", buffer);
- exit(1);
- }
- break;
- case 'h':
- if (initval & 0x3ff) {
- fprintf(stderr, "Wrong initializer for SETHI. Cannot have set low 10 bits\n%s\n", buffer);
- exit(1);
- }
- if (strncmp (buffer + mode+9, "HI22 ", 10)) {
- fprintf(stderr, "BTFIXUP_SETHI results in relocation other than R_SPARC_HI22\n%s\n", buffer);
- exit(1);
- }
- break;
- case 'i':
- if (initval) {
- fprintf(stderr, "Cannot use pre-initialized fixups for INT\n%s\n", buffer);
- exit(1);
- }
- if (strncmp (buffer + mode+9, "HI22 ", 10) && strncmp (buffer + mode+9, "LO10 ", 10)) {
- fprintf(stderr, "BTFIXUP_INT results in relocation other than R_SPARC_HI22 and R_SPARC_LO10\n%s\n", buffer);
- exit(1);
- }
- break;
- }
- if (!f->setinitval) {
- f->initval = initval;
- if (initvalstr) {
- f->initvalstr = strdup(initvalstr);
- if (!f->initvalstr) fatal();
- }
- f->setinitval = 1;
- } else if (f->initval != initval) {
- fprintf(stderr, "Btfixup %s previously used with initializer %s which doesn't match with current initializer\n%s\n",
- f->name, f->initvalstr ? : "0x00000000", buffer);
- exit(1);
- } else if (initval && strcmp(f->initvalstr, initvalstr)) {
- fprintf(stderr, "Btfixup %s previously used with initializer %s which doesn't match with current initializer.\n"
- "Initializers have to match literally as well.\n%s\n",
- f->name, f->initvalstr, buffer);
- exit(1);

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/asi.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/asmmacro.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/btfixup.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/cache.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/cacheflush.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/cacheflush_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/cacheflush_64.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/cachetlb_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/cmpxchg_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/contregs.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/cpu_type.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/cpudata_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/cypress.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/dma.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/elf_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/floppy_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/floppy_64.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/head_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/leon.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/machines.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/mbus.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/memreg.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/mmu_context_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/obio.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/oplib_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/page_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/pgalloc_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/pgtable_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/pgtable_64.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/pgtsrmmu.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/pgtsun4c.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/processor_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/setup.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/shmparam_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/smp_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/smpprim.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/string_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/sysen.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/thread_info_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/timer_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/timex_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/tlbflush_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/uaccess_32.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/vac-ops.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/vaddrs.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/winmacro.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/auxio_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/devices.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/ds.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/entry.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/etrap_32.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/head_32.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/head_64.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/idprom.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/ioport.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/irq.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/irq_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/irq_64.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/kernel.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/leon_kernel.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/leon_smp.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/module.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/muldiv.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/of_device_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/pcic.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/process_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/rtrap_32.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/rtrap_64.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/setup_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/signal_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/smp_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/sparc_ksyms_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/sun4c_irq.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/sun4d_irq.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/sun4d_smp.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/sun4m_irq.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/sun4m_smp.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/sys_sparc_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/time_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/trampoline_32.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/traps_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/ttable_32.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/ttable_64.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/unaligned_64.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/wof.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/kernel/wuf.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/ashldi3.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/ashrdi3.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/atomic_32.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/lib/atomic_64.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/bitops.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/blockops.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/bzero.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/divdi3.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/ipcsum.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/ksyms.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/lshrdi3.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/memmove.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/mul.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/lib/muldi3.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/rem.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/lib/sdiv.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/lib/strlen_user_64.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/strncmp_32.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/strncmp_64.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/strncpy_from_user_32.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/strncpy_from_user_64.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/ucmpdi2.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/udiv.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/lib/udivdi3.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/lib/umul.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/lib/urem.S

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/lib/xor.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/mm/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/sparc/mm/btfixup.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/mm/fault_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/mm/init_32.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/mm/init_64.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/mm/io-unit.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/mm/iommu.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/mm/leon_mm.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/mm/loadmmu.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/mm/nosun4c.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/mm/srmmu.c

View file

This diff is incomplete. Download the complete patch.

arch/sparc/mm/srmmu.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/mm/sun4c.c

View before deletion

This diff is incomplete. Download the complete patch.

arch/sparc/mm/viking.S

View file

This diff is incomplete. Download the complete patch.

arch/sparc/prom/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/sparc/prom/segment.c

View before deletion

This diff is incomplete. Download the complete patch.