[patch 04/11] spufs: add spu-side context switch code

Milton Miller miltonm at bga.com
Fri Sep 23 04:44:01 EST 2005


On Sep 16, 2005, at 5:01 PM, Arnd Bergmann wrote:

> Add the source code that is used to generate spu_save_dump.h and
> spu_restore_dump.h. Since a full spu tool chain is needed to
> generate these files, the default remains to use the shipped
> versions in order to keep the number of tools for building the
> kernel down.
>
> From: Mark Nutter: <mnutter at us.ibm.com>
> Signed-off-by: Arnd Bergmann <arndb at de.ibm.com>
>
> --
>
>  Makefile           |   49 ++++
>  spu_restore.c      |  336 +++++++++++++++++++++++++++++++++
>  spu_restore_crt0.S |  116 +++++++++++
>  spu_save.c         |  195 +++++++++++++++++++
>  spu_save_crt0.S    |  102 ++++++++++
>  spu_utils.h        |  160 +++++++++++++++
>  6 files changed, 958 insertions(+)
>
> Index: linux-cg/fs/spufs/Makefile
> ===================================================================
> --- linux-cg.orig/fs/spufs/Makefile
> +++ linux-cg/fs/spufs/Makefile

...

> +
> +# 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 " */" ; \
> +		echo "static unsigned int $*_code[] __page_aligned = {" ; \
> +		hexdump -v -e '4/4 "0x%08x, " "\n"' $< ; \
> +		echo "};" ; \
> +		) > $@
> +quiet_cmd_hexdump = HEXDUMP $@
> +$(obj)/%_dump.h: $(obj)/%.bin
> +	$(call if_changed,hexdump)
>

How about doing an .incbin of the generated binary?

I guess the problem wouuld be shipping binary vs text file for the
no tools case?   One way to handle this is would be to ship headers
built this way, but include them based on the KCONFIG that says build
the code locally.

Oh, and i guess static wouuld have to go for .incbin seperately
linked.

milton




More information about the Linuxppc64-dev mailing list