Changeset 235d31d in mainline for uspace/lib/c/generic/ipc.c


Ignore:
Timestamp:
2014-12-22T17:47:40Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8c7d5ad
Parents:
eae91e0 (diff), 759ea0d (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.
Message:

Merge the CHT pre-integration branch

This branch contains:

  • the merge of lp:~adam-hraska+lp/helenos/rcu, which brings:
  • a new preemptible kernel RCU variant called A-RCU,
  • a preemptible variant of Podzimek's non-preemptible kernel RCU and
  • a new variant of usersace RCU,
  • a new concurrent hash table (CHT) implementation based on RCU,
  • a deployment of CHT in kernel futex handling,
  • a deployment of the userspace RCU in the implementation of upgradable futexes,

all described in Adam Hraska's master thesis named Read-Copy-Update
for HelenOS, defended in 2013 at MFF UK; furthemore, the branch
fixes two synchronization bugs in condvars and waitq, respectively:

  • revid:adam.hraska+hos@gmail.com-20121116144921-3to9u1tn1sg07rg7
  • revid:adam.hraska+hos@gmail.com-20121116173623-km7gwtqixwudpe66
  • build fixes required to pass make check
  • overhaul of ia64 and sparc64 trap handling, to allow exc_dispatch() to be used now when the kernel is more picky about CPU state accounting
  • an important fix of the sparc64/sun4v preemptible trap handler
  • various other fixes of issues discovered on non-x86 architectures
File:
1 edited

Legend:

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

    reae91e0 r235d31d  
    8181LIST_INITIALIZE(queued_calls);
    8282
    83 static atomic_t ipc_futex = FUTEX_INITIALIZER;
     83static futex_t ipc_futex = FUTEX_INITIALIZER;
    8484
    8585/** Send asynchronous message via syscall.
     
    136136        if (!call) {
    137137                /* Nothing to do regardless if failed or not */
    138                 futex_up(&ipc_futex);
     138                futex_unlock(&ipc_futex);
    139139                return;
    140140        }
    141141       
    142142        if (callid == (ipc_callid_t) IPC_CALLRET_FATAL) {
    143                 futex_up(&ipc_futex);
     143                futex_unlock(&ipc_futex);
    144144               
    145145                /* Call asynchronous handler with error code */
     
    152152       
    153153        if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY) {
    154                 futex_up(&ipc_futex);
     154                futex_unlock(&ipc_futex);
    155155               
    156156                call->u.msg.phoneid = phoneid;
     
    175175        /* Add call to the list of dispatched calls */
    176176        list_append(&call->list, &dispatched_calls);
    177         futex_up(&ipc_futex);
     177        futex_unlock(&ipc_futex);
    178178}
    179179
     
    219219         */
    220220       
    221         futex_down(&ipc_futex);
     221        futex_lock(&ipc_futex);
    222222        ipc_callid_t callid = __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phoneid,
    223223            imethod, arg1, arg2, arg3, arg4);
     
    226226                if (!call) {
    227227                        call = ipc_prepare_async(private, callback);
    228                         if (!call)
     228                        if (!call) {
     229                                futex_unlock(&ipc_futex);
    229230                                return;
     231                        }
    230232                }
    231233               
     
    289291         */
    290292       
    291         futex_down(&ipc_futex);
     293        futex_lock(&ipc_futex);
    292294        ipc_callid_t callid =
    293295            ipc_call_async_internal(phoneid, &call->u.msg.data);
     
    384386                        call->u.callid = callid;
    385387                       
    386                         futex_down(&ipc_futex);
     388                        futex_lock(&ipc_futex);
    387389                        list_append(&call->list, &dispatched_calls);
    388                         futex_up(&ipc_futex);
     390                        futex_unlock(&ipc_futex);
    389391                }
    390392               
     
    412414        callid &= ~IPC_CALLID_ANSWERED;
    413415       
    414         futex_down(&ipc_futex);
     416        futex_lock(&ipc_futex);
    415417       
    416418        link_t *item;
     
    423425                        list_remove(&call->list);
    424426                       
    425                         futex_up(&ipc_futex);
     427                        futex_unlock(&ipc_futex);
    426428                       
    427429                        if (call->callback)
     
    434436        }
    435437       
    436         futex_up(&ipc_futex);
     438        futex_unlock(&ipc_futex);
    437439}
    438440
Note: See TracChangeset for help on using the changeset viewer.