For common calls, give servers unique call numbers
The getsysinfo(2), getrusage(2), and svrctl(2) calls used the same call number to different services. Since we want to give each service its own call number ranges, this is no longer tenable. This patch introduces per-service call numbers for these calls. Note that the remainder of the COMMON_ range is left intact, as these the remaining requests in it are processed by SEF and thus server- agnostic. The range should really be prefixed with SEF_ now. Change-Id: I80d728bbeb98227359c525494c433965b40fefc3
This commit is contained in:
@@ -22,10 +22,10 @@ int getrusage(int who, struct rusage *r_usage)
|
||||
}
|
||||
|
||||
memset(r_usage, 0, sizeof(struct rusage));
|
||||
if ((rc = _syscall(PM_PROC_NR, GETRUSAGE, &m)) < 0)
|
||||
if ((rc = _syscall(PM_PROC_NR, PM_GETRUSAGE, &m)) < 0)
|
||||
return rc;
|
||||
m.RU_RUSAGE_ADDR = r_usage;
|
||||
if ((rc = _syscall(VFS_PROC_NR, GETRUSAGE, &m)) < 0)
|
||||
if ((rc = _syscall(VFS_PROC_NR, VFS_GETRUSAGE, &m)) < 0)
|
||||
return rc;
|
||||
m.RU_RUSAGE_ADDR = r_usage;
|
||||
return _syscall(VM_PROC_NR, VM_GETRUSAGE, &m);
|
||||
|
||||
@@ -16,11 +16,11 @@ int svrctl(int request, void *argp)
|
||||
case 'M':
|
||||
case 'S':
|
||||
/* PM handles calls for itself and the kernel. */
|
||||
return _syscall(PM_PROC_NR, SVRCTL, &m);
|
||||
return _syscall(PM_PROC_NR, PM_SVRCTL, &m);
|
||||
case 'F':
|
||||
case 'I':
|
||||
/* VFS handles calls for itself and inet. */
|
||||
return _syscall(VFS_PROC_NR, SVRCTL, &m);
|
||||
return _syscall(VFS_PROC_NR, VFS_SVRCTL, &m);
|
||||
default:
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
#include "syslib.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <minix/sysinfo.h>
|
||||
#include <minix/com.h>
|
||||
@@ -12,9 +13,20 @@ int getsysinfo(
|
||||
)
|
||||
{
|
||||
message m;
|
||||
int call_nr;
|
||||
|
||||
switch (who) {
|
||||
case PM_PROC_NR: call_nr = PM_GETSYSINFO; break;
|
||||
case VFS_PROC_NR: call_nr = VFS_GETSYSINFO; break;
|
||||
case RS_PROC_NR: call_nr = RS_GETSYSINFO; break;
|
||||
case DS_PROC_NR: call_nr = DS_GETSYSINFO; break;
|
||||
default:
|
||||
return ENOSYS;
|
||||
}
|
||||
|
||||
memset(&m, 0, sizeof(m));
|
||||
m.SI_WHAT = what;
|
||||
m.SI_WHERE = where;
|
||||
m.SI_SIZE = size;
|
||||
return _taskcall(who, COMMON_GETSYSINFO, &m);
|
||||
return _taskcall(who, call_nr, &m);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user