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


Ignore:
Timestamp:
2019-02-23T17:16:01Z (5 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8c193d83, ca0e838
Parents:
bc417660 (diff), 95a47b0 (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.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-23 17:16:01)
git-committer:
GitHub <noreply@…> (2019-02-23 17:16:01)
Message:

Merge pull request #157

Turn some function-like macros into functions

File:
1 edited

Legend:

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

    rbc417660 rab87db5  
    3636#define _ABI_IPC_IPC_H_
    3737
     38#include <stdint.h>
    3839#include <abi/proc/task.h>
    3940#include <abi/cap.h>
     41#include <_bits/errno.h>
    4042
    4143/** Length of data being transferred with IPC call
     
    7173 */
    7274#define DATA_XFER_LIMIT  (64 * 1024)
    73 
    74 /* Macros for manipulating calling data */
    75 #define IPC_SET_RETVAL(data, retval)  ((data).args[0] = (sysarg_t) (retval))
    76 #define IPC_SET_IMETHOD(data, val)    ((data).args[0] = (val))
    77 #define IPC_SET_ARG1(data, val)       ((data).args[1] = (val))
    78 #define IPC_SET_ARG2(data, val)       ((data).args[2] = (val))
    79 #define IPC_SET_ARG3(data, val)       ((data).args[3] = (val))
    80 #define IPC_SET_ARG4(data, val)       ((data).args[4] = (val))
    81 #define IPC_SET_ARG5(data, val)       ((data).args[5] = (val))
    82 
    83 #define IPC_GET_IMETHOD(data)  ((data).args[0])
    84 #define IPC_GET_RETVAL(data)   ((errno_t) (data).args[0])
    85 
    86 #define IPC_GET_ARG1(data)  ((data).args[1])
    87 #define IPC_GET_ARG2(data)  ((data).args[2])
    88 #define IPC_GET_ARG3(data)  ((data).args[3])
    89 #define IPC_GET_ARG4(data)  ((data).args[4])
    90 #define IPC_GET_ARG5(data)  ((data).args[5])
    9175
    9276/* Forwarding flags. */
     
    128112} ipc_data_t;
    129113
     114/* Functions for manipulating calling data */
     115
     116static inline void ipc_set_retval(ipc_data_t *data, errno_t retval)
     117{
     118        data->args[0] = (sysarg_t) retval;
     119}
     120
     121static inline void ipc_set_imethod(ipc_data_t *data, sysarg_t val)
     122{
     123        data->args[0] = val;
     124}
     125
     126static inline void ipc_set_arg1(ipc_data_t *data, sysarg_t val)
     127{
     128        data->args[1] = val;
     129}
     130
     131static inline void ipc_set_arg2(ipc_data_t *data, sysarg_t val)
     132{
     133        data->args[2] = val;
     134}
     135
     136static inline void ipc_set_arg3(ipc_data_t *data, sysarg_t val)
     137{
     138        data->args[3] = val;
     139}
     140
     141static inline void ipc_set_arg4(ipc_data_t *data, sysarg_t val)
     142{
     143        data->args[4] = val;
     144}
     145
     146static inline void ipc_set_arg5(ipc_data_t *data, sysarg_t val)
     147{
     148        data->args[5] = val;
     149}
     150
     151static inline sysarg_t ipc_get_imethod(ipc_data_t *data)
     152{
     153        return data->args[0];
     154}
     155static inline errno_t ipc_get_retval(ipc_data_t *data)
     156{
     157        return (errno_t) data->args[0];
     158}
     159
     160static inline sysarg_t ipc_get_arg1(ipc_data_t *data)
     161{
     162        return data->args[1];
     163}
     164
     165static inline sysarg_t ipc_get_arg2(ipc_data_t *data)
     166{
     167        return data->args[2];
     168}
     169
     170static inline sysarg_t ipc_get_arg3(ipc_data_t *data)
     171{
     172        return data->args[3];
     173}
     174
     175static inline sysarg_t ipc_get_arg4(ipc_data_t *data)
     176{
     177        return data->args[4];
     178}
     179
     180static inline sysarg_t ipc_get_arg5(ipc_data_t *data)
     181{
     182        return data->args[5];
     183}
     184
    130185#endif
    131186
Note: See TracChangeset for help on using the changeset viewer.