#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>
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);
+ }
}
}
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;
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)) {
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);
}
/*===========================================================================*