Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset d7978525 in mainline


Ignore:
Timestamp:
2012-08-12T19:16:45Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
6266cc6
Parents:
6c34f587
Message:

Implement ipc_*_finalize() functionality directly in async framework.

  • Remove ipc_*_finalize() as these interfaces do not make much sense only on their own.
Location:
uspace/lib/c
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async.c

    r6c34f587 rd7978525  
    114114#include <stdlib.h>
    115115#include <macros.h>
     116#include "private/libc.h"
    116117
    117118#define CLIENT_HASH_TABLE_BUCKETS  32
     
    21662167int async_share_in_finalize(ipc_callid_t callid, void *src, unsigned int flags)
    21672168{
    2168         return ipc_share_in_finalize(callid, src, flags);
     2169        return ipc_answer_3(callid, EOK, (sysarg_t) src, (sysarg_t) flags,
     2170            (sysarg_t) __entry);
    21692171}
    21702172
     
    22332235int async_share_out_finalize(ipc_callid_t callid, void **dst)
    22342236{
    2235         return ipc_share_out_finalize(callid, dst);
     2237        return ipc_answer_2(callid, EOK, (sysarg_t) __entry, (sysarg_t) dst);
    22362238}
    22372239
     
    23172319int async_data_read_finalize(ipc_callid_t callid, const void *src, size_t size)
    23182320{
    2319         return ipc_data_read_finalize(callid, src, size);
     2321        return ipc_answer_2(callid, EOK, (sysarg_t) src, (sysarg_t) size);
    23202322}
    23212323
     
    24202422int async_data_write_finalize(ipc_callid_t callid, void *dst, size_t size)
    24212423{
    2422         return ipc_data_write_finalize(callid, dst, size);
     2424        return ipc_answer_2(callid, EOK, (sysarg_t) dst, (sysarg_t) size);
    24232425}
    24242426
  • uspace/lib/c/generic/ipc.c

    r6c34f587 rd7978525  
    4848#include <fibril.h>
    4949#include <macros.h>
    50 #include "private/libc.h"
    5150
    5251/**
     
    567566}
    568567
    569 /** Wrapper for answering the IPC_M_SHARE_IN calls.
    570  *
    571  * This wrapper only makes it more comfortable to answer IPC_M_SHARE_IN
    572  * calls so that the user doesn't have to remember the meaning of each
    573  * IPC argument.
    574  *
    575  * @param callid Hash of the IPC_M_DATA_READ call to answer.
    576  * @param src    Source address space base.
    577  * @param flags Flags to be used for sharing. Bits can be only cleared.
    578  *
    579  * @return Zero on success or a value from @ref errno.h on failure.
    580  *
    581  */
    582 int ipc_share_in_finalize(ipc_callid_t callid, void *src, unsigned int flags)
    583 {
    584         return ipc_answer_3(callid, EOK, (sysarg_t) src, (sysarg_t) flags,
    585             (sysarg_t) __entry);
    586 }
    587 
    588 /** Wrapper for answering the IPC_M_SHARE_OUT calls.
    589  *
    590  * This wrapper only makes it more comfortable to answer IPC_M_SHARE_OUT
    591  * calls so that the user doesn't have to remember the meaning of each
    592  * IPC argument.
    593  *
    594  * @param callid Hash of the IPC_M_DATA_WRITE call to answer.
    595  * @param dst    Destination address space area base address.
    596  *
    597  * @return Zero on success or a value from @ref errno.h on failure.
    598  *
    599  */
    600 int ipc_share_out_finalize(ipc_callid_t callid, void **dst)
    601 {
    602         return ipc_answer_2(callid, EOK, (sysarg_t) __entry, (sysarg_t) dst);
    603 }
    604 
    605 /** Wrapper for answering the IPC_M_DATA_READ calls.
    606  *
    607  * This wrapper only makes it more comfortable to answer IPC_M_DATA_READ
    608  * calls so that the user doesn't have to remember the meaning of each
    609  * IPC argument.
    610  *
    611  * @param callid Hash of the IPC_M_DATA_READ call to answer.
    612  * @param src    Source address for the IPC_M_DATA_READ call.
    613  * @param size   Size for the IPC_M_DATA_READ call. Can be smaller than
    614  *               the maximum size announced by the sender.
    615  *
    616  * @return Zero on success or a value from @ref errno.h on failure.
    617  *
    618  */
    619 int ipc_data_read_finalize(ipc_callid_t callid, const void *src, size_t size)
    620 {
    621         return ipc_answer_2(callid, EOK, (sysarg_t) src, (sysarg_t) size);
    622 }
    623 
    624 /** Wrapper for answering the IPC_M_DATA_WRITE calls.
    625  *
    626  * This wrapper only makes it more comfortable to answer IPC_M_DATA_WRITE
    627  * calls so that the user doesn't have to remember the meaning of each
    628  * IPC argument.
    629  *
    630  * @param callid Hash of the IPC_M_DATA_WRITE call to answer.
    631  * @param dst    Final destination address for the IPC_M_DATA_WRITE call.
    632  * @param size   Final size for the IPC_M_DATA_WRITE call.
    633  *
    634  * @return Zero on success or a value from @ref errno.h on failure.
    635  *
    636  */
    637 int ipc_data_write_finalize(ipc_callid_t callid, void *dst, size_t size)
    638 {
    639         return ipc_answer_2(callid, EOK, (sysarg_t) dst, (sysarg_t) size);
    640 }
    641 
    642568/** Connect to a task specified by id.
    643569 *
  • uspace/lib/c/include/ipc/ipc.h

    r6c34f587 rd7978525  
    125125    sysarg_t, sysarg_t, sysarg_t, unsigned int);
    126126
    127 extern int ipc_share_in_finalize(ipc_callid_t, void *, unsigned int);
    128 extern int ipc_share_out_finalize(ipc_callid_t, void **);
    129 extern int ipc_data_read_finalize(ipc_callid_t, const void *, size_t);
    130 extern int ipc_data_write_finalize(ipc_callid_t, void *, size_t);
    131 
    132127extern int ipc_connect_kbox(task_id_t);
    133128
Note: See TracChangeset for help on using the changeset viewer.