diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2007-05-23 21:39:54 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2007-05-23 21:39:54 +0000 |
commit | a0050b64fc79c4bab523e7abf0739ab22a4d2a33 (patch) | |
tree | c204b305fea8f9aefa971fbf553458ddac581cbc /libgloss/spu | |
parent | 9a3ec8622b2fb10c95112188c7f5ff1424c738e6 (diff) | |
download | newlib-a0050b64fc79c4bab523e7abf0739ab22a4d2a33.zip newlib-a0050b64fc79c4bab523e7abf0739ab22a4d2a33.tar.gz newlib-a0050b64fc79c4bab523e7abf0739ab22a4d2a33.tar.bz2 |
2007-05-23 Patrick Mansfield <patmans@us.ibm.com>
* spu/syscalls.c: Change __send_to_ppe to return the result stored
in stored in slot 0 of the data, rather than have each assisted
call retrieve the value.
* spu/jsre.h: Remove the now unused syscall_out_t.
* spu/access.c: Use the __send_to_ppe result instead of the slot 0
value, remove unused syscall_out_t variable.
* spu/close.c: Ditto.
* spu/dup.c: Ditto.
* spu/fstat.c: Ditto.
* spu/ftruncate.c: Ditto.
* spu/gettimeofday.c: Ditto.
* spu/lseek.c: Ditto.
* spu/open.c: Ditto.
* spu/read.c: Ditto.
* spu/stat.c: Ditto.
* spu/unlink.c: Ditto.
* spu/write.c: Ditto.
Diffstat (limited to 'libgloss/spu')
-rw-r--r-- | libgloss/spu/access.c | 7 | ||||
-rw-r--r-- | libgloss/spu/close.c | 9 | ||||
-rw-r--r-- | libgloss/spu/dup.c | 7 | ||||
-rw-r--r-- | libgloss/spu/fstat.c | 9 | ||||
-rw-r--r-- | libgloss/spu/ftruncate.c | 7 | ||||
-rw-r--r-- | libgloss/spu/gettimeofday.c | 6 | ||||
-rw-r--r-- | libgloss/spu/jsre.h | 7 | ||||
-rw-r--r-- | libgloss/spu/lseek.c | 6 | ||||
-rw-r--r-- | libgloss/spu/open.c | 8 | ||||
-rw-r--r-- | libgloss/spu/read.c | 7 | ||||
-rw-r--r-- | libgloss/spu/stat.c | 8 | ||||
-rw-r--r-- | libgloss/spu/syscalls.c | 7 | ||||
-rw-r--r-- | libgloss/spu/unlink.c | 9 | ||||
-rw-r--r-- | libgloss/spu/write.c | 7 |
14 files changed, 25 insertions, 79 deletions
diff --git a/libgloss/spu/access.c b/libgloss/spu/access.c index 0b639a9..8b02316 100644 --- a/libgloss/spu/access.c +++ b/libgloss/spu/access.c @@ -35,13 +35,8 @@ int access (const char *pathname, int mode) { syscall_access_t sys; - syscall_out_t *psys_out = ( syscall_out_t* )&sys; sys.pathname = (unsigned int) pathname; sys.mode = mode; - - __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_ACCESS, &sys); - - return ( psys_out->rc); + return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_ACCESS, &sys); } - diff --git a/libgloss/spu/close.c b/libgloss/spu/close.c index 77e3ce1..ea47d02 100644 --- a/libgloss/spu/close.c +++ b/libgloss/spu/close.c @@ -35,13 +35,8 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) int close (int file) { - syscall_close_t sys ; - syscall_out_t *psys_out = ( syscall_out_t* )&sys; + syscall_close_t sys; sys.file = file; - - __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_CLOSE, &sys); - - return ( psys_out->rc); + return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_CLOSE, &sys); } - diff --git a/libgloss/spu/dup.c b/libgloss/spu/dup.c index 3240a0d..2ff7870 100644 --- a/libgloss/spu/dup.c +++ b/libgloss/spu/dup.c @@ -35,12 +35,7 @@ int dup (int oldfd) { syscall_dup_t sys; - syscall_out_t *psys_out = ( syscall_out_t* )&sys; sys.oldfd = oldfd; - - __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_DUP, &sys); - - return ( psys_out->rc); + return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_DUP, &sys); } - diff --git a/libgloss/spu/fstat.c b/libgloss/spu/fstat.c index cef2431..69316d4 100644 --- a/libgloss/spu/fstat.c +++ b/libgloss/spu/fstat.c @@ -37,13 +37,12 @@ int fstat (int file, struct stat *pstat) { syscall_fstat_t sys; - syscall_out_t *psys_out = ( syscall_out_t* )&sys; jsre_stat_t pjstat; + int ret; sys.file = file; sys.ptr = ( unsigned int )&pjstat; - - __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_FSTAT, &sys); + ret = __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_FSTAT, &sys); pstat->st_dev = pjstat.dev; pstat->st_ino = pjstat.ino; @@ -59,7 +58,5 @@ fstat (int file, struct stat *pstat) pstat->st_mtime = pjstat.mtime; pstat->st_ctime = pjstat.ctime; - - return( psys_out->rc ); + return ret; } - diff --git a/libgloss/spu/ftruncate.c b/libgloss/spu/ftruncate.c index 487c70d..47a998f 100644 --- a/libgloss/spu/ftruncate.c +++ b/libgloss/spu/ftruncate.c @@ -35,13 +35,8 @@ int ftruncate (int file, off_t length) { syscall_ftruncate_t sys; - syscall_out_t *psys_out = ( syscall_out_t* )&sys; sys.file = file; sys.length = length; - - __send_to_ppe(JSRE_POSIX1_SIGNALCODE, JSRE_FTRUNCATE, &sys); - - return ( psys_out->rc); + return __send_to_ppe(JSRE_POSIX1_SIGNALCODE, JSRE_FTRUNCATE, &sys); } - diff --git a/libgloss/spu/gettimeofday.c b/libgloss/spu/gettimeofday.c index 91b7353..93051f6 100644 --- a/libgloss/spu/gettimeofday.c +++ b/libgloss/spu/gettimeofday.c @@ -38,12 +38,8 @@ int gettimeofday (struct timeval *tv, struct timezone *tz) { syscall_gettimeofday_t sys; - syscall_out_t *psys_out = ( syscall_out_t* )&sys; sys.tv = (unsigned int)tv; sys.tz = (unsigned int)tz; - - __send_to_ppe(JSRE_POSIX1_SIGNALCODE, JSRE_GETTIMEOFDAY, &sys); - - return (psys_out->rc); + return __send_to_ppe(JSRE_POSIX1_SIGNALCODE, JSRE_GETTIMEOFDAY, &sys); } diff --git a/libgloss/spu/jsre.h b/libgloss/spu/jsre.h index 46f8ee5..f69cd49 100644 --- a/libgloss/spu/jsre.h +++ b/libgloss/spu/jsre.h @@ -165,13 +165,6 @@ typedef struct unsigned int pad1[ 3 ]; } syscall_stat_t; -typedef struct -{ - unsigned int rc; - unsigned int pad0[ 2 ]; - unsigned int err; -} syscall_out_t; - typedef struct { unsigned int dev; unsigned int ino; diff --git a/libgloss/spu/lseek.c b/libgloss/spu/lseek.c index e4e1754..9ba372c 100644 --- a/libgloss/spu/lseek.c +++ b/libgloss/spu/lseek.c @@ -37,7 +37,6 @@ off_t lseek (int file, off_t offset, int whence) { syscall_lseek_t sys; - syscall_out_t *psys_out = ( syscall_out_t* )&sys; sys.file = file; sys.offset = offset; @@ -54,8 +53,5 @@ lseek (int file, off_t offset, int whence) break; } - __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_LSEEK, &sys); - - return ( psys_out->rc); + return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_LSEEK, &sys); } - diff --git a/libgloss/spu/open.c b/libgloss/spu/open.c index c6882bd..46afcab 100644 --- a/libgloss/spu/open.c +++ b/libgloss/spu/open.c @@ -37,8 +37,7 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) int open (const char *filename, int flags, ...) { - syscall_open_t sys ; - syscall_out_t *psys_out = ( syscall_out_t* )&sys; + syscall_open_t sys; va_list ap; sys.pathname = ( unsigned int )filename; @@ -70,8 +69,5 @@ open (const char *filename, int flags, ...) sys.mode = va_arg (ap, int); va_end (ap); - __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_OPEN, &sys); - - return ( psys_out->rc); + return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_OPEN, &sys); } - diff --git a/libgloss/spu/read.c b/libgloss/spu/read.c index 95c25b3..1a75ae0 100644 --- a/libgloss/spu/read.c +++ b/libgloss/spu/read.c @@ -37,14 +37,9 @@ int read (int file, void *ptr, size_t len) { syscall_write_t sys; - syscall_out_t *psys_out = ( syscall_out_t* )&sys; sys.file = file; sys.ptr = ( unsigned int )ptr; sys.len = len; - - __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_READ, &sys); - - return ( psys_out->rc); + return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_READ, &sys); } - diff --git a/libgloss/spu/stat.c b/libgloss/spu/stat.c index ec7ab6d..ad925c6 100644 --- a/libgloss/spu/stat.c +++ b/libgloss/spu/stat.c @@ -38,13 +38,12 @@ int stat (const char *pathname, struct stat *pstat) { syscall_stat_t sys; - syscall_out_t *psys_out = ( syscall_out_t* )&sys; jsre_stat_t pjstat; + int ret; sys.pathname = (unsigned int)pathname; sys.ptr = ( unsigned int )&pjstat; - - __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_STAT, &sys); + ret = __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_STAT, &sys); pstat->st_dev = pjstat.dev; pstat->st_ino = pjstat.ino; @@ -60,6 +59,5 @@ stat (const char *pathname, struct stat *pstat) pstat->st_mtime = pjstat.mtime; pstat->st_ctime = pjstat.ctime; - return( psys_out->rc ); + return ret; } - diff --git a/libgloss/spu/syscalls.c b/libgloss/spu/syscalls.c index e4509c0..f2f2928 100644 --- a/libgloss/spu/syscalls.c +++ b/libgloss/spu/syscalls.c @@ -32,7 +32,7 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) #include <errno.h> #include "jsre.h" -void +int __send_to_ppe (unsigned int signalcode, unsigned int opcode, void *data) { @@ -49,5 +49,10 @@ __send_to_ppe (unsigned int signalcode, unsigned int opcode, void *data) asm ("sync"); f (); errno = ((unsigned int *) data)[3]; + + /* + * Return the rc code stored in slot 0. + */ + return ((unsigned int *) data)[0]; } diff --git a/libgloss/spu/unlink.c b/libgloss/spu/unlink.c index 47b02a6..4a7edef 100644 --- a/libgloss/spu/unlink.c +++ b/libgloss/spu/unlink.c @@ -35,13 +35,8 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) int unlink (const char *pathname) { - syscall_unlink_t sys ; - syscall_out_t *psys_out = ( syscall_out_t* )&sys; + syscall_unlink_t sys; sys.pathname = ( unsigned int )pathname; - - __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_UNLINK, &sys); - - return ( psys_out->rc); + return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_UNLINK, &sys); } - diff --git a/libgloss/spu/write.c b/libgloss/spu/write.c index eec559e..c966342 100644 --- a/libgloss/spu/write.c +++ b/libgloss/spu/write.c @@ -37,14 +37,9 @@ int write (int file, const void *ptr, size_t len) { syscall_write_t sys; - syscall_out_t *psys_out = ( syscall_out_t* )&sys; sys.file = file; sys.ptr = ( unsigned int )ptr; sys.len = len; - - __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_WRITE, &sys); - - return ( psys_out->rc); + return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_WRITE, &sys); } - |