Changeset 969d88e in mainline
- Timestamp:
- 2011-04-09T11:04:11Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 534d08e8
- Parents:
- 88ccd8b8 (diff), 17279ead (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. - Files:
-
- 2 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
r88ccd8b8 r969d88e 226 226 generic/src/proc/task.c \ 227 227 generic/src/proc/the.c \ 228 generic/src/proc/tasklet.c \229 228 generic/src/syscall/syscall.c \ 230 229 generic/src/syscall/copy.c \ … … 382 381 generic/src/main/kinit.c \ 383 382 generic/src/proc/the.c \ 384 generic/src/proc/tasklet.c \385 383 generic/src/mm/frame.c \ 386 384 generic/src/mm/page.c \ -
kernel/arch/mips32/include/atomic.h
r88ccd8b8 r969d88e 91 91 " sc %0, %1\n" 92 92 " beqz %0, 1b\n" 93 " nop\n" 93 94 "2:\n" 94 95 : "=&r" (tmp), -
kernel/generic/include/ipc/ipc.h
r88ccd8b8 r969d88e 115 115 */ 116 116 #define IPC_FF_ROUTE_FROM_ME (1 << 0) 117 118 /* Data transfer flags. */ 119 #define IPC_XF_NONE 0 120 121 /** Restrict the transfer size if necessary. */ 122 #define IPC_XF_RESTRICT (1 << 0) 117 123 118 124 /** Kernel IPC interfaces -
kernel/generic/src/ipc/sysipc.c
r88ccd8b8 r969d88e 426 426 case IPC_M_DATA_READ: { 427 427 size_t size = IPC_GET_ARG2(call->data); 428 if ( (size <= 0 || (size > DATA_XFER_LIMIT)))428 if (size <= 0) 429 429 return ELIMIT; 430 430 if (size > DATA_XFER_LIMIT) { 431 int flags = IPC_GET_ARG3(call->data); 432 if (flags & IPC_XF_RESTRICT) 433 IPC_SET_ARG2(call->data, DATA_XFER_LIMIT); 434 else 435 return ELIMIT; 436 } 431 437 break; 432 438 } … … 435 441 size_t size = IPC_GET_ARG2(call->data); 436 442 437 if (size > DATA_XFER_LIMIT) 438 return ELIMIT; 443 if (size > DATA_XFER_LIMIT) { 444 int flags = IPC_GET_ARG3(call->data); 445 if (flags & IPC_XF_RESTRICT) { 446 size = DATA_XFER_LIMIT; 447 IPC_SET_ARG2(call->data, size); 448 } else 449 return ELIMIT; 450 } 439 451 440 452 call->buffer = (uint8_t *) malloc(size, 0); -
kernel/generic/src/main/main.c
r88ccd8b8 r969d88e 58 58 #include <proc/thread.h> 59 59 #include <proc/task.h> 60 #include <proc/tasklet.h>61 60 #include <main/kinit.h> 62 61 #include <main/version.h> … … 217 216 tlb_init(); 218 217 ddi_init(); 219 tasklet_init();220 218 arch_post_mm_init(); 221 219 arch_pre_smp_init(); -
uspace/app/stats/stats.c
r88ccd8b8 r969d88e 265 265 /* Threads */ 266 266 if ((off = arg_parse_short_long(argv[i], "-t", "--task=")) != -1) { 267 / * TODO: Support for 64b range */267 // TODO: Support for 64b range 268 268 int tmp; 269 269 int ret = arg_parse_int(argc, argv, &i, &tmp, off); -
uspace/lib/c/arch/mips32/include/atomic.h
r88ccd8b8 r969d88e 70 70 " sc %0, %1\n" 71 71 " beq %0, %4, 1b\n" /* if the atomic operation failed, try again */ 72 /* nop */ /* nop is inserted automatically by compiler */73 72 " nop\n" 74 73 : "=&r" (tmp), -
uspace/lib/c/generic/async.c
r88ccd8b8 r969d88e 1572 1572 * @param dst Address of the beginning of the destination buffer. 1573 1573 * @param size Size of the destination buffer. 1574 * @param flags Flags to control the data transfer. 1574 1575 * 1575 1576 * @return Zero on success or a negative error code from errno.h. 1576 1577 * 1577 1578 */ 1578 int async_data_read_start(int phoneid, void *dst, size_t size) 1579 { 1580 return async_req_2_0(phoneid, IPC_M_DATA_READ, (sysarg_t) dst, 1581 (sysarg_t) size); 1579 int 1580 async_data_read_start_generic(int phoneid, void *dst, size_t size, int flags) 1581 { 1582 return async_req_3_0(phoneid, IPC_M_DATA_READ, (sysarg_t) dst, 1583 (sysarg_t) size, (sysarg_t) flags); 1582 1584 } 1583 1585 … … 1669 1671 * @param src Address of the beginning of the source buffer. 1670 1672 * @param size Size of the source buffer. 1673 * @param flags Flags to control the data transfer. 1671 1674 * 1672 1675 * @return Zero on success or a negative error code from errno.h. 1673 1676 * 1674 1677 */ 1675 int async_data_write_start(int phoneid, const void *src, size_t size) 1676 { 1677 return async_req_2_0(phoneid, IPC_M_DATA_WRITE, (sysarg_t) src, 1678 (sysarg_t) size); 1678 int 1679 async_data_write_start_generic(int phoneid, const void *src, size_t size, 1680 int flags) 1681 { 1682 return async_req_3_0(phoneid, IPC_M_DATA_WRITE, (sysarg_t) src, 1683 (sysarg_t) size, (sysarg_t) flags); 1679 1684 } 1680 1685 -
uspace/lib/c/generic/vfs/vfs.c
r88ccd8b8 r969d88e 378 378 379 379 req = async_send_1(vfs_phone, VFS_IN_READ, fildes, &answer); 380 rc = async_data_read_start(vfs_phone, (void *)buf, nbyte); 380 rc = async_data_read_start_generic(vfs_phone, (void *) buf, nbyte, 381 IPC_XF_RESTRICT); 381 382 if (rc != EOK) { 382 383 vfs_exchange_end(vfs_phone); … … 407 408 408 409 req = async_send_1(vfs_phone, VFS_IN_WRITE, fildes, &answer); 409 rc = async_data_write_start(vfs_phone, (void *)buf, nbyte); 410 rc = async_data_write_start_generic(vfs_phone, (void *) buf, nbyte, 411 IPC_XF_RESTRICT); 410 412 if (rc != EOK) { 411 413 vfs_exchange_end(vfs_phone); -
uspace/lib/c/include/async.h
r88ccd8b8 r969d88e 340 340 (arg4), (answer)) 341 341 342 extern int async_data_read_start(int, void *, size_t); 342 #define async_data_read_start(p, buf, len) \ 343 async_data_read_start_generic((p), (buf), (len), IPC_XF_NONE) 344 345 extern int async_data_read_start_generic(int, void *, size_t, int); 343 346 extern bool async_data_read_receive(ipc_callid_t *, size_t *); 344 347 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t); … … 379 382 (arg4), (answer)) 380 383 381 extern int async_data_write_start(int, const void *, size_t); 384 #define async_data_write_start(p, buf, len) \ 385 async_data_write_start_generic((p), (buf), (len), IPC_XF_NONE) 386 387 extern int async_data_write_start_generic(int, const void *, size_t, int); 382 388 extern bool async_data_write_receive(ipc_callid_t *, size_t *); 383 389 extern int async_data_write_finalize(ipc_callid_t, void *, size_t); -
uspace/lib/drv/generic/driver.c
r88ccd8b8 r969d88e 47 47 #include <stdlib.h> 48 48 #include <str.h> 49 #include <str_error.h> 49 50 #include <ctype.h> 50 51 #include <errno.h> … … 655 656 int ddf_driver_main(driver_t *drv) 656 657 { 658 int rc; 659 657 660 /* 658 661 * Remember the driver structure - driver_ops will be called by generic … … 668 671 669 672 /* 670 * Register driver by device manager with generic handler for incoming671 * connections.673 * Register driver with device manager using generic handler for 674 * incoming connections. 672 675 */ 673 devman_driver_register(driver->name, driver_connection); 674 676 rc = devman_driver_register(driver->name, driver_connection); 677 if (rc != EOK) { 678 printf("Error: Failed to register driver with device manager " 679 "(%s).\n", (rc == EEXISTS) ? "driver already started" : 680 str_error(rc)); 681 682 return 1; 683 } 684 685 /* Return success from the task since server has started. */ 686 rc = task_retval(0); 687 if (rc != EOK) 688 return 1; 689 675 690 async_manager(); 676 691 -
uspace/lib/net/generic/net_checksum.c
r88ccd8b8 r969d88e 106 106 seed = (seed << 1) ^ ((uint32_t) CRC_DIVIDER_BE); 107 107 } else { 108 /* shift otherwise */108 /* Shift otherwise */ 109 109 seed <<= 1; 110 110 } -
uspace/lib/net/il/ip_client.c
r88ccd8b8 r969d88e 123 123 return EOK; 124 124 125 /* TODO IPv6 */ 126 /* case AF_INET6: 125 // TODO IPv6 126 #if 0 127 case AF_INET6: 127 128 if (addrlen != sizeof(struct sockaddr_in6)) 128 129 return EINVAL; … … 130 131 address_in6 = (struct sockaddr_in6 *) addr; 131 132 return EOK; 132 */ 133 #endif 133 134 134 135 default: … … 258 259 header_in->data_length = htons(data_length); 259 260 return EOK; 260 / * TODO IPv6 */261 // TODO IPv6 261 262 } else { 262 263 return EINVAL; -
uspace/lib/net/include/ip_client.h
r88ccd8b8 r969d88e 54 54 socklen_t, struct sockaddr *, socklen_t, size_t, void **, size_t *); 55 55 56 / * TODO ipopt manipulation */56 // TODO ipopt manipulation 57 57 58 58 #endif -
uspace/lib/net/tl/socket_core.c
r88ccd8b8 r969d88e 306 306 307 307 case AF_INET6: 308 / * TODO IPv6 */308 // TODO IPv6 309 309 break; 310 310 } … … 376 376 377 377 count = 0; 378 // socket_id = socket_globals.last_id; 378 #if 0 379 socket_id = socket_globals.last_id; 380 #endif 379 381 do { 380 382 if (count < SOCKET_ID_TRIES) { … … 388 390 if (socket_id < INT_MAX) { 389 391 ++ socket_id; 390 /* } else if(socket_globals.last_id) { 391 * socket_globals.last_id = 0; 392 * socket_id = 1; 393 */ } else { 392 #if 0 393 } else if(socket_globals.last_id) { 394 socket_globals.last_id = 0; 395 socket_id = 1; 396 #endif 397 } else { 394 398 return ELIMIT; 395 399 } -
uspace/srv/devman/devman.c
r88ccd8b8 r969d88e 555 555 } 556 556 557 /** Remember the driver's phone.558 *559 * @param driver The driver.560 * @param phone The phone to the driver.561 */562 void set_driver_phone(driver_t *driver, sysarg_t phone)563 {564 fibril_mutex_lock(&driver->driver_mutex);565 assert(driver->state == DRIVER_STARTING);566 driver->phone = phone;567 fibril_mutex_unlock(&driver->driver_mutex);568 }569 570 557 /** Notify driver about the devices to which it was assigned. 571 558 * … … 685 672 list_initialize(&drv->devices); 686 673 fibril_mutex_initialize(&drv->driver_mutex); 674 drv->phone = -1; 687 675 } 688 676 -
uspace/srv/devman/devman.h
r88ccd8b8 r969d88e 88 88 89 89 /** Phone asociated with this driver. */ 90 sysarg_t phone;90 int phone; 91 91 /** Name of the device driver. */ 92 92 char *name; … … 316 316 317 317 extern driver_t *find_driver(driver_list_t *, const char *); 318 extern void set_driver_phone(driver_t *, sysarg_t);319 318 extern void initialize_running_driver(driver_t *, dev_tree_t *); 320 319 -
uspace/srv/devman/main.c
r88ccd8b8 r969d88e 95 95 /* Find driver structure. */ 96 96 driver = find_driver(&drivers_list, drv_name); 97 98 97 if (driver == NULL) { 99 98 log_msg(LVL_ERROR, "No driver named `%s' was found.", drv_name); … … 107 106 drv_name = NULL; 108 107 108 fibril_mutex_lock(&driver->driver_mutex); 109 110 if (driver->phone >= 0) { 111 /* We already have a connection to the driver. */ 112 log_msg(LVL_ERROR, "Driver '%s' already started.\n", 113 driver->name); 114 fibril_mutex_unlock(&driver->driver_mutex); 115 async_answer_0(iid, EEXISTS); 116 return NULL; 117 } 118 119 switch (driver->state) { 120 case DRIVER_NOT_STARTED: 121 /* Somebody started the driver manually. */ 122 log_msg(LVL_NOTE, "Driver '%s' started manually.\n", 123 driver->name); 124 driver->state = DRIVER_STARTING; 125 break; 126 case DRIVER_STARTING: 127 /* The expected case */ 128 break; 129 case DRIVER_RUNNING: 130 /* Should not happen since we do not have a connected phone */ 131 assert(false); 132 } 133 109 134 /* Create connection to the driver. */ 110 135 log_msg(LVL_DEBUG, "Creating connection to the `%s' driver.", … … 113 138 ipc_callid_t callid = async_get_call(&call); 114 139 if (IPC_GET_IMETHOD(call) != IPC_M_CONNECT_TO_ME) { 140 fibril_mutex_unlock(&driver->driver_mutex); 115 141 async_answer_0(callid, ENOTSUP); 116 142 async_answer_0(iid, ENOTSUP); … … 119 145 120 146 /* Remember driver's phone. */ 121 set_driver_phone(driver, IPC_GET_ARG5(call)); 147 driver->phone = IPC_GET_ARG5(call); 148 149 fibril_mutex_unlock(&driver->driver_mutex); 122 150 123 151 log_msg(LVL_NOTE, … … 578 606 method = DRIVER_CLIENT; 579 607 580 if (driver->phone < =0) {608 if (driver->phone < 0) { 581 609 log_msg(LVL_ERROR, 582 610 "Could not forward to driver `%s' (phone is %d).", … … 618 646 dev = fun->dev; 619 647 620 if (dev->state != DEVICE_USABLE || dev->drv->phone < =0) {648 if (dev->state != DEVICE_USABLE || dev->drv->phone < 0) { 621 649 async_answer_0(iid, EINVAL); 622 650 return; -
uspace/srv/fs/fat/fat_ops.c
r88ccd8b8 r969d88e 722 722 (str_cmp((char *) d->name, FAT_NAME_DOT)) == 0) { 723 723 memset(d, 0, sizeof(fat_dentry_t)); 724 str_cpy((char *) d->name, 8, FAT_NAME_DOT);725 str_cpy((char *) d->ext, 3, FAT_EXT_PAD);724 memcpy(d->name, FAT_NAME_DOT, FAT_NAME_LEN); 725 memcpy(d->ext, FAT_EXT_PAD, FAT_EXT_LEN); 726 726 d->attr = FAT_ATTR_SUBDIR; 727 727 d->firstc = host2uint16_t_le(childp->firstc); … … 732 732 (str_cmp((char *) d->name, FAT_NAME_DOT_DOT) == 0)) { 733 733 memset(d, 0, sizeof(fat_dentry_t)); 734 str_cpy((char *) d->name, 8, FAT_NAME_DOT_DOT);735 str_cpy((char *) d->ext, 3, FAT_EXT_PAD);734 memcpy(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN); 735 memcpy(d->ext, FAT_EXT_PAD, FAT_EXT_LEN); 736 736 d->attr = FAT_ATTR_SUBDIR; 737 737 d->firstc = (parentp->firstc == FAT_CLST_ROOT) ? -
uspace/srv/hw/irc/apic/apic.c
r88ccd8b8 r969d88e 56 56 static int apic_enable_irq(sysarg_t irq) 57 57 { 58 / * FIXME: TODO */58 // FIXME: TODO 59 59 return ENOTSUP; 60 60 } -
uspace/srv/net/il/ip/ip.c
r88ccd8b8 r969d88e 365 365 366 366 if (ip_netif->dhcp) { 367 / * TODO dhcp */367 // TODO dhcp 368 368 net_free_settings(configuration, data); 369 369 return ENOTSUP; … … 398 398 } 399 399 } else { 400 / * TODO ipv6 in separate module */400 // TODO ipv6 in separate module 401 401 net_free_settings(configuration, data); 402 402 return ENOTSUP; … … 517 517 ip_netif->dhcp ? "dhcp" : "static"); 518 518 519 / * TODO ipv6 addresses */519 // TODO ipv6 addresses 520 520 521 521 char address[INET_ADDRSTRLEN]; … … 946 946 947 947 /* Greatest multiple of 8 lower than content */ 948 / * TODO even fragmentation? */948 // TODO even fragmentation? 949 949 length = length & ~0x7; 950 950 … … 1212 1212 } 1213 1213 1214 /* Ff the local host is the destination */1214 /* If the local host is the destination */ 1215 1215 if ((route->address.s_addr == dest->s_addr) && 1216 1216 (dest->s_addr != IPV4_LOCALHOST_ADDRESS)) { … … 1279 1279 in_addr_t destination; 1280 1280 1281 / * TODO search set ipopt route? */1281 // TODO search set ipopt route? 1282 1282 destination.s_addr = header->destination_address; 1283 1283 return destination; … … 1321 1321 if ((header->flags & IPFLAG_MORE_FRAGMENTS) || 1322 1322 IP_FRAGMENT_OFFSET(header)) { 1323 / * TODO fragmented */1323 // TODO fragmented 1324 1324 return ENOTSUP; 1325 1325 } … … 1437 1437 phone = ip_prepare_icmp_and_get_phone(0, packet, header); 1438 1438 if (phone >= 0) { 1439 /* ttlexceeded ICMP */1439 /* TTL exceeded ICMP */ 1440 1440 icmp_time_exceeded_msg(phone, ICMP_EXC_TTL, packet); 1441 1441 } … … 1777 1777 if ((type != ICMP_DEST_UNREACH) || 1778 1778 (code != ICMP_HOST_UNREACH)) { 1779 1779 /* No, something else */ 1780 1780 break; 1781 1781 } -
uspace/srv/vfs/vfs_file.c
r88ccd8b8 r969d88e 258 258 if ((fd >= 0) && (fd < MAX_OPEN_FILES)) { 259 259 vfs_file_t *file = FILES[fd]; 260 vfs_file_addref(file); 261 fibril_mutex_unlock(&VFS_DATA->lock); 262 return file; 260 if (file != NULL) { 261 vfs_file_addref(file); 262 fibril_mutex_unlock(&VFS_DATA->lock); 263 return file; 264 } 263 265 } 264 266 fibril_mutex_unlock(&VFS_DATA->lock); -
uspace/srv/vfs/vfs_ops.c
r88ccd8b8 r969d88e 611 611 void vfs_open_node(ipc_callid_t rid, ipc_call_t *request) 612 612 { 613 / * FIXME: check for sanity of the supplied fs, dev and index */613 // FIXME: check for sanity of the supplied fs, dev and index 614 614 615 615 /*
Note:
See TracChangeset
for help on using the changeset viewer.