Use ds_retrieve_u32 to get the endpoint of inet and of the ethernet drivers.
This commit is contained in:
		
							parent
							
								
									9852471c08
								
							
						
					
					
						commit
						33d31720a5
					
				| @ -50,6 +50,7 @@ from DL_ETH: | |||||||
| #include <time.h> | #include <time.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
| #include <sys/svrctl.h> | #include <sys/svrctl.h> | ||||||
|  | #include <minix/ds.h> | ||||||
| 
 | 
 | ||||||
| #include "mq.h" | #include "mq.h" | ||||||
| #include "qp.h" | #include "qp.h" | ||||||
| @ -96,6 +97,7 @@ PUBLIC void main() | |||||||
| 	mq_t *mq; | 	mq_t *mq; | ||||||
| 	int r; | 	int r; | ||||||
| 	int source, m_type, timerand, fd; | 	int source, m_type, timerand, fd; | ||||||
|  | 	u32_t tasknr; | ||||||
| 	struct fssignon device; | 	struct fssignon device; | ||||||
| #ifdef __minix_vmd | #ifdef __minix_vmd | ||||||
| 	struct systaskinfo info; | 	struct systaskinfo info; | ||||||
| @ -157,8 +159,10 @@ PUBLIC void main() | |||||||
| #else /* Minix 3 */ | #else /* Minix 3 */ | ||||||
| 
 | 
 | ||||||
| 	/* Our new identity as a server. */ | 	/* Our new identity as a server. */ | ||||||
| 	if ((this_proc = getprocnr()) < 0) | 	r= ds_retrieve_u32("inet", &tasknr); | ||||||
| 		ip_panic(( "unable to get own process nr\n")); | 	if (r != OK) | ||||||
|  | 		ip_panic(("inet: ds_retrieve_u32 failed for 'inet': %d", r)); | ||||||
|  | 	this_proc= tasknr; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| 	/* Register the device group. */ | 	/* Register the device group. */ | ||||||
|  | |||||||
| @ -7,6 +7,7 @@ Copyright 1995 Philip Homburg | |||||||
| */ | */ | ||||||
| 
 | 
 | ||||||
| #include "inet.h" | #include "inet.h" | ||||||
|  | #include <minix/ds.h> | ||||||
| #include <minix/safecopies.h> | #include <minix/safecopies.h> | ||||||
| #include "proto.h" | #include "proto.h" | ||||||
| #include "osdep_eth.h" | #include "osdep_eth.h" | ||||||
| @ -37,7 +38,8 @@ FORWARD _PROTOTYPE( int asynsend, (endpoint_t dst, message *mp) ); | |||||||
| 
 | 
 | ||||||
| PUBLIC void osdep_eth_init() | PUBLIC void osdep_eth_init() | ||||||
| { | { | ||||||
| 	int i, j, r, tasknr, rport; | 	int i, j, r, rport; | ||||||
|  | 	u32_t tasknr; | ||||||
| 	struct eth_conf *ecp; | 	struct eth_conf *ecp; | ||||||
| 	eth_port_t *eth_port, *rep; | 	eth_port_t *eth_port, *rep; | ||||||
| 	message mess; | 	message mess; | ||||||
| @ -102,7 +104,12 @@ PUBLIC void osdep_eth_init() | |||||||
| #ifdef __minix_vmd | #ifdef __minix_vmd | ||||||
| 		r= sys_findproc(ecp->ec_task, &tasknr, 0); | 		r= sys_findproc(ecp->ec_task, &tasknr, 0); | ||||||
| #else /* Minix 3 */ | #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  | #endif  | ||||||
| 		if (r != OK) | 		if (r != OK) | ||||||
| 		{ | 		{ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Philip Homburg
						Philip Homburg