Changeset f5837524 in mainline for abi/include/abi/ipc/ipc.h


Ignore:
Timestamp:
2018-10-29T17:15:02Z (5 years ago)
Author:
Jakub Jermar <jakub@…>
Children:
eec201d
Parents:
184f2f8a
git-author:
Jakub Jermar <jakub@…> (2018-10-28 12:42:35)
git-committer:
Jakub Jermar <jakub@…> (2018-10-29 17:15:02)
Message:

Use user-defined labels instead of phone hashes

This commit changes the way how the async framework maps incomming calls
to connections. Instead of abusing the kernel addresses of attached
phones as identifiers, the IPC_M_CONNECT_TO_ME and IPC_M_CONNECT_ME_TO
messages allow the server to specify an arbitrary label which is
remembered in the connected phone and consequently imprinted on each
call which is routed through this phone.

The async framework uses the address of the connection structure as the
label. This removes the need for a connection hash table because each
incoming call already remembers the connection in its label.

To disambiguate this new label and the other user-defined label used for
answers, the call structure now has the request_label member for the
former and answer_label member for the latter.

This commit also moves the kernel definition of ipc_data_t to abi/ and
removes the uspace redefinition thereof. Finally, when forwarding the
IPC_M_CONNECT_TO_ME call, the phone capability and the kernel object
allocated in request_process are now correctly disposed of.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abi/include/abi/ipc/ipc.h

    r184f2f8a rf5837524  
    3535#ifndef ABI_IPC_IPC_H_
    3636#define ABI_IPC_IPC_H_
     37
     38#include <abi/proc/task.h>
     39#include <abi/cap.h>
    3740
    3841/** Length of data being transferred with IPC call
     
    108111#define IPC_FIRST_USER_METHOD  1024
    109112
     113typedef struct {
     114        sysarg_t args[IPC_CALL_LEN];
     115        /**
     116         * Task which made or forwarded the call with IPC_FF_ROUTE_FROM_ME,
     117         * or the task which answered the call.
     118         */
     119        task_id_t task_id;
     120        /** Flags */
     121        unsigned flags;
     122        /** User-defined label associated with requests */
     123        sysarg_t request_label;
     124        /** User-defined label associated with answers */
     125        sysarg_t answer_label;
     126        /** Capability handle */
     127        cap_call_handle_t cap_handle;
     128} ipc_data_t;
     129
    110130#endif
    111131
Note: See TracChangeset for help on using the changeset viewer.