Changes in / [7a46bfe:fb7e5a9a] in mainline
- Files:
-
- 6 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.common
r7a46bfe rfb7e5a9a 103 103 $(USPACE_PATH)/srv/fs/fat/fat \ 104 104 $(USPACE_PATH)/srv/fs/mfs/mfs \ 105 $(USPACE_PATH)/srv/fs/cdfs/cdfs \ 105 106 $(USPACE_PATH)/srv/fs/exfat/exfat \ 106 107 $(USPACE_PATH)/srv/fs/ext2fs/ext2fs \ -
tools/toolchain.sh
r7a46bfe rfb7e5a9a 53 53 EOF 54 54 55 BINUTILS_VERSION="2.21" 55 BINUTILS_VERSION="2.21.1" 56 BINUTILS_RELEASE="a" 56 57 GCC_VERSION="4.6.1" 57 GDB_VERSION="7. 2"58 GDB_VERSION="7.3.1" 58 59 59 60 BASEDIR="`pwd`" 60 BINUTILS="binutils-${BINUTILS_VERSION} .tar.bz2"61 BINUTILS="binutils-${BINUTILS_VERSION}${BINUTILS_RELEASE}.tar.bz2" 61 62 GCC_CORE="gcc-core-${GCC_VERSION}.tar.bz2" 62 63 GCC_OBJC="gcc-objc-${GCC_VERSION}.tar.bz2" … … 273 274 GDB_SOURCE="ftp://ftp.gnu.org/gnu/gdb/" 274 275 275 download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" " c84c5acc9d266f1a7044b51c85a823f5"276 download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "bde820eac53fa3a8d8696667418557ad" 276 277 download_fetch "${GCC_SOURCE}" "${GCC_CORE}" "0c0e7e35d2215e19de9c97efba507553" 277 278 download_fetch "${GCC_SOURCE}" "${GCC_OBJC}" "cbf0d4b701827922cf37ba6a4ace0079" 278 279 download_fetch "${GCC_SOURCE}" "${GCC_CPP}" "0d75ca7ca35b1e7f252223f9d23a6ad1" 279 download_fetch "${GDB_SOURCE}" "${GDB}" " 64260e6c56979ee750a01055f16091a5"280 download_fetch "${GDB_SOURCE}" "${GDB}" "b89a5fac359c618dda97b88645ceab47" 280 281 } 281 282 -
uspace/Makefile
r7a46bfe rfb7e5a9a 82 82 srv/fs/exfat \ 83 83 srv/fs/fat \ 84 srv/fs/cdfs \ 84 85 srv/fs/tmpfs \ 85 86 srv/fs/mfs \ -
uspace/app/mkmfs/mkmfs.c
r7a46bfe rfb7e5a9a 114 114 int rc, c, opt_ind; 115 115 char *device_name; 116 aoff64_t devblock_size;116 size_t devblock_size; 117 117 118 118 struct mfs_sb_info sb; -
uspace/drv/test/test1/test1.c
r7a46bfe rfb7e5a9a 42 42 static int test1_add_device(ddf_dev_t *dev); 43 43 static int test1_dev_remove(ddf_dev_t *dev); 44 static int test1_dev_gone(ddf_dev_t *dev); 44 45 static int test1_fun_online(ddf_fun_t *fun); 45 46 static int test1_fun_offline(ddf_fun_t *fun); … … 48 49 .add_device = &test1_add_device, 49 50 .dev_remove = &test1_dev_remove, 51 .dev_gone = &test1_dev_gone, 50 52 .fun_online = &test1_fun_online, 51 53 .fun_offline = &test1_fun_offline … … 213 215 } 214 216 217 static int fun_unbind(ddf_fun_t *fun, const char *name) 218 { 219 int rc; 220 221 ddf_msg(LVL_DEBUG, "fun_unbind(%p, '%s')", fun, name); 222 rc = ddf_fun_unbind(fun); 223 if (rc != EOK) { 224 ddf_msg(LVL_ERROR, "Failed unbinding function '%s'.", name); 225 return rc; 226 } 227 228 ddf_fun_destroy(fun); 229 return EOK; 230 } 231 215 232 static int test1_dev_remove(ddf_dev_t *dev) 216 233 { … … 234 251 if (test1->child != NULL) { 235 252 rc = fun_remove(test1->child, "child"); 253 if (rc != EOK) 254 return rc; 255 } 256 257 return EOK; 258 } 259 260 static int test1_dev_gone(ddf_dev_t *dev) 261 { 262 test1_t *test1 = (test1_t *)dev->driver_data; 263 int rc; 264 265 ddf_msg(LVL_DEBUG, "test1_dev_remove(%p)", dev); 266 267 if (test1->fun_a != NULL) { 268 rc = fun_unbind(test1->fun_a, "a"); 269 if (rc != EOK) 270 return rc; 271 } 272 273 if (test1->clone != NULL) { 274 rc = fun_unbind(test1->clone, "clone"); 275 if (rc != EOK) 276 return rc; 277 } 278 279 if (test1->child != NULL) { 280 rc = fun_unbind(test1->child, "child"); 236 281 if (rc != EOK) 237 282 return rc; -
uspace/drv/test/test2/test2.c
r7a46bfe rfb7e5a9a 42 42 static int test2_add_device(ddf_dev_t *dev); 43 43 static int test2_dev_remove(ddf_dev_t *dev); 44 static int test2_dev_gone(ddf_dev_t *dev); 44 45 static int test2_fun_online(ddf_fun_t *fun); 45 46 static int test2_fun_offline(ddf_fun_t *fun); … … 48 49 .add_device = &test2_add_device, 49 50 .dev_remove = &test2_dev_remove, 51 .dev_gone = &test2_dev_gone, 50 52 .fun_online = &test2_fun_online, 51 53 .fun_offline = &test2_fun_offline … … 111 113 } 112 114 113 /** Add child devices after some sleep.115 /** Simulate plugging and surprise unplugging. 114 116 * 115 117 * @param arg Parent device structure (ddf_dev_t *). 116 118 * @return Always EOK. 117 119 */ 118 static int p ostponed_birth(void *arg)120 static int plug_unplug(void *arg) 119 121 { 120 122 test2_t *test2 = (test2_t *) arg; … … 144 146 test2->fun_a = fun_a; 145 147 148 async_usleep(10000000); 149 150 ddf_msg(LVL_NOTE, "Unbinding function test1."); 151 ddf_fun_unbind(test2->test1); 152 async_usleep(1000000); 153 ddf_msg(LVL_NOTE, "Unbinding function child."); 154 ddf_fun_unbind(test2->child); 155 146 156 return EOK; 147 157 } … … 158 168 } 159 169 170 rc = ddf_fun_unbind(fun); 171 if (rc != EOK) { 172 ddf_msg(LVL_ERROR, "Failed unbinding function '%s'.", name); 173 return rc; 174 } 175 176 ddf_fun_destroy(fun); 177 return EOK; 178 } 179 180 static int fun_unbind(ddf_fun_t *fun, const char *name) 181 { 182 int rc; 183 184 ddf_msg(LVL_DEBUG, "fun_unbind(%p, '%s')", fun, name); 160 185 rc = ddf_fun_unbind(fun); 161 186 if (rc != EOK) { … … 184 209 185 210 if (str_cmp(dev->name, "child") != 0) { 186 fid_t postpone = fibril_create(p ostponed_birth, test2);211 fid_t postpone = fibril_create(plug_unplug, test2); 187 212 if (postpone == 0) { 188 213 ddf_msg(LVL_ERROR, "fibril_create() failed."); … … 232 257 } 233 258 259 static int test2_dev_gone(ddf_dev_t *dev) 260 { 261 test2_t *test2 = (test2_t *)dev->driver_data; 262 int rc; 263 264 ddf_msg(LVL_DEBUG, "test2_dev_gone(%p)", dev); 265 266 if (test2->fun_a != NULL) { 267 rc = fun_unbind(test2->fun_a, "a"); 268 if (rc != EOK) 269 return rc; 270 } 271 272 if (test2->fun_err != NULL) { 273 rc = fun_unbind(test2->fun_err, "ERROR"); 274 if (rc != EOK) 275 return rc; 276 } 277 278 if (test2->child != NULL) { 279 rc = fun_unbind(test2->child, "child"); 280 if (rc != EOK) 281 return rc; 282 } 283 284 if (test2->test1 != NULL) { 285 rc = fun_unbind(test2->test1, "test1"); 286 if (rc != EOK) 287 return rc; 288 } 289 290 return EOK; 291 } 292 234 293 235 294 static int test2_fun_online(ddf_fun_t *fun) … … 248 307 { 249 308 printf(NAME ": HelenOS test2 virtual device driver\n"); 250 ddf_log_init(NAME, LVL_ ERROR);309 ddf_log_init(NAME, LVL_NOTE); 251 310 return ddf_driver_main(&test2_driver); 252 311 } -
uspace/lib/block/libblock.c
r7a46bfe rfb7e5a9a 93 93 static int get_block_size(async_sess_t *, size_t *); 94 94 static int get_num_blocks(async_sess_t *, aoff64_t *); 95 static int read_toc(async_sess_t *, uint8_t);96 95 static aoff64_t ba_ltop(devcon_t *, aoff64_t); 97 96 … … 896 895 * @param service_id Service ID of the block device. 897 896 * @param session Starting session. 898 * @param data Buffer to read TOC into. 899 * 900 * @return EOK on success. 901 * @return Error code on failure. 902 * 903 */ 904 int block_get_toc(service_id_t service_id, uint8_t session, void *data) 897 * 898 * @return Allocated TOC structure. 899 * @return NULL on failure. 900 * 901 */ 902 toc_block_t *block_get_toc(service_id_t service_id, uint8_t session) 905 903 { 906 904 devcon_t *devcon = devcon_search(service_id); 907 905 assert(devcon); 908 906 907 toc_block_t *toc = NULL; 908 909 909 fibril_mutex_lock(&devcon->comm_area_lock); 910 910 911 int rc = read_toc(devcon->sess, session); 912 if (rc == EOK) 913 memcpy(data, devcon->comm_area, devcon->pblock_size); 911 async_exch_t *exch = async_exchange_begin(devcon->sess); 912 int rc = async_req_1_0(exch, BD_READ_TOC, session); 913 async_exchange_end(exch); 914 915 if (rc == EOK) { 916 toc = (toc_block_t *) malloc(sizeof(toc_block_t)); 917 if (toc != NULL) { 918 memset(toc, 0, sizeof(toc_block_t)); 919 memcpy(toc, devcon->comm_area, 920 min(devcon->pblock_size, sizeof(toc_block_t))); 921 } 922 } 923 914 924 915 925 fibril_mutex_unlock(&devcon->comm_area_lock); 916 926 917 return rc;927 return toc; 918 928 } 919 929 … … 1008 1018 } 1009 1019 1010 /** Get TOC from block device. */1011 static int read_toc(async_sess_t *sess, uint8_t session)1012 {1013 async_exch_t *exch = async_exchange_begin(sess);1014 int rc = async_req_1_0(exch, BD_READ_TOC, session);1015 async_exchange_end(exch);1016 1017 return rc;1018 }1019 1020 1020 /** Convert logical block address to physical block address. */ 1021 1021 static aoff64_t ba_ltop(devcon_t *devcon, aoff64_t lba) -
uspace/lib/block/libblock.h
r7a46bfe rfb7e5a9a 97 97 }; 98 98 99 typedef struct { 100 uint16_t size; 101 uint8_t first_session; 102 uint8_t last_session; 103 104 uint8_t res0; 105 uint8_t adr_ctrl; 106 uint8_t first_track; 107 uint8_t res1; 108 109 uint32_t first_lba; 110 } __attribute__((packed)) toc_block_t; 111 99 112 extern int block_init(exch_mgmt_t, service_id_t, size_t); 100 113 extern void block_fini(service_id_t); … … 114 127 extern int block_get_bsize(service_id_t, size_t *); 115 128 extern int block_get_nblocks(service_id_t, aoff64_t *); 116 extern int block_get_toc(service_id_t, uint8_t, void *);129 extern toc_block_t *block_get_toc(service_id_t, uint8_t); 117 130 extern int block_read_direct(service_id_t, aoff64_t, size_t, void *); 118 131 extern int block_read_bytes_direct(service_id_t, aoff64_t, size_t, void *); … … 123 136 /** @} 124 137 */ 125 -
uspace/lib/c/generic/str.c
r7a46bfe rfb7e5a9a 1291 1291 } 1292 1292 1293 /** Convert string to uint8_t. 1294 * 1295 * @param nptr Pointer to string. 1296 * @param endptr If not NULL, pointer to the first invalid character 1297 * is stored here. 1298 * @param base Zero or number between 2 and 36 inclusive. 1299 * @param strict Do not allow any trailing characters. 1300 * @param result Result of the conversion. 1301 * 1302 * @return EOK if conversion was successful. 1303 * 1304 */ 1305 int str_uint8_t(const char *nptr, char **endptr, unsigned int base, 1306 bool strict, uint8_t *result) 1307 { 1308 assert(result != NULL); 1309 1310 bool neg; 1311 char *lendptr; 1312 uint64_t res; 1313 int ret = str_uint(nptr, &lendptr, base, &neg, &res); 1314 1315 if (endptr != NULL) 1316 *endptr = (char *) lendptr; 1317 1318 if (ret != EOK) 1319 return ret; 1320 1321 /* Do not allow negative values */ 1322 if (neg) 1323 return EINVAL; 1324 1325 /* Check whether we are at the end of 1326 the string in strict mode */ 1327 if ((strict) && (*lendptr != 0)) 1328 return EINVAL; 1329 1330 /* Check for overflow */ 1331 uint8_t _res = (uint8_t) res; 1332 if (_res != res) 1333 return EOVERFLOW; 1334 1335 *result = _res; 1336 1337 return EOK; 1338 } 1339 1340 /** Convert string to uint16_t. 1341 * 1342 * @param nptr Pointer to string. 1343 * @param endptr If not NULL, pointer to the first invalid character 1344 * is stored here. 1345 * @param base Zero or number between 2 and 36 inclusive. 1346 * @param strict Do not allow any trailing characters. 1347 * @param result Result of the conversion. 1348 * 1349 * @return EOK if conversion was successful. 1350 * 1351 */ 1352 int str_uint16_t(const char *nptr, char **endptr, unsigned int base, 1353 bool strict, uint16_t *result) 1354 { 1355 assert(result != NULL); 1356 1357 bool neg; 1358 char *lendptr; 1359 uint64_t res; 1360 int ret = str_uint(nptr, &lendptr, base, &neg, &res); 1361 1362 if (endptr != NULL) 1363 *endptr = (char *) lendptr; 1364 1365 if (ret != EOK) 1366 return ret; 1367 1368 /* Do not allow negative values */ 1369 if (neg) 1370 return EINVAL; 1371 1372 /* Check whether we are at the end of 1373 the string in strict mode */ 1374 if ((strict) && (*lendptr != 0)) 1375 return EINVAL; 1376 1377 /* Check for overflow */ 1378 uint16_t _res = (uint16_t) res; 1379 if (_res != res) 1380 return EOVERFLOW; 1381 1382 *result = _res; 1383 1384 return EOK; 1385 } 1386 1387 /** Convert string to uint32_t. 1388 * 1389 * @param nptr Pointer to string. 1390 * @param endptr If not NULL, pointer to the first invalid character 1391 * is stored here. 1392 * @param base Zero or number between 2 and 36 inclusive. 1393 * @param strict Do not allow any trailing characters. 1394 * @param result Result of the conversion. 1395 * 1396 * @return EOK if conversion was successful. 1397 * 1398 */ 1399 int str_uint32_t(const char *nptr, char **endptr, unsigned int base, 1400 bool strict, uint32_t *result) 1401 { 1402 assert(result != NULL); 1403 1404 bool neg; 1405 char *lendptr; 1406 uint64_t res; 1407 int ret = str_uint(nptr, &lendptr, base, &neg, &res); 1408 1409 if (endptr != NULL) 1410 *endptr = (char *) lendptr; 1411 1412 if (ret != EOK) 1413 return ret; 1414 1415 /* Do not allow negative values */ 1416 if (neg) 1417 return EINVAL; 1418 1419 /* Check whether we are at the end of 1420 the string in strict mode */ 1421 if ((strict) && (*lendptr != 0)) 1422 return EINVAL; 1423 1424 /* Check for overflow */ 1425 uint32_t _res = (uint32_t) res; 1426 if (_res != res) 1427 return EOVERFLOW; 1428 1429 *result = _res; 1430 1431 return EOK; 1432 } 1433 1293 1434 /** Convert string to uint64_t. 1294 1435 * -
uspace/lib/c/include/ipc/devman.h
r7a46bfe rfb7e5a9a 147 147 DRIVER_DEV_ADD = IPC_FIRST_USER_METHOD, 148 148 DRIVER_DEV_REMOVE, 149 DRIVER_DEV_GONE, 149 150 DRIVER_FUN_ONLINE, 150 151 DRIVER_FUN_OFFLINE, 151 152 152 } devman_to_driver_t; 153 153 -
uspace/lib/c/include/str.h
r7a46bfe rfb7e5a9a 97 97 extern char *str_ndup(const char *, size_t max_size); 98 98 99 extern int str_uint8_t(const char *, char **, unsigned int, bool, uint8_t *); 100 extern int str_uint16_t(const char *, char **, unsigned int, bool, uint16_t *); 101 extern int str_uint32_t(const char *, char **, unsigned int, bool, uint32_t *); 99 102 extern int str_uint64(const char *, char **, unsigned int, bool, uint64_t *); 100 103 extern int str_size_t(const char *, char **, unsigned int, bool, size_t *); -
uspace/lib/drv/generic/driver.c
r7a46bfe rfb7e5a9a 333 333 } 334 334 335 static void driver_dev_gone(ipc_callid_t iid, ipc_call_t *icall) 336 { 337 devman_handle_t devh; 338 ddf_dev_t *dev; 339 int rc; 340 341 devh = IPC_GET_ARG1(*icall); 342 343 fibril_mutex_lock(&devices_mutex); 344 dev = driver_get_device(devh); 345 if (dev != NULL) 346 dev_add_ref(dev); 347 fibril_mutex_unlock(&devices_mutex); 348 349 if (dev == NULL) { 350 async_answer_0(iid, ENOENT); 351 return; 352 } 353 354 if (driver->driver_ops->dev_gone != NULL) 355 rc = driver->driver_ops->dev_gone(dev); 356 else 357 rc = ENOTSUP; 358 359 if (rc == EOK) 360 dev_del_ref(dev); 361 362 async_answer_0(iid, (sysarg_t) rc); 363 } 364 335 365 static void driver_fun_online(ipc_callid_t iid, ipc_call_t *icall) 336 366 { … … 423 453 case DRIVER_DEV_REMOVE: 424 454 driver_dev_remove(callid, &call); 455 break; 456 case DRIVER_DEV_GONE: 457 driver_dev_gone(callid, &call); 425 458 break; 426 459 case DRIVER_FUN_ONLINE: -
uspace/lib/drv/include/ddf/driver.h
r7a46bfe rfb7e5a9a 139 139 /** Ask driver to remove a device */ 140 140 int (*dev_remove)(ddf_dev_t *); 141 /** Inform driver a device disappeared */ 142 int (*dev_gone)(ddf_dev_t *); 141 143 /** Ask driver to online a specific function */ 142 144 int (*fun_online)(ddf_fun_t *); -
uspace/lib/fs/libfs.c
r7a46bfe rfb7e5a9a 837 837 stat.is_directory = ops->is_directory(fn); 838 838 stat.size = ops->size_get(fn); 839 stat.service = ops-> device_get(fn);839 stat.service = ops->service_get(fn); 840 840 841 841 ops->node_put(fn); -
uspace/lib/fs/libfs.h
r7a46bfe rfb7e5a9a 92 92 bool (* is_directory)(fs_node_t *); 93 93 bool (* is_file)(fs_node_t *); 94 service_id_t (* device_get)(fs_node_t *);94 service_id_t (* service_get)(fs_node_t *); 95 95 } libfs_ops_t; 96 96 -
uspace/srv/devman/devman.c
r7a46bfe rfb7e5a9a 878 878 879 879 return retval; 880 880 } 881 882 int driver_dev_gone(dev_tree_t *tree, dev_node_t *dev) 883 { 884 async_exch_t *exch; 885 sysarg_t retval; 886 driver_t *drv; 887 devman_handle_t handle; 888 889 assert(dev != NULL); 890 891 log_msg(LVL_DEBUG, "driver_dev_gone(%p)", dev); 892 893 fibril_rwlock_read_lock(&tree->rwlock); 894 drv = dev->drv; 895 handle = dev->handle; 896 fibril_rwlock_read_unlock(&tree->rwlock); 897 898 exch = async_exchange_begin(drv->sess); 899 retval = async_req_1_0(exch, DRIVER_DEV_GONE, handle); 900 async_exchange_end(exch); 901 902 return retval; 881 903 } 882 904 -
uspace/srv/devman/devman.h
r7a46bfe rfb7e5a9a 263 263 extern bool start_driver(driver_t *); 264 264 extern int driver_dev_remove(dev_tree_t *, dev_node_t *); 265 extern int driver_dev_gone(dev_tree_t *, dev_node_t *); 265 266 extern int driver_fun_online(dev_tree_t *, fun_node_t *); 266 267 extern int driver_fun_offline(dev_tree_t *, fun_node_t *); -
uspace/srv/devman/main.c
r7a46bfe rfb7e5a9a 316 316 if (fun->child != NULL) { 317 317 dev_node_t *dev = fun->child; 318 device_state_t dev_state; 318 319 319 320 dev_add_ref(dev); 321 dev_state = dev->state; 322 320 323 fibril_rwlock_write_unlock(&device_tree.rwlock); 321 324 322 325 /* If device is owned by driver, ask driver to give it up. */ 323 if (dev ->state == DEVICE_USABLE) {326 if (dev_state == DEVICE_USABLE) { 324 327 rc = driver_dev_remove(&device_tree, dev); 325 328 if (rc != EOK) { … … 333 336 if (!list_empty(&dev->functions)) { 334 337 fibril_rwlock_read_unlock(&device_tree.rwlock); 338 dev_del_ref(dev); 335 339 return EIO; 336 340 } 341 337 342 driver_t *driver = dev->drv; 338 343 fibril_rwlock_read_unlock(&device_tree.rwlock); … … 507 512 fun_node_t *fun; 508 513 int rc; 509 510 printf("devman_drv_fun_online()\n"); 514 515 log_msg(LVL_DEBUG, "devman_drv_fun_online()"); 516 511 517 fun = find_fun_node(&device_tree, IPC_GET_ARG1(*icall)); 512 518 if (fun == NULL) { … … 526 532 rc = online_function(fun); 527 533 if (rc != EOK) { 528 printf("devman_drv_fun_online() online_fun->ERROR\n");529 534 fun_del_ref(fun); 530 535 async_answer_0(iid, (sysarg_t) rc); … … 533 538 534 539 fun_del_ref(fun); 535 printf("devman_drv_fun_online() online_fun->OK\n");536 540 537 541 async_answer_0(iid, (sysarg_t) EOK); … … 580 584 int rc; 581 585 582 583 586 fun_node_t *fun = find_fun_node(&device_tree, fun_handle); 584 587 if (fun == NULL) { … … 599 602 600 603 if (fun->ftype == fun_inner) { 601 /* Handle possible descendants */ 602 /* TODO - This is a surprise removal */ 604 /* This is a surprise removal. Handle possible descendants */ 603 605 if (fun->child != NULL) { 604 log_msg(LVL_WARN, "devman_remove_function(): not handling " 605 "descendants\n"); 606 dev_node_t *dev = fun->child; 607 device_state_t dev_state; 608 int gone_rc; 609 610 dev_add_ref(dev); 611 dev_state = dev->state; 612 613 fibril_rwlock_write_unlock(&device_tree.rwlock); 614 615 /* If device is owned by driver, inform driver it is gone. */ 616 if (dev_state == DEVICE_USABLE) 617 gone_rc = driver_dev_gone(&device_tree, dev); 618 else 619 gone_rc = EOK; 620 621 fibril_rwlock_read_lock(&device_tree.rwlock); 622 623 /* Verify that driver succeeded and removed all functions */ 624 if (gone_rc != EOK || !list_empty(&dev->functions)) { 625 log_msg(LVL_ERROR, "Driver did not remove " 626 "functions for device that is gone. " 627 "Device node is now defunct."); 628 629 /* 630 * Not much we can do but mark the device 631 * node as having invalid state. This 632 * is a driver bug. 633 */ 634 dev->state = DEVICE_INVALID; 635 fibril_rwlock_read_unlock(&device_tree.rwlock); 636 dev_del_ref(dev); 637 return; 638 } 639 640 driver_t *driver = dev->drv; 641 fibril_rwlock_read_unlock(&device_tree.rwlock); 642 643 if (driver) 644 detach_driver(&device_tree, dev); 645 646 fibril_rwlock_write_lock(&device_tree.rwlock); 647 remove_dev_node(&device_tree, dev); 648 649 /* Delete ref created when node was inserted */ 650 dev_del_ref(dev); 651 /* Delete ref created by dev_add_ref(dev) above */ 652 dev_del_ref(dev); 606 653 } 607 654 } else { -
uspace/srv/fs/exfat/exfat_ops.c
r7a46bfe rfb7e5a9a 87 87 static bool exfat_is_directory(fs_node_t *); 88 88 static bool exfat_is_file(fs_node_t *node); 89 static service_id_t exfat_ device_get(fs_node_t *node);89 static service_id_t exfat_service_get(fs_node_t *node); 90 90 91 91 /* … … 898 898 } 899 899 900 service_id_t exfat_ device_get(fs_node_t *node)900 service_id_t exfat_service_get(fs_node_t *node) 901 901 { 902 902 return 0; … … 921 921 .is_directory = exfat_is_directory, 922 922 .is_file = exfat_is_file, 923 . device_get = exfat_device_get923 .service_get = exfat_service_get 924 924 }; 925 925 -
uspace/srv/fs/ext2fs/ext2fs_ops.c
r7a46bfe rfb7e5a9a 112 112 static bool ext2fs_is_directory(fs_node_t *); 113 113 static bool ext2fs_is_file(fs_node_t *node); 114 static service_id_t ext2fs_ device_get(fs_node_t *node);114 static service_id_t ext2fs_service_get(fs_node_t *node); 115 115 116 116 /* … … 557 557 } 558 558 559 service_id_t ext2fs_ device_get(fs_node_t *fn)559 service_id_t ext2fs_service_get(fs_node_t *fn) 560 560 { 561 561 EXT2FS_DBG(""); … … 581 581 .is_directory = ext2fs_is_directory, 582 582 .is_file = ext2fs_is_file, 583 . device_get = ext2fs_device_get583 .service_get = ext2fs_service_get 584 584 }; 585 585 -
uspace/srv/fs/fat/fat_ops.c
r7a46bfe rfb7e5a9a 90 90 static bool fat_is_directory(fs_node_t *); 91 91 static bool fat_is_file(fs_node_t *node); 92 static service_id_t fat_ device_get(fs_node_t *node);92 static service_id_t fat_service_get(fs_node_t *node); 93 93 94 94 /* … … 838 838 } 839 839 840 service_id_t fat_ device_get(fs_node_t *node)840 service_id_t fat_service_get(fs_node_t *node) 841 841 { 842 842 return 0; … … 860 860 .is_directory = fat_is_directory, 861 861 .is_file = fat_is_file, 862 . device_get = fat_device_get862 .service_get = fat_service_get 863 863 }; 864 864 -
uspace/srv/fs/locfs/locfs_ops.c
r7a46bfe rfb7e5a9a 418 418 } 419 419 420 static service_id_t locfs_ device_get(fs_node_t *fn)420 static service_id_t locfs_service_get(fs_node_t *fn) 421 421 { 422 422 locfs_node_t *node = (locfs_node_t *) fn->data; … … 445 445 .is_directory = locfs_is_directory, 446 446 .is_file = locfs_is_file, 447 . device_get = locfs_device_get447 .service_get = locfs_service_get 448 448 }; 449 449 -
uspace/srv/fs/mfs/mfs_ops.c
r7a46bfe rfb7e5a9a 55 55 static int mfs_has_children(bool *has_children, fs_node_t *fsnode); 56 56 static int mfs_root_get(fs_node_t **rfn, service_id_t service_id); 57 static service_id_t mfs_ device_get(fs_node_t *fsnode);57 static service_id_t mfs_service_get(fs_node_t *fsnode); 58 58 static aoff64_t mfs_size_get(fs_node_t *node); 59 59 static int mfs_match(fs_node_t **rfn, fs_node_t *pfn, const char *component); … … 81 81 .size_get = mfs_size_get, 82 82 .root_get = mfs_root_get, 83 . device_get = mfs_device_get,83 .service_get = mfs_service_get, 84 84 .is_directory = mfs_is_directory, 85 85 .is_file = mfs_is_file, … … 325 325 } 326 326 327 service_id_t mfs_ device_get(fs_node_t *fsnode)327 service_id_t mfs_service_get(fs_node_t *fsnode) 328 328 { 329 329 struct mfs_node *node = fsnode->data; -
uspace/srv/fs/tmpfs/tmpfs_ops.c
r7a46bfe rfb7e5a9a 114 114 } 115 115 116 static service_id_t tmpfs_ device_get(fs_node_t *fn)116 static service_id_t tmpfs_service_get(fs_node_t *fn) 117 117 { 118 118 return 0; … … 136 136 .is_directory = tmpfs_is_directory, 137 137 .is_file = tmpfs_is_file, 138 . device_get = tmpfs_device_get138 .service_get = tmpfs_service_get 139 139 }; 140 140 -
uspace/srv/loc/loc.c
r7a46bfe rfb7e5a9a 1277 1277 categ_dir_add_cat(&cdir, cat); 1278 1278 1279 cat = category_new("test3"); 1280 categ_dir_add_cat(&cdir, cat); 1281 1279 1282 cat = category_new("usbhc"); 1280 1283 categ_dir_add_cat(&cdir, cat); 1281 1284 1285 cat = category_new("virt-null"); 1286 categ_dir_add_cat(&cdir, cat); 1287 1282 1288 cat = category_new("virtual"); 1283 1289 categ_dir_add_cat(&cdir, cat); 1290 1284 1291 1285 1292 return true;
Note:
See TracChangeset
for help on using the changeset viewer.