Changes in / [55132b8:e4f2656] in mainline


Ignore:
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/ipc/ipc.h

    r55132b8 re4f2656  
    115115 */
    116116#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)
    123117
    124118/** Kernel IPC interfaces
  • kernel/generic/src/ipc/sysipc.c

    r55132b8 re4f2656  
    426426        case IPC_M_DATA_READ: {
    427427                size_t size = IPC_GET_ARG2(call->data);
    428                 if (size <= 0)
     428                if ((size <= 0 || (size > DATA_XFER_LIMIT)))
    429429                        return ELIMIT;
    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                 }
     430               
    437431                break;
    438432        }
     
    441435                size_t size = IPC_GET_ARG2(call->data);
    442436               
    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                 }
     437                if (size > DATA_XFER_LIMIT)
     438                        return ELIMIT;
    451439               
    452440                call->buffer = (uint8_t *) malloc(size, 0);
  • uspace/lib/c/generic/async.c

    r55132b8 re4f2656  
    15721572 * @param dst     Address of the beginning of the destination buffer.
    15731573 * @param size    Size of the destination buffer.
    1574  * @param flags   Flags to control the data transfer.
    15751574 *
    15761575 * @return Zero on success or a negative error code from errno.h.
    15771576 *
    15781577 */
    1579 int
    1580 async_data_read_start_flexible(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);
     1578int 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);
    15841582}
    15851583
     
    16711669 * @param src     Address of the beginning of the source buffer.
    16721670 * @param size    Size of the source buffer.
    1673  * @param flags   Flags to control the data transfer.
    16741671 *
    16751672 * @return Zero on success or a negative error code from errno.h.
    16761673 *
    16771674 */
    1678 int
    1679 async_data_write_start_flexible(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);
     1675int 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);
    16841679}
    16851680
  • uspace/lib/c/generic/vfs/vfs.c

    r55132b8 re4f2656  
    378378       
    379379        req = async_send_1(vfs_phone, VFS_IN_READ, fildes, &answer);
    380         rc = async_data_read_start_flexible(vfs_phone, (void *) buf, nbyte,
    381             IPC_XF_RESTRICT);
     380        rc = async_data_read_start(vfs_phone, (void *)buf, nbyte);
    382381        if (rc != EOK) {
    383382                vfs_exchange_end(vfs_phone);
     
    408407       
    409408        req = async_send_1(vfs_phone, VFS_IN_WRITE, fildes, &answer);
    410         rc = async_data_write_start_flexible(vfs_phone, (void *) buf, nbyte,
    411             IPC_XF_RESTRICT);
     409        rc = async_data_write_start(vfs_phone, (void *)buf, nbyte);
    412410        if (rc != EOK) {
    413411                vfs_exchange_end(vfs_phone);
  • uspace/lib/c/include/async.h

    r55132b8 re4f2656  
    340340            (arg4), (answer))
    341341
    342 #define async_data_read_start(p, buf, len) \
    343         async_data_read_start_flexible((p), (buf), (len), IPC_XF_NONE)
    344 
    345 extern int async_data_read_start_flexible(int, void *, size_t, int);
     342extern int async_data_read_start(int, void *, size_t);
    346343extern bool async_data_read_receive(ipc_callid_t *, size_t *);
    347344extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
     
    382379            (arg4), (answer))
    383380
    384 #define async_data_write_start(p, buf, len) \
    385         async_data_write_start_flexible((p), (buf), (len), IPC_XF_NONE)
    386 
    387 extern int async_data_write_start_flexible(int, const void *, size_t, int);
     381extern int async_data_write_start(int, const void *, size_t);
    388382extern bool async_data_write_receive(ipc_callid_t *, size_t *);
    389383extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
Note: See TracChangeset for help on using the changeset viewer.