[Cbe-oss-dev] [PATCH 2] libspe2: remove CHECK_nnn_OPCODE to fix waitpid
Patrick Mansfield
patmans at us.ibm.com
Wed May 16 03:35:48 EST 2007
The waitpid handler is checking for the wrong opcode, it should be
CHECK_POSIX1_OPCODE(WAITPID) not CHECK_POSIX1_OPCODE(WAIT).
That could be simply fixed, but on failure returning 1 from the handler
does not do anything - neither the return code (rc) nor errno are set -
and the SPE/newlib code ends up with whatever values were passed to the
assist call (garbage data for errno, and whatever the first argument was
for the rc). There is no common rc value that can be used as the rc, like
-1 (for the C99 or POSIX functions).
So just remove the opcode checks both CHECK_C99_OPCODE and
CHECK_POSIX1_OPCODE.
Only patching libspe2, that is the only difference from the last posting.
Signed-off-by: Patrick Mansfield <patmans at us.ibm.com>
Index: libspe2/spebase/default_c99_handler.c
===================================================================
--- libspe2.orig/spebase/default_c99_handler.c
+++ libspe2/spebase/default_c99_handler.c
@@ -154,12 +154,6 @@ static FILE *spe_FILE_ptrs[SPE_FOPEN_MAX
typedef unsigned long long __va_elem;
-#define CHECK_C99_OPCODE(_op) \
- if (SPE_C99_OP(opdata) != SPE_C99_ ## _op) { \
- DEBUG_PRINTF("OPCODE (0x%x) mismatch.\n", SPE_C99_OP(opdata)); \
- return 1; \
- }
-
/* Allocate stack space for vargs array. */
#define __VA_LIST_ALIGN 16UL
@@ -782,7 +776,6 @@ int default_c99_handler_remove(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(REMOVE);
path = GET_LS_PTR(arg0->slot[0]);
rc = remove(path);
PUT_LS_RC(rc, 0, 0, errno);
@@ -808,7 +801,6 @@ int default_c99_handler_rename(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(RENAME);
oldname = GET_LS_PTR(arg0->slot[0]);
newname = GET_LS_PTR(arg1->slot[0]);
rc = rename(oldname, newname);
@@ -833,7 +825,6 @@ int default_c99_handler_tmpfile(char *ls
int i;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(TMPFILE);
if (nr_spe_FILE_ptrs >= SPE_FOPEN_MAX) {
PUT_LS_RC(0, 0, 0, EMFILE);
} else {
@@ -874,7 +865,6 @@ int default_c99_handler_tmpnam(char *ls,
DECL_RET();
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(TMPNAM);
PUT_LS_RC(0, 0, 0, 0);
return 0;
}
@@ -897,7 +887,6 @@ int default_c99_handler_fclose(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FCLOSE);
stream = get_FILE(arg0->slot[0]);
pthread_mutex_lock(&spe_c99_file_mutex);
rc = fclose(stream);
@@ -928,7 +917,6 @@ int default_c99_handler_fflush(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FFLUSH);
stream = get_FILE(arg0->slot[0]);
rc = fflush(stream);
PUT_LS_RC(rc, 0, 0, errno);
@@ -955,7 +943,6 @@ int default_c99_handler_fopen(char *ls,
int i, rc = 0, err = EMFILE;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FOPEN);
path = GET_LS_PTR(arg0->slot[0]);
mode = GET_LS_PTR(arg1->slot[0]);
pthread_mutex_lock(&spe_c99_file_mutex);
@@ -997,7 +984,6 @@ int default_c99_handler_freopen(char *ls
int i;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FREOPEN);
i = arg2->slot[0];
if ((i <= 0) || (i >= SPE_FOPEN_MAX)) {
PUT_LS_RC(1, 0, 0, EBADF);
@@ -1033,7 +1019,6 @@ int default_c99_handler_setbuf(char *ls,
char *buf;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(SETBUF);
stream = get_FILE(arg0->slot[0]);
buf = GET_LS_PTR_NULL(arg1->slot[0]);
setvbuf(stream, buf, buf ? _IOFBF : _IONBF, SPE_STDIO_BUFSIZ);
@@ -1061,7 +1046,6 @@ int default_c99_handler_setvbuf(char *ls
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(SETVBUF);
stream = get_FILE(arg0->slot[0]);
buf = GET_LS_PTR_NULL(arg1->slot[0]);
mode = arg2->slot[0];
@@ -1092,7 +1076,6 @@ int default_c99_handler_vfprintf(char *l
__va_elem *vlist;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(VFPRINTF);
stream = get_FILE(arg0->slot[0]);
format = GET_LS_PTR(arg1->slot[0]);
memcpy(&spe_vlist, arg2, sizeof(struct spe_va_list));
@@ -1126,7 +1109,6 @@ int default_c99_handler_vfscanf(char *ls
struct __va_temp *vtemps;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(VFSCANF);
stream = get_FILE(arg0->slot[0]);
format = GET_LS_PTR(arg1->slot[0]);
memcpy(&spe_vlist, arg2, sizeof(struct spe_va_list));
@@ -1166,7 +1148,6 @@ int default_c99_handler_vprintf(char *ls
__va_elem *vlist;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(VPRINTF);
stream = get_FILE(SPE_STDOUT);
format = GET_LS_PTR(arg0->slot[0]);
memcpy(&spe_vlist, arg1, sizeof(struct spe_va_list));
@@ -1200,7 +1181,6 @@ int default_c99_handler_vscanf(char *ls,
struct __va_temp *vtemps;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(VSCANF);
stream = get_FILE(SPE_STDIN);
format = GET_LS_PTR(arg0->slot[0]);
memcpy(&spe_vlist, arg1, sizeof(struct spe_va_list));
@@ -1241,7 +1221,6 @@ int default_c99_handler_vsnprintf(char *
__va_elem *vlist;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(VSNPRINTF);
str = GET_LS_PTR(arg0->slot[0]);
size = arg1->slot[0];
format = GET_LS_PTR(arg2->slot[0]);
@@ -1275,7 +1254,6 @@ int default_c99_handler_vsprintf(char *l
__va_elem *vlist;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(VSPRINTF);
str = GET_LS_PTR(arg0->slot[0]);
format = GET_LS_PTR(arg1->slot[0]);
memcpy(&spe_vlist, arg2, sizeof(struct spe_va_list));
@@ -1309,7 +1287,6 @@ int default_c99_handler_vsscanf(char *ls
struct __va_temp *vtemps;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(VSSCANF);
str = GET_LS_PTR(arg0->slot[0]);
format = GET_LS_PTR(arg1->slot[0]);
memcpy(&spe_vlist, arg2, sizeof(struct spe_va_list));
@@ -1346,7 +1323,6 @@ int default_c99_handler_fgetc(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FGETC);
stream = get_FILE(arg0->slot[0]);
rc = fgetc(stream);
PUT_LS_RC(rc, 0, 0, errno);
@@ -1373,7 +1349,6 @@ int default_c99_handler_fgets(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FGETS);
s = GET_LS_PTR(arg0->slot[0]);
size = arg1->slot[0];
stream = get_FILE(arg2->slot[0]);
@@ -1399,7 +1374,6 @@ int default_c99_handler_fileno(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FILENO);
stream = get_FILE(arg0->slot[0]);
rc = fileno(stream);
PUT_LS_RC(rc, 0, 0, errno);
@@ -1425,7 +1399,6 @@ int default_c99_handler_fputc(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FPUTC);
c = arg0->slot[0];
stream = get_FILE(arg1->slot[0]);
rc = fputc(c, stream);
@@ -1452,7 +1425,6 @@ int default_c99_handler_fputs(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FPUTS);
s = GET_LS_PTR(arg0->slot[0]);
stream = get_FILE(arg1->slot[0]);
rc = fputs(s, stream);
@@ -1478,7 +1450,6 @@ int default_c99_handler_getc(char *ls, u
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(GETC);
stream = get_FILE(arg0->slot[0]);
rc = getc(stream);
PUT_LS_RC(rc, 0, 0, errno);
@@ -1503,7 +1474,6 @@ int default_c99_handler_getchar(char *ls
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(GETCHAR);
stream = get_FILE(SPE_STDIN);
rc = getc(stream);
PUT_LS_RC(rc, 0, 0, errno);
@@ -1534,7 +1504,6 @@ int default_c99_handler_gets(char *ls, u
int size;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(GETS);
stream = get_FILE(SPE_STDIN);
s = GET_LS_PTR(arg0->slot[0]);
size = LS_SIZE - arg0->slot[0];
@@ -1566,7 +1535,6 @@ int default_c99_handler_putc(char *ls, u
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(PUTC);
f = get_FILE(arg1->slot[0]);
rc = putc(arg0->slot[0], f);
PUT_LS_RC(rc, 0, 0, errno);
@@ -1591,7 +1559,6 @@ int default_c99_handler_putchar(char *ls
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(PUTCHAR);
stream = get_FILE(SPE_STDOUT);
rc = putc(arg0->slot[0], stream);
PUT_LS_RC(rc, 0, 0, errno);
@@ -1616,7 +1583,6 @@ int default_c99_handler_puts(char *ls, u
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(PUTS);
s = GET_LS_PTR(arg0->slot[0]);
rc = puts(s);
PUT_LS_RC(rc, 0, 0, errno);
@@ -1641,7 +1607,6 @@ int default_c99_handler_ungetc(char *ls,
int rc, c;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(UNGETC);
c = arg0->slot[0];
stream = get_FILE(arg1->slot[0]);
rc = ungetc(c, stream);
@@ -1669,7 +1634,6 @@ int default_c99_handler_fread(char *ls,
int rc = 0;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FREAD);
ptr = GET_LS_PTR(arg0->slot[0]);
size = arg1->slot[0];
nmemb = arg2->slot[0];
@@ -1699,7 +1663,6 @@ int default_c99_handler_fwrite(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FWRITE);
ptr = GET_LS_PTR(arg0->slot[0]);
size = arg1->slot[0];
nmemb = arg2->slot[0];
@@ -1728,7 +1691,6 @@ int default_c99_handler_fgetpos(char *ls
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FGETPOS);
stream = get_FILE(arg0->slot[0]);
pos = (fpos_t *) GET_LS_PTR(arg1->slot[0]);
rc = fgetpos(stream, pos);
@@ -1756,7 +1718,6 @@ int default_c99_handler_fseek(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FSEEK);
stream = get_FILE(arg0->slot[0]);
offset = (long) arg1->slot[0];
whence = arg2->slot[0];
@@ -1784,7 +1745,6 @@ int default_c99_handler_fsetpos(char *ls
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FSETPOS);
stream = get_FILE(arg0->slot[0]);
pos = (fpos_t *) GET_LS_PTR(arg1->slot[0]);
rc = fsetpos(stream, pos);
@@ -1810,7 +1770,6 @@ int default_c99_handler_ftell(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FTELL);
stream = get_FILE(arg0->slot[0]);
rc = ftell(stream);
PUT_LS_RC(rc, 0, 0, errno);
@@ -1833,7 +1792,6 @@ int default_c99_handler_rewind(char *ls,
FILE *stream;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(REWIND);
stream = get_FILE(arg0->slot[0]);
rewind(stream);
return 0;
@@ -1855,7 +1813,6 @@ int default_c99_handler_clearerr(char *l
FILE *stream;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(CLEARERR);
stream = get_FILE(arg0->slot[0]);
clearerr(stream);
return 0;
@@ -1879,7 +1836,6 @@ int default_c99_handler_feof(char *ls, u
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FEOF);
stream = get_FILE(arg0->slot[0]);
rc = feof(stream);
PUT_LS_RC(rc, 0, 0, errno);
@@ -1904,7 +1860,6 @@ int default_c99_handler_ferror(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(FERROR);
stream = get_FILE(arg0->slot[0]);
rc = ferror(stream);
PUT_LS_RC(rc, 0, 0, errno);
@@ -1927,7 +1882,6 @@ int default_c99_handler_perror(char *ls,
char *s;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(PERROR);
s = GET_LS_PTR_NULL(arg0->slot[0]);
perror(s);
return 0;
@@ -1951,7 +1905,6 @@ int default_c99_handler_system(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_C99_OPCODE(SYSTEM);
string = GET_LS_PTR(arg0->slot[0]);
rc = system(string);
PUT_LS_RC(rc, 0, 0, errno);
Index: libspe2/spebase/default_posix1_handler.c
===================================================================
--- libspe2.orig/spebase/default_posix1_handler.c
+++ libspe2/spebase/default_posix1_handler.c
@@ -123,12 +123,6 @@ enum {
#define SPE_POSIX1_NR_OPCODES \
((SPE_POSIX1_LAST_OPCODE - SPE_POSIX1_ADJTIMEX) + 1)
-#define CHECK_POSIX1_OPCODE(_op) \
- if (SPE_POSIX1_OP(opdata) != SPE_POSIX1_ ## _op) { \
- DEBUG_PRINTF("OPCODE (0x%x) mismatch.\n", SPE_POSIX1_OP(opdata)); \
- return 1; \
- }
-
typedef union {
unsigned long long all64;
unsigned int by32[2];
@@ -210,7 +204,6 @@ int default_posix1_handler_stat(char *ls
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(STAT);
file_name = GET_LS_PTR(arg0->slot[0]);
rc = stat(file_name, &buf);
if (rc == 0) {
@@ -253,7 +246,6 @@ int default_posix1_handler_fstat(char *l
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(FSTAT);
filedes = arg0->slot[0];
rc = fstat(filedes, &buf);
if (rc == 0) {
@@ -296,7 +288,6 @@ int default_posix1_handler_lstat(char *l
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(LSTAT);
file_name = GET_LS_PTR(arg0->slot[0]);
rc = lstat(file_name, &buf);
if (rc == 0) {
@@ -339,7 +330,6 @@ int default_posix1_handler_open(char *ls
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(OPEN);
pathname = GET_LS_PTR(arg0->slot[0]);
flags = (int) arg1->slot[0];
mode = (mode_t) arg2->slot[0];
@@ -367,7 +357,6 @@ int default_posix1_handler_access(char *
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(ACCESS);
pathname = GET_LS_PTR(arg0->slot[0]);
mode = (int) arg1->slot[0];
rc = access(pathname, mode);
@@ -395,7 +384,6 @@ int default_posix1_handler_creat(char *l
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(CREAT);
pathname = GET_LS_PTR(arg0->slot[0]);
mode = (mode_t) arg1->slot[0];
rc = creat(pathname, mode);
@@ -421,7 +409,6 @@ int default_posix1_handler_close(char *l
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(CLOSE);
fd = arg0->slot[0];
rc = close(fd);
PUT_LS_RC(rc, 0, 0, errno);
@@ -446,7 +433,6 @@ int default_posix1_handler_dup(char *ls,
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(DUP);
oldfd = arg0->slot[0];
rc = dup(oldfd);
PUT_LS_RC(rc, 0, 0, errno);
@@ -471,7 +457,6 @@ int default_posix1_handler_time(char *ls
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(TIME);
t = GET_LS_PTR(arg0->slot[0]);
rc = time(t);
PUT_LS_RC(rc, 0, 0, errno);
@@ -499,7 +484,6 @@ int default_posix1_handler_read(char *ls
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(READ);
fd = arg0->slot[0];
buf = GET_LS_PTR(arg1->slot[0]);
count = arg2->slot[0];
@@ -528,7 +512,6 @@ int default_posix1_handler_write(char *l
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(WRITE);
fd = arg0->slot[0];
buf = GET_LS_PTR(arg1->slot[0]);
count = arg2->slot[0];
@@ -557,7 +540,6 @@ int default_posix1_handler_lseek(char *l
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(LSEEK);
fildes = arg0->slot[0];
offset = (off_t) arg1->slot[0];
whence = arg2->slot[0];
@@ -586,7 +568,6 @@ int default_posix1_handler_ftruncate(cha
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(FTRUNCATE);
fd = arg0->slot[0];
length = (off_t) arg1->slot[0];
rc = ftruncate(fd, length);
@@ -612,7 +593,6 @@ int default_posix1_handler_unlink(char *
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(UNLINK);
pathname = GET_LS_PTR(arg0->slot[0]);
rc = unlink(pathname);
PUT_LS_RC(rc, 0, 0, errno);
@@ -648,7 +628,6 @@ int default_posix1_handler_mmap(char *ls
addr64 addr;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(MMAP);
start.by32[0] = arg0->slot[0];
start.by32[1] = arg0->slot[1];
length = (size_t) arg1->slot[0];
@@ -689,7 +668,6 @@ int default_posix1_handler_munmap(char *
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(MUNMAP);
start.by32[0] = arg0->slot[0];
start.by32[1] = arg0->slot[1];
length = (size_t) arg1->slot[0];
@@ -723,7 +701,6 @@ int default_posix1_handler_mremap(char *
addr64 addr;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(MREMAP);
old_address.by32[0] = arg0->slot[0];
old_address.by32[1] = arg0->slot[1];
old_size = (size_t) arg1->slot[0];
@@ -759,7 +736,6 @@ int default_posix1_handler_msync(char *l
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(MSYNC);
start.by32[0] = arg0->slot[0];
start.by32[1] = arg0->slot[1];
length = (size_t) arg1->slot[0];
@@ -793,7 +769,6 @@ int default_posix1_handler_shm_open(char
unsigned long addr;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(SHM_OPEN);
name = GET_LS_PTR(arg0->slot[0]);
oflag = (int) arg1->slot[0];
mode = (mode_t) arg2->slot[0];
@@ -802,7 +777,6 @@ int default_posix1_handler_shm_open(char
#else
DECL_0_ARGS();
DECL_RET();
- CHECK_POSIX1_OPCODE(SHM_OPEN);
PUT_LS_RC(-1, 0, 0, ENOSYS);
#endif
return 0;
@@ -827,14 +801,12 @@ int default_posix1_handler_shm_unlink(ch
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(SHM_UNLINK);
name = GET_LS_PTR(arg0->slot[0]);
rc = shm_unlink(name);
PUT_LS_RC(rc, 0, 0, errno);
#else
DECL_0_ARGS();
DECL_RET();
- CHECK_POSIX1_OPCODE(SHM_UNLINK);
PUT_LS_RC(-1, 0, 0, ENOSYS);
#endif
return 0;
@@ -864,7 +836,6 @@ int default_posix1_handler_shmat(char *l
addr64 addr;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(SHMAT);
shmid = arg0->slot[0];
shmaddr.by32[0] = arg1->slot[0];
shmaddr.by32[1] = arg1->slot[1];
@@ -875,7 +846,6 @@ int default_posix1_handler_shmat(char *l
#else
DECL_0_ARGS();
DECL_RET();
- CHECK_POSIX1_OPCODE(SHMAT);
PUT_LS_RC(-1, 0, 0, ENOSYS);
#endif
return 0;
@@ -903,7 +873,6 @@ int default_posix1_handler_shmdt(char *l
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(SHMDT);
shmaddr.by32[0] = arg0->slot[0];
shmaddr.by32[1] = arg0->slot[1];
rc = shmdt((void *) ((unsigned long) shmaddr.all64));
@@ -911,7 +880,6 @@ int default_posix1_handler_shmdt(char *l
#else
DECL_0_ARGS();
DECL_RET();
- CHECK_POSIX1_OPCODE(SHMDT);
PUT_LS_RC(-1, 0, 0, ENOSYS);
#endif
return 0;
@@ -941,7 +909,6 @@ int default_posix1_handler_shmctl(char *
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(SHMCTL);
shmid = arg0->slot[0];
cmd = arg1->slot[0];
buf.by32[0] = arg2->slot[0];
@@ -951,7 +918,6 @@ int default_posix1_handler_shmctl(char *
#else
DECL_0_ARGS();
DECL_RET();
- CHECK_POSIX1_OPCODE(SHMCTL);
PUT_LS_RC(-1, 0, 0, ENOSYS);
#endif
return 0;
@@ -978,7 +944,6 @@ int default_posix1_handler_shmget(char *
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(SHMGET);
key = (key_t) arg0->slot[0];
size = arg1->slot[0];
shmflg = arg2->slot[0];
@@ -987,7 +952,6 @@ int default_posix1_handler_shmget(char *
#else
DECL_0_ARGS();
DECL_RET();
- CHECK_POSIX1_OPCODE(SHMGET);
PUT_LS_RC(-1, 0, 0, ENOSYS);
#endif
return 0;
@@ -1015,7 +979,6 @@ int default_posix1_handler_ftok(char *ls
key_t rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(FTOK);
pathname = GET_LS_PTR(arg0->slot[0]);
proj_id = arg1->slot[0];
rc = ftok(pathname, proj_id);
@@ -1040,7 +1003,6 @@ int default_posix1_handler_getpagesize(c
int sz;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(GETPAGESIZE);
sz = getpagesize();
PUT_LS_RC(sz, 0, 0, 0);
return 0;
@@ -1064,7 +1026,6 @@ int default_posix1_handler_wait(char *ls
pid_t pid;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(WAIT);
status = (int *) GET_LS_PTR(arg0->slot[0]);
pid = wait(status);
PUT_LS_RC(pid, 0, 0, errno);
@@ -1090,7 +1051,6 @@ int default_posix1_handler_waitpid(char
int options;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(WAIT);
pid = arg0->slot[0];
status = (int *) GET_LS_PTR(arg1->slot[0]);
options = arg2->slot[0];
@@ -1118,7 +1078,6 @@ int default_posix1_handler_kill(char *ls
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(KILL);
pid = arg0->slot[0];
sig = arg1->slot[0];
rc = kill(pid, sig);
@@ -1169,7 +1128,6 @@ int default_posix1_handler_adjtimex(char
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(ADJTIMEX);
buf = (struct spe_compat_timex *) GET_LS_PTR(arg0->slot[0]);
_COPY_TIMEX_STRUCT(&local, buf);
rc = adjtimex(&local);
@@ -1201,7 +1159,6 @@ int default_posix1_handler_gettimeofday(
int rc;
DEBUG_PRINTF("%s\n", __func__);
- CHECK_POSIX1_OPCODE(GETTIMEOFDAY);
tv = (struct spe_compat_timeval *) GET_LS_PTR(arg0->slot[0]);
tz = (struct spe_compat_timezone *) GET_LS_PTR(arg1->slot[0]);
rc = gettimeofday(&t, &zone);
More information about the cbe-oss-dev
mailing list