Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2007-04-05 00:59:38 +0400
committerJeff Johnston <jjohnstn@redhat.com>2007-04-05 00:59:38 +0400
commitc6e05f0d080e0d5c7e1458b41f3211feace794ef (patch)
tree9c93e73372828515b3379031732a96bbcd260e82 /libgloss/spu
parenta706aa2e1c7326e8ed46353f3b11b6cc89e7d38f (diff)
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.
Diffstat (limited to 'libgloss/spu')
-rw-r--r--libgloss/spu/access.c4
-rw-r--r--libgloss/spu/close.c4
-rw-r--r--libgloss/spu/dup.c4
-rw-r--r--libgloss/spu/fstat.c4
-rw-r--r--libgloss/spu/ftruncate.c4
-rw-r--r--libgloss/spu/gettimeofday.c3
-rw-r--r--libgloss/spu/jsre.h2
-rw-r--r--libgloss/spu/lseek.c4
-rw-r--r--libgloss/spu/open.c4
-rw-r--r--libgloss/spu/read.c4
-rw-r--r--libgloss/spu/stat.c4
-rw-r--r--libgloss/spu/syscalls.c6
-rw-r--r--libgloss/spu/unlink.c4
-rw-r--r--libgloss/spu/write.c4
14 files changed, 17 insertions, 38 deletions
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 <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 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 <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 86562e7c5..3240a0da5 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 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 <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 4f05bef5e..487c70dac 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 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 <sys/syscall.h>
#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 <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 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 <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 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 <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 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 <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 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 <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 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 <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 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 <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);
}