2006-06-20 02:33:20 +08:00
|
|
|
|
2005-11-16 04:53:48 +08:00
|
|
|
obj-$(CONFIG_SPU_FS) += spufs.o
|
[POWERPC] coredump: Add SPU elf notes to coredump.
This patch adds SPU elf notes to the coredump. It creates a separate note
for each of /regs, /fpcr, /lslr, /decr, /decr_status, /mem, /signal1,
/signal1_type, /signal2, /signal2_type, /event_mask, /event_status,
/mbox_info, /ibox_info, /wbox_info, /dma_info, /proxydma_info, /object-id.
A new macro, ARCH_HAVE_EXTRA_NOTES, was created for architectures to
specify they have extra elf core notes.
A new macro, ELF_CORE_EXTRA_NOTES_SIZE, was created so the size of the
additional notes could be calculated and added to the notes phdr entry.
A new macro, ELF_CORE_WRITE_EXTRA_NOTES, was created so the new notes
would be written after the existing notes.
The SPU coredump code resides in spufs. Stub functions are provided in the
kernel which are hooked into the spufs code which does the actual work via
register_arch_coredump_calls().
A new set of __spufs_<file>_read/get() functions was provided to allow the
coredump code to read from the spufs files without having to lock the
SPU context for each file read from.
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Dwayne Grant McConnell <decimal@us.ibm.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
2006-11-23 07:46:37 +08:00
|
|
|
spufs-y += inode.o file.o context.o syscalls.o coredump.o
|
2006-10-04 23:26:15 +08:00
|
|
|
spufs-y += sched.o backing_ops.o hw_ops.o run.o gang.o
|
2007-12-20 15:39:59 +08:00
|
|
|
spufs-y += switch.o fault.o lscsa_alloc.o
|
2005-11-16 04:53:49 +08:00
|
|
|
|
2009-06-12 12:31:52 +08:00
|
|
|
# magic for the trace events
|
|
|
|
CFLAGS_sched.o := -I$(src)
|
2008-01-11 12:03:26 +08:00
|
|
|
|
2005-11-16 04:53:51 +08:00
|
|
|
# Rules to build switch.o with the help of SPU tool chain
|
|
|
|
SPU_CROSS := spu-
|
|
|
|
SPU_CC := $(SPU_CROSS)gcc
|
|
|
|
SPU_AS := $(SPU_CROSS)gcc
|
|
|
|
SPU_LD := $(SPU_CROSS)ld
|
|
|
|
SPU_OBJCOPY := $(SPU_CROSS)objcopy
|
2009-10-18 04:33:27 +08:00
|
|
|
SPU_CFLAGS := -O2 -Wall -I$(srctree)/include -D__KERNEL__
|
|
|
|
SPU_AFLAGS := -c -D__ASSEMBLY__ -I$(srctree)/include -D__KERNEL__
|
2005-11-16 04:53:51 +08:00
|
|
|
SPU_LDFLAGS := -N -Ttext=0x0
|
|
|
|
|
2005-11-16 04:53:49 +08:00
|
|
|
$(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h
|
2006-06-20 02:33:32 +08:00
|
|
|
clean-files := spu_save_dump.h spu_restore_dump.h
|
2005-11-16 04:53:51 +08:00
|
|
|
|
|
|
|
# Compile SPU files
|
|
|
|
cmd_spu_cc = $(SPU_CC) $(SPU_CFLAGS) -c -o $@ $<
|
|
|
|
quiet_cmd_spu_cc = SPU_CC $@
|
|
|
|
$(obj)/spu_%.o: $(src)/spu_%.c
|
|
|
|
$(call if_changed,spu_cc)
|
|
|
|
|
|
|
|
# Assemble SPU files
|
|
|
|
cmd_spu_as = $(SPU_AS) $(SPU_AFLAGS) -o $@ $<
|
|
|
|
quiet_cmd_spu_as = SPU_AS $@
|
|
|
|
$(obj)/spu_%.o: $(src)/spu_%.S
|
|
|
|
$(call if_changed,spu_as)
|
|
|
|
|
|
|
|
# Link SPU Executables
|
|
|
|
cmd_spu_ld = $(SPU_LD) $(SPU_LDFLAGS) -o $@ $^
|
|
|
|
quiet_cmd_spu_ld = SPU_LD $@
|
|
|
|
$(obj)/spu_%: $(obj)/spu_%_crt0.o $(obj)/spu_%.o
|
|
|
|
$(call if_changed,spu_ld)
|
|
|
|
|
|
|
|
# Copy into binary format
|
|
|
|
cmd_spu_objcopy = $(SPU_OBJCOPY) -O binary $< $@
|
|
|
|
quiet_cmd_spu_objcopy = OBJCOPY $@
|
|
|
|
$(obj)/spu_%.bin: $(src)/spu_%
|
|
|
|
$(call if_changed,spu_objcopy)
|
|
|
|
|
|
|
|
# create C code from ELF executable
|
|
|
|
cmd_hexdump = ( \
|
|
|
|
echo "/*" ; \
|
|
|
|
echo " * $*_dump.h: Copyright (C) 2005 IBM." ; \
|
|
|
|
echo " * Hex-dump auto generated from $*.c." ; \
|
|
|
|
echo " * Do not edit!" ; \
|
|
|
|
echo " */" ; \
|
2006-06-20 02:33:35 +08:00
|
|
|
echo "static unsigned int $*_code[] " \
|
|
|
|
"__attribute__((__aligned__(128))) = {" ; \
|
2005-12-10 02:04:17 +08:00
|
|
|
hexdump -v -e '"0x" 4/1 "%02x" "," "\n"' $< ; \
|
2005-11-16 04:53:51 +08:00
|
|
|
echo "};" ; \
|
|
|
|
) > $@
|
|
|
|
quiet_cmd_hexdump = HEXDUMP $@
|
|
|
|
$(obj)/%_dump.h: $(obj)/%.bin
|
|
|
|
$(call if_changed,hexdump)
|