Changeset d8b42fb2 in mainline


Ignore:
Timestamp:
2006-06-19T10:10:00Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
09087d2
Parents:
231a60a
Message:

Sligtly more efficient ipc.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • console/gcons.c

    r231a60a rd8b42fb2  
    230230}
    231231
    232 
     232/** Return x, where left <= x <= right && |a-x|==min(|a-x|) is smallest */
    233233static inline int limit(int a,int left, int right)
    234234{
  • libc/generic/ipc.c

    r231a60a rd8b42fb2  
    150150                                    async_call_t *call, int can_preempt)
    151151{
     152        if (!call) { /* Nothing to do regardless if failed or not */
     153                futex_up(&ipc_futex);
     154                return;
     155        }
     156
    152157        if (callid == IPC_CALLRET_FATAL) {
    153158                futex_up(&ipc_futex);
     
    193198                      ipc_async_callback_t callback, int can_preempt)
    194199{
    195         async_call_t *call;
    196         ipc_callid_t callid;
    197 
    198         call = ipc_prepare_async(private, callback);
    199         if (!call)
    200                 return;
     200        async_call_t *call = NULL;
     201        ipc_callid_t callid;
     202
     203        if (callback) {
     204                call = ipc_prepare_async(private, callback);
     205                if (!call)
     206                        return;
     207        }
    201208
    202209        /* We need to make sure that we get callid before
     
    206213
    207214        if (callid == IPC_CALLRET_TEMPORARY) {
     215                if (!call) {
     216                        call = ipc_prepare_async(private, callback);
     217                        if (!call)
     218                                return;
     219                }
    208220                IPC_SET_METHOD(call->u.msg.data, method);
    209221                IPC_SET_ARG1(call->u.msg.data, arg1);
     
    343355        }
    344356        futex_up(&ipc_futex);
    345         printf("Received unidentified answer: %P!!!\n", callid);
     357        /* We may get here after async_msg, which doesn't register any callback */
    346358}
    347359
Note: See TracChangeset for help on using the changeset viewer.