Changeset 072607b in mainline


Ignore:
Timestamp:
2016-08-30T16:09:17Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5c2af75
Parents:
c32b6f0
Message:

Add IPC_M_PAGE_IN system method

Files:
1 added
4 edited

Legend:

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

    rc32b6f0 r072607b  
    5151 */
    5252
    53 /** This message is sent to answerbox when the phone is hung up
    54  *
    55  * The numerical value zero (0) of this method is important,
    56  * so as the value can be easily tested in conditions.
    57  *
    58  */
    59 #define IPC_M_PHONE_HUNGUP  0
    60 
    61 /** Clone connection.
    62  *
    63  * The calling task clones one of its phones for the callee.
    64  *
    65  * - ARG1 - The caller sets ARG1 to the phone of the cloned connection.
    66  *        - The callee gets the new phone from ARG1.
    67  *
    68  * - on answer, the callee acknowledges the new connection by sending EOK back
    69  *   or the kernel closes it
    70  *
    71  */
    72 #define IPC_M_CONNECTION_CLONE  1
    73 
    74 /** Protocol for establishing a cloned connection.
    75  *
    76  * Through this call, the recipient learns about the new cloned connection.
    77  *
    78  * - ARG5 - the kernel sets ARG5 to contain the hash of the used phone
    79  * - on answer, the callee acknowledges the new connection by sending EOK back
    80  *   or the kernel closes it
    81  *
    82  */
    83 #define IPC_M_CLONE_ESTABLISH  2
    84 
    85 /** Protocol for initializing callback connections.
    86  *
    87  * Calling process asks the callee to create a callback connection,
    88  * so that it can start initiating new messages.
    89  *
    90  * The protocol for negotiating is:
    91  * - sys_connect_to_me - sends a message IPC_M_CONNECT_TO_ME
    92  * - recipient         - upon receipt tries to allocate new phone
    93  *                       - if it fails, responds with ELIMIT
    94  *                     - passes call to userspace. If userspace
    95  *                       responds with error, phone is deallocated and
    96  *                       error is sent back to caller. Otherwise
    97  *                       the call is accepted and the response is sent back.
    98  *                     - the hash of the allocated phone is passed to userspace
    99  *                       (on the receiving side) as ARG5 of the call.
    100  *
    101  */
    102 #define IPC_M_CONNECT_TO_ME  3
    103 
    104 /** Protocol for initializing new foward connections.
    105  *
    106  * Calling process asks the callee to create for him a new connection.
    107  * E.g. the caller wants a name server to connect him to print server.
    108  *
    109  * The protocol for negotiating is:
    110  * - sys_connect_me_to - send a synchronous message to name server
    111  *                       indicating that it wants to be connected to some
    112  *                       service
    113  *                     - arg1/2/3 are user specified, arg5 contains
    114  *                       address of the phone that should be connected
    115  *                       (TODO: it leaks to userspace)
    116  *  - recipient        -  if ipc_answer == 0, then accept connection
    117  *                     -  otherwise connection refused
    118  *                     -  recepient may forward message.
    119  *
    120  */
    121 #define IPC_M_CONNECT_ME_TO  4
    122 
    123 /** Send as_area over IPC.
    124  * - ARG1 - source as_area base address
    125  * - ARG2 - size of source as_area (filled automatically by kernel)
    126  * - ARG3 - flags of the as_area being sent
    127  *
    128  * on answer, the recipient must set:
    129  *
    130  * - ARG1 - dst as_area lower bound
    131  * - ARG2 - dst as_area base adress pointer
    132  *          (filled automatically by the kernel)
    133  *
    134  */
    135 #define IPC_M_SHARE_OUT  5
    136 
    137 /** Receive as_area over IPC.
    138  * - ARG1 - destination as_area size
    139  * - ARG2 - user defined argument
    140  *
    141  * on answer, the recipient must set:
    142  *
    143  * - ARG1 - source as_area base address
    144  * - ARG2 - flags that will be used for sharing
    145  * - ARG3 - dst as_area lower bound
    146  * - ARG4 - dst as_area base address (filled automatically by kernel)
    147  *
    148  */
    149 #define IPC_M_SHARE_IN  6
    150 
    151 /** Send data to another address space over IPC.
    152  * - ARG1 - source address space virtual address
    153  * - ARG2 - size of data to be copied, may be overriden by the recipient
    154  *
    155  * on answer, the recipient must set:
    156  *
    157  * - ARG1 - final destination address space virtual address
    158  * - ARG2 - final size of data to be copied
    159  *
    160  */
    161 #define IPC_M_DATA_WRITE  7
    162 
    163 /** Receive data from another address space over IPC.
    164  * - ARG1 - destination virtual address in the source address space
    165  * - ARG2 - size of data to be received, may be cropped by the recipient
    166  *
    167  * on answer, the recipient must set:
    168  *
    169  * - ARG1 - source virtual address in the destination address space
    170  * - ARG2 - final size of data to be copied
    171  *
    172  */
    173 #define IPC_M_DATA_READ  8
    174 
    175 /** Authorize change of recipient's state in a third party task.
    176  * - ARG1 - user protocol defined data
    177  * - ARG2 - user protocol defined data
    178  * - ARG3 - user protocol defined data
    179  * - ARG5 - sender's phone to the third party task
    180  *
    181  * on EOK answer, the recipient must set:
    182  *
    183  * - ARG1 - recipient's phone to the third party task
    184  */
    185 #define IPC_M_STATE_CHANGE_AUTHORIZE  9
    186 
    187 /** Debug the recipient.
    188  * - ARG1 - specifies the debug method (from udebug_method_t)
    189  * - other arguments are specific to the debug method
    190  *
    191  */
    192 #define IPC_M_DEBUG  10
     53enum {
     54        /** This message is sent to answerbox when the phone is hung up
     55         *
     56         * The numerical value zero (0) of this method is important,
     57         * so as the value can be easily tested in conditions.
     58         */
     59        IPC_M_PHONE_HUNGUP = 0,
     60
     61        /** Clone connection.
     62         *
     63         * The calling task clones one of its phones for the callee.
     64         *
     65         * - ARG1 - The caller sets ARG1 to the phone of the cloned connection.
     66         *        - The callee gets the new phone from ARG1.
     67         *
     68         * - on answer, the callee acknowledges the new connection by sending EOK back
     69         *   or the kernel closes it
     70         */
     71        IPC_M_CONNECTION_CLONE,
     72
     73        /** Protocol for establishing a cloned connection.
     74         *
     75         * Through this call, the recipient learns about the new cloned connection.
     76         *
     77         * - ARG5 - the kernel sets ARG5 to contain the hash of the used phone
     78         * - on answer, the callee acknowledges the new connection by sending EOK back
     79         *   or the kernel closes it
     80         */
     81        IPC_M_CLONE_ESTABLISH,
     82
     83        /** Protocol for initializing callback connections.
     84         *
     85         * Calling process asks the callee to create a callback connection,
     86         * so that it can start initiating new messages.
     87         *
     88         * The protocol for negotiating is:
     89         * - sys_connect_to_me - sends a message IPC_M_CONNECT_TO_ME
     90         * - recipient         - upon receipt tries to allocate new phone
     91         *                       - if it fails, responds with ELIMIT
     92         *                     - passes call to userspace. If userspace
     93         *                       responds with error, phone is deallocated and
     94         *                       error is sent back to caller. Otherwise
     95         *                       the call is accepted and the response is sent back.
     96         *                     - the hash of the allocated phone is passed to userspace
     97         *                       (on the receiving side) as ARG5 of the call.
     98         */
     99        IPC_M_CONNECT_TO_ME,
     100
     101        /** Protocol for initializing new foward connections.
     102         *
     103         * Calling process asks the callee to create for him a new connection.
     104         * E.g. the caller wants a name server to connect him to print server.
     105         *
     106         * The protocol for negotiating is:
     107         * - sys_connect_me_to - send a synchronous message to name server
     108         *                       indicating that it wants to be connected to some
     109         *                       service
     110         *                     - arg1/2/3 are user specified, arg5 contains
     111         *                       address of the phone that should be connected
     112         *                       (TODO: it leaks to userspace)
     113         *  - recipient        - if ipc_answer == 0, then accept connection
     114         *                     - otherwise connection refused
     115         *                     - recepient may forward message.
     116         */
     117        IPC_M_CONNECT_ME_TO,
     118
     119        /** Share a single page over IPC.
     120         *
     121         * - ARG1 - page-aligned offset from the beginning of the memory object
     122         * - ARG2 - page size
     123         *
     124         * on answer, the recipient must set:
     125         *
     126         * - ARG1 - source user page address
     127         */
     128        IPC_M_PAGE_IN,
     129
     130        /** Receive as_area over IPC.
     131         *
     132         * - ARG1 - destination as_area size
     133         * - ARG2 - user defined argument
     134         *
     135         * on answer, the recipient must set:
     136         *
     137         * - ARG1 - source as_area base address
     138         * - ARG2 - flags that will be used for sharing
     139         * - ARG3 - dst as_area lower bound
     140         * - ARG4 - dst as_area base address (filled automatically by kernel)
     141         */
     142        IPC_M_SHARE_IN,
     143
     144        /** Send as_area over IPC.
     145         *
     146         * - ARG1 - source as_area base address
     147         * - ARG2 - size of source as_area (filled automatically by kernel)
     148         * - ARG3 - flags of the as_area being sent
     149         *
     150         * on answer, the recipient must set:
     151         *
     152         * - ARG1 - dst as_area lower bound
     153         * - ARG2 - dst as_area base adress pointer
     154         *          (filled automatically by the kernel)
     155         */
     156        IPC_M_SHARE_OUT,
     157
     158        /** Receive data from another address space over IPC.
     159         *
     160         * - ARG1 - destination virtual address in the source address space
     161         * - ARG2 - size of data to be received, may be cropped by the recipient
     162         *
     163         * on answer, the recipient must set:
     164         *
     165         * - ARG1 - source virtual address in the destination address space
     166         * - ARG2 - final size of data to be copied
     167         */
     168        IPC_M_DATA_READ,
     169
     170        /** Send data to another address space over IPC.
     171         *
     172         * - ARG1 - source address space virtual address
     173         * - ARG2 - size of data to be copied, may be overriden by the recipient
     174         *
     175         * on answer, the recipient must set:
     176         *
     177         * - ARG1 - final destination address space virtual address
     178         * - ARG2 - final size of data to be copied
     179         */
     180        IPC_M_DATA_WRITE,
     181
     182        /** Authorize change of recipient's state in a third party task.
     183         *
     184         * - ARG1 - user protocol defined data
     185         * - ARG2 - user protocol defined data
     186         * - ARG3 - user protocol defined data
     187         * - ARG5 - sender's phone to the third party task
     188         *
     189         * on EOK answer, the recipient must set:
     190         *
     191         * - ARG1 - recipient's phone to the third party task
     192         */
     193        IPC_M_STATE_CHANGE_AUTHORIZE,
     194
     195        /** Debug the recipient.
     196         *
     197         * - ARG1 - specifies the debug method (from udebug_method_t)
     198         * - other arguments are specific to the debug method
     199         */
     200        IPC_M_DEBUG,
     201};
    193202
    194203/** Last system IPC method */
  • kernel/Makefile

    rc32b6f0 r072607b  
    279279        generic/src/ipc/ops/datawrite.c \
    280280        generic/src/ipc/ops/debug.c \
     281        generic/src/ipc/ops/pagein.c \
    281282        generic/src/ipc/ops/sharein.c \
    282283        generic/src/ipc/ops/shareout.c \
  • kernel/generic/src/ipc/sysipc.c

    rc32b6f0 r072607b  
    106106{
    107107        switch (imethod) {
     108        case IPC_M_PAGE_IN:
    108109        case IPC_M_SHARE_OUT:
    109110        case IPC_M_SHARE_IN:
     
    137138        case IPC_M_CONNECT_TO_ME:
    138139        case IPC_M_CONNECT_ME_TO:
     140        case IPC_M_PAGE_IN:
    139141        case IPC_M_SHARE_OUT:
    140142        case IPC_M_SHARE_IN:
  • kernel/generic/src/ipc/sysipc_ops.c

    rc32b6f0 r072607b  
    4242sysipc_ops_t ipc_m_connect_to_me_ops;
    4343sysipc_ops_t ipc_m_connect_me_to_ops;
     44sysipc_ops_t ipc_m_page_in_ops;
    4445sysipc_ops_t ipc_m_share_out_ops;
    4546sysipc_ops_t ipc_m_share_in_ops;
     
    5455        [IPC_M_CONNECT_TO_ME] = &ipc_m_connect_to_me_ops,
    5556        [IPC_M_CONNECT_ME_TO] = &ipc_m_connect_me_to_ops,
     57        [IPC_M_PAGE_IN] = &ipc_m_page_in_ops,
    5658        [IPC_M_SHARE_OUT] = &ipc_m_share_out_ops,
    5759        [IPC_M_SHARE_IN] = &ipc_m_share_in_ops,
Note: See TracChangeset for help on using the changeset viewer.