Tell the kernel about the new boottime and don't tell VFS.

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).
This commit is contained in:
Philip Homburg 2007-08-07 12:28:42 +00:00
parent fd151245e9
commit a81e82b3da
3 changed files with 17 additions and 18 deletions

View 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;

View 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)) {

View 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);
}
/*===========================================================================*