From a81e82b3da5d23376490d6cbd3c0fa0b6f22e633 Mon Sep 17 00:00:00 2001 From: Philip Homburg Date: Tue, 7 Aug 2007 12:28:42 +0000 Subject: [PATCH] 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). --- servers/pm/main.c | 22 +++++++++++----------- servers/pm/misc.c | 2 ++ servers/pm/time.c | 11 ++++------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/servers/pm/main.c b/servers/pm/main.c index f59af00e7..44fd5e318 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -13,6 +13,8 @@ #include #include #include +#include +#include #include #include #include @@ -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; diff --git a/servers/pm/misc.c b/servers/pm/misc.c index 70147268d..d27d70270 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -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)) { diff --git a/servers/pm/time.c b/servers/pm/time.c index b5b519177..c16370c90 100644 --- a/servers/pm/time.c +++ b/servers/pm/time.c @@ -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); } /*===========================================================================* -- 2.44.0