From: David van Moolenbroek Date: Tue, 24 Aug 2010 07:20:41 +0000 (+0000) Subject: RS: use PM's API instead of its internals X-Git-Tag: v3.1.8~53 X-Git-Url: http://zhaoyanbai.com/repos/man.arpaname.html?a=commitdiff_plain;h=959026c29a09eff2572077e98a56900ac298c300;p=minix.git RS: use PM's API instead of its internals --- diff --git a/servers/rs/main.c b/servers/rs/main.c index 2ac28ac84..a314938f8 100644 --- a/servers/rs/main.c +++ b/servers/rs/main.c @@ -15,7 +15,6 @@ #include "kernel/const.h" #include "kernel/type.h" #include "kernel/proc.h" -#include "../pm/mproc.h" /* Declare some local functions. */ FORWARD _PROTOTYPE(void boot_image_info_lookup, ( endpoint_t endpoint, @@ -166,7 +165,6 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) struct rproc *replica_rp; struct rprocpub *rpub; struct boot_image image[NR_BOOT_PROCS]; - struct mproc mproc[NR_PROCS]; struct boot_image_priv *boot_image_priv; struct boot_image_sys *boot_image_sys; struct boot_image_dev *boot_image_dev; @@ -403,9 +401,6 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) * Complete the initialization of the system process table in collaboration * with other system services. */ - if ((s = getsysinfo(PM_PROC_NR, SI_PROC_TAB, mproc)) != OK) { - panic("unable to get copy of PM process table: %d", s); - } for (i=0; boot_image_priv_table[i].endpoint != NULL_BOOT_NR; i++) { boot_image_priv = &boot_image_priv_table[i]; @@ -418,15 +413,9 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) rp = &rproc[boot_image_priv - boot_image_priv_table]; rpub = rp->r_pub; - /* Get pid from PM process table. */ - rp->r_pid = -1; - for (j = 0; j < NR_PROCS; j++) { - if (mproc[j].mp_endpoint == rpub->endpoint) { - rp->r_pid = mproc[j].mp_pid; - break; - } - } - if(j == NR_PROCS) { + /* Get pid from PM. */ + rp->r_pid = getnpid(rpub->endpoint); + if(rp->r_pid == -1) { panic("unable to get pid"); } }