summaryrefslogtreecommitdiffstats
path: root/newlib/libc/machine/spu/vsprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/machine/spu/vsprintf.c')
-rw-r--r--newlib/libc/machine/spu/vsprintf.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/newlib/libc/machine/spu/vsprintf.c b/newlib/libc/machine/spu/vsprintf.c
new file mode 100644
index 000000000..3a45c2b92
--- /dev/null
+++ b/newlib/libc/machine/spu/vsprintf.c
@@ -0,0 +1,39 @@
+
+#include <_ansi.h>
+#include <stdio.h>
+
+#include "c99ppe.h"
+
+#ifdef _HAVE_STDC
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
+typedef struct
+{
+ char *str;
+ unsigned int pad0[ 3 ];
+ char *fmt;
+ unsigned int pad1[ 3 ];
+ va_list ap;
+} c99_vsprintf_t;
+
+int
+_DEFUN (vsprintf, (str, fmt, ap),
+ char *str _AND
+ _CONST char *fmt _AND
+ va_list ap)
+{
+ int* ret;
+ c99_vsprintf_t args;
+ ret = (int*) &args;
+
+ args.str = str;
+ args.fmt = (char*) fmt;
+ va_copy(args.ap,ap);
+
+ send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VSPRINTF, &args);
+
+ return *ret;
+}