From 1f04287b3f087e863f4c2df53f0d23d5f8c9f204 Mon Sep 17 00:00:00 2001 From: Philip Homburg Date: Tue, 7 Aug 2007 12:24:06 +0000 Subject: [PATCH] Removed dmap table. Publish endpoint in DS before calling mapdriver5. --- servers/rs/main.c | 26 -------------------------- servers/rs/manager.c | 12 ++++++------ 2 files changed, 6 insertions(+), 32 deletions(-) diff --git a/servers/rs/main.c b/servers/rs/main.c index 0c3ff6272..74eff80e4 100644 --- a/servers/rs/main.c +++ b/servers/rs/main.c @@ -9,7 +9,6 @@ */ #include "inc.h" #include -#include #include #include "../../kernel/const.h" #include "../../kernel/type.h" @@ -22,7 +21,6 @@ FORWARD _PROTOTYPE(void reply, (int whom, message *m_out) ); /* Data buffers to retrieve info during initialization. */ PRIVATE struct boot_image image[NR_BOOT_PROCS]; -PUBLIC struct dmap dmap[NR_DEVICES]; long rs_verbose = 0; @@ -142,31 +140,7 @@ PRIVATE void init_server(void) */ if ((s = sys_getimage(image)) != OK) panic("RS","warning: couldn't get copy of image table", s); - if ((s = getsysinfo(FS_PROC_NR, SI_DMAP_TAB, dmap)) < 0) - panic("RS","warning: couldn't get copy of dmap table", errno); -#if 0 - /* Now initialize the table with the processes in the system image. - * Prepend /sbin/ to the binaries so that we can actually find them. - */ - for (s=0; s< NR_BOOT_PROCS; s++) { - ip = &image[s]; - if (ip->proc_nr >= 0) { - rproc[s].r_flags = RS_IN_USE; - rproc[s].r_proc_nr_e = ip->endpoint; - rproc[s].r_pid = getnpid(ip->proc_nr); - for(t=0; t< NR_DEVICES; t++) - if (dmap[t].dmap_driver == ip->proc_nr) - rproc[s].r_dev_nr = t; - strcpy(rproc[s].r_cmd, "/sbin/"); - strcpy(rproc[s].r_cmd+6, ip->proc_name); - rproc[s].r_argc = 1; - rproc[s].r_argv[0] = rproc[s].r_cmd; - rproc[s].r_argv[1] = NULL; - } - } -#endif - /* Set alarm to periodically check driver status. */ if (OK != (s=sys_setalarm(RS_DELTA_T, 0))) panic("RS", "couldn't set alarm", s); diff --git a/servers/rs/manager.c b/servers/rs/manager.c index d0f04247d..457bafdef 100644 --- a/servers/rs/manager.c +++ b/servers/rs/manager.c @@ -799,9 +799,13 @@ endpoint_t *endpoint; return(s); /* return error */ } + s= ds_publish_u32(rp->r_label, child_proc_nr_e); + if (s != OK) + printf("start_service: ds_publish_u32 failed: %d\n", s); + if (rp->r_dev_nr > 0) { /* set driver map */ - if ((s=mapdriver(child_proc_nr_e, rp->r_dev_nr, rp->r_dev_style, - !!use_copy /* force */)) < 0) { + if ((s=mapdriver5(rp->r_label, strlen(rp->r_label), + rp->r_dev_nr, rp->r_dev_style, !!use_copy /* force */)) < 0) { report("RS", "couldn't map driver", errno); rp->r_flags |= RS_EXITING; /* expect exit */ if(child_pid > 0) kill(child_pid, SIGKILL); /* kill driver */ @@ -832,10 +836,6 @@ endpoint_t *endpoint; if(endpoint) *endpoint = child_proc_nr_e; /* send back child endpoint */ - s= ds_publish_u32(rp->r_label, child_proc_nr_e); - if (s != OK) - printf("start_service: ds_publish_u32 failed: %d\n", s); - return(OK); } -- 2.44.0