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:
parent
fd151245e9
commit
a81e82b3da
@ -13,6 +13,8 @@
|
|||||||
#include <minix/keymap.h>
|
#include <minix/keymap.h>
|
||||||
#include <minix/callnr.h>
|
#include <minix/callnr.h>
|
||||||
#include <minix/com.h>
|
#include <minix/com.h>
|
||||||
|
#include <minix/ds.h>
|
||||||
|
#include <minix/type.h>
|
||||||
#include <minix/endpoint.h>
|
#include <minix/endpoint.h>
|
||||||
#include <minix/minlib.h>
|
#include <minix/minlib.h>
|
||||||
#include <minix/type.h>
|
#include <minix/type.h>
|
||||||
@ -326,6 +328,15 @@ PRIVATE void pm_init()
|
|||||||
mess.PR_ENDPT = rmp->mp_endpoint;
|
mess.PR_ENDPT = rmp->mp_endpoint;
|
||||||
if (OK != (s=send(FS_PROC_NR, &mess)))
|
if (OK != (s=send(FS_PROC_NR, &mess)))
|
||||||
panic(__FILE__,"can't sync up with FS", s);
|
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;
|
continue;
|
||||||
switch(call)
|
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:
|
case PM_SETSID:
|
||||||
m.m_type= call;
|
m.m_type= call;
|
||||||
m.PM_SETSID_PROC= rmp->mp_endpoint;
|
m.PM_SETSID_PROC= rmp->mp_endpoint;
|
||||||
|
@ -329,6 +329,8 @@ PUBLIC int do_getprocnr()
|
|||||||
return EPERM;
|
return EPERM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("PM: do_getprocnr call from endpoint %d\n", mp->mp_endpoint);
|
||||||
|
|
||||||
if (m_in.pid >= 0) { /* lookup process by pid */
|
if (m_in.pid >= 0) { /* lookup process by pid */
|
||||||
for (rmp = &mproc[0]; rmp < &mproc[NR_PROCS]; rmp++) {
|
for (rmp = &mproc[0]; rmp < &mproc[NR_PROCS]; rmp++) {
|
||||||
if ((rmp->mp_flags & IN_USE) && (rmp->mp_pid==m_in.pid)) {
|
if ((rmp->mp_flags & IN_USE) && (rmp->mp_pid==m_in.pid)) {
|
||||||
|
@ -53,14 +53,11 @@ PUBLIC int do_stime()
|
|||||||
panic(__FILE__,"do_stime couldn't get uptime", s);
|
panic(__FILE__,"do_stime couldn't get uptime", s);
|
||||||
boottime = (long) m_in.stime - (uptime/HZ);
|
boottime = (long) m_in.stime - (uptime/HZ);
|
||||||
|
|
||||||
if (mp->mp_fs_call != PM_IDLE)
|
s= sys_stime(boottime); /* Tell kernel about boottime */
|
||||||
panic("pm", "do_stime: not idle", mp->mp_fs_call);
|
if (s != OK)
|
||||||
mp->mp_fs_call= PM_STIME;
|
panic(__FILE__, "pm: sys_stime failed", s);
|
||||||
s= notify(FS_PROC_NR);
|
|
||||||
if (s != OK) panic("pm", "do_stime: unable to notify FS", s);
|
|
||||||
|
|
||||||
/* Do not reply until FS is ready to process the stime request */
|
return(OK);
|
||||||
return(SUSPEND);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user