+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
*/
-#include <errno.h>
#include "jsre.h"
int
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);
}
Author: Andreas Neukoetter (ti95neuk@de.ibm.com)
*/
-#include <errno.h>
#include "jsre.h"
int
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);
}
*/
-#include <errno.h>
#include "jsre.h"
int
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);
}
*/
#include <sys/stat.h>
-#include <errno.h>
#include "jsre.h"
int
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;
pstat->st_ctime = pjstat.ctime;
- errno = psys_out->err;
return( psys_out->rc );
}
*/
#include <unistd.h>
-#include <errno.h>
#include "jsre.h"
int
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);
}
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);
}
unsigned int ctime;
} jsre_stat_t;
-void _send_to_ppe (unsigned int signalcode, unsigned int opcode, void *data);
+#include <sys/syscall.h>
#endif
*/
#include <unistd.h>
-#include <errno.h>
#include "jsre.h"
off_t
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);
}
#include <stdarg.h>
#include <fcntl.h>
-#include <errno.h>
#include "jsre.h"
int
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);
}
*/
#include <fcntl.h>
-#include <errno.h>
#include "jsre.h"
int
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);
}
#include <stdarg.h>
#include <fcntl.h>
-#include <errno.h>
#include "jsre.h"
int
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;
pstat->st_mtime = pjstat.mtime;
pstat->st_ctime = pjstat.ctime;
- errno = psys_out->err;
return( psys_out->rc );
}
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 );
void (*f) (void) = (void *) &stopfunc;
asm ("sync");
- return (f ());
+ f ();
+ errno = ((unsigned int *) data)[3];
}
Author: Andreas Neukoetter (ti95neuk@de.ibm.com)
*/
-#include <errno.h>
#include "jsre.h"
int
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);
}
*/
#include <fcntl.h>
-#include <errno.h>
#include "jsre.h"
int
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);
}