libsys: various updates

- move system calls for use by services from libminlib into libsys;
- move srv_fork(2) and srv_kill(2) from RS and into libsys;
- replace getprocnr(2) with sef_self(3);
- rename previous getnprocnr(2) to getprocnr(2);
- clean up getepinfo(2);
- change all libsys calls that used _syscall to use _taskcall, so as
  to avoid going through errno to pass errors; this is already how
  most calls work anyway, and many of the calls previously using
  _syscall were already assumed to return the actual error;
- initialize request messages to zero, for future compatibility
  (note that this does not include PCI calls, which are in need of a
  much bigger overhaul, nor kernel calls);
- clean up more of dead DS code as a side effect.

Change-Id: I8788f54c68598fcf58e23486e270c2d749780ebb
This commit is contained in:
David van Moolenbroek
2014-03-01 09:05:00 +01:00
committed by sambuc
parent efd3487bc5
commit 80bd109cd3
82 changed files with 477 additions and 544 deletions
+8 -5
View File
@@ -123,12 +123,12 @@ int do_mapdriver(message *UNUSED(m_out))
/* Only RS can map drivers. */
if (who_e != RS_PROC_NR) return(EPERM);
label_vir = (vir_bytes) job_m_in.md_label;
label_len = (size_t) job_m_in.md_label_len;
major = job_m_in.md_major;
label_vir = (vir_bytes) job_m_in.VFS_MAPDRIVER_LABEL;
label_len = (size_t) job_m_in.VFS_MAPDRIVER_LABELLEN;
major = job_m_in.VFS_MAPDRIVER_MAJOR;
/* Get the label */
if (label_len+1 > sizeof(label)) { /* Can we store this label? */
if (label_len > sizeof(label)) { /* Can we store this label? */
printf("VFS: do_mapdriver: label too long\n");
return(EINVAL);
}
@@ -137,7 +137,10 @@ int do_mapdriver(message *UNUSED(m_out))
printf("VFS: do_mapdriver: sys_vircopy failed: %d\n", r);
return(EINVAL);
}
label[label_len] = '\0'; /* Terminate label */
if (label[label_len-1] != '\0') {
printf("VFS: do_mapdriver: label not null-terminated\n");
return(EINVAL);
}
/* Now we know how the driver is called, fetch its endpoint */
r = ds_retrieve_label_endpt(label, &endpoint);
-3
View File
@@ -46,9 +46,6 @@
#define whence m2_i2
#define svrctl_req m2_i1
#define svrctl_argp m2_p1
#define md_label m2_p1
#define md_label_len m2_l1
#define md_major m2_i1
/* The following names are synonyms for the variables in the output message. */
#define reply_type m_type