2 copies of taskcall.c removed

- taskcall.c is 3x in the trunk as part of libc, libsysutil and
  libsys.  It should be only part of libsys.

- only system process should be linked with libsys, therefore using
  raw _taskcall() in service.c is replaced by _syscall()

- the same for minix_rs.c

- lib/other/sys_eniop.c can go without replacement as it is part of
  syslib
This commit is contained in:
Tomas Hruby 2010-01-25 14:22:09 +00:00
parent 769e5f373a
commit ee4cff8d66
7 changed files with 17 additions and 74 deletions

View File

@ -88,11 +88,9 @@ libc_FILES=" \
strtok_r.c \ strtok_r.c \
strtoll.c \ strtoll.c \
swab.c \ swab.c \
sys_eniop.c \
syscall.c \ syscall.c \
sysconf.c \ sysconf.c \
syslog.c \ syslog.c \
taskcall.c \
telldir.c \ telldir.c \
termcap.c \ termcap.c \
ttyname.c \ ttyname.c \

View File

@ -16,10 +16,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <lib.h>
int minix_rs_lookup(const char *name, endpoint_t *value) int minix_rs_lookup(const char *name, endpoint_t *value)
{ {
int r;
message m; message m;
size_t len_key; size_t len_key;
@ -28,12 +28,11 @@ int minix_rs_lookup(const char *name, endpoint_t *value)
m.RS_NAME = (char *) name; m.RS_NAME = (char *) name;
m.RS_NAME_LEN = len_key; m.RS_NAME_LEN = len_key;
r = _taskcall(RS_PROC_NR, RS_LOOKUP, &m); if (_syscall(RS_PROC_NR, RS_LOOKUP, &m) != -1) {
if(r == OK) {
*value = m.RS_ENDPOINT; *value = m.RS_ENDPOINT;
return OK;
} }
return r; return -1;
} }

View File

@ -1,14 +0,0 @@
#include "../syslib/syslib.h"
/*===========================================================================*
* sys_enable_iop *
*===========================================================================*/
PUBLIC int sys_enable_iop(proc_nr_e)
endpoint_t proc_nr_e; /* number of process to allow I/O */
{
message m_iop;
m_iop.IO_ENDPT = proc_nr_e;
return _taskcall(SYSTASK, SYS_IOPENABLE, &m_iop);
}

View File

@ -1,20 +0,0 @@
/* _taskcall() is the same as _syscall() except it returns negative error
* codes directly and not in errno. This is a better interface for MM and
* FS.
*/
#include <lib.h>
#include <minix/syslib.h>
PUBLIC int _taskcall(who, syscallnr, msgptr)
endpoint_t who;
int syscallnr;
register message *msgptr;
{
int status;
msgptr->m_type = syscallnr;
status = _sendrec(who, msgptr);
if (status != 0) return(status);
return(msgptr->m_type);
}

View File

@ -20,7 +20,6 @@ libsys_FILES=" \
fkey_ctl.c \ fkey_ctl.c \
tsc_util.c \ tsc_util.c \
report.c \ report.c \
taskcall.c \
read_tsc.s \ read_tsc.s \
read_tsc_64.c \ read_tsc_64.c \
ser_putc.c \ ser_putc.c \

View File

@ -1,20 +0,0 @@
/* _taskcall() is the same as _syscall() except it returns negative error
* codes directly and not in errno. This is a better interface for MM and
* FS.
*/
#include <lib.h>
#include <minix/syslib.h>
PUBLIC int _taskcall(who, syscallnr, msgptr)
endpoint_t who;
int syscallnr;
register message *msgptr;
{
int status;
msgptr->m_type = syscallnr;
status = _sendrec(who, msgptr);
if (status != 0) return(status);
return(msgptr->m_type);
}

View File

@ -15,6 +15,7 @@
#include <pwd.h> #include <pwd.h>
#include <unistd.h> #include <unistd.h>
#include <limits.h> #include <limits.h>
#include <lib.h>
#include <minix/config.h> #include <minix/config.h>
#include <minix/com.h> #include <minix/com.h>
#include <minix/const.h> #include <minix/const.h>
@ -124,10 +125,10 @@ PRIVATE void print_usage(char *app_name, char *problem)
/* A request to the RS server failed. Report and exit. /* A request to the RS server failed. Report and exit.
*/ */
PRIVATE void failure(int num) PRIVATE void failure(void)
{ {
fprintf(stderr, "Request to RS failed: %s (error %d)\n", strerror(num), num); fprintf(stderr, "Request to RS failed: %s (error %d)\n", strerror(errno), errno);
exit(num); exit(errno);
} }
@ -1069,7 +1070,7 @@ PUBLIC int main(int argc, char **argv)
message m; message m;
int result; int result;
int request; int request;
int i, s; int i;
char *label, *progname = NULL; char *label, *progname = NULL;
struct passwd *pw; struct passwd *pw;
@ -1141,8 +1142,8 @@ PUBLIC int main(int argc, char **argv)
m.RS_CMD_ADDR = (char *) &rs_start; m.RS_CMD_ADDR = (char *) &rs_start;
/* Build request message and send the request. */ /* Build request message and send the request. */
if (OK != (s=_taskcall(RS_PROC_NR, request, &m))) if (_syscall(RS_PROC_NR, request, &m) == -1)
failure(-s); failure();
else if(req_printep) else if(req_printep)
printf("%d\n", m.RS_ENDPOINT); printf("%d\n", m.RS_ENDPOINT);
result = m.m_type; result = m.m_type;
@ -1153,20 +1154,20 @@ PUBLIC int main(int argc, char **argv)
case RS_RESTART: case RS_RESTART:
m.RS_CMD_ADDR = req_label; m.RS_CMD_ADDR = req_label;
m.RS_CMD_LEN = strlen(req_label); m.RS_CMD_LEN = strlen(req_label);
if (OK != (s=_taskcall(RS_PROC_NR, request, &m))) if (_syscall(RS_PROC_NR, request, &m) == -1)
failure(-s); failure();
break; break;
case RS_SHUTDOWN: case RS_SHUTDOWN:
if (OK != (s=_taskcall(RS_PROC_NR, request, &m))) if (_syscall(RS_PROC_NR, request, &m) == -1)
failure(-s); failure();
break; break;
case RS_UPDATE: case RS_UPDATE:
m.RS_CMD_ADDR = req_label; m.RS_CMD_ADDR = req_label;
m.RS_CMD_LEN = strlen(req_label); m.RS_CMD_LEN = strlen(req_label);
m.RS_LU_STATE = req_lu_state; m.RS_LU_STATE = req_lu_state;
m.RS_LU_PREPARE_MAXTIME = req_prepare_maxtime; m.RS_LU_PREPARE_MAXTIME = req_prepare_maxtime;
if (OK != (s=_taskcall(RS_PROC_NR, request, &m))) if (_syscall(RS_PROC_NR, request, &m) == -1)
failure(-s); failure();
break; break;
default: default:
print_usage(argv[ARG_NAME], "request is not yet supported"); print_usage(argv[ARG_NAME], "request is not yet supported");