Ignore:
File:
1 edited

Legend:

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

    r1e9f8ab r7e752b2  
    151151        atomic_set(&task->refcount, 0);
    152152        atomic_set(&task->lifecount, 0);
     153        atomic_set(&task->active_calls, 0);
    153154       
    154155        irq_spinlock_initialize(&task->lock, "task_t_lock");
     
    290291}
    291292
    292 #ifdef __32_BITS__
    293 
    294 /** Syscall for reading task ID from userspace (32 bits)
    295  *
    296  * @param uspace_taskid Pointer to user-space buffer
    297  *                      where to store current task ID.
     293/** Syscall for reading task ID from userspace.
     294 *
     295 * @param uspace_task_id Userspace address of 8-byte buffer
     296 *                       where to store current task ID.
    298297 *
    299298 * @return Zero on success or an error code from @ref errno.h.
    300299 *
    301300 */
    302 sysarg_t sys_task_get_id(sysarg64_t *uspace_taskid)
     301unative_t sys_task_get_id(task_id_t *uspace_task_id)
    303302{
    304303        /*
     
    306305         * the lifespan of the task.
    307306         */
    308         return (sysarg_t) copy_to_uspace(uspace_taskid, &TASK->taskid,
     307        return (unative_t) copy_to_uspace(uspace_task_id, &TASK->taskid,
    309308            sizeof(TASK->taskid));
    310309}
    311 
    312 #endif  /* __32_BITS__ */
    313 
    314 #ifdef __64_BITS__
    315 
    316 /** Syscall for reading task ID from userspace (64 bits)
    317  *
    318  * @return Current task ID.
    319  *
    320  */
    321 sysarg_t sys_task_get_id(void)
    322 {
    323         /*
    324          * No need to acquire lock on TASK because taskid remains constant for
    325          * the lifespan of the task.
    326          */
    327         return TASK->taskid;
    328 }
    329 
    330 #endif  /* __64_BITS__ */
    331310
    332311/** Syscall for setting the task name.
     
    340319 *
    341320 */
    342 sysarg_t sys_task_set_name(const char *uspace_name, size_t name_len)
     321unative_t sys_task_set_name(const char *uspace_name, size_t name_len)
    343322{
    344323        int rc;
     
    352331        rc = copy_from_uspace(namebuf, uspace_name, name_len);
    353332        if (rc != 0)
    354                 return (sysarg_t) rc;
     333                return (unative_t) rc;
    355334       
    356335        namebuf[name_len] = '\0';
     
    358337       
    359338        return EOK;
    360 }
    361 
    362 /** Syscall to forcefully terminate a task
    363  *
    364  * @param uspace_taskid Pointer to task ID in user space.
    365  *
    366  * @return 0 on success or an error code from @ref errno.h.
    367  *
    368  */
    369 sysarg_t sys_task_kill(task_id_t *uspace_taskid)
    370 {
    371         task_id_t taskid;
    372         int rc;
    373 
    374         rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(taskid));
    375         if (rc != 0)
    376                 return (sysarg_t) rc;
    377 
    378         return (sysarg_t) task_kill(taskid);
    379339}
    380340
     
    518478#ifdef __32_BITS__
    519479        if (*additional)
    520                 printf("%-8" PRIu64 " %9" PRIua, task->taskid,
    521                     atomic_get(&task->refcount));
     480                printf("%-8" PRIu64 " %9" PRIua " %7" PRIua, task->taskid,
     481                    atomic_get(&task->refcount), atomic_get(&task->active_calls));
    522482        else
    523483                printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %10p %10p"
     
    530490        if (*additional)
    531491                printf("%-8" PRIu64 " %9" PRIu64 "%c %9" PRIu64 "%c "
    532                     "%9" PRIua, task->taskid, ucycles, usuffix, kcycles,
    533                     ksuffix, atomic_get(&task->refcount));
     492                    "%9" PRIua " %7" PRIua,
     493                    task->taskid, ucycles, usuffix, kcycles, ksuffix,
     494                    atomic_get(&task->refcount), atomic_get(&task->active_calls));
    534495        else
    535496                printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %18p %18p\n",
Note: See TracChangeset for help on using the changeset viewer.