OSDN Git Service

2007-04-04 Patrick Mansfield <patmans@us.ibm.com>
authorjjohnstn <jjohnstn>
Wed, 4 Apr 2007 20:59:38 +0000 (20:59 +0000)
committerjjohnstn <jjohnstn>
Wed, 4 Apr 2007 20:59:38 +0000 (20:59 +0000)
        * 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.

15 files changed:
libgloss/ChangeLog
libgloss/spu/access.c
libgloss/spu/close.c
libgloss/spu/dup.c
libgloss/spu/fstat.c
libgloss/spu/ftruncate.c
libgloss/spu/gettimeofday.c
libgloss/spu/jsre.h
libgloss/spu/lseek.c
libgloss/spu/open.c
libgloss/spu/read.c
libgloss/spu/stat.c
libgloss/spu/syscalls.c
libgloss/spu/unlink.c
libgloss/spu/write.c

index dd3730a..a80ed95 100644 (file)
@@ -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
index ae3ab2d..0b639a9 100644 (file)
@@ -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);
 }
 
index 2de16d0..77e3ce1 100644 (file)
@@ -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);
 }
 
index 86562e7..3240a0d 100644 (file)
@@ -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);
 }
 
index cd58c29..cef2431 100644 (file)
@@ -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 );
 }
 
index 4f05bef..487c70d 100644 (file)
@@ -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);
 }
 
index 78f26a2..91b7353 100644 (file)
@@ -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);
 }
index f2dda3d..46f8ee5 100644 (file)
@@ -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
index 7c3f451..e4e1754 100644 (file)
@@ -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);
 }
 
index af048a8..c005f1d 100644 (file)
@@ -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);
 }
 
index 178e850..95c25b3 100644 (file)
@@ -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);
 }
 
index 5dbae8a..ec7ab6d 100644 (file)
@@ -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 );
 }
 
index ff4f551..e4509c0 100644 (file)
@@ -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];
 }
 
index 6d143ca..47b02a6 100644 (file)
@@ -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);
 }
 
index 4952f67..eec559e 100644 (file)
@@ -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);
 }