2007-05-23 Patrick Mansfield <patmans@us.ibm.com>
* spu/syscalls.c: Change __send_to_ppe to return the result stored
        in stored in slot 0 of the data, rather than have each assisted
        call retrieve the value.
        * spu/jsre.h: Remove the now unused syscall_out_t.
        * spu/access.c: Use the __send_to_ppe result instead of the slot 0
        value, remove unused syscall_out_t variable.
        * 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:
		| @@ -1,3 +1,23 @@ | |||||||
|  | 2007-05-23 Patrick Mansfield <patmans@us.ibm.com> | ||||||
|  |  | ||||||
|  | 	* spu/syscalls.c: Change __send_to_ppe to return the result stored | ||||||
|  | 	in stored in slot 0 of the data, rather than have each assisted | ||||||
|  | 	call retrieve the value. | ||||||
|  | 	* spu/jsre.h: Remove the now unused syscall_out_t. | ||||||
|  | 	* spu/access.c: Use the __send_to_ppe result instead of the slot 0 | ||||||
|  | 	value, remove unused syscall_out_t variable. | ||||||
|  | 	* 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-05-23  Kazu Hirata  <kazu@codesourcery.com> | 2007-05-23  Kazu Hirata  <kazu@codesourcery.com> | ||||||
|  |  | ||||||
| 	* m68k/fido.sc (.data): Move .jcr to .text.  Catch .got.plt | 	* m68k/fido.sc (.data): Move .jcr to .text.  Catch .got.plt | ||||||
|   | |||||||
| @@ -35,13 +35,8 @@ int | |||||||
| access (const char *pathname, int mode) | access (const char *pathname, int mode) | ||||||
| { | { | ||||||
|         syscall_access_t sys; |         syscall_access_t sys; | ||||||
|         syscall_out_t   *psys_out = ( syscall_out_t* )&sys; |  | ||||||
|  |  | ||||||
|         sys.pathname = (unsigned int) pathname; |         sys.pathname = (unsigned int) pathname; | ||||||
|         sys.mode = mode; |         sys.mode = mode; | ||||||
|  |         return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_ACCESS, &sys); | ||||||
|         __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_ACCESS, &sys); |  | ||||||
|  |  | ||||||
|         return ( psys_out->rc); |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -35,13 +35,8 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) | |||||||
| int | int | ||||||
| close (int file) | close (int file) | ||||||
| { | { | ||||||
|         syscall_close_t sys ; |         syscall_close_t sys; | ||||||
| 	syscall_out_t	*psys_out = ( syscall_out_t* )&sys; |  | ||||||
|  |  | ||||||
| 	sys.file = file; | 	sys.file = file; | ||||||
|  |         return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_CLOSE, &sys); | ||||||
|         __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_CLOSE, &sys); |  | ||||||
|  |  | ||||||
|         return ( psys_out->rc); |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -35,12 +35,7 @@ int | |||||||
| dup (int oldfd) | dup (int oldfd) | ||||||
| { | { | ||||||
|         syscall_dup_t sys; |         syscall_dup_t sys; | ||||||
|         syscall_out_t   *psys_out = ( syscall_out_t* )&sys; |  | ||||||
|  |  | ||||||
|         sys.oldfd = oldfd; |         sys.oldfd = oldfd; | ||||||
|  |         return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_DUP, &sys); | ||||||
|         __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_DUP, &sys); |  | ||||||
|  |  | ||||||
|         return ( psys_out->rc); |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,13 +37,12 @@ int | |||||||
| fstat (int file, struct stat *pstat) | fstat (int file, struct stat *pstat) | ||||||
| { | { | ||||||
|         syscall_fstat_t sys; |         syscall_fstat_t sys; | ||||||
|         syscall_out_t   *psys_out = ( syscall_out_t* )&sys; |  | ||||||
|         jsre_stat_t pjstat; |         jsre_stat_t pjstat; | ||||||
|  |         int ret; | ||||||
|  |  | ||||||
|         sys.file = file; |         sys.file = file; | ||||||
|         sys.ptr = ( unsigned int )&pjstat; |         sys.ptr = ( unsigned int )&pjstat; | ||||||
|  |         ret = __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; | ||||||
| @@ -59,7 +58,5 @@ fstat (int file, struct stat *pstat) | |||||||
|         pstat->st_mtime = pjstat.mtime; |         pstat->st_mtime = pjstat.mtime; | ||||||
|         pstat->st_ctime = pjstat.ctime; |         pstat->st_ctime = pjstat.ctime; | ||||||
|  |  | ||||||
|  |         return ret; | ||||||
|         return( psys_out->rc ); |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -35,13 +35,8 @@ int | |||||||
| ftruncate (int file, off_t length) | ftruncate (int file, off_t length) | ||||||
| { | { | ||||||
| 	syscall_ftruncate_t sys; | 	syscall_ftruncate_t sys; | ||||||
| 	syscall_out_t	*psys_out = ( syscall_out_t* )&sys; |  | ||||||
|  |  | ||||||
| 	sys.file = file; | 	sys.file = file; | ||||||
| 	sys.length = length; | 	sys.length = length; | ||||||
|  | 	return __send_to_ppe(JSRE_POSIX1_SIGNALCODE, JSRE_FTRUNCATE, &sys); | ||||||
| 	__send_to_ppe(JSRE_POSIX1_SIGNALCODE, JSRE_FTRUNCATE, &sys); |  | ||||||
|  |  | ||||||
| 	return ( psys_out->rc); |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -38,12 +38,8 @@ int | |||||||
| gettimeofday (struct timeval *tv, struct timezone *tz) | gettimeofday (struct timeval *tv, struct timezone *tz) | ||||||
| { | { | ||||||
| 	syscall_gettimeofday_t sys; | 	syscall_gettimeofday_t sys; | ||||||
| 	syscall_out_t *psys_out = ( syscall_out_t* )&sys; |  | ||||||
|  |  | ||||||
| 	sys.tv = (unsigned int)tv; | 	sys.tv = (unsigned int)tv; | ||||||
| 	sys.tz = (unsigned int)tz; | 	sys.tz = (unsigned int)tz; | ||||||
|  | 	return __send_to_ppe(JSRE_POSIX1_SIGNALCODE, JSRE_GETTIMEOFDAY, &sys); | ||||||
| 	__send_to_ppe(JSRE_POSIX1_SIGNALCODE, JSRE_GETTIMEOFDAY, &sys); |  | ||||||
|  |  | ||||||
| 	return (psys_out->rc); |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -165,13 +165,6 @@ typedef struct | |||||||
|         unsigned int    pad1[ 3 ]; |         unsigned int    pad1[ 3 ]; | ||||||
| } syscall_stat_t; | } syscall_stat_t; | ||||||
|  |  | ||||||
| typedef struct |  | ||||||
| { |  | ||||||
| 	unsigned int	rc; |  | ||||||
| 	unsigned int	pad0[ 2 ]; |  | ||||||
| 	unsigned int	err; |  | ||||||
| } syscall_out_t; |  | ||||||
|  |  | ||||||
| typedef struct { | typedef struct { | ||||||
|     unsigned int dev; |     unsigned int dev; | ||||||
|     unsigned int ino; |     unsigned int ino; | ||||||
|   | |||||||
| @@ -37,7 +37,6 @@ off_t | |||||||
| lseek (int file, off_t offset, int whence) | lseek (int file, off_t offset, int whence) | ||||||
| { | { | ||||||
|         syscall_lseek_t sys; |         syscall_lseek_t sys; | ||||||
| 	syscall_out_t	*psys_out = ( syscall_out_t* )&sys; |  | ||||||
|  |  | ||||||
| 	sys.file = file; | 	sys.file = file; | ||||||
| 	sys.offset = offset; | 	sys.offset = offset; | ||||||
| @@ -54,8 +53,5 @@ lseek (int file, off_t offset, int whence) | |||||||
| 			break; | 			break; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	__send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_LSEEK, &sys); | 	return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_LSEEK, &sys); | ||||||
|  |  | ||||||
|         return ( psys_out->rc); |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,8 +37,7 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) | |||||||
| int | int | ||||||
| open (const char *filename, int flags, ...) | open (const char *filename, int flags, ...) | ||||||
| { | { | ||||||
|         syscall_open_t sys ; |         syscall_open_t sys; | ||||||
| 	syscall_out_t	*psys_out = ( syscall_out_t* )&sys; |  | ||||||
|         va_list ap; |         va_list ap; | ||||||
|  |  | ||||||
|         sys.pathname = ( unsigned int )filename; |         sys.pathname = ( unsigned int )filename; | ||||||
| @@ -70,8 +69,5 @@ open (const char *filename, int flags, ...) | |||||||
|         sys.mode = va_arg (ap, int); |         sys.mode = va_arg (ap, int); | ||||||
|         va_end (ap); |         va_end (ap); | ||||||
|  |  | ||||||
|         __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_OPEN, &sys); |         return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_OPEN, &sys); | ||||||
|  |  | ||||||
|         return ( psys_out->rc); |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,14 +37,9 @@ int | |||||||
| read (int file, void *ptr, size_t len) | read (int file, void *ptr, size_t len) | ||||||
| { | { | ||||||
|         syscall_write_t sys; |         syscall_write_t sys; | ||||||
| 	syscall_out_t	*psys_out = ( syscall_out_t* )&sys; |  | ||||||
|  |  | ||||||
| 	sys.file = file; | 	sys.file = file; | ||||||
| 	sys.ptr = ( unsigned int )ptr; | 	sys.ptr = ( unsigned int )ptr; | ||||||
| 	sys.len = len; | 	sys.len = len; | ||||||
|  | 	return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_READ, &sys); | ||||||
| 	__send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_READ, &sys); |  | ||||||
|  |  | ||||||
|         return ( psys_out->rc); |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -38,13 +38,12 @@ int | |||||||
| stat (const char *pathname, struct stat *pstat) | stat (const char *pathname, struct stat *pstat) | ||||||
| { | { | ||||||
| 	syscall_stat_t sys; | 	syscall_stat_t sys; | ||||||
| 	syscall_out_t   *psys_out = ( syscall_out_t* )&sys; |  | ||||||
| 	jsre_stat_t pjstat; | 	jsre_stat_t pjstat; | ||||||
|  | 	int ret; | ||||||
|  |  | ||||||
| 	sys.pathname = (unsigned int)pathname; | 	sys.pathname = (unsigned int)pathname; | ||||||
| 	sys.ptr = ( unsigned int )&pjstat; | 	sys.ptr = ( unsigned int )&pjstat; | ||||||
|  | 	ret = __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; | ||||||
| @@ -60,6 +59,5 @@ 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; | ||||||
|  |  | ||||||
| 	return( psys_out->rc ); | 	return ret; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -32,7 +32,7 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) | |||||||
| #include <errno.h> | #include <errno.h> | ||||||
| #include "jsre.h" | #include "jsre.h" | ||||||
|  |  | ||||||
| void | int | ||||||
| __send_to_ppe (unsigned int signalcode, unsigned int opcode, void *data) | __send_to_ppe (unsigned int signalcode, unsigned int opcode, void *data) | ||||||
| { | { | ||||||
|  |  | ||||||
| @@ -49,5 +49,10 @@ __send_to_ppe (unsigned int signalcode, unsigned int opcode, void *data) | |||||||
|         asm ("sync"); |         asm ("sync"); | ||||||
|         f (); |         f (); | ||||||
|         errno = ((unsigned int *) data)[3]; |         errno = ((unsigned int *) data)[3]; | ||||||
|  |  | ||||||
|  |         /* | ||||||
|  |          * Return the rc code stored in slot 0. | ||||||
|  |          */ | ||||||
|  |         return ((unsigned int *) data)[0]; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -35,13 +35,8 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) | |||||||
| int | int | ||||||
| unlink (const char *pathname) | unlink (const char *pathname) | ||||||
| { | { | ||||||
|         syscall_unlink_t sys ; |         syscall_unlink_t sys; | ||||||
| 	syscall_out_t	*psys_out = ( syscall_out_t* )&sys; |  | ||||||
|  |  | ||||||
| 	sys.pathname = ( unsigned int )pathname; | 	sys.pathname = ( unsigned int )pathname; | ||||||
|  |         return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_UNLINK, &sys); | ||||||
|         __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_UNLINK, &sys); |  | ||||||
|  |  | ||||||
|         return ( psys_out->rc); |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -37,14 +37,9 @@ int | |||||||
| write (int file, const void *ptr, size_t len) | write (int file, const void *ptr, size_t len) | ||||||
| { | { | ||||||
|         syscall_write_t sys; |         syscall_write_t sys; | ||||||
| 	syscall_out_t	*psys_out = ( syscall_out_t* )&sys; |  | ||||||
|  |  | ||||||
| 	sys.file = file; | 	sys.file = file; | ||||||
| 	sys.ptr = ( unsigned int )ptr; | 	sys.ptr = ( unsigned int )ptr; | ||||||
| 	sys.len = len; | 	sys.len = len; | ||||||
|  | 	return __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_WRITE, &sys); | ||||||
| 	__send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_WRITE, &sys); |  | ||||||
|  |  | ||||||
|         return ( psys_out->rc); |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user