Changeset 45f04f8 in mainline for uspace/lib/c
- Timestamp:
- 2010-11-18T18:23:43Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3f0a7971, a7811f17, cb569e6
- Parents:
- 51a268f (diff), c63e70c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/lib/c
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/devman.c
r51a268f r45f04f8 141 141 142 142 int devman_child_device_register( 143 const char *name, match_id_list_t *match_ids, dev ice_handle_t parent_handle, device_handle_t *handle)143 const char *name, match_id_list_t *match_ids, devman_handle_t parent_handle, devman_handle_t *handle) 144 144 { 145 145 int phone = devman_get_phone(DEVMAN_DRIVER, IPC_FLAG_BLOCKING); … … 180 180 } 181 181 182 int devman_add_device_to_class(dev ice_handle_t dev_handle, const char *class_name)182 int devman_add_device_to_class(devman_handle_t devman_handle, const char *class_name) 183 183 { 184 184 int phone = devman_get_phone(DEVMAN_DRIVER, IPC_FLAG_BLOCKING); … … 189 189 async_serialize_start(); 190 190 ipc_call_t answer; 191 aid_t req = async_send_1(phone, DEVMAN_ADD_DEVICE_TO_CLASS, dev _handle, &answer);191 aid_t req = async_send_1(phone, DEVMAN_ADD_DEVICE_TO_CLASS, devman_handle, &answer); 192 192 193 193 ipcarg_t retval = async_data_write_start(phone, class_name, str_size(class_name)); … … 224 224 } 225 225 226 int devman_device_connect(dev ice_handle_t handle, unsigned int flags)226 int devman_device_connect(devman_handle_t handle, unsigned int flags) 227 227 { 228 228 int phone; … … 239 239 } 240 240 241 int devman_parent_device_connect(dev ice_handle_t handle, unsigned int flags)241 int devman_parent_device_connect(devman_handle_t handle, unsigned int flags) 242 242 { 243 243 int phone; … … 254 254 } 255 255 256 int devman_device_get_handle(const char *pathname, dev ice_handle_t *handle, unsigned int flags)256 int devman_device_get_handle(const char *pathname, devman_handle_t *handle, unsigned int flags) 257 257 { 258 258 int phone = devman_get_phone(DEVMAN_CLIENT, flags); … … 280 280 if (retval != EOK) { 281 281 if (handle != NULL) 282 *handle = (dev ice_handle_t) -1;282 *handle = (devman_handle_t) -1; 283 283 return retval; 284 284 } 285 285 286 286 if (handle != NULL) 287 *handle = (dev ice_handle_t) IPC_GET_ARG1(answer);287 *handle = (devman_handle_t) IPC_GET_ARG1(answer); 288 288 289 289 return retval; -
uspace/lib/c/generic/devmap.c
r51a268f r45f04f8 132 132 * 133 133 */ 134 int devmap_device_register(const char *fqdn, dev _handle_t *handle)134 int devmap_device_register(const char *fqdn, devmap_handle_t *handle) 135 135 { 136 136 int phone = devmap_get_phone(DEVMAP_DRIVER, IPC_FLAG_BLOCKING); … … 163 163 164 164 if (handle != NULL) 165 *handle = (dev _handle_t) IPC_GET_ARG1(answer);165 *handle = (devmap_handle_t) IPC_GET_ARG1(answer); 166 166 167 167 return retval; 168 168 } 169 169 170 int devmap_device_get_handle(const char *fqdn, dev _handle_t *handle, unsigned int flags)170 int devmap_device_get_handle(const char *fqdn, devmap_handle_t *handle, unsigned int flags) 171 171 { 172 172 int phone = devmap_get_phone(DEVMAP_CLIENT, flags); … … 194 194 if (retval != EOK) { 195 195 if (handle != NULL) 196 *handle = (dev _handle_t) -1;196 *handle = (devmap_handle_t) -1; 197 197 return retval; 198 198 } 199 199 200 200 if (handle != NULL) 201 *handle = (dev _handle_t) IPC_GET_ARG1(answer);201 *handle = (devmap_handle_t) IPC_GET_ARG1(answer); 202 202 203 203 return retval; 204 204 } 205 205 206 int devmap_namespace_get_handle(const char *name, dev _handle_t *handle, unsigned int flags)206 int devmap_namespace_get_handle(const char *name, devmap_handle_t *handle, unsigned int flags) 207 207 { 208 208 int phone = devmap_get_phone(DEVMAP_CLIENT, flags); … … 230 230 if (retval != EOK) { 231 231 if (handle != NULL) 232 *handle = (dev _handle_t) -1;232 *handle = (devmap_handle_t) -1; 233 233 return retval; 234 234 } 235 235 236 236 if (handle != NULL) 237 *handle = (dev _handle_t) IPC_GET_ARG1(answer);237 *handle = (devmap_handle_t) IPC_GET_ARG1(answer); 238 238 239 239 return retval; 240 240 } 241 241 242 devmap_handle_type_t devmap_handle_probe(dev _handle_t handle)242 devmap_handle_type_t devmap_handle_probe(devmap_handle_t handle) 243 243 { 244 244 int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING); … … 255 255 } 256 256 257 int devmap_device_connect(dev _handle_t handle, unsigned int flags)257 int devmap_device_connect(devmap_handle_t handle, unsigned int flags) 258 258 { 259 259 int phone; … … 305 305 } 306 306 307 static size_t devmap_count_devices_internal(int phone, dev _handle_t ns_handle)307 static size_t devmap_count_devices_internal(int phone, devmap_handle_t ns_handle) 308 308 { 309 309 ipcarg_t count; … … 325 325 } 326 326 327 size_t devmap_count_devices(dev _handle_t ns_handle)327 size_t devmap_count_devices(devmap_handle_t ns_handle) 328 328 { 329 329 int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING); … … 387 387 } 388 388 389 size_t devmap_get_devices(dev _handle_t ns_handle, dev_desc_t **data)389 size_t devmap_get_devices(devmap_handle_t ns_handle, dev_desc_t **data) 390 390 { 391 391 int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING); -
uspace/lib/c/generic/vfs/vfs.c
r51a268f r45f04f8 136 136 } 137 137 138 dev _handle_t dev_handle;139 int res = devmap_device_get_handle(fqdn, &dev _handle, flags);138 devmap_handle_t devmap_handle; 139 int res = devmap_device_get_handle(fqdn, &devmap_handle, flags); 140 140 if (res != EOK) { 141 141 if (null_id != -1) … … 159 159 160 160 ipcarg_t rc_orig; 161 aid_t req = async_send_2(vfs_phone, VFS_IN_MOUNT, dev _handle, flags, NULL);161 aid_t req = async_send_2(vfs_phone, VFS_IN_MOUNT, devmap_handle, flags, NULL); 162 162 ipcarg_t rc = async_data_write_start(vfs_phone, (void *) mpa, mpa_size); 163 163 if (rc != EOK) { … … 328 328 ipc_call_t answer; 329 329 aid_t req = async_send_4(vfs_phone, VFS_IN_OPEN_NODE, node->fs_handle, 330 node->dev _handle, node->index, oflag, &answer);330 node->devmap_handle, node->index, oflag, &answer); 331 331 332 332 ipcarg_t rc; … … 797 797 if (rc == EOK) { 798 798 node->fs_handle = stat.fs_handle; 799 node->dev _handle = stat.dev_handle;799 node->devmap_handle = stat.devmap_handle; 800 800 node->index = stat.index; 801 801 } -
uspace/lib/c/include/devman.h
r51a268f r45f04f8 42 42 43 43 44 int devman_get_phone(devman_interface_t, unsigned int);45 void devman_hangup_phone(devman_interface_t iface);44 extern int devman_get_phone(devman_interface_t, unsigned int); 45 extern void devman_hangup_phone(devman_interface_t); 46 46 47 int devman_driver_register(const char *, async_client_conn_t); 48 int devman_child_device_register(const char *, match_id_list_t *, device_handle_t, device_handle_t *); 47 extern int devman_driver_register(const char *, async_client_conn_t); 48 extern int devman_child_device_register(const char *, match_id_list_t *, 49 devman_handle_t, devman_handle_t *); 49 50 50 int devman_device_connect(device_handle_t handle, unsigned int flags);51 int devman_parent_device_connect(device_handle_t handle, unsigned int flags);51 extern int devman_device_connect(devman_handle_t, unsigned int); 52 extern int devman_parent_device_connect(devman_handle_t, unsigned int); 52 53 53 int devman_device_get_handle(const char *pathname, device_handle_t *handle, unsigned int flags); 54 extern int devman_device_get_handle(const char *, devman_handle_t *, 55 unsigned int); 54 56 55 int devman_add_device_to_class(device_handle_t dev_handle, const char *class_name);57 extern int devman_add_device_to_class(devman_handle_t, const char *); 56 58 57 59 #endif -
uspace/lib/c/include/devmap.h
r51a268f r45f04f8 44 44 45 45 extern int devmap_driver_register(const char *, async_client_conn_t); 46 extern int devmap_device_register(const char *, dev _handle_t *);46 extern int devmap_device_register(const char *, devmap_handle_t *); 47 47 48 extern int devmap_device_get_handle(const char *, dev _handle_t *, unsigned int);49 extern int devmap_namespace_get_handle(const char *, dev _handle_t *, unsigned int);50 extern devmap_handle_type_t devmap_handle_probe(dev _handle_t);48 extern int devmap_device_get_handle(const char *, devmap_handle_t *, unsigned int); 49 extern int devmap_namespace_get_handle(const char *, devmap_handle_t *, unsigned int); 50 extern devmap_handle_type_t devmap_handle_probe(devmap_handle_t); 51 51 52 extern int devmap_device_connect(dev _handle_t, unsigned int);52 extern int devmap_device_connect(devmap_handle_t, unsigned int); 53 53 54 54 extern int devmap_null_create(void); … … 56 56 57 57 extern size_t devmap_count_namespaces(void); 58 extern size_t devmap_count_devices(dev _handle_t);58 extern size_t devmap_count_devices(devmap_handle_t); 59 59 60 60 extern size_t devmap_get_namespaces(dev_desc_t **); 61 extern size_t devmap_get_devices(dev _handle_t, dev_desc_t **);61 extern size_t devmap_get_devices(devmap_handle_t, dev_desc_t **); 62 62 63 63 #endif -
uspace/lib/c/include/ipc/devman.h
r51a268f r45f04f8 42 42 #define DEVMAN_NAME_MAXLEN 256 43 43 44 typedef ipcarg_t dev ice_handle_t;44 typedef ipcarg_t devman_handle_t; 45 45 46 46 /** Ids of device models used for device-to-driver matching. -
uspace/lib/c/include/ipc/devmap.h
r51a268f r45f04f8 40 40 #define DEVMAP_NAME_MAXLEN 255 41 41 42 typedef ipcarg_t dev _handle_t;42 typedef ipcarg_t devmap_handle_t; 43 43 44 44 typedef enum { … … 81 81 82 82 typedef struct { 83 dev _handle_t handle;83 devmap_handle_t handle; 84 84 char name[DEVMAP_NAME_MAXLEN + 1]; 85 85 } dev_desc_t; -
uspace/lib/c/include/sys/stat.h
r51a268f r45f04f8 43 43 struct stat { 44 44 fs_handle_t fs_handle; 45 dev _handle_t dev_handle;45 devmap_handle_t devmap_handle; 46 46 fs_index_t index; 47 47 unsigned int lnkcnt; … … 49 49 bool is_directory; 50 50 aoff64_t size; 51 dev _handle_t device;51 devmap_handle_t device; 52 52 }; 53 53 -
uspace/lib/c/include/vfs/vfs.h
r51a268f r45f04f8 47 47 typedef struct { 48 48 fs_handle_t fs_handle; 49 dev _handle_t dev_handle;49 devmap_handle_t devmap_handle; 50 50 fs_index_t index; 51 51 } fdi_node_t;
Note:
See TracChangeset
for help on using the changeset viewer.