Clean up interface to PM and VFS

- introduce new call numbers, names, and field aliases;
- initialize request messages to zero for all ABI calls;
- format callnr.h in the same way as com.h;
- redo call tables in both servers;
- remove param.h namespace pollution in the servers;
- make brk(2) go to VM directly, rather than through PM;
- remove obsolete BRK, UTIME, and WAIT calls;
- clean up path copying routine in VFS;
- move remaining system calls from libminlib to libc;
- correct some errno-related mistakes in libc routines.

Change-Id: I2d8ec5d061cd7e0b30c51ffd77aa72ebf84e2565
This commit is contained in:
David van Moolenbroek
2013-11-04 22:48:08 +01:00
committed by Lionel Sambuc
parent 2c8310fce6
commit 24ec0d73b5
164 changed files with 1615 additions and 1778 deletions

View File

@@ -85,7 +85,6 @@ SRCS+= \
taskcall.c \
tickdelay.c \
timers.c \
vm_brk.c \
vm_cache.c \
vm_exit.c \
vm_fork.c \

View File

@@ -12,5 +12,5 @@ copyfd(endpoint_t endpt, int fd, int what)
m.VFS_COPYFD_FD = fd;
m.VFS_COPYFD_WHAT = what;
return _taskcall(VFS_PROC_NR, COPYFD, &m);
return _taskcall(VFS_PROC_NR, VFS_COPYFD, &m);
}

View File

@@ -13,7 +13,7 @@ getepinfo(endpoint_t proc_ep, uid_t *uid, gid_t *gid)
memset(&m, 0, sizeof(m));
m.PM_GETEPINFO_ENDPT = proc_ep;
if ((r = _taskcall(PM_PROC_NR, GETEPINFO, &m)) < 0)
if ((r = _taskcall(PM_PROC_NR, PM_GETEPINFO, &m)) < 0)
return r;
if (uid != NULL)

View File

@@ -11,7 +11,7 @@ getprocnr(pid_t pid, endpoint_t *proc_e)
memset(&m, 0, sizeof(m));
m.PM_GETPROCNR_PID = pid;
if ((r = _taskcall(PM_PROC_NR, GETPROCNR, &m)) < 0)
if ((r = _taskcall(PM_PROC_NR, PM_GETPROCNR, &m)) < 0)
return r;
*proc_e = m.PM_GETPROCNR_ENDPT;

View File

@@ -13,5 +13,5 @@ mapdriver(char *label, devmajor_t major)
m.VFS_MAPDRIVER_LABELLEN = strlen(label) + 1;
m.VFS_MAPDRIVER_MAJOR = major;
return _taskcall(VFS_PROC_NR, MAPDRIVER, &m);
return _taskcall(VFS_PROC_NR, VFS_MAPDRIVER, &m);
}

View File

@@ -231,8 +231,9 @@ void sef_exit(int status)
sys_exit();
/* If sys_exit() fails, this is not a system service. Exit through PM. */
m.m1_i1 = status;
_syscall(PM_PROC_NR, EXIT, &m);
memset(&m, 0, sizeof(m));
m.PM_EXIT_STATUS = status;
_syscall(PM_PROC_NR, PM_EXIT, &m);
/* If everything else fails, hang. */
printf("Warning: system service %d couldn't exit\n", sef_self_endpoint);

View File

@@ -8,7 +8,7 @@ srv_fork(uid_t reuid, gid_t regid)
message m;
memset(&m, 0, sizeof(m));
m.m1_i1 = (int) reuid;
m.m1_i2 = (int) regid;
return _taskcall(PM_PROC_NR, SRV_FORK, &m);
m.PM_SRV_FORK_UID = (int) reuid;
m.PM_SRV_FORK_GID = (int) regid;
return _taskcall(PM_PROC_NR, PM_SRV_FORK, &m);
}

View File

@@ -8,7 +8,7 @@ srv_kill(pid_t pid, int sig)
message m;
memset(&m, 0, sizeof(m));
m.m1_i1 = pid;
m.m1_i2 = sig;
return _taskcall(PM_PROC_NR, SRV_KILL, &m);
m.PM_SIG_PID = pid;
m.PM_SIG_NR = sig;
return _taskcall(PM_PROC_NR, PM_SRV_KILL, &m);
}

View File

@@ -1,20 +0,0 @@
#include "syslib.h"
#include <string.h>
#include <minix/vm.h>
/*===========================================================================*
* vm_brk *
*===========================================================================*/
int vm_brk(endpoint_t ep, char *addr)
{
message m;
memset(&m, 0, sizeof(m));
m.VMB_ENDPOINT = ep;
m.VMB_ADDR = (void *) addr;
return _taskcall(VM_PROC_NR, VM_BRK, &m);
}