Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/task.c

    r5bcf1f9 r5d0500c  
    5050#include <ipc/ipc.h>
    5151#include <ipc/ipcrsc.h>
     52#include <ipc/event.h>
    5253#include <print.h>
    5354#include <errno.h>
     
    5758#include <syscall/copy.h>
    5859#include <macros.h>
    59 #include <ipc/event.h>
    6060
    6161/** Spinlock protecting the tasks_tree AVL tree. */
     
    155155        mutex_initialize(&task->futexes_lock, MUTEX_PASSIVE);
    156156       
    157         list_initialize(&task->th_head);
    158         list_initialize(&task->sync_box_head);
     157        list_initialize(&task->threads);
     158        list_initialize(&task->sync_boxes);
    159159       
    160160        ipc_answerbox_init(&task->answerbox, task);
     
    190190        str_cpy(task->name, TASK_NAME_BUFLEN, name);
    191191       
    192         task->context = CONTEXT;
     192        task->container = CONTAINER;
    193193        task->capabilities = 0;
    194194        task->ucycles = 0;
     
    201201        task->ipc_info.irq_notif_received = 0;
    202202        task->ipc_info.forwarded = 0;
     203
     204        event_task_init(task);
    203205       
    204206#ifdef CONFIG_UDEBUG
     
    211213       
    212214        if ((ipc_phone_0) &&
    213             (context_check(ipc_phone_0->task->context, task->context)))
     215            (container_check(ipc_phone_0->task->container, task->container)))
    214216                ipc_phone_connect(&task->phones[0], ipc_phone_0);
    215217       
     
    435437       
    436438        /* Current values of threads */
    437         link_t *cur;
    438         for (cur = task->th_head.next; cur != &task->th_head; cur = cur->next) {
     439        list_foreach(task->threads, cur) {
    439440                thread_t *thread = list_get_instance(cur, thread_t, th_link);
    440441               
     
    468469         */
    469470       
    470         link_t *cur;
    471         for (cur = task->th_head.next; cur != &task->th_head; cur = cur->next) {
     471        list_foreach(task->threads, cur) {
    472472                thread_t *thread = list_get_instance(cur, thread_t, th_link);
    473473                bool sleeping = false;
     
    534534        */
    535535        if (notify) {
    536                 if (event_is_subscribed(EVENT_FAULT)) {
    537                         /* Notify the subscriber that a fault occurred. */
    538                         event_notify_3(EVENT_FAULT, LOWER32(TASK->taskid),
    539                             UPPER32(TASK->taskid), (sysarg_t) THREAD);
    540                
     536                /* Notify the subscriber that a fault occurred. */
     537                if (event_notify_3(EVENT_FAULT, false, LOWER32(TASK->taskid),
     538                    UPPER32(TASK->taskid), (sysarg_t) THREAD) == EOK) {
    541539#ifdef CONFIG_UDEBUG
    542540                        /* Wait for a debugging session. */
     
    586584                printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %10p %10p"
    587585                    " %9" PRIu64 "%c %9" PRIu64 "%c\n", task->taskid,
    588                     task->name, task->context, task, task->as,
     586                    task->name, task->container, task, task->as,
    589587                    ucycles, usuffix, kcycles, ksuffix);
    590588#endif
     
    597595        else
    598596                printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %18p %18p\n",
    599                     task->taskid, task->name, task->context, task, task->as);
     597                    task->taskid, task->name, task->container, task, task->as);
    600598#endif
    601599       
     
    627625                printf("[id    ] [threads] [calls] [callee\n");
    628626        else
    629                 printf("[id    ] [name        ] [ctx] [address ] [as      ]"
     627                printf("[id    ] [name        ] [ctn] [address ] [as      ]"
    630628                    " [ucycles ] [kcycles ]\n");
    631629#endif
     
    636634                    " [callee\n");
    637635        else
    638                 printf("[id    ] [name        ] [ctx] [address         ]"
     636                printf("[id    ] [name        ] [ctn] [address         ]"
    639637                    " [as              ]\n");
    640638#endif
Note: See TracChangeset for help on using the changeset viewer.