]> Zhao Yanbai Git Server - minix.git/commitdiff
Tell the kernel about the new boottime and don't tell VFS.
authorPhilip Homburg <philip@cs.vu.nl>
Tue, 7 Aug 2007 12:28:42 +0000 (12:28 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Tue, 7 Aug 2007 12:28:42 +0000 (12:28 +0000)
Tell DS about all processes in the boot image. PM_STIME is removed.
Diagnostic for calls to do_getprocnr (DS should be used to get endpoints).

servers/pm/main.c
servers/pm/misc.c
servers/pm/time.c

index f59af00e70f4d646024bd6d3e1905d8b5a168b6d..44fd5e31865b276f75173e119af9ba47106648a5 100644 (file)
@@ -13,6 +13,8 @@
 #include <minix/keymap.h>
 #include <minix/callnr.h>
 #include <minix/com.h>
+#include <minix/ds.h>
+#include <minix/type.h>
 #include <minix/endpoint.h>
 #include <minix/minlib.h>
 #include <minix/type.h>
@@ -326,6 +328,15 @@ PRIVATE void pm_init()
                mess.PR_ENDPT = rmp->mp_endpoint;
                if (OK != (s=send(FS_PROC_NR, &mess)))
                        panic(__FILE__,"can't sync up with FS", s);
+
+               /* Register proces with ds */
+               s= ds_publish_u32(rmp->mp_name, rmp->mp_endpoint);
+               if (s != OK)
+               {
+                       printf(
+                       "pm_init: unable to register '%s' with ds: %d\n",
+                               rmp->mp_name, s);
+               }
        }
   }
 
@@ -529,17 +540,6 @@ PRIVATE void send_work()
                        continue;
                switch(call)
                {
-               case PM_STIME:
-                       m.m_type= call;
-                       m.PM_STIME_TIME= boottime;
-
-                       /* FS does not reply */
-                       rmp->mp_fs_call= PM_IDLE;
-
-                       /* Wakeup the original caller */
-                       setreply(rmp-mproc, OK);
-                       break;
-
                case PM_SETSID:
                        m.m_type= call;
                        m.PM_SETSID_PROC= rmp->mp_endpoint;
index 70147268d2bbc799bba12302fc2e2b62b443b10f..d27d70270e1b1385b487ed97bc1328321076c1c0 100644 (file)
@@ -329,6 +329,8 @@ PUBLIC int do_getprocnr()
        return EPERM;
   }
 
+  printf("PM: do_getprocnr call from endpoint %d\n", mp->mp_endpoint);
+
   if (m_in.pid >= 0) {                 /* lookup process by pid */
        for (rmp = &mproc[0]; rmp < &mproc[NR_PROCS]; rmp++) {
                if ((rmp->mp_flags & IN_USE) && (rmp->mp_pid==m_in.pid)) {
index b5b519177ad6c4fd05dbe7d8aec744e00b941b9f..c16370c901101ae300dc0711332b5b667a8b2772 100644 (file)
@@ -53,14 +53,11 @@ PUBLIC int do_stime()
       panic(__FILE__,"do_stime couldn't get uptime", s);
   boottime = (long) m_in.stime - (uptime/HZ);
 
-  if (mp->mp_fs_call != PM_IDLE)
-       panic("pm", "do_stime: not idle", mp->mp_fs_call);
-  mp->mp_fs_call= PM_STIME;
-  s= notify(FS_PROC_NR);
-  if (s != OK) panic("pm", "do_stime: unable to notify FS", s);
+  s= sys_stime(boottime);              /* Tell kernel about boottime */
+  if (s != OK)
+       panic(__FILE__, "pm: sys_stime failed", s);
 
-  /* Do not reply until FS is ready to process the stime request */
-  return(SUSPEND);
+  return(OK);
 }
 
 /*===========================================================================*