Changeset 3529f148 in mainline for uspace/srv/taskman/event.c


Ignore:
Timestamp:
2020-03-06T19:14:20Z (4 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/taskman/event.c

    r06599a1 r3529f148  
    5050        task_id_t waiter_id;  /**< Task ID who waits. */
    5151        ipc_call_t *icall;  /**< Call ID waiting for the event. */
    52         int flags;            /**< Wait flags. */
     52        task_wait_flag_t flags; /**< Wait flags. */
    5353} pending_wait_t;
    5454
     
    6767}
    6868
    69 static int event_flags(task_t *task)
    70 {
    71         int flags = 0;
     69static task_wait_flag_t event_flags(task_t *task)
     70{
     71        task_wait_flag_t flags = TASK_WAIT_NONE;
    7272        if (task->retval_type == RVAL_SET) {
    7373                flags |= TASK_WAIT_RETVAL;
     
    8888static void event_notify(task_t *sender, async_sess_t *sess)
    8989{
    90         int flags = event_flags(sender);
    91         if (flags == 0) {
     90        task_wait_flag_t flags = event_flags(sender);
     91        if (flags == TASK_WAIT_NONE) {
    9292                return;
    9393        }
     
    114114static void event_notify_all(task_t *sender)
    115115{
    116         int flags = event_flags(sender);
    117         if (flags == 0) {
     116        task_wait_flag_t flags = event_flags(sender);
     117        if (flags == TASK_WAIT_NONE) {
    118118                return;
    119119        }
     
    140140                        continue; // TODO really when does this happen?
    141141                }
    142                 int notify_flags = event_flags(t);
     142                task_wait_flag_t notify_flags = event_flags(t);
    143143
    144144                /*
     
    146146                 * thus it can be never present in rest flags.
    147147                 */
    148                 int rest = (~notify_flags & pr->flags) & ~TASK_WAIT_RETVAL;
     148                task_wait_flag_t rest = (~notify_flags & pr->flags) & ~TASK_WAIT_RETVAL;
    149149                rest &= ~TASK_WAIT_BOTH;
    150                 int match = notify_flags & pr->flags;
     150                bool match = notify_flags & pr->flags;
    151151                // TODO why do I even accept such calls?
    152152                bool answer = !(pr->icall->flags & IPC_CALL_NOTIF);
     
    233233}
    234234
    235 void wait_for_task(task_id_t id, int flags, ipc_call_t *icall,
     235void wait_for_task(task_id_t id, task_wait_flag_t flags, ipc_call_t *icall,
    236236    task_id_t waiter_id)
    237237{
Note: See TracChangeset for help on using the changeset viewer.