diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2007-08-23 18:45:22 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2007-08-23 18:45:22 +0000 |
commit | e6e56f7c72648ab51f54dc7a2cfc83b9c5b9c6e5 (patch) | |
tree | cd78bb15deffea016411d3743adb7cbf5c108787 /newlib/libc/machine/spu/c99ppe.h | |
parent | fc32145a4c2dc74dc6b5309ba58dba2df1768e16 (diff) | |
download | cygnal-e6e56f7c72648ab51f54dc7a2cfc83b9c5b9c6e5.tar.gz cygnal-e6e56f7c72648ab51f54dc7a2cfc83b9c5b9c6e5.tar.bz2 cygnal-e6e56f7c72648ab51f54dc7a2cfc83b9c5b9c6e5.zip |
2007-08-23 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/syscall.def: Ditto. (for maintenance)
* libc/machine/spu/mk_syscalls: Ditto. (for maintenance)
* 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.
Diffstat (limited to 'newlib/libc/machine/spu/c99ppe.h')
-rw-r--r-- | newlib/libc/machine/spu/c99ppe.h | 94 |
1 files changed, 50 insertions, 44 deletions
diff --git a/newlib/libc/machine/spu/c99ppe.h b/newlib/libc/machine/spu/c99ppe.h index da5d03c5c..b0ccf2dc0 100644 --- a/newlib/libc/machine/spu/c99ppe.h +++ b/newlib/libc/machine/spu/c99ppe.h @@ -30,8 +30,10 @@ POSSIBILITY OF SUCH DAMAGE. Author: Joel Schopp <jschopp@austin.ibm.com> */ +#ifndef __ASSEMBLER__ #include <errno.h> #include <sys/syscall.h> +#endif /* !__ASSEMBLER__ */ #define SPE_C99_SIGNALCODE 0x2100 @@ -39,50 +41,49 @@ Author: Joel Schopp <jschopp@austin.ibm.com> #define SPE_C99_OP_MASK 0xff #define SPE_C99_DATA_MASK 0xffffff -enum { - SPE_C99_CLEARERR=0x01, - SPE_C99_FCLOSE, - SPE_C99_FEOF, - SPE_C99_FERROR, - SPE_C99_FFLUSH, - SPE_C99_FGETC, - SPE_C99_FGETPOS, - SPE_C99_FGETS, - SPE_C99_FILENO, - SPE_C99_FOPEN, //implemented - SPE_C99_FPUTC, - SPE_C99_FPUTS, - SPE_C99_FREAD, - SPE_C99_FREOPEN, - SPE_C99_FSEEK, - SPE_C99_FSETPOS, - SPE_C99_FTELL, - SPE_C99_FWRITE, - SPE_C99_GETC, - SPE_C99_GETCHAR, - SPE_C99_GETS, - SPE_C99_PERROR, - SPE_C99_PUTC, - SPE_C99_PUTCHAR, - SPE_C99_PUTS, - SPE_C99_REMOVE, - SPE_C99_RENAME, - SPE_C99_REWIND, - SPE_C99_SETBUF, - SPE_C99_SETVBUF, - SPE_C99_SYSTEM, //not yet implemented in newlib - SPE_C99_TMPFILE, - SPE_C99_TMPNAM, - SPE_C99_UNGETC, - SPE_C99_VFPRINTF, - SPE_C99_VFSCANF, - SPE_C99_VPRINTF, - SPE_C99_VSCANF, - SPE_C99_VSNPRINTF, - SPE_C99_VSPRINTF, - SPE_C99_VSSCANF, - SPE_C99_LAST_OPCODE, -}; +#define SPE_C99_CLEARERR 1 +#define SPE_C99_FCLOSE 2 +#define SPE_C99_FEOF 3 +#define SPE_C99_FERROR 4 +#define SPE_C99_FFLUSH 5 +#define SPE_C99_FGETC 6 +#define SPE_C99_FGETPOS 7 +#define SPE_C99_FGETS 8 +#define SPE_C99_FILENO 9 +#define SPE_C99_FOPEN 10 //implemented +#define SPE_C99_FPUTC 11 +#define SPE_C99_FPUTS 12 +#define SPE_C99_FREAD 13 +#define SPE_C99_FREOPEN 14 +#define SPE_C99_FSEEK 15 +#define SPE_C99_FSETPOS 16 +#define SPE_C99_FTELL 17 +#define SPE_C99_FWRITE 18 +#define SPE_C99_GETC 19 +#define SPE_C99_GETCHAR 20 +#define SPE_C99_GETS 21 +#define SPE_C99_PERROR 22 +#define SPE_C99_PUTC 23 +#define SPE_C99_PUTCHAR 24 +#define SPE_C99_PUTS 25 +#define SPE_C99_REMOVE 26 +#define SPE_C99_RENAME 27 +#define SPE_C99_REWIND 28 +#define SPE_C99_SETBUF 29 +#define SPE_C99_SETVBUF 30 +#define SPE_C99_SYSTEM 31 //not yet implemented in newlib +#define SPE_C99_TMPFILE 32 +#define SPE_C99_TMPNAM 33 +#define SPE_C99_UNGETC 34 +#define SPE_C99_VFPRINTF 35 +#define SPE_C99_VFSCANF 36 +#define SPE_C99_VPRINTF 37 +#define SPE_C99_VSCANF 38 +#define SPE_C99_VSNPRINTF 39 +#define SPE_C99_VSPRINTF 40 +#define SPE_C99_VSSCANF 41 +#define SPE_C99_LAST_OPCODE 42 + #define SPE_C99_NR_OPCODES ((SPE_C99_LAST_OPCODE - SPE_C99_CLEARERR) + 1) #define SPE_STDIN 1 @@ -90,6 +91,10 @@ enum { #define SPE_STDERR 3 #define SPE_FOPEN_MAX FOPEN_MAX +#ifdef __ASSEMBLER__ +#define SPE_STACK_REGS 72 /* Number of registers preserved in stack + in case of variable argument API. */ +#else /* !__ASSEMBLER__ */ struct spe_reg128{ unsigned int slot[4]; }; @@ -102,3 +107,4 @@ FILE *_EXFUN(__sfp,(struct _reent *)); 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__ */ |