Changes in uspace/lib/c/generic/devman.c [622dea8:96b02eb9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/devman.c
r622dea8 r96b02eb9 42 42 #include <devman.h> 43 43 #include <async.h> 44 #include <fibril_synch.h>45 44 #include <errno.h> 46 45 #include <malloc.h> … … 51 50 static int devman_phone_client = -1; 52 51 53 static FIBRIL_MUTEX_INITIALIZE(devman_phone_mutex);54 55 52 int devman_get_phone(devman_interface_t iface, unsigned int flags) 56 53 { 57 54 switch (iface) { 58 55 case DEVMAN_DRIVER: 59 fibril_mutex_lock(&devman_phone_mutex); 60 if (devman_phone_driver >= 0) { 61 fibril_mutex_unlock(&devman_phone_mutex); 56 if (devman_phone_driver >= 0) 62 57 return devman_phone_driver; 63 }64 58 65 59 if (flags & IPC_FLAG_BLOCKING) 66 devman_phone_driver = async_connect_me_to_blocking(67 PHONE_NS,SERVICE_DEVMAN, DEVMAN_DRIVER, 0);60 devman_phone_driver = ipc_connect_me_to_blocking(PHONE_NS, 61 SERVICE_DEVMAN, DEVMAN_DRIVER, 0); 68 62 else 69 devman_phone_driver = async_connect_me_to(PHONE_NS,63 devman_phone_driver = ipc_connect_me_to(PHONE_NS, 70 64 SERVICE_DEVMAN, DEVMAN_DRIVER, 0); 71 65 72 fibril_mutex_unlock(&devman_phone_mutex);73 66 return devman_phone_driver; 74 67 case DEVMAN_CLIENT: 75 fibril_mutex_lock(&devman_phone_mutex); 76 if (devman_phone_client >= 0) { 77 fibril_mutex_unlock(&devman_phone_mutex); 68 if (devman_phone_client >= 0) 78 69 return devman_phone_client; 79 }80 70 81 71 if (flags & IPC_FLAG_BLOCKING) 82 devman_phone_client = async_connect_me_to_blocking(83 PHONE_NS,SERVICE_DEVMAN, DEVMAN_CLIENT, 0);72 devman_phone_client = ipc_connect_me_to_blocking(PHONE_NS, 73 SERVICE_DEVMAN, DEVMAN_CLIENT, 0); 84 74 else 85 devman_phone_client = async_connect_me_to(PHONE_NS,75 devman_phone_client = ipc_connect_me_to(PHONE_NS, 86 76 SERVICE_DEVMAN, DEVMAN_CLIENT, 0); 87 fibril_mutex_unlock(&devman_phone_mutex); 88 89 fibril_mutex_unlock(&devman_phone_mutex); 77 90 78 return devman_phone_client; 91 79 default: … … 242 230 243 231 if (flags & IPC_FLAG_BLOCKING) { 244 phone = async_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN,232 phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN, 245 233 DEVMAN_CONNECT_TO_DEVICE, handle); 246 234 } else { 247 phone = async_connect_me_to(PHONE_NS, SERVICE_DEVMAN,235 phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAN, 248 236 DEVMAN_CONNECT_TO_DEVICE, handle); 249 237 } … … 257 245 258 246 if (flags & IPC_FLAG_BLOCKING) { 259 phone = async_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN,247 phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAN, 260 248 DEVMAN_CONNECT_TO_PARENTS_DEVICE, handle); 261 249 } else { 262 phone = async_connect_me_to(PHONE_NS, SERVICE_DEVMAN,250 phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAN, 263 251 DEVMAN_CONNECT_TO_PARENTS_DEVICE, handle); 264 252 }
Note:
See TracChangeset
for help on using the changeset viewer.