Changeset 3529f148 in mainline for uspace/lib/c


Ignore:
Timestamp:
2020-03-06T19:14:20Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
13b4504
Parents:
06599a1
git-author:
Matthieu Riolo <matthieu.riolo@…> (2020-02-29 11:22:13)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2020-03-06 19:14:20)
Message:

Adding types task_wait_flag_t and ipc_start_flag_t which replaces makros

Location:
uspace/lib/c
Files:
8 edited

Legend:

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

    r06599a1 r3529f148  
    286286}
    287287
    288 async_sess_t *devman_device_connect(devman_handle_t handle, unsigned int flags)
     288async_sess_t *devman_device_connect(devman_handle_t handle, ipc_start_flag_t flags)
    289289{
    290290        async_sess_t *sess;
     
    359359
    360360errno_t devman_fun_get_handle(const char *pathname, devman_handle_t *handle,
    361     unsigned int flags)
     361    ipc_start_flag_t flags)
    362362{
    363363        async_exch_t *exch;
  • uspace/lib/c/generic/loc.c

    r06599a1 r3529f148  
    454454
    455455errno_t loc_namespace_get_id(const char *name, service_id_t *handle,
    456     unsigned int flags)
     456    ipc_start_flag_t flags)
    457457{
    458458        async_exch_t *exch;
     
    503503 */
    504504errno_t loc_category_get_id(const char *name, category_id_t *cat_id,
    505     unsigned int flags)
     505    ipc_start_flag_t flags)
    506506{
    507507        async_exch_t *exch;
     
    558558
    559559async_sess_t *loc_service_connect(service_id_t handle, iface_t iface,
    560     unsigned int flags)
     560    ipc_start_flag_t flags)
    561561{
    562562        async_sess_t *sess;
  • uspace/lib/c/generic/task.c

    r06599a1 r3529f148  
    417417 * @return EOK on success, else error code.
    418418 */
    419 errno_t task_wait_task_id(task_id_t id, int flags, task_exit_t *texit, int *retval)
     419errno_t task_wait_task_id(task_id_t id, task_wait_flag_t flags, task_exit_t *texit, int *retval)
    420420{
    421421        task_wait_t wait;
  • uspace/lib/c/include/devman.h

    r06599a1 r3529f148  
    5353extern errno_t devman_drv_fun_offline(devman_handle_t);
    5454
    55 extern async_sess_t *devman_device_connect(devman_handle_t, unsigned int);
     55extern async_sess_t *devman_device_connect(devman_handle_t, ipc_start_flag_t);
    5656extern async_sess_t *devman_parent_device_connect(devman_handle_t,
    5757    unsigned int);
    5858
    5959extern errno_t devman_fun_get_handle(const char *, devman_handle_t *,
    60     unsigned int);
     60    ipc_start_flag_t);
    6161extern errno_t devman_fun_get_child(devman_handle_t, devman_handle_t *);
    6262extern errno_t devman_dev_get_parent(devman_handle_t, devman_handle_t *);
  • uspace/lib/c/include/ipc/common.h

    r06599a1 r3529f148  
    4141/* Well known phone descriptors */
    4242static cap_phone_handle_t const PHONE_INITIAL = (cap_phone_handle_t) (CAP_NIL + 1);
    43 #define IPC_FLAG_BLOCKING   0x01
    4443
    45 /**
    46  * IPC_FLAG_AUTOSTART_ is for use in brokers only. In client code use
    47  * IPC_AUTOSTART that includes implies blocking behavior.
    48  */
    49 #define IPC_FLAG_AUTOSTART_  0x02
     44typedef enum {
     45        /**
     46         * IPC_FLAG_AUTOSTART_ is for use in brokers only. In client code use
     47         * IPC_AUTOSTART that includes implies blocking behavior.
     48         */
     49        IPC_FLAG_BLOCKING = 0x01,
     50        IPC_FLAG_AUTOSTART_ = 0x02,
    5051
    51 /**
    52  * Similar to blocking IPC_FLAG_BLOCKING behavior, broker will attempt to
    53  * start the server.
    54  */
    55 #define IPC_AUTOSTART (IPC_FLAG_BLOCKING | IPC_FLAG_AUTOSTART_)
     52        /**
     53         * Similar to blocking IPC_FLAG_BLOCKING behavior, broker will attempt to
     54         * start the server.
     55         */
     56        IPC_AUTOSTART = (IPC_FLAG_BLOCKING | IPC_FLAG_AUTOSTART_),
     57} ipc_start_flag_t;
    5658
    5759typedef ipc_data_t ipc_call_t;
  • uspace/lib/c/include/loc.h

    r06599a1 r3529f148  
    5252
    5353extern errno_t loc_service_get_id(const char *, service_id_t *,
    54     unsigned int);
     54    ipc_start_flag_t);
    5555extern errno_t loc_service_get_name(service_id_t, char **);
    5656extern errno_t loc_service_get_server_name(service_id_t, char **);
    5757extern errno_t loc_namespace_get_id(const char *, service_id_t *,
    58     unsigned int);
     58    ipc_start_flag_t);
    5959extern errno_t loc_category_get_id(const char *, category_id_t *,
    60     unsigned int);
     60    ipc_start_flag_t);
    6161extern errno_t loc_category_get_name(category_id_t, char **);
    6262extern errno_t loc_category_get_svcs(category_id_t, category_id_t **, size_t *);
     
    6464
    6565extern async_sess_t *loc_service_connect(service_id_t, iface_t,
    66     unsigned int);
     66    ipc_start_flag_t);
    6767
    6868extern int loc_null_create(void);
  • uspace/lib/c/include/task.h

    r06599a1 r3529f148  
    4141#include <types/task.h>
    4242
    43 #define TASK_WAIT_EXIT   0x1
    44 #define TASK_WAIT_RETVAL 0x2
    45 #define TASK_WAIT_BOTH   0x4
    46 
    47 static inline void task_wait_set(task_wait_t *wait, int flags)
     43static inline void task_wait_set(task_wait_t *wait, task_wait_flag_t flags)
    4844{
    4945        wait->flags = flags;
     
    7066extern void task_cancel_wait(task_wait_t *);
    7167extern errno_t task_wait(task_wait_t *, task_exit_t *, int *);
    72 extern errno_t task_wait_task_id(task_id_t, int, task_exit_t *, int *);
     68extern errno_t task_wait_task_id(task_id_t, task_wait_flag_t, task_exit_t *, int *);
    7369
    7470extern errno_t task_retval(int);
  • uspace/lib/c/include/types/task.h

    r06599a1 r3529f148  
    3939
    4040typedef enum {
     41        TASK_WAIT_NONE   = 0x0,
     42        TASK_WAIT_EXIT   = 0x1,
     43        TASK_WAIT_RETVAL = 0x2,
     44        TASK_WAIT_BOTH   = 0x4
     45} task_wait_flag_t;
     46
     47typedef enum {
    4148        TASK_EXIT_RUNNING,   /**< Internal taskman value. */
    4249        TASK_EXIT_NORMAL,
     
    4552
    4653typedef struct {
    47         int flags;
     54        task_wait_flag_t flags;
    4855        ipc_call_t result;
    4956        aid_t aid;
     
    5158} task_wait_t;
    5259
    53 typedef void (*task_event_handler_t)(task_id_t, int, task_exit_t, int);
     60typedef void (*task_event_handler_t)(task_id_t, task_wait_flag_t, task_exit_t, int);
    5461
    5562#endif
Note: See TracChangeset for help on using the changeset viewer.