]> Zhao Yanbai Git Server - minix.git/commitdiff
RS: use PM's API instead of its internals
authorDavid van Moolenbroek <david@minix3.org>
Tue, 24 Aug 2010 07:20:41 +0000 (07:20 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Tue, 24 Aug 2010 07:20:41 +0000 (07:20 +0000)
servers/rs/main.c

index 2ac28ac84a40cb76abe0dfb2eaf43d2a81b113f6..a314938f87d55e7baa00ebc7d6ba6dca22a6335c 100644 (file)
@@ -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");
       }
   }