From c6e05f0d080e0d5c7e1458b41f3211feace794ef Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 4 Apr 2007 20:59:38 +0000 Subject: 2007-04-04 Patrick Mansfield * 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. --- libgloss/ChangeLog | 19 +++++++++++++++++++ libgloss/spu/access.c | 4 +--- libgloss/spu/close.c | 4 +--- libgloss/spu/dup.c | 4 +--- libgloss/spu/fstat.c | 4 +--- libgloss/spu/ftruncate.c | 4 +--- libgloss/spu/gettimeofday.c | 3 +-- libgloss/spu/jsre.h | 2 +- libgloss/spu/lseek.c | 4 +--- libgloss/spu/open.c | 4 +--- libgloss/spu/read.c | 4 +--- libgloss/spu/stat.c | 4 +--- libgloss/spu/syscalls.c | 6 ++++-- libgloss/spu/unlink.c | 4 +--- libgloss/spu/write.c | 4 +--- 15 files changed, 36 insertions(+), 38 deletions(-) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index dd3730aba..a80ed950a 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,22 @@ +2007-04-04 Patrick Mansfield + + * 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 * spu/sbrk.c (sbrk): Adjust the stack pointer vector correctly so diff --git a/libgloss/spu/access.c b/libgloss/spu/access.c index ae3ab2d7f..0b639a981 100644 --- a/libgloss/spu/access.c +++ b/libgloss/spu/access.c @@ -29,7 +29,6 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include #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 2de16d0e5..77e3ce177 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 #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 86562e7c5..3240a0da5 100644 --- a/libgloss/spu/dup.c +++ b/libgloss/spu/dup.c @@ -29,7 +29,6 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include #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 cd58c2928..cef243161 100644 --- a/libgloss/spu/fstat.c +++ b/libgloss/spu/fstat.c @@ -31,7 +31,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ #include -#include #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 4f05bef5e..487c70dac 100644 --- a/libgloss/spu/ftruncate.c +++ b/libgloss/spu/ftruncate.c @@ -29,7 +29,6 @@ POSSIBILITY OF SUCH DAMAGE. */ #include -#include #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 78f26a25c..91b73535a 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 f2dda3d13..46f8ee539 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 #endif diff --git a/libgloss/spu/lseek.c b/libgloss/spu/lseek.c index 7c3f451ea..e4e1754fa 100644 --- a/libgloss/spu/lseek.c +++ b/libgloss/spu/lseek.c @@ -31,7 +31,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ #include -#include #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 af048a8a2..c005f1d0a 100644 --- a/libgloss/spu/open.c +++ b/libgloss/spu/open.c @@ -32,7 +32,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) #include #include -#include #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 178e85087..95c25b36f 100644 --- a/libgloss/spu/read.c +++ b/libgloss/spu/read.c @@ -31,7 +31,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ #include -#include #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 5dbae8ac8..ec7ab6d3a 100644 --- a/libgloss/spu/stat.c +++ b/libgloss/spu/stat.c @@ -32,7 +32,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) #include #include -#include #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 ff4f5515d..e4509c097 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 #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 6d143ca54..47b02a6a4 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 #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 4952f670c..eec559e97 100644 --- a/libgloss/spu/write.c +++ b/libgloss/spu/write.c @@ -31,7 +31,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ #include -#include #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); } -- cgit v1.2.3