Changeset 95ad426 in mainline


Ignore:
Timestamp:
2009-06-02T17:28:10Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1ed901d
Parents:
34356b2
Message:

add very simple implementation of task destruction notification
(which will be later used for waiting on a task)

Location:
kernel/generic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/ipc/event_types.h

    r34356b2 r95ad426  
    3939        EVENT_KLOG = 0,
    4040        EVENT_KCONSOLE,
     41        EVENT_WAIT,
    4142        EVENT_END
    4243} event_type_t;
  • kernel/generic/include/macros.h

    r34356b2 r95ad426  
    8484#define STRING_ARG(arg)  #arg
    8585
     86#define LOWER32(arg)  ((arg) & 0xffffffff)
     87#define UPPER32(arg)  (((arg) >> 32) & 0xffffffff)
     88
     89#define MERGE_LOHI32(lo, hi)  ((lo & 0xffffffff) | ((hi & 0xffffffff) < 32))
     90
    8691/** Pseudorandom generator
    8792 *
  • kernel/generic/src/proc/task.c

    r34356b2 r95ad426  
    5555#include <string.h>
    5656#include <syscall/copy.h>
     57#include <macros.h>
     58#include <ipc/event.h>
    5759
    5860/** Spinlock protecting the tasks_tree AVL tree. */
     
    230232                as_destroy(t->as);
    231233       
     234        /*
     235         * Notify about task destruction.
     236         */
     237        if (event_is_subscribed(EVENT_WAIT))
     238                event_notify_2(EVENT_WAIT, LOWER32(t->taskid), UPPER32(t->taskid));
     239       
    232240        free(t);
    233241        TASK = NULL;
Note: See TracChangeset for help on using the changeset viewer.