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.
This commit is contained in:
Jeff Johnston 2007-04-04 20:59:38 +00:00
parent a706aa2e1c
commit c6e05f0d08
15 changed files with 36 additions and 38 deletions

View 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> 2007-03-01 Ben Elliston <bje@au.ibm.com>
* spu/sbrk.c (sbrk): Adjust the stack pointer vector correctly so * spu/sbrk.c (sbrk): Adjust the stack pointer vector correctly so

View File

@ -29,7 +29,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <errno.h>
#include "jsre.h" #include "jsre.h"
int int
@ -41,9 +40,8 @@ access (const char *pathname, int mode)
sys.pathname = (unsigned int) pathname; sys.pathname = (unsigned int) pathname;
sys.mode = mode; 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); return ( psys_out->rc);
} }

View File

@ -30,7 +30,6 @@ POSSIBILITY OF SUCH DAMAGE.
Author: Andreas Neukoetter (ti95neuk@de.ibm.com) Author: Andreas Neukoetter (ti95neuk@de.ibm.com)
*/ */
#include <errno.h>
#include "jsre.h" #include "jsre.h"
int int
@ -41,9 +40,8 @@ close (int file)
sys.file = 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); return ( psys_out->rc);
} }

View File

@ -29,7 +29,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <errno.h>
#include "jsre.h" #include "jsre.h"
int int
@ -40,9 +39,8 @@ dup (int oldfd)
sys.oldfd = 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); return ( psys_out->rc);
} }

View File

@ -31,7 +31,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com)
*/ */
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h>
#include "jsre.h" #include "jsre.h"
int int
@ -44,7 +43,7 @@ fstat (int file, struct stat *pstat)
sys.file = file; sys.file = file;
sys.ptr = ( unsigned int )&pjstat; 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_dev = pjstat.dev;
pstat->st_ino = pjstat.ino; pstat->st_ino = pjstat.ino;
@ -61,7 +60,6 @@ fstat (int file, struct stat *pstat)
pstat->st_ctime = pjstat.ctime; pstat->st_ctime = pjstat.ctime;
errno = psys_out->err;
return( psys_out->rc ); return( psys_out->rc );
} }

View File

@ -29,7 +29,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include "jsre.h" #include "jsre.h"
int int
@ -41,9 +40,8 @@ ftruncate (int file, off_t length)
sys.file = file; sys.file = file;
sys.length = length; 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); return ( psys_out->rc);
} }

View File

@ -43,8 +43,7 @@ gettimeofday (struct timeval *tv, struct timezone *tz)
sys.tv = (unsigned int)tv; sys.tv = (unsigned int)tv;
sys.tz = (unsigned int)tz; 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); return (psys_out->rc);
} }

View File

@ -188,6 +188,6 @@ typedef struct {
unsigned int ctime; unsigned int ctime;
} jsre_stat_t; } jsre_stat_t;
void _send_to_ppe (unsigned int signalcode, unsigned int opcode, void *data); #include <sys/syscall.h>
#endif #endif

View File

@ -31,7 +31,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com)
*/ */
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include "jsre.h" #include "jsre.h"
off_t off_t
@ -55,9 +54,8 @@ lseek (int file, off_t offset, int whence)
break; 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); return ( psys_out->rc);
} }

View File

@ -32,7 +32,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com)
#include <stdarg.h> #include <stdarg.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h>
#include "jsre.h" #include "jsre.h"
int int
@ -81,9 +80,8 @@ open (const char *filename, int flags, ...)
sys.mode = 0; 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); return ( psys_out->rc);
} }

View File

@ -31,7 +31,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com)
*/ */
#include <fcntl.h> #include <fcntl.h>
#include <errno.h>
#include "jsre.h" #include "jsre.h"
int int
@ -44,9 +43,8 @@ read (int file, void *ptr, size_t len)
sys.ptr = ( unsigned int )ptr; sys.ptr = ( unsigned int )ptr;
sys.len = len; 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); return ( psys_out->rc);
} }

View File

@ -32,7 +32,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com)
#include <stdarg.h> #include <stdarg.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h>
#include "jsre.h" #include "jsre.h"
int int
@ -45,7 +44,7 @@ stat (const char *pathname, struct stat *pstat)
sys.pathname = (unsigned int)pathname; sys.pathname = (unsigned int)pathname;
sys.ptr = ( unsigned int )&pjstat; 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_dev = pjstat.dev;
pstat->st_ino = pjstat.ino; pstat->st_ino = pjstat.ino;
@ -61,7 +60,6 @@ stat (const char *pathname, struct stat *pstat)
pstat->st_mtime = pjstat.mtime; pstat->st_mtime = pjstat.mtime;
pstat->st_ctime = pjstat.ctime; pstat->st_ctime = pjstat.ctime;
errno = psys_out->err;
return( psys_out->rc ); return( psys_out->rc );
} }

View File

@ -29,10 +29,11 @@ POSSIBILITY OF SUCH DAMAGE.
Author: Andreas Neukoetter (ti95neuk@de.ibm.com) Author: Andreas Neukoetter (ti95neuk@de.ibm.com)
*/ */
#include <errno.h>
#include "jsre.h" #include "jsre.h"
void 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 ); 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; void (*f) (void) = (void *) &stopfunc;
asm ("sync"); asm ("sync");
return (f ()); f ();
errno = ((unsigned int *) data)[3];
} }

View File

@ -30,7 +30,6 @@ POSSIBILITY OF SUCH DAMAGE.
Author: Andreas Neukoetter (ti95neuk@de.ibm.com) Author: Andreas Neukoetter (ti95neuk@de.ibm.com)
*/ */
#include <errno.h>
#include "jsre.h" #include "jsre.h"
int int
@ -41,9 +40,8 @@ unlink (const char *pathname)
sys.pathname = ( unsigned int )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); return ( psys_out->rc);
} }

View File

@ -31,7 +31,6 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com)
*/ */
#include <fcntl.h> #include <fcntl.h>
#include <errno.h>
#include "jsre.h" #include "jsre.h"
int int
@ -44,9 +43,8 @@ write (int file, const void *ptr, size_t len)
sys.ptr = ( unsigned int )ptr; sys.ptr = ( unsigned int )ptr;
sys.len = len; 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); return ( psys_out->rc);
} }