From: Philip Homburg Date: Wed, 2 May 2007 11:30:16 +0000 (+0000) Subject: Use ds_retrieve_u32 to get the endpoint of inet and of the ethernet drivers. X-Git-Tag: v3.1.4~386 X-Git-Url: http://zhaoyanbai.com/repos/%22/xml/v3/zones/static/man.7.txt?a=commitdiff_plain;h=33d31720a5180739d4f48d41156c4e46bd12a656;p=minix.git Use ds_retrieve_u32 to get the endpoint of inet and of the ethernet drivers. --- diff --git a/servers/inet/inet.c b/servers/inet/inet.c index d7fefa9e4..c7f5de955 100644 --- a/servers/inet/inet.c +++ b/servers/inet/inet.c @@ -50,6 +50,7 @@ from DL_ETH: #include #include #include +#include #include "mq.h" #include "qp.h" @@ -96,6 +97,7 @@ PUBLIC void main() mq_t *mq; int r; int source, m_type, timerand, fd; + u32_t tasknr; struct fssignon device; #ifdef __minix_vmd struct systaskinfo info; @@ -157,8 +159,10 @@ PUBLIC void main() #else /* Minix 3 */ /* Our new identity as a server. */ - if ((this_proc = getprocnr()) < 0) - ip_panic(( "unable to get own process nr\n")); + r= ds_retrieve_u32("inet", &tasknr); + if (r != OK) + ip_panic(("inet: ds_retrieve_u32 failed for 'inet': %d", r)); + this_proc= tasknr; #endif /* Register the device group. */ diff --git a/servers/inet/mnx_eth.c b/servers/inet/mnx_eth.c index 859dc7099..c5d38d523 100644 --- a/servers/inet/mnx_eth.c +++ b/servers/inet/mnx_eth.c @@ -7,6 +7,7 @@ Copyright 1995 Philip Homburg */ #include "inet.h" +#include #include #include "proto.h" #include "osdep_eth.h" @@ -37,7 +38,8 @@ FORWARD _PROTOTYPE( int asynsend, (endpoint_t dst, message *mp) ); PUBLIC void osdep_eth_init() { - int i, j, r, tasknr, rport; + int i, j, r, rport; + u32_t tasknr; struct eth_conf *ecp; eth_port_t *eth_port, *rep; message mess; @@ -102,7 +104,12 @@ PUBLIC void osdep_eth_init() #ifdef __minix_vmd r= sys_findproc(ecp->ec_task, &tasknr, 0); #else /* Minix 3 */ - r = _pm_findproc(ecp->ec_task, &tasknr); + r= ds_retrieve_u32(ecp->ec_task, &tasknr); + if (r != OK && r != ESRCH) + { + printf("inet: ds_retrieve_u32 failed for '%s': %d\n", + ecp->ec_task, r); + } #endif if (r != OK) {