Thank you.
---
Hidetaka Takano / Toshiba
========================================================
newlib/ChangeLog:
2007-08-xx Hidetaka Takano <hidetaka.takano@glb.toshiba.co.jp>
Reduce the memory consumption of variable argument functions
for SPU (cell):
* libc/machine/spu/Makefile.am: Replace printf/scanf family C sources
to assembler sources.
* libc/machine/spu/Makefile.in: Regenerated.
* libc/machine/spu/stdio.c: Add __check_init function wrapping
CHECK_INIT macro to use from assembler routines.
* libc/machine/spu/c99ppe.h: Add definitions for assembler code.
* libc/machine/spu/fiprintf.S: New file.
* libc/machine/spu/fiscanf.S: Ditto.
* libc/machine/spu/fprintf.S: Ditto.
* libc/machine/spu/fscanf.S: Ditto.
* libc/machine/spu/iprintf.S: Ditto.
* libc/machine/spu/iscanf.S: Ditto.
* libc/machine/spu/printf.S: Ditto.
* libc/machine/spu/scanf.S: Ditto.
* libc/machine/spu/siprintf.S: Ditto.
* libc/machine/spu/siscanf.S: Ditto.
* libc/machine/spu/sniprintf.S: Ditto.
* libc/machine/spu/snprintf.S: Ditto.
* libc/machine/spu/sprintf.S: Ditto.
* libc/machine/spu/sscanf.S: Ditto.
* libc/machine/spu/stack_reg_va.S: Ditto.
* libc/machine/spu/fiprintf.c: Removed. (Replaced by .S)
* libc/machine/spu/fiscanf.c: Ditto.
* libc/machine/spu/fprintf.c: Ditto.
* libc/machine/spu/fscanf.c: Ditto.
* libc/machine/spu/iprintf.c: Ditto.
* libc/machine/spu/iscanf.c: Ditto.
* libc/machine/spu/printf.c: Ditto.
* libc/machine/spu/scanf.c: Ditto.
* libc/machine/spu/siprintf.c: Ditto.
* libc/machine/spu/siscanf.c: Ditto.
* libc/machine/spu/sniprintf.c: Ditto.
* libc/machine/spu/snprintf.c: Ditto.
* libc/machine/spu/sprintf.c: Ditto.
* libc/machine/spu/sscanf.c: Ditto.
========================================================
Index: newlib/libc/machine/spu/Makefile.in
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/Makefile.in,v
retrieving revision 1.12
diff -u -r1.12 Makefile.in
--- newlib/libc/machine/spu/Makefile.in 15 Jun 2007 16:00:46 -0000 1.12
+++ newlib/libc/machine/spu/Makefile.in 15 Aug 2007 10:42:22 -0000
@@ -73,13 +73,6 @@
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
- $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
- $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
- $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
- $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
- $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
- $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
- $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -135,7 +128,8 @@
lib_a-vprintf.$(OBJEXT) lib_a-vscanf.$(OBJEXT) \
lib_a-vsiprintf.$(OBJEXT) lib_a-vsiscanf.$(OBJEXT) \
lib_a-vsniprintf.$(OBJEXT) lib_a-vsnprintf.$(OBJEXT) \
- lib_a-vsprintf.$(OBJEXT) lib_a-vsscanf.$(OBJEXT)
+ lib_a-vsprintf.$(OBJEXT) lib_a-vsscanf.$(OBJEXT) \
+ lib_a-stack_reg_va.$(OBJEXT)
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir)
depcomp =
@@ -261,18 +255,18 @@
noinst_LIBRARIES = lib.a
AM_CCASFLAGS = $(INCLUDES)
lib_a_SOURCES = setjmp.S clearerr.c creat.c fclose.c feof.c ferror.c fflush.c \
- fgetc.c fgetpos.c fgets.c fileno.c fiprintf.c fiscanf.c fopen.c \
- fprintf.c fputc.c fputs.c fread.c freopen.c fscanf.c fseek.c \
- fsetpos.c ftell.c fwrite.c getc.c getchar.c gets.c iprintf.c \
- iscanf.c memcpy.c memmove.c memset.c perror.c printf.c \
- putc.c putchar.c puts.c remove.c rename.c rewind.c scanf.c \
- setbuf.c setvbuf.c siprintf.c siscanf.c sleep.c sniprintf.c \
- snprintf.c sprintf.c sscanf.c stdio.c strcat.c strchr.c strcmp.c \
+ fgetc.c fgetpos.c fgets.c fileno.c fiprintf.S fiscanf.S fopen.c \
+ fprintf.S fputc.c fputs.c fread.c freopen.c fscanf.S fseek.c \
+ fsetpos.c ftell.c fwrite.c getc.c getchar.c gets.c iprintf.S \
+ iscanf.S memcpy.c memmove.c memset.c perror.c printf.S \
+ putc.c putchar.c puts.c remove.c rename.c rewind.c scanf.S \
+ setbuf.c setvbuf.c siprintf.S siscanf.S sleep.c sniprintf.S \
+ snprintf.S sprintf.S sscanf.S stdio.c strcat.c strchr.c strcmp.c \
strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \
strrchr.c strspn.c strxfrm.c tmpfile.c tmpnam.c ungetc.c usleep.c \
vfiprintf.c vfiscanf.c vfprintf.c vfscanf.c viprintf.c viscanf.c \
vprintf.c vscanf.c vsiprintf.c vsiscanf.c vsniprintf.c vsnprintf.c \
- vsprintf.c vsscanf.c
+ vsprintf.c vsscanf.c stack_reg_va.S
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
lib_a_CFLAGS = $(AM_CFLAGS)
@@ -341,6 +335,96 @@
lib_a-setjmp.obj: setjmp.S
$(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else
$(CYGPATH_W) '$(srcdir)/setjmp.S'; fi`
+lib_a-fiprintf.o: fiprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-fiprintf.o `test -f 'fiprintf.S' || echo '$(srcdir)/'`fiprintf.S
+
+lib_a-fiprintf.obj: fiprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-fiprintf.obj `if test -f 'fiprintf.S'; then $(CYGPATH_W) 'fiprintf.S';
else $(CYGPATH_W) '$(srcdir)/fiprintf.S'; fi`
+
+lib_a-fiscanf.o: fiscanf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-fiscanf.o `test -f 'fiscanf.S' || echo '$(srcdir)/'`fiscanf.S
+
+lib_a-fiscanf.obj: fiscanf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-fiscanf.obj `if test -f 'fiscanf.S'; then $(CYGPATH_W) 'fiscanf.S'; else
$(CYGPATH_W) '$(srcdir)/fiscanf.S'; fi`
+
+lib_a-fprintf.o: fprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-fprintf.o `test -f 'fprintf.S' || echo '$(srcdir)/'`fprintf.S
+
+lib_a-fprintf.obj: fprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-fprintf.obj `if test -f 'fprintf.S'; then $(CYGPATH_W) 'fprintf.S'; else
$(CYGPATH_W) '$(srcdir)/fprintf.S'; fi`
+
+lib_a-fscanf.o: fscanf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-fscanf.o `test -f 'fscanf.S' || echo '$(srcdir)/'`fscanf.S
+
+lib_a-fscanf.obj: fscanf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-fscanf.obj `if test -f 'fscanf.S'; then $(CYGPATH_W) 'fscanf.S'; else
$(CYGPATH_W) '$(srcdir)/fscanf.S'; fi`
+
+lib_a-iprintf.o: iprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-iprintf.o `test -f 'iprintf.S' || echo '$(srcdir)/'`iprintf.S
+
+lib_a-iprintf.obj: iprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-iprintf.obj `if test -f 'iprintf.S'; then $(CYGPATH_W) 'iprintf.S'; else
$(CYGPATH_W) '$(srcdir)/iprintf.S'; fi`
+
+lib_a-iscanf.o: iscanf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-iscanf.o `test -f 'iscanf.S' || echo '$(srcdir)/'`iscanf.S
+
+lib_a-iscanf.obj: iscanf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-iscanf.obj `if test -f 'iscanf.S'; then $(CYGPATH_W) 'iscanf.S'; else
$(CYGPATH_W) '$(srcdir)/iscanf.S'; fi`
+
+lib_a-printf.o: printf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-printf.o `test -f 'printf.S' || echo '$(srcdir)/'`printf.S
+
+lib_a-printf.obj: printf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-printf.obj `if test -f 'printf.S'; then $(CYGPATH_W) 'printf.S'; else
$(CYGPATH_W) '$(srcdir)/printf.S'; fi`
+
+lib_a-scanf.o: scanf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-scanf.o `test -f 'scanf.S' || echo '$(srcdir)/'`scanf.S
+
+lib_a-scanf.obj: scanf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-scanf.obj `if test -f 'scanf.S'; then $(CYGPATH_W) 'scanf.S'; else
$(CYGPATH_W) '$(srcdir)/scanf.S'; fi`
+
+lib_a-siprintf.o: siprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-siprintf.o `test -f 'siprintf.S' || echo '$(srcdir)/'`siprintf.S
+
+lib_a-siprintf.obj: siprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-siprintf.obj `if test -f 'siprintf.S'; then $(CYGPATH_W) 'siprintf.S';
else $(CYGPATH_W) '$(srcdir)/siprintf.S'; fi`
+
+lib_a-siscanf.o: siscanf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-siscanf.o `test -f 'siscanf.S' || echo '$(srcdir)/'`siscanf.S
+
+lib_a-siscanf.obj: siscanf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-siscanf.obj `if test -f 'siscanf.S'; then $(CYGPATH_W) 'siscanf.S'; else
$(CYGPATH_W) '$(srcdir)/siscanf.S'; fi`
+
+lib_a-sniprintf.o: sniprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-sniprintf.o `test -f 'sniprintf.S' || echo '$(srcdir)/'`sniprintf.S
+
+lib_a-sniprintf.obj: sniprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-sniprintf.obj `if test -f 'sniprintf.S'; then $(CYGPATH_W)
'sniprintf.S'; else $(CYGPATH_W) '$(srcdir)/sniprintf.S'; fi`
+
+lib_a-snprintf.o: snprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-snprintf.o `test -f 'snprintf.S' || echo '$(srcdir)/'`snprintf.S
+
+lib_a-snprintf.obj: snprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-snprintf.obj `if test -f 'snprintf.S'; then $(CYGPATH_W) 'snprintf.S';
else $(CYGPATH_W) '$(srcdir)/snprintf.S'; fi`
+
+lib_a-sprintf.o: sprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-sprintf.o `test -f 'sprintf.S' || echo '$(srcdir)/'`sprintf.S
+
+lib_a-sprintf.obj: sprintf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-sprintf.obj `if test -f 'sprintf.S'; then $(CYGPATH_W) 'sprintf.S'; else
$(CYGPATH_W) '$(srcdir)/sprintf.S'; fi`
+
+lib_a-sscanf.o: sscanf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-sscanf.o `test -f 'sscanf.S' || echo '$(srcdir)/'`sscanf.S
+
+lib_a-sscanf.obj: sscanf.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-sscanf.obj `if test -f 'sscanf.S'; then $(CYGPATH_W) 'sscanf.S'; else
$(CYGPATH_W) '$(srcdir)/sscanf.S'; fi`
+
+lib_a-stack_reg_va.o: stack_reg_va.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-stack_reg_va.o `test -f 'stack_reg_va.S' || echo
'$(srcdir)/'`stack_reg_va.S
+
+lib_a-stack_reg_va.obj: stack_reg_va.S
+ $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-stack_reg_va.obj `if test -f 'stack_reg_va.S'; then $(CYGPATH_W)
'stack_reg_va.S'; else $(CYGPATH_W) '$(srcdir)/stack_reg_va.S'; fi`
+
.c.o:
$(COMPILE) -c $<
@@ -407,30 +491,12 @@
lib_a-fileno.obj: fileno.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fileno.obj
`if test -f 'fileno.c'; then $(CYGPATH_W) 'fileno.c'; else $(CYGPATH_W) '$(srcdir)/fileno.c'; fi`
-lib_a-fiprintf.o: fiprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fiprintf.o
`test -f 'fiprintf.c' || echo '$(srcdir)/'`fiprintf.c
-
-lib_a-fiprintf.obj: fiprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fiprintf.obj
`if test -f 'fiprintf.c'; then $(CYGPATH_W) 'fiprintf.c'; else $(CYGPATH_W) '$(srcdir)/fiprintf.c'; fi`
-
-lib_a-fiscanf.o: fiscanf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fiscanf.o
`test -f 'fiscanf.c' || echo '$(srcdir)/'`fiscanf.c
-
-lib_a-fiscanf.obj: fiscanf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fiscanf.obj
`if test -f 'fiscanf.c'; then $(CYGPATH_W) 'fiscanf.c'; else $(CYGPATH_W) '$(srcdir)/fiscanf.c'; fi`
-
lib_a-fopen.o: fopen.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fopen.o `test
-f 'fopen.c' || echo '$(srcdir)/'`fopen.c
lib_a-fopen.obj: fopen.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fopen.obj `if
test -f 'fopen.c'; then $(CYGPATH_W) 'fopen.c'; else $(CYGPATH_W) '$(srcdir)/fopen.c'; fi`
-lib_a-fprintf.o: fprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fprintf.o
`test -f 'fprintf.c' || echo '$(srcdir)/'`fprintf.c
-
-lib_a-fprintf.obj: fprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fprintf.obj
`if test -f 'fprintf.c'; then $(CYGPATH_W) 'fprintf.c'; else $(CYGPATH_W) '$(srcdir)/fprintf.c'; fi`
-
lib_a-fputc.o: fputc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fputc.o `test
-f 'fputc.c' || echo '$(srcdir)/'`fputc.c
@@ -455,12 +521,6 @@
lib_a-freopen.obj: freopen.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-freopen.obj
`if test -f 'freopen.c'; then $(CYGPATH_W) 'freopen.c'; else $(CYGPATH_W) '$(srcdir)/freopen.c'; fi`
-lib_a-fscanf.o: fscanf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fscanf.o
`test -f 'fscanf.c' || echo '$(srcdir)/'`fscanf.c
-
-lib_a-fscanf.obj: fscanf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fscanf.obj
`if test -f 'fscanf.c'; then $(CYGPATH_W) 'fscanf.c'; else $(CYGPATH_W) '$(srcdir)/fscanf.c'; fi`
-
lib_a-fseek.o: fseek.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fseek.o `test
-f 'fseek.c' || echo '$(srcdir)/'`fseek.c
@@ -503,18 +563,6 @@
lib_a-gets.obj: gets.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gets.obj `if
test -f 'gets.c'; then $(CYGPATH_W) 'gets.c'; else $(CYGPATH_W) '$(srcdir)/gets.c'; fi`
-lib_a-iprintf.o: iprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-iprintf.o
`test -f 'iprintf.c' || echo '$(srcdir)/'`iprintf.c
-
-lib_a-iprintf.obj: iprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-iprintf.obj
`if test -f 'iprintf.c'; then $(CYGPATH_W) 'iprintf.c'; else $(CYGPATH_W) '$(srcdir)/iprintf.c'; fi`
-
-lib_a-iscanf.o: iscanf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-iscanf.o
`test -f 'iscanf.c' || echo '$(srcdir)/'`iscanf.c
-
-lib_a-iscanf.obj: iscanf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-iscanf.obj
`if test -f 'iscanf.c'; then $(CYGPATH_W) 'iscanf.c'; else $(CYGPATH_W) '$(srcdir)/iscanf.c'; fi`
-
lib_a-memcpy.o: memcpy.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcpy.o
`test -f 'memcpy.c' || echo '$(srcdir)/'`memcpy.c
@@ -539,12 +587,6 @@
lib_a-perror.obj: perror.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-perror.obj
`if test -f 'perror.c'; then $(CYGPATH_W) 'perror.c'; else $(CYGPATH_W) '$(srcdir)/perror.c'; fi`
-lib_a-printf.o: printf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-printf.o
`test -f 'printf.c' || echo '$(srcdir)/'`printf.c
-
-lib_a-printf.obj: printf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-printf.obj
`if test -f 'printf.c'; then $(CYGPATH_W) 'printf.c'; else $(CYGPATH_W) '$(srcdir)/printf.c'; fi`
-
lib_a-putc.o: putc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putc.o `test
-f 'putc.c' || echo '$(srcdir)/'`putc.c
@@ -581,12 +623,6 @@
lib_a-rewind.obj: rewind.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-rewind.obj
`if test -f 'rewind.c'; then $(CYGPATH_W) 'rewind.c'; else $(CYGPATH_W) '$(srcdir)/rewind.c'; fi`
-lib_a-scanf.o: scanf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-scanf.o `test
-f 'scanf.c' || echo '$(srcdir)/'`scanf.c
-
-lib_a-scanf.obj: scanf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-scanf.obj `if
test -f 'scanf.c'; then $(CYGPATH_W) 'scanf.c'; else $(CYGPATH_W) '$(srcdir)/scanf.c'; fi`
-
lib_a-setbuf.o: setbuf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-setbuf.o
`test -f 'setbuf.c' || echo '$(srcdir)/'`setbuf.c
@@ -599,48 +635,12 @@
lib_a-setvbuf.obj: setvbuf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-setvbuf.obj
`if test -f 'setvbuf.c'; then $(CYGPATH_W) 'setvbuf.c'; else $(CYGPATH_W) '$(srcdir)/setvbuf.c'; fi`
-lib_a-siprintf.o: siprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-siprintf.o
`test -f 'siprintf.c' || echo '$(srcdir)/'`siprintf.c
-
-lib_a-siprintf.obj: siprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-siprintf.obj
`if test -f 'siprintf.c'; then $(CYGPATH_W) 'siprintf.c'; else $(CYGPATH_W) '$(srcdir)/siprintf.c'; fi`
-
-lib_a-siscanf.o: siscanf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-siscanf.o
`test -f 'siscanf.c' || echo '$(srcdir)/'`siscanf.c
-
-lib_a-siscanf.obj: siscanf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-siscanf.obj
`if test -f 'siscanf.c'; then $(CYGPATH_W) 'siscanf.c'; else $(CYGPATH_W) '$(srcdir)/siscanf.c'; fi`
-
lib_a-sleep.o: sleep.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sleep.o `test
-f 'sleep.c' || echo '$(srcdir)/'`sleep.c
lib_a-sleep.obj: sleep.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sleep.obj `if
test -f 'sleep.c'; then $(CYGPATH_W) 'sleep.c'; else $(CYGPATH_W) '$(srcdir)/sleep.c'; fi`
-lib_a-sniprintf.o: sniprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sniprintf.o
`test -f 'sniprintf.c' || echo '$(srcdir)/'`sniprintf.c
-
-lib_a-sniprintf.obj: sniprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sniprintf.obj
`if test -f 'sniprintf.c'; then $(CYGPATH_W) 'sniprintf.c'; else $(CYGPATH_W) '$(srcdir)/sniprintf.c'; fi`
-
-lib_a-snprintf.o: snprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-snprintf.o
`test -f 'snprintf.c' || echo '$(srcdir)/'`snprintf.c
-
-lib_a-snprintf.obj: snprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-snprintf.obj
`if test -f 'snprintf.c'; then $(CYGPATH_W) 'snprintf.c'; else $(CYGPATH_W) '$(srcdir)/snprintf.c'; fi`
-
-lib_a-sprintf.o: sprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sprintf.o
`test -f 'sprintf.c' || echo '$(srcdir)/'`sprintf.c
-
-lib_a-sprintf.obj: sprintf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sprintf.obj
`if test -f 'sprintf.c'; then $(CYGPATH_W) 'sprintf.c'; else $(CYGPATH_W) '$(srcdir)/sprintf.c'; fi`
-
-lib_a-sscanf.o: sscanf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sscanf.o
`test -f 'sscanf.c' || echo '$(srcdir)/'`sscanf.c
-
-lib_a-sscanf.obj: sscanf.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sscanf.obj
`if test -f 'sscanf.c'; then $(CYGPATH_W) 'sscanf.c'; else $(CYGPATH_W) '$(srcdir)/sscanf.c'; fi`
-
lib_a-stdio.o: stdio.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stdio.o `test
-f 'stdio.c' || echo '$(srcdir)/'`stdio.c
Index: newlib/libc/machine/spu/sniprintf.c
===================================================================
RCS file: newlib/libc/machine/spu/sniprintf.c
diff -N newlib/libc/machine/spu/sniprintf.c
--- newlib/libc/machine/spu/sniprintf.c 20 Feb 2007 20:58:38 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,2 +0,0 @@
-#define INTEGER_ONLY
-#include "snprintf.c"
Index: newlib/libc/machine/spu/fprintf.c
===================================================================
RCS file: newlib/libc/machine/spu/fprintf.c
diff -N newlib/libc/machine/spu/fprintf.c
--- newlib/libc/machine/spu/fprintf.c 23 May 2007 21:41:17 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,81 +0,0 @@
-/*
-(C) Copyright IBM Corp. 2006
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
- * Neither the name of IBM nor the names of its contributors may be
-used to endorse or promote products derived from this software without
-specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-Author: Joel Schopp <jschopp@austin.ibm.com>
-*/
-
-#include <_ansi.h>
-#include <stdio.h>
-
-#include "c99ppe.h"
-
-#ifdef _HAVE_STDC
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifdef INTEGER_ONLY
-# define fprintf fiprintf
-#endif
-
-typedef struct
-{
- int fp;
- unsigned int pad0[ 3 ];
- _CONST char* fmt;
- unsigned int pad1[ 3 ];
- va_list ap;
-} c99_fprintf_t;
-
-#ifndef _REENT_ONLY
-
-int
-fprintf(FILE * fp, _CONST char *fmt,...)
-{
- int ret;
- c99_fprintf_t args;
-
- CHECK_INIT(_REENT);
-
- args.fp = fp->_fp;
- args.fmt = (char*) fmt;
-
-#ifdef _HAVE_STDC
- va_start (args.ap, fmt);
-#else
- va_start (args.ap);
-#endif
-
- ret =__send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFPRINTF, &args);
-
- va_end (args.ap);
- return ret;
-}
-#endif /* ! _REENT_ONLY */
Index: newlib/libc/machine/spu/sprintf.c
===================================================================
RCS file: newlib/libc/machine/spu/sprintf.c
diff -N newlib/libc/machine/spu/sprintf.c
--- newlib/libc/machine/spu/sprintf.c 23 May 2007 21:41:17 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,82 +0,0 @@
-/*
-(C) Copyright IBM Corp. 2006
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
- * Neither the name of IBM nor the names of its contributors may be
-used to endorse or promote products derived from this software without
-specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-Author: Joel Schopp <jschopp@austin.ibm.com>
-*/
-
-#include <_ansi.h>
-#include <stdio.h>
-
-#include "c99ppe.h"
-
-#ifdef _HAVE_STDC
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifdef INTEGER_ONLY
-# define sprintf siprintf
-#endif
-
-typedef struct
-{
- char* str;
- unsigned int pad0[ 3 ];
- _CONST char* fmt;
- unsigned int pad1[ 3 ];
- va_list ap;
-} c99_sprintf_t;
-
-#ifndef _REENT_ONLY
-
-_DEFUN(sprintf, (str, fmt),
- char *str _AND
- _CONST char *fmt _DOTS)
-{
- int ret;
- c99_sprintf_t args;
-
- CHECK_STR_INIT(_REENT);
-
- args.str = str;
- args.fmt = fmt;
-#ifdef _HAVE_STDC
- va_start (args.ap, fmt);
-#else
- va_start (args.ap);
-#endif
-
- ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSPRINTF, &args);
-
- va_end (args.ap);
- return ret;
-}
-
-#endif /* ! _REENT_ONLY */
Index: newlib/libc/machine/spu/sscanf.c
===================================================================
RCS file: newlib/libc/machine/spu/sscanf.c
diff -N newlib/libc/machine/spu/sscanf.c
--- newlib/libc/machine/spu/sscanf.c 23 May 2007 21:41:17 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,83 +0,0 @@
-/*
-(C) Copyright IBM Corp. 2006
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
- * Neither the name of IBM nor the names of its contributors may be
-used to endorse or promote products derived from this software without
-specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-Author: Joel Schopp <jschopp@austin.ibm.com>
-*/
-
-#include <_ansi.h>
-#include <stdio.h>
-
-#include "c99ppe.h"
-
-#ifdef _HAVE_STDC
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifdef INTEGER_ONLY
-# define sscanf siscanf
-#endif
-
-typedef struct
-{
- _CONST char* str;
- unsigned int pad0[ 3 ];
- _CONST char* fmt;
- unsigned int pad1[ 3 ];
- va_list ap;
-} c99_sscanf_t;
-
-#ifndef _REENT_ONLY
-
-int
-_DEFUN(sscanf, (str, fmt),
- _CONST char *str _AND
- _CONST char *fmt _DOTS)
-{
- int ret;
- c99_sscanf_t args;
-
- CHECK_STR_INIT(_REENT);
-
- args.str = str;
- args.fmt = fmt;
-#ifdef _HAVE_STDC
- va_start (args.ap, fmt);
-#else
- va_start (args.ap);
-#endif
-
- ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSSCANF, &args);
-
- va_end (args.ap);
- return ret;
-}
-
-#endif /* ! _REENT_ONLY */
Index: newlib/libc/machine/spu/stdio.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/stdio.c,v
retrieving revision 1.1
diff -u -r1.1 stdio.c
--- newlib/libc/machine/spu/stdio.c 1 Feb 2007 16:33:05 -0000 1.1
+++ newlib/libc/machine/spu/stdio.c 15 Aug 2007 10:42:23 -0000
@@ -80,3 +80,9 @@
s->_stderr = &s->__sf[2];
s->_stderr->_fp = SPE_STDERR;
}
+
+_VOID
+_DEFUN_VOID (__check_init)
+{
+ CHECK_INIT(_REENT);
+}
Index: newlib/libc/machine/spu/printf.c
===================================================================
RCS file: newlib/libc/machine/spu/printf.c
diff -N newlib/libc/machine/spu/printf.c
--- newlib/libc/machine/spu/printf.c 23 May 2007 21:41:17 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,56 +0,0 @@
-#include <_ansi.h>
-#include <stdio.h>
-
-#include "c99ppe.h"
-
-#ifdef _HAVE_STDC
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifdef INTEGER_ONLY
-# define printf iprintf
-#endif
-
-typedef struct
-{
- _CONST char* fmt;
- unsigned int pad0[ 3 ];
- va_list ap;
-} c99_printf_t;
-
-#ifndef _REENT_ONLY
-
-#ifdef _HAVE_STDC
-int
-_DEFUN (printf, (fmt,ap),
- _CONST char *fmt _AND
- ...)
-#else
-int
-#error
-printf (fmt, va_alist)
- _CONST char *fmt;
- va_dcl
-#endif
-{
- int ret;
- c99_printf_t args;
-
- CHECK_STD_INIT(_REENT);
-
- args.fmt = fmt;
-#ifdef _HAVE_STDC
- va_start (args.ap, fmt);
-#else
- va_start (args.ap);
-#endif
-
- ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VPRINTF, &args);
-
- va_end (args.ap);
- return ret;
-}
-
-#endif /* ! _REENT_ONLY */
Index: newlib/libc/machine/spu/snprintf.c
===================================================================
RCS file: newlib/libc/machine/spu/snprintf.c
diff -N newlib/libc/machine/spu/snprintf.c
--- newlib/libc/machine/spu/snprintf.c 23 May 2007 21:41:17 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,86 +0,0 @@
-/*
-(C) Copyright IBM Corp. 2006
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
- * Neither the name of IBM nor the names of its contributors may be
-used to endorse or promote products derived from this software without
-specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-Author: Joel Schopp <jschopp@austin.ibm.com>
-*/
-
-#include <_ansi.h>
-#include <stdio.h>
-
-#include "c99ppe.h"
-
-#ifdef _HAVE_STDC
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifdef INTEGER_ONLY
-# define snprintf sniprintf
-#endif
-
-typedef struct
-{
- char* str;
- unsigned int pad0[ 3 ];
- size_t size;
- unsigned int pad1[ 3 ];
- _CONST char* fmt;
- unsigned int pad2[ 3 ];
- va_list ap;
-} c99_snprintf_t;
-
-#ifndef _REENT_ONLY
-
-_DEFUN(snprintf, (str, size, fmt),
- char *str _AND
- size_t size _AND
- _CONST char *fmt _DOTS)
-{
- int ret;
- c99_snprintf_t args;
-
- CHECK_STR_INIT(_REENT);
-
- args.str = str;
- args.size = size;
- args.fmt = fmt;
-#ifdef _HAVE_STDC
- va_start (args.ap, fmt);
-#else
- va_start (args.ap);
-#endif
-
- ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSNPRINTF, &args);
-
- va_end (args.ap);
- return ret;
-}
-
-#endif /* ! _REENT_ONLY */
Index: newlib/libc/machine/spu/scanf.c
===================================================================
RCS file: newlib/libc/machine/spu/scanf.c
diff -N newlib/libc/machine/spu/scanf.c
--- newlib/libc/machine/spu/scanf.c 23 May 2007 21:41:17 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,78 +0,0 @@
-/*
-(C) Copyright IBM Corp. 2006
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
- * Neither the name of IBM nor the names of its contributors may be
-used to endorse or promote products derived from this software without
-specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-Author: Joel Schopp <jschopp@austin.ibm.com>
-*/
-
-#include <_ansi.h>
-#include <stdio.h>
-
-#include "c99ppe.h"
-
-#ifdef _HAVE_STDC
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifdef INTEGER_ONLY
-# define scanf iscanf
-#endif
-
-typedef struct
-{
- _CONST char* fmt;
- unsigned int pad0[ 3 ];
- va_list ap;
-} c99_vscanf_t;
-
-#ifndef _REENT_ONLY
-
-scanf(_CONST char *fmt, ...)
-{
- int ret;
- c99_vscanf_t args;
-
- CHECK_STD_INIT(_REENT);
-
- args.fmt = (char*) fmt;
-#ifdef _HAVE_STDC
- va_start (args.ap, fmt);
-#else
- va_start (args.ap);
-#endif
-
-
- ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSCANF, &args);
-
- va_end (args.ap);
- return ret;
-}
-
-#endif /* ! _REENT_ONLY */
Index: newlib/libc/machine/spu/fiprintf.c
===================================================================
RCS file: newlib/libc/machine/spu/fiprintf.c
diff -N newlib/libc/machine/spu/fiprintf.c
--- newlib/libc/machine/spu/fiprintf.c 20 Feb 2007 20:58:38 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,2 +0,0 @@
-#define INTEGER_ONLY
-#include "fprintf.c"
Index: newlib/libc/machine/spu/iprintf.c
===================================================================
RCS file: newlib/libc/machine/spu/iprintf.c
diff -N newlib/libc/machine/spu/iprintf.c
--- newlib/libc/machine/spu/iprintf.c 20 Feb 2007 20:58:38 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,2 +0,0 @@
-#define INTEGER_ONLY
-#include "printf.c"
Index: newlib/libc/machine/spu/Makefile.am
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/Makefile.am,v
retrieving revision 1.11
diff -u -r1.11 Makefile.am
--- newlib/libc/machine/spu/Makefile.am 15 Jun 2007 16:00:46 -0000 1.11
+++ newlib/libc/machine/spu/Makefile.am 15 Aug 2007 10:42:09 -0000
@@ -9,18 +9,18 @@
AM_CCASFLAGS = $(INCLUDES)
lib_a_SOURCES = setjmp.S clearerr.c creat.c fclose.c feof.c ferror.c fflush.c \
- fgetc.c fgetpos.c fgets.c fileno.c fiprintf.c fiscanf.c fopen.c \
- fprintf.c fputc.c fputs.c fread.c freopen.c fscanf.c fseek.c \
- fsetpos.c ftell.c fwrite.c getc.c getchar.c gets.c iprintf.c \
- iscanf.c memcpy.c memmove.c memset.c perror.c printf.c \
- putc.c putchar.c puts.c remove.c rename.c rewind.c scanf.c \
- setbuf.c setvbuf.c siprintf.c siscanf.c sleep.c sniprintf.c \
- snprintf.c sprintf.c sscanf.c stdio.c strcat.c strchr.c strcmp.c \
+ fgetc.c fgetpos.c fgets.c fileno.c fiprintf.S fiscanf.S fopen.c \
+ fprintf.S fputc.c fputs.c fread.c freopen.c fscanf.S fseek.c \
+ fsetpos.c ftell.c fwrite.c getc.c getchar.c gets.c iprintf.S \
+ iscanf.S memcpy.c memmove.c memset.c perror.c printf.S \
+ putc.c putchar.c puts.c remove.c rename.c rewind.c scanf.S \
+ setbuf.c setvbuf.c siprintf.S siscanf.S sleep.c sniprintf.S \
+ snprintf.S sprintf.S sscanf.S stdio.c strcat.c strchr.c strcmp.c \
strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \
strrchr.c strspn.c strxfrm.c tmpfile.c tmpnam.c ungetc.c usleep.c \
vfiprintf.c vfiscanf.c vfprintf.c vfscanf.c viprintf.c viscanf.c \
vprintf.c vscanf.c vsiprintf.c vsiscanf.c vsniprintf.c vsnprintf.c \
- vsprintf.c vsscanf.c
+ vsprintf.c vsscanf.c stack_reg_va.S
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
lib_a_CFLAGS = $(AM_CFLAGS)
Index: newlib/libc/machine/spu/siscanf.c
===================================================================
RCS file: newlib/libc/machine/spu/siscanf.c
diff -N newlib/libc/machine/spu/siscanf.c
--- newlib/libc/machine/spu/siscanf.c 20 Feb 2007 20:58:38 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,2 +0,0 @@
-#define INTEGER_ONLY
-#include "sscanf.c"
Index: newlib/libc/machine/spu/fiscanf.c
===================================================================
RCS file: newlib/libc/machine/spu/fiscanf.c
diff -N newlib/libc/machine/spu/fiscanf.c
--- newlib/libc/machine/spu/fiscanf.c 20 Feb 2007 20:58:38 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,2 +0,0 @@
-#define INTEGER_ONLY
-#include "fscanf.c"
Index: newlib/libc/machine/spu/c99ppe.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/spu/c99ppe.h,v
retrieving revision 1.4
diff -u -r1.4 c99ppe.h
--- newlib/libc/machine/spu/c99ppe.h 4 Apr 2007 21:03:13 -0000 1.4
+++ newlib/libc/machine/spu/c99ppe.h 15 Aug 2007 10:42:23 -0000
@@ -30,11 +30,26 @@
Author: Joel Schopp <jschopp@austin.ibm.com>
*/
+#define SPE_C99_SIGNALCODE 0x2100
+
+#ifdef __ASSEMBLER__
+
+#define STACK_REGS 72 /* Number of registers preserved in stack
+ in case of variable argument API. */
+
+#define SPE_C99_VFPRINTF 0x23
+#define SPE_C99_VFSCANF 0x24
+#define SPE_C99_VPRINTF 0x25
+#define SPE_C99_VSCANF 0x26
+#define SPE_C99_VSNPRINTF 0x27
+#define SPE_C99_VSPRINTF 0x28
+#define SPE_C99_VSSCANF 0x29
+
+#else /* __ASSEMBLER__ */
+
#include <errno.h>
#include <sys/syscall.h>
-#define SPE_C99_SIGNALCODE 0x2100
-
#define SPE_C99_OP_SHIFT 24
#define SPE_C99_OP_MASK 0xff
#define SPE_C99_DATA_MASK 0xffffff
@@ -102,3 +117,5 @@
do { if ((ptr) && !(ptr)->__sdidinit) __sinit (ptr); } while (0)
#define CHECK_STD_INIT(ptr) /* currently, do nothing */
#define CHECK_STR_INIT(ptr) /* currently, do nothing */
+
+#endif /* __ASSEMBLER__ */
Index: newlib/libc/machine/spu/iscanf.c
===================================================================
RCS file: newlib/libc/machine/spu/iscanf.c
diff -N newlib/libc/machine/spu/iscanf.c
--- newlib/libc/machine/spu/iscanf.c 20 Feb 2007 20:58:38 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,2 +0,0 @@
-#define INTEGER_ONLY
-#include "scanf.c"
Index: newlib/libc/machine/spu/fscanf.c
===================================================================
RCS file: newlib/libc/machine/spu/fscanf.c
diff -N newlib/libc/machine/spu/fscanf.c
--- newlib/libc/machine/spu/fscanf.c 23 May 2007 21:41:17 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,80 +0,0 @@
-/*
-(C) Copyright IBM Corp. 2006
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
- * Neither the name of IBM nor the names of its contributors may be
-used to endorse or promote products derived from this software without
-specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-Author: Joel Schopp <jschopp@austin.ibm.com>
-*/
-
-#include <_ansi.h>
-#include <stdio.h>
-
-#include "c99ppe.h"
-
-#ifdef _HAVE_STDC
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifdef INTEGER_ONLY
-# define fscanf fiscanf
-#endif
-
-typedef struct
-{
- int fp;
- unsigned int pad0[ 3 ];
- _CONST char* fmt;
- unsigned int pad1[ 3 ];
- va_list ap;
-} c99_vfscanf_t;
-
-#ifndef _REENT_ONLY
-
-fscanf(FILE *fp, _CONST char *fmt, ...)
-{
- int ret;
- c99_vfscanf_t args;
-
- CHECK_INIT(_REENT);
-
- args.fp = fp->_fp;
- args.fmt = (char*) fmt;
-#ifdef _HAVE_STDC
- va_start (args.ap, fmt);
-#else
- va_start (args.ap);
-#endif
-
-
- ret = __send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VFSCANF, &args);
-
- va_end (args.ap);
- return ret;
-}
-#endif /* ! _REENT_ONLY */
Index: newlib/libc/machine/spu/siprintf.c
===================================================================
RCS file: newlib/libc/machine/spu/siprintf.c
diff -N newlib/libc/machine/spu/siprintf.c
--- newlib/libc/machine/spu/siprintf.c 20 Feb 2007 20:58:38 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,2 +0,0 @@
-#define INTEGER_ONLY
-#include "sprintf.c"
Index: newlib/libc/machine/spu/sprintf.S
===================================================================
RCS file: newlib/libc/machine/spu/sprintf.S
diff -N newlib/libc/machine/spu/sprintf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/sprintf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "c99ppe.h"
+
+#define SIGCODE SPE_C99_SIGNALCODE
+#define NAME sprintf
+#define PARMS 2
+#define OPCODE SPE_C99_VSPRINTF
+
+#define parms $2
+
+ .text
+ .align 4
+ GLOBL NAME
+NAME:
+ stqd $0, 16($sp) /* save caller address */
+ il parms, PARMS
+ brsl $0, __stack_reg_va /* save register to the stack frame */
+
+ il $3, SIGCODE /* signal code */
+ il $4, OPCODE /* op code */
+ ai $5, $sp, 16*2 /* data ($3 save address) */
+ brsl $0, __send_to_ppe
+
+ il $2, 16*(STACK_REGS+2+2)
+ a $sp, $sp, $2
+ lqd $0, 16($sp) /* load caller address */
+ bi $0 /* return to caller */
Index: newlib/libc/machine/spu/fprintf.S
===================================================================
RCS file: newlib/libc/machine/spu/fprintf.S
diff -N newlib/libc/machine/spu/fprintf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/fprintf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "c99ppe.h"
+
+#define SIGCODE SPE_C99_SIGNALCODE
+#define NAME fprintf
+#define PARMS 2
+#define OPCODE SPE_C99_VFPRINTF
+#define FP 3
+
+#define parms $2
+
+ .text
+ .align 4
+ GLOBL NAME
+NAME:
+ stqd $0, 16($sp) /* save caller address */
+ il parms, PARMS
+ brsl $0, __stack_reg_va /* save register to the stack frame */
+
+ brsl $0, __check_init
+ lqd $3, 16*(FP-1)($sp) /* $3 <- saved FP on the stack frame */
+ lqd $2, 0($3) /* FP = fp->_fp */
+ rotqby $2, $2, $3
+ stqd $2, 16*(FP-1)($sp) /* replace FP on the stack frame */
+
+ il $3, SIGCODE /* signal code */
+ il $4, OPCODE /* op code */
+ ai $5, $sp, 16*2 /* data ($3 save address) */
+ brsl $0, __send_to_ppe
+
+ il $2, 16*(STACK_REGS+2+2)
+ a $sp, $sp, $2
+ lqd $0, 16($sp) /* load caller address */
+ bi $0 /* return to caller */
Index: newlib/libc/machine/spu/siprintf.S
===================================================================
RCS file: newlib/libc/machine/spu/siprintf.S
diff -N newlib/libc/machine/spu/siprintf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/siprintf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,32 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define sprintf siprintf
+#include "sprintf.S"
Index: newlib/libc/machine/spu/sniprintf.S
===================================================================
RCS file: newlib/libc/machine/spu/sniprintf.S
diff -N newlib/libc/machine/spu/sniprintf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/sniprintf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,32 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define snprintf sniprintf
+#include "snprintf.S"
Index: newlib/libc/machine/spu/printf.S
===================================================================
RCS file: newlib/libc/machine/spu/printf.S
diff -N newlib/libc/machine/spu/printf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/printf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "c99ppe.h"
+
+#define SIGCODE SPE_C99_SIGNALCODE
+#define NAME printf
+#define PARMS 1
+#define OPCODE SPE_C99_VPRINTF
+
+#define parms $2
+
+ .text
+ .align 4
+ GLOBL NAME
+NAME:
+ stqd $0, 16($sp) /* save caller address */
+ il parms, PARMS
+ brsl $0, __stack_reg_va /* save register to the stack frame */
+
+ il $3, SIGCODE /* signal code */
+ il $4, OPCODE /* op code */
+ ai $5, $sp, 16*2 /* data ($3 save address) */
+ brsl $0, __send_to_ppe
+
+ il $2, 16*(STACK_REGS+2+2)
+ a $sp, $sp, $2
+ lqd $0, 16($sp) /* load caller address */
+ bi $0 /* return to caller */
Index: newlib/libc/machine/spu/stack_reg_va.S
===================================================================
RCS file: newlib/libc/machine/spu/stack_reg_va.S
diff -N newlib/libc/machine/spu/stack_reg_va.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/stack_reg_va.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,166 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * This file contains code use to construct a PIC, spu side, syscall
+ * function with variable parameters in accordance with the CBE ABI.
+ *
+ * This function is equivalent to constructing a va_list structure and
+ * calling the va_list form of the function. Therefore, for example,
+ * a printf function stack frame will look like this:
+ *
+ * | Stack | high memory
+ * | Parms |
+ * | |
+ * |------------|
+ * | Link Reg |
+ * |------------|
+ * | Back Chain |<-----. <---- input SP
+ * |------------| |
+ * | Reg 74 | |
+ * |------------| |
+ * | Reg 73 | |
+ * |------------| |
+ * // ... // |
+ * |------------| |
+ * | Reg 5 | |
+ * |------------| |
+ * | Reg 4 |<--. |
+ * |------------| | |
+ * va_list.| call_stack |------'
+ * |------------| |
+ * va_list.| next_arg |---'
+ * |------------|
+ * | format (r3)| <---- start of parameters
+ * |------------| |------------|
+ * | stack | | |
+ * | code | |(Back Chain)| <---- output SP
+ * | 1-3 qwords | <---- code_ptr `------------'
+ * `------------'
+ * low memory
+ *
+ * This was written in assembly so that it is smaller than what would
+ * be produced by using va_start.
+ */
+
+#include "c99ppe.h"
+
+#define parms $2
+
+#define offset $67
+#define flag $68
+#define regdec $69
+#define link $70
+
+#define code_ptr $71
+#define ptr $72
+#define inst $73
+#define tmp $74
+
+ .text
+ .global __stack_reg_va
+
+__stack_reg_va:
+
+ /* Save registers 69-74 explicitly so that we have some
+ * working registers.
+ */
+ stqd $74, 16*(-1)($sp)
+ stqd $73, 16*(-2)($sp)
+ stqd $72, 16*(-3)($sp)
+ stqd $71, 16*(-4)($sp)
+ stqd $70, 16*(-5)($sp)
+ stqd $69, 16*(-6)($sp)
+
+ /* Construct self-modifying stack code that saves the remaining
+ * volatile registers onto the stack.
+ */
+ il regdec, -1 /* for decrement register value in save instruction */
+ shlqbyi regdec, regdec, 12
+ il tmp, -(STACK_REGS+2+3)*16
+ a code_ptr, $sp, tmp
+ lqr tmp, save_regs_1 /* store stack code */
+ stqd tmp, 0(code_ptr)
+ lqr inst, save_regs_2
+ ai ptr, $sp, 16*(-6)
+ sync
+ bisl link, code_ptr /* branch to the constructed stack code */
+
+ /* Adjust pointer so that it points to the first variable
+ * argument on the stack.
+ */
+ ai offset, parms, -1 /* offset = parms - 1 */
+ mpyi offset, offset, 16 /* offset = offset * 16 */
+ a ptr, ptr, offset /* ptr = ptr + offset */
+
+ /* Store the va_list to the parameter list.
+ */
+ stqd $sp, 16*(-1)(ptr)
+ stqd ptr, 16*(-2)(ptr)
+
+ /* Make $3 store address.
+ */
+ ai offset, parms, 2 /* offset = parms + 2 */
+ mpyi offset, offset, -16 /* offset = offset * -16 */
+ a ptr, ptr, offset /* ptr = ptr + offset */
+
+ /* Save all the fixed (non-variable arguments on the stack)
+ */
+ ceqi flag, parms, 0x01 /* if(parms==1) flag=0xFFFFFFFF */
+ brnz flag, reg_3 /* if(flag!=0) jump */
+ ceqi flag, parms, 0x02 /* if(parms==2) flag=0xFFFFFFFF */
+ brnz flag, reg_4 /* if(flag!=0) jump */
+ stqd $5, 16*2(ptr)
+reg_4:
+ stqd $4, 16*1(ptr)
+reg_3:
+ stqd $3, 0(ptr)
+
+ il $3, -16*(STACK_REGS+2+2)
+ stqx $sp, $3, $sp /* save back chain */
+ a $sp, $sp, $3
+ bi $0 /* return to caller */
+
+/***************************** stack code *********************************************/
+
+ /* The following code is copied into the stack for re-entract,
+ * self-modified, code execution. This code copies the volatile
+ * registers into a va_list parameter array.
+ */
+ .balignl 16, 0
+save_regs_1:
+ stqd inst, 16(code_ptr) /* store instruction */
+ sync
+ a inst, inst, regdec /* decrement register number in the instruction */
+ ceqbi tmp, inst, 3 /* if (reg-num == 3) tmp = 0x000000FF 000..0 */
+save_regs_2:
+ stqd $68, -16(ptr)
+ ai ptr, ptr, -16
+ brz tmp, save_regs_1 /* if (tmp == 0) jump */
+ bi link /* finish to make va_list */
Index: newlib/libc/machine/spu/siscanf.S
===================================================================
RCS file: newlib/libc/machine/spu/siscanf.S
diff -N newlib/libc/machine/spu/siscanf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/siscanf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,32 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define sscanf siscanf
+#include "sscanf.S"
Index: newlib/libc/machine/spu/fscanf.S
===================================================================
RCS file: newlib/libc/machine/spu/fscanf.S
diff -N newlib/libc/machine/spu/fscanf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/fscanf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "c99ppe.h"
+
+#define SIGCODE SPE_C99_SIGNALCODE
+#define NAME fscanf
+#define PARMS 2
+#define OPCODE SPE_C99_VFSCANF
+#define FP 3
+
+#define parms $2
+
+ .text
+ .align 4
+ GLOBL NAME
+NAME:
+ stqd $0, 16($sp) /* save caller address */
+ il parms, PARMS
+ brsl $0, __stack_reg_va /* save register to the stack frame */
+
+ brsl $0, __check_init
+ lqd $3, 16*(FP-1)($sp) /* $3 <- saved FP on the stack frame */
+ lqd $2, 0($3) /* FP = fp->_fp */
+ rotqby $2, $2, $3
+ stqd $2, 16*(FP-1)($sp) /* replace FP on the stack frame */
+
+ il $3, SIGCODE /* signal code */
+ il $4, OPCODE /* op code */
+ ai $5, $sp, 16*2 /* data ($3 save address) */
+ brsl $0, __send_to_ppe
+
+ il $2, 16*(STACK_REGS+2+2)
+ a $sp, $sp, $2
+ lqd $0, 16($sp) /* load caller address */
+ bi $0 /* return to caller */
Index: newlib/libc/machine/spu/sscanf.S
===================================================================
RCS file: newlib/libc/machine/spu/sscanf.S
diff -N newlib/libc/machine/spu/sscanf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/sscanf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "c99ppe.h"
+
+#define SIGCODE SPE_C99_SIGNALCODE
+#define NAME sscanf
+#define PARMS 2
+#define OPCODE SPE_C99_VSSCANF
+
+#define parms $2
+
+ .text
+ .align 4
+ GLOBL NAME
+NAME:
+ stqd $0, 16($sp) /* save caller address */
+ il parms, PARMS
+ brsl $0, __stack_reg_va /* save register to the stack frame */
+
+ il $3, SIGCODE /* signal code */
+ il $4, OPCODE /* op code */
+ ai $5, $sp, 16*2 /* data ($3 save address) */
+ brsl $0, __send_to_ppe
+
+ il $2, 16*(STACK_REGS+2+2)
+ a $sp, $sp, $2
+ lqd $0, 16($sp) /* load caller address */
+ bi $0 /* return to caller */
Index: newlib/libc/machine/spu/iprintf.S
===================================================================
RCS file: newlib/libc/machine/spu/iprintf.S
diff -N newlib/libc/machine/spu/iprintf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/iprintf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,32 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define printf iprintf
+#include "printf.S"
Index: newlib/libc/machine/spu/iscanf.S
===================================================================
RCS file: newlib/libc/machine/spu/iscanf.S
diff -N newlib/libc/machine/spu/iscanf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/iscanf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,32 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define scanf iscanf
+#include "scanf.S"
Index: newlib/libc/machine/spu/snprintf.S
===================================================================
RCS file: newlib/libc/machine/spu/snprintf.S
diff -N newlib/libc/machine/spu/snprintf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/snprintf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "c99ppe.h"
+
+#define SIGCODE SPE_C99_SIGNALCODE
+#define NAME snprintf
+#define PARMS 3
+#define OPCODE SPE_C99_VSNPRINTF
+
+#define parms $2
+
+ .text
+ .align 4
+ GLOBL NAME
+NAME:
+ stqd $0, 16($sp) /* save caller address */
+ il parms, PARMS
+ brsl $0, __stack_reg_va /* save register to the stack frame */
+
+ il $3, SIGCODE /* signal code */
+ il $4, OPCODE /* op code */
+ ai $5, $sp, 16*2 /* data ($3 save address) */
+ brsl $0, __send_to_ppe
+
+ il $2, 16*(STACK_REGS+2+2)
+ a $sp, $sp, $2
+ lqd $0, 16($sp) /* load caller address */
+ bi $0 /* return to caller */
Index: newlib/libc/machine/spu/scanf.S
===================================================================
RCS file: newlib/libc/machine/spu/scanf.S
diff -N newlib/libc/machine/spu/scanf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/scanf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "c99ppe.h"
+
+#define SIGCODE SPE_C99_SIGNALCODE
+#define NAME scanf
+#define PARMS 1
+#define OPCODE SPE_C99_VSCANF
+
+#define parms $2
+
+ .text
+ .align 4
+ GLOBL NAME
+NAME:
+ stqd $0, 16($sp) /* save caller address */
+ il parms, PARMS
+ brsl $0, __stack_reg_va /* save register to the stack frame */
+
+ il $3, SIGCODE /* signal code */
+ il $4, OPCODE /* op code */
+ ai $5, $sp, 16*2 /* data ($3 save address) */
+ brsl $0, __send_to_ppe
+
+ il $2, 16*(STACK_REGS+2+2)
+ a $sp, $sp, $2
+ lqd $0, 16($sp) /* load caller address */
+ bi $0 /* return to caller */
Index: newlib/libc/machine/spu/fiscanf.S
===================================================================
RCS file: newlib/libc/machine/spu/fiscanf.S
diff -N newlib/libc/machine/spu/fiscanf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/fiscanf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,32 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define fscanf fiscanf
+#include "fscanf.S"
Index: newlib/libc/machine/spu/fiprintf.S
===================================================================
RCS file: newlib/libc/machine/spu/fiprintf.S
diff -N newlib/libc/machine/spu/fiprintf.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ newlib/libc/machine/spu/fiprintf.S 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,32 @@
+/*
+ Copyright (c) 2007, Toshiba Corporation
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the names of Toshiba nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define fprintf fiprintf
+#include "fprintf.S"