diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2007-04-04 20:59:38 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2007-04-04 20:59:38 +0000 |
commit | c6e05f0d080e0d5c7e1458b41f3211feace794ef (patch) | |
tree | 9c93e73372828515b3379031732a96bbcd260e82 | |
parent | a706aa2e1c7326e8ed46353f3b11b6cc89e7d38f (diff) | |
download | newlib-c6e05f0d080e0d5c7e1458b41f3211feace794ef.zip newlib-c6e05f0d080e0d5c7e1458b41f3211feace794ef.tar.gz newlib-c6e05f0d080e0d5c7e1458b41f3211feace794ef.tar.bz2 |
2007-04-04 Patrick Mansfield <patmans@us.ibm.com>
* spu/syscalls.c: Rename _send_to_ppe __send_to_ppe, and set errno
on return from the offload call.
* spu/jsre.h: Include sys/syscall.h for the send_to_ppe prototype.
* spu/access.c: Call __send_to_ppe instead of _send_to_ppe, and
remove the setting of errno.
* 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.
-rw-r--r-- | libgloss/ChangeLog | 19 | ||||
-rw-r--r-- | libgloss/spu/access.c | 4 | ||||
-rw-r--r-- | libgloss/spu/close.c | 4 | ||||
-rw-r--r-- | libgloss/spu/dup.c | 4 | ||||
-rw-r--r-- | libgloss/spu/fstat.c | 4 | ||||
-rw-r--r-- | libgloss/spu/ftruncate.c | 4 | ||||
-rw-r--r-- | libgloss/spu/gettimeofday.c | 3 | ||||
-rw-r--r-- | libgloss/spu/jsre.h | 2 | ||||
-rw-r--r-- | libgloss/spu/lseek.c | 4 | ||||
-rw-r--r-- | libgloss/spu/open.c | 4 | ||||
-rw-r--r-- | libgloss/spu/read.c | 4 | ||||
-rw-r--r-- | libgloss/spu/stat.c | 4 | ||||
-rw-r--r-- | libgloss/spu/syscalls.c | 6 | ||||
-rw-r--r-- | libgloss/spu/unlink.c | 4 | ||||
-rw-r--r-- | libgloss/spu/write.c | 4 |
15 files changed, 36 insertions, 38 deletions
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index dd3730a..a80ed95 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,22 @@ +2007-04-04 Patrick Mansfield <patmans@us.ibm.com> + + * spu/syscalls.c: Rename _send_to_ppe __send_to_ppe, and set errno + on return from the offload call. + * spu/jsre.h: Include sys/syscall.h for the send_to_ppe prototype. + * spu/access.c: Call __send_to_ppe instead of _send_to_ppe, and + remove the setting of errno. + * 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. + 2007-03-01 Ben Elliston <bje@au.ibm.com> * spu/sbrk.c (sbrk): Adjust the stack pointer vector correctly so diff --git a/libgloss/spu/access.c b/libgloss/spu/access.c index ae3ab2d..0b639a9 100644 --- a/libgloss/spu/access.c +++ b/libgloss/spu/access.c @@ -29,7 +29,6 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <errno.h> #include "jsre.h" int @@ -41,9 +40,8 @@ access (const char *pathname, int mode) sys.pathname = (unsigned int) pathname; sys.mode = mode; - _send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_ACCESS, &sys); + __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_ACCESS, &sys); - errno = psys_out->err; return ( psys_out->rc); } diff --git a/libgloss/spu/close.c b/libgloss/spu/close.c index 2de16d0..77e3ce1 100644 --- a/libgloss/spu/close.c +++ b/libgloss/spu/close.c @@ -30,7 +30,6 @@ POSSIBILITY OF SUCH DAMAGE. Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ -#include <errno.h> #include "jsre.h" int @@ -41,9 +40,8 @@ close (int file) sys.file = file; - _send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_CLOSE, &sys); + __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_CLOSE, &sys); - errno = psys_out->err; return ( psys_out->rc); } diff --git a/libgloss/spu/dup.c b/libgloss/spu/dup.c index 86562e7..3240a0d 100644 --- a/libgloss/spu/dup.c +++ b/libgloss/spu/dup.c @@ -29,7 +29,6 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include <errno.h> #include "jsre.h" int @@ -40,9 +39,8 @@ dup (int oldfd) sys.oldfd = oldfd; - _send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_DUP, &sys); + __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_DUP, &sys); - errno = psys_out->err; return ( psys_out->rc); } diff --git a/libgloss/spu/fstat.c b/libgloss/spu/fstat.c index cd58c29..cef2431 100644 --- a/libgloss/spu/fstat.c +++ b/libgloss/spu/fstat.c @@ -31,7 +31,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ #include <sys/stat.h> -#include <errno.h> #include "jsre.h" int @@ -44,7 +43,7 @@ fstat (int file, struct stat *pstat) sys.file = file; sys.ptr = ( unsigned int )&pjstat; - _send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_FSTAT, &sys); + __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_FSTAT, &sys); pstat->st_dev = pjstat.dev; pstat->st_ino = pjstat.ino; @@ -61,7 +60,6 @@ fstat (int file, struct stat *pstat) pstat->st_ctime = pjstat.ctime; - errno = psys_out->err; return( psys_out->rc ); } diff --git a/libgloss/spu/ftruncate.c b/libgloss/spu/ftruncate.c index 4f05bef..487c70d 100644 --- a/libgloss/spu/ftruncate.c +++ b/libgloss/spu/ftruncate.c @@ -29,7 +29,6 @@ POSSIBILITY OF SUCH DAMAGE. */ #include <unistd.h> -#include <errno.h> #include "jsre.h" int @@ -41,9 +40,8 @@ ftruncate (int file, off_t length) sys.file = file; sys.length = length; - _send_to_ppe(JSRE_POSIX1_SIGNALCODE, JSRE_FTRUNCATE, &sys); + __send_to_ppe(JSRE_POSIX1_SIGNALCODE, JSRE_FTRUNCATE, &sys); - errno = psys_out->err; return ( psys_out->rc); } diff --git a/libgloss/spu/gettimeofday.c b/libgloss/spu/gettimeofday.c index 78f26a2..91b7353 100644 --- a/libgloss/spu/gettimeofday.c +++ b/libgloss/spu/gettimeofday.c @@ -43,8 +43,7 @@ gettimeofday (struct timeval *tv, struct timezone *tz) sys.tv = (unsigned int)tv; sys.tz = (unsigned int)tz; - _send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_GETTIMEOFDAY, &sys); + __send_to_ppe(JSRE_POSIX1_SIGNALCODE, JSRE_GETTIMEOFDAY, &sys); - errno = psys_out->err; return (psys_out->rc); } diff --git a/libgloss/spu/jsre.h b/libgloss/spu/jsre.h index f2dda3d..46f8ee5 100644 --- a/libgloss/spu/jsre.h +++ b/libgloss/spu/jsre.h @@ -188,6 +188,6 @@ typedef struct { unsigned int ctime; } jsre_stat_t; -void _send_to_ppe (unsigned int signalcode, unsigned int opcode, void *data); +#include <sys/syscall.h> #endif diff --git a/libgloss/spu/lseek.c b/libgloss/spu/lseek.c index 7c3f451..e4e1754 100644 --- a/libgloss/spu/lseek.c +++ b/libgloss/spu/lseek.c @@ -31,7 +31,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ #include <unistd.h> -#include <errno.h> #include "jsre.h" off_t @@ -55,9 +54,8 @@ lseek (int file, off_t offset, int whence) break; } - _send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_LSEEK, &sys); + __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_LSEEK, &sys); - errno = psys_out->err; return ( psys_out->rc); } diff --git a/libgloss/spu/open.c b/libgloss/spu/open.c index af048a8..c005f1d 100644 --- a/libgloss/spu/open.c +++ b/libgloss/spu/open.c @@ -32,7 +32,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) #include <stdarg.h> #include <fcntl.h> -#include <errno.h> #include "jsre.h" int @@ -81,9 +80,8 @@ open (const char *filename, int flags, ...) sys.mode = 0; } - _send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_OPEN, &sys); + __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_OPEN, &sys); - errno = psys_out->err; return ( psys_out->rc); } diff --git a/libgloss/spu/read.c b/libgloss/spu/read.c index 178e850..95c25b3 100644 --- a/libgloss/spu/read.c +++ b/libgloss/spu/read.c @@ -31,7 +31,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ #include <fcntl.h> -#include <errno.h> #include "jsre.h" int @@ -44,9 +43,8 @@ read (int file, void *ptr, size_t len) sys.ptr = ( unsigned int )ptr; sys.len = len; - _send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_READ, &sys); + __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_READ, &sys); - errno = psys_out->err; return ( psys_out->rc); } diff --git a/libgloss/spu/stat.c b/libgloss/spu/stat.c index 5dbae8a..ec7ab6d 100644 --- a/libgloss/spu/stat.c +++ b/libgloss/spu/stat.c @@ -32,7 +32,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) #include <stdarg.h> #include <fcntl.h> -#include <errno.h> #include "jsre.h" int @@ -45,7 +44,7 @@ stat (const char *pathname, struct stat *pstat) sys.pathname = (unsigned int)pathname; sys.ptr = ( unsigned int )&pjstat; - _send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_STAT, &sys); + __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_STAT, &sys); pstat->st_dev = pjstat.dev; pstat->st_ino = pjstat.ino; @@ -61,7 +60,6 @@ stat (const char *pathname, struct stat *pstat) pstat->st_mtime = pjstat.mtime; pstat->st_ctime = pjstat.ctime; - errno = psys_out->err; return( psys_out->rc ); } diff --git a/libgloss/spu/syscalls.c b/libgloss/spu/syscalls.c index ff4f551..e4509c0 100644 --- a/libgloss/spu/syscalls.c +++ b/libgloss/spu/syscalls.c @@ -29,10 +29,11 @@ POSSIBILITY OF SUCH DAMAGE. Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ +#include <errno.h> #include "jsre.h" void -_send_to_ppe (unsigned int signalcode, unsigned int opcode, void *data) +__send_to_ppe (unsigned int signalcode, unsigned int opcode, void *data) { unsigned int combined = ( ( opcode<<24 )&0xff000000 ) | ( ( unsigned int )data & 0x00ffffff ); @@ -46,6 +47,7 @@ _send_to_ppe (unsigned int signalcode, unsigned int opcode, void *data) void (*f) (void) = (void *) &stopfunc; asm ("sync"); - return (f ()); + f (); + errno = ((unsigned int *) data)[3]; } diff --git a/libgloss/spu/unlink.c b/libgloss/spu/unlink.c index 6d143ca..47b02a6 100644 --- a/libgloss/spu/unlink.c +++ b/libgloss/spu/unlink.c @@ -30,7 +30,6 @@ POSSIBILITY OF SUCH DAMAGE. Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ -#include <errno.h> #include "jsre.h" int @@ -41,9 +40,8 @@ unlink (const char *pathname) sys.pathname = ( unsigned int )pathname; - _send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_UNLINK, &sys); + __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_UNLINK, &sys); - errno = psys_out->err; return ( psys_out->rc); } diff --git a/libgloss/spu/write.c b/libgloss/spu/write.c index 4952f67..eec559e 100644 --- a/libgloss/spu/write.c +++ b/libgloss/spu/write.c @@ -31,7 +31,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ #include <fcntl.h> -#include <errno.h> #include "jsre.h" int @@ -44,9 +43,8 @@ write (int file, const void *ptr, size_t len) sys.ptr = ( unsigned int )ptr; sys.len = len; - _send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_WRITE, &sys); + __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_WRITE, &sys); - errno = psys_out->err; return ( psys_out->rc); } |