Changes in / [9247c02c:2f2f1186] in mainline


Ignore:
Files:
10 edited

Legend:

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

    r9247c02c r2f2f1186  
    4040#include <synch/mutex.h>
    4141#include <synch/waitq.h>
    42 #include <typedefs.h>
    4342
    4443#define IPC_MAX_PHONES  32
     
    9998        sysarg_t args[IPC_CALL_LEN];
    10099        /** Task which made or forwarded the call with IPC_FF_ROUTE_FROM_ME. */
    101         task_id_t task_id;
     100        struct task *task;
    102101        /** Phone which made or last masqueraded this call. */
    103102        phone_t *phone;
  • kernel/generic/src/ipc/event.c

    r9247c02c r2f2f1186  
    161161                                IPC_SET_ARG5(call->data, a5);
    162162                               
    163                                 call->data.task_id = TASK ? TASK->taskid : 0;
    164                                
    165163                                irq_spinlock_lock(&event->answerbox->irq_lock, true);
    166164                                list_append(&call->link, &event->answerbox->irq_notifs);
  • kernel/generic/src/ipc/ipc.c

    r9247c02c r2f2f1186  
    294294                atomic_inc(&phone->active_calls);
    295295                call->data.phone = phone;
    296                 call->data.task_id = TASK->taskid;
     296                call->data.task = TASK;
    297297        }
    298298       
     
    406406                        call->caller_phone = call->data.phone;
    407407                call->data.phone = newphone;
    408                 call->data.task_id = TASK->taskid;
     408                call->data.task = TASK;
    409409        }
    410410       
  • kernel/generic/src/ipc/sysipc.c

    r9247c02c r2f2f1186  
    5454#include <mm/as.h>
    5555#include <print.h>
    56 #include <macros.h>
    5756
    5857/**
     
    376375                                    IPC_GET_ARG2(*olddata),
    377376                                    IPC_GET_ARG3(*olddata),
    378                                     LOWER32(olddata->task_id),
    379                                     UPPER32(olddata->task_id));
     377                                    (sysarg_t) olddata->task,
     378                                    (sysarg_t) TASK);
    380379                                IPC_SET_RETVAL(answer->data, rc);
    381380                        }
  • uspace/lib/c/generic/async.c

    r9247c02c r2f2f1186  
    112112#include <mem.h>
    113113#include <stdlib.h>
    114 #include <macros.h>
    115114#include "private/async.h"
    116115
     
    139138        link_t link;
    140139       
    141         sysarg_t in_task_id;
     140        sysarg_t in_task_hash;
    142141        atomic_t refcnt;
    143142        void *data;
     
    151150        link_t link;
    152151       
    153         /** Incoming client task ID. */
    154         task_id_t in_task_id;
     152        /** Incoming client task hash. */
     153        sysarg_t in_task_hash;
    155154       
    156155        /** Incoming phone hash. */
     
    284283{
    285284        assert(key);
    286         assert(keys == 2);
    287285        assert(item);
    288286       
    289287        client_t *client = hash_table_get_instance(item, client_t, link);
    290         return (key[0] == LOWER32(client->in_task_id) &&
    291             (key[1] == UPPER32(client->in_task_id)));
     288        return (key[0] == client->in_task_hash);
    292289}
    293290
     
    577574}
    578575
    579 static client_t *async_client_get(task_id_t client_id, bool create)
    580 {
    581         unsigned long key[2] = {
    582                 LOWER32(client_id),
    583                 UPPER32(client_id),
    584         };
     576static client_t *async_client_get(sysarg_t client_hash, bool create)
     577{
     578        unsigned long key = client_hash;
    585579        client_t *client = NULL;
    586580
    587581        futex_down(&async_futex);
    588         link_t *lnk = hash_table_find(&client_hash_table, key);
     582        link_t *lnk = hash_table_find(&client_hash_table, &key);
    589583        if (lnk) {
    590584                client = hash_table_get_instance(lnk, client_t, link);
     
    593587                client = malloc(sizeof(client_t));
    594588                if (client) {
    595                         client->in_task_id = client_id;
     589                        client->in_task_hash = client_hash;
    596590                        client->data = async_client_data_create();
    597591               
    598592                        atomic_set(&client->refcnt, 1);
    599                         hash_table_insert(&client_hash_table, key, &client->link);
     593                        hash_table_insert(&client_hash_table, &key, &client->link);
    600594                }
    601595        }
     
    608602{
    609603        bool destroy;
    610         unsigned long key[2] = {
    611                 LOWER32(client->in_task_id),
    612                 UPPER32(client->in_task_id)
    613         };
     604        unsigned long key = client->in_task_hash;
    614605       
    615606        futex_down(&async_futex);
    616607       
    617608        if (atomic_predec(&client->refcnt) == 0) {
    618                 hash_table_remove(&client_hash_table, key, 2);
     609                hash_table_remove(&client_hash_table, &key, 1);
    619610                destroy = true;
    620611        } else
     
    637628}
    638629
    639 void *async_get_client_data_by_id(task_id_t client_id)
    640 {
    641         client_t *client = async_client_get(client_id, false);
     630void *async_get_client_data_by_hash(sysarg_t client_hash)
     631{
     632        client_t *client = async_client_get(client_hash, false);
    642633        if (!client)
    643634                return NULL;
     
    650641}
    651642
    652 void async_put_client_data_by_id(task_id_t client_id)
    653 {
    654         client_t *client = async_client_get(client_id, false);
     643void async_put_client_data_by_hash(sysarg_t client_hash)
     644{
     645        client_t *client = async_client_get(client_hash, false);
    655646
    656647        assert(client);
     
    689680         */
    690681
    691         client_t *client = async_client_get(fibril_connection->in_task_id, true);
     682        client_t *client = async_client_get(fibril_connection->in_task_hash, true);
    692683        if (!client) {
    693684                ipc_answer_0(fibril_connection->callid, ENOMEM);
     
    746737 * particular fibrils.
    747738 *
    748  * @param in_task_id    Identification of the incoming connection.
     739 * @param in_task_hash  Identification of the incoming connection.
    749740 * @param in_phone_hash Identification of the incoming connection.
    750741 * @param callid        Hash of the opening IPC_M_CONNECT_ME_TO call.
     
    760751 *
    761752 */
    762 fid_t async_new_connection(task_id_t in_task_id, sysarg_t in_phone_hash,
     753fid_t async_new_connection(sysarg_t in_task_hash, sysarg_t in_phone_hash,
    763754    ipc_callid_t callid, ipc_call_t *call,
    764755    async_client_conn_t cfibril, void *carg)
     
    772763        }
    773764       
    774         conn->in_task_id = in_task_id;
     765        conn->in_task_hash = in_task_hash;
    775766        conn->in_phone_hash = in_phone_hash;
    776767        list_initialize(&conn->msg_queue);
     
    831822        case IPC_M_CONNECT_ME_TO:
    832823                /* Open new connection with fibril, etc. */
    833                 async_new_connection(call->in_task_id, IPC_GET_ARG5(*call),
     824                async_new_connection(call->in_task_hash, IPC_GET_ARG5(*call),
    834825                    callid, call, client_connection, NULL);
    835826                return;
     
    979970{
    980971        if (!hash_table_create(&client_hash_table, CLIENT_HASH_TABLE_BUCKETS,
    981             2, &client_hash_table_ops))
     972            1, &client_hash_table_ops))
    982973                abort();
    983974       
  • uspace/lib/c/include/async.h

    r9247c02c r2f2f1186  
    176176extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t);
    177177
    178 extern fid_t async_new_connection(task_id_t, sysarg_t, ipc_callid_t,
     178extern fid_t async_new_connection(sysarg_t, sysarg_t, ipc_callid_t,
    179179    ipc_call_t *, async_client_conn_t, void *);
    180180
     
    186186extern void async_set_client_data_destructor(async_client_data_dtor_t);
    187187extern void *async_get_client_data(void);
    188 extern void *async_get_client_data_by_id(task_id_t);
    189 extern void async_put_client_data_by_id(task_id_t);
     188extern void *async_get_client_data_by_hash(sysarg_t);
     189extern void async_put_client_data_by_hash(sysarg_t);
    190190
    191191extern void async_set_client_connection(async_client_conn_t);
  • uspace/lib/c/include/ipc/common.h

    r9247c02c r2f2f1186  
    3939#include <abi/ipc/ipc.h>
    4040#include <atomic.h>
    41 #include <task.h>
    4241
    4342#define IPC_FLAG_BLOCKING  0x01
     
    4544typedef struct {
    4645        sysarg_t args[IPC_CALL_LEN];
    47         task_id_t in_task_id;
     46        sysarg_t in_task_hash;
    4847        sysarg_t in_phone_hash;
    4948} ipc_call_t;
  • uspace/srv/vfs/vfs.c

    r9247c02c r2f2f1186  
    3636 */
    3737
    38 #include <vfs/vfs.h>
    3938#include <ipc/services.h>
    4039#include <abi/ipc/event.h>
     
    4847#include <as.h>
    4948#include <atomic.h>
    50 #include <macros.h>
     49#include <vfs/vfs.h>
    5150#include "vfs.h"
    5251
     
    144143        case VFS_TASK_STATE_CHANGE:
    145144                if (IPC_GET_ARG1(*call) == VFS_PASS_HANDLE)
    146                         vfs_pass_handle(
    147                             (task_id_t) MERGE_LOUP32(IPC_GET_ARG4(*call),
    148                             IPC_GET_ARG5(*call)), call->in_task_id,
    149                             (int) IPC_GET_ARG2(*call));
     145                        vfs_pass_handle(IPC_GET_ARG4(*call),
     146                            IPC_GET_ARG5(*call), (int) IPC_GET_ARG2(*call));
    150147                break;
    151148        default:
  • uspace/srv/vfs/vfs.h

    r9247c02c r2f2f1186  
    4141#include <bool.h>
    4242#include <ipc/vfs.h>
    43 #include <task.h>
    4443
    4544#ifndef dprintf
     
    189188extern void vfs_client_data_destroy(void *);
    190189
    191 extern void vfs_pass_handle(task_id_t, task_id_t, int);
     190extern void vfs_pass_handle(sysarg_t, sysarg_t, int);
    192191extern int vfs_wait_handle_internal(void);
    193192
  • uspace/srv/vfs/vfs_file.c

    r9247c02c r2f2f1186  
    4444#include <fibril_synch.h>
    4545#include <adt/list.h>
    46 #include <task.h>
    4746#include "vfs.h"
    4847
     
    347346}
    348347
    349 void vfs_pass_handle(task_id_t donor_id, task_id_t acceptor_id, int donor_fd)
     348void vfs_pass_handle(sysarg_t donor_hash, sysarg_t acceptor_hash, int donor_fd)
    350349{
    351350        vfs_client_data_t *donor_data = NULL;
     
    356355        int acceptor_fd;
    357356
    358         acceptor_data = async_get_client_data_by_id(acceptor_id);
     357        acceptor_data = async_get_client_data_by_hash(acceptor_hash);
    359358        if (!acceptor_data)
    360359                return;
     
    366365        bh->handle = -1;
    367366
    368         donor_data = async_get_client_data_by_id(donor_id);
     367        donor_data = async_get_client_data_by_hash(donor_hash);
    369368        if (!donor_data)
    370369                goto out;
     
    403402
    404403        if (donor_data)
    405                 async_put_client_data_by_id(donor_id);
     404                async_put_client_data_by_hash(donor_hash);
    406405        if (acceptor_data)
    407                 async_put_client_data_by_id(acceptor_id);
     406                async_put_client_data_by_hash(acceptor_hash);
    408407        if (donor_file)
    409408                _vfs_file_put(donor_data, donor_file);
Note: See TracChangeset for help on using the changeset viewer.