Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/proc/task.h

    r41df2827 ree42e43  
    11/*
    2  * Copyright (c) 2001-2004 Jakub Jermar
     2 * Copyright (c) 2010 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    4040#include <synch/spinlock.h>
    4141#include <synch/mutex.h>
    42 #include <synch/rwlock.h>
    4342#include <synch/futex.h>
    4443#include <adt/avl.h>
     
    5655#include <ipc/kbox.h>
    5756#include <mm/as.h>
    58 
    59 #define TASK_NAME_BUFLEN        20
     57#include <sysinfo/abi.h>
    6058
    6159struct thread;
     
    7169         * threads.
    7270         */
    73         SPINLOCK_DECLARE(lock);
    74 
     71        IRQ_SPINLOCK_DECLARE(lock);
     72       
    7573        char name[TASK_NAME_BUFLEN];
    7674        /** List of threads contained in this task. */
     
    8179        task_id_t taskid;
    8280        /** Task security context. */
    83         context_id_t context;   
    84 
     81        context_id_t context;
     82       
    8583        /** Number of references (i.e. threads). */
    8684        atomic_t refcount;
    8785        /** Number of threads that haven't exited yet. */
    8886        atomic_t lifecount;
    89 
     87       
    9088        /** Task capabilities. */
    91         cap_t capabilities;     
    92 
     89        cap_t capabilities;
     90       
    9391        /* IPC stuff */
    9492        answerbox_t answerbox;  /**< Communication endpoint */
    9593        phone_t phones[IPC_MAX_PHONES];
     94        stats_ipc_t ipc_info;   /**< IPC statistics */
    9695        /**
    9796         * Active asynchronous messages. It is used for limiting uspace to
     
    101100        /** List of synchronous answerboxes. */
    102101        link_t sync_box_head;
    103 
     102       
    104103#ifdef CONFIG_UDEBUG
    105104        /** Debugging stuff. */
    106105        udebug_task_t udebug;
    107 
     106       
    108107        /** Kernel answerbox. */
    109108        kbox_t kb;
    110 #endif
    111 
     109#endif /* CONFIG_UDEBUG */
     110       
    112111        /** Architecture specific task data. */
    113112        task_arch_t arch;
     
    119118        mutex_t futexes_lock;
    120119        /** B+tree of futexes referenced by this task. */
    121         btree_t futexes;       
     120        btree_t futexes;
    122121       
    123122        /** Accumulated accounting. */
    124         uint64_t cycles;
     123        uint64_t ucycles;
     124        uint64_t kcycles;
    125125} task_t;
    126126
    127 SPINLOCK_EXTERN(tasks_lock);
     127IRQ_SPINLOCK_EXTERN(tasks_lock);
    128128extern avltree_t tasks_tree;
    129129
    130130extern void task_init(void);
    131131extern void task_done(void);
    132 extern task_t *task_create(as_t *as, char *name);
    133 extern void task_destroy(task_t *t);
    134 extern task_t *task_find_by_id(task_id_t id);
    135 extern int task_kill(task_id_t id);
    136 extern uint64_t task_get_accounting(task_t *t);
    137 extern void task_print_list(void);
     132extern task_t *task_create(as_t *, const char *);
     133extern void task_destroy(task_t *);
     134extern void task_hold(task_t *);
     135extern void task_release(task_t *);
     136extern task_t *task_find_by_id(task_id_t);
     137extern int task_kill(task_id_t);
     138extern void task_get_accounting(task_t *, uint64_t *, uint64_t *);
     139extern void task_print_list(bool);
    138140
    139 extern void cap_set(task_t *t, cap_t caps);
    140 extern cap_t cap_get(task_t *t);
     141extern void cap_set(task_t *, cap_t);
     142extern cap_t cap_get(task_t *);
    141143
    142144#ifndef task_create_arch
    143 extern void task_create_arch(task_t *t);
     145extern void task_create_arch(task_t *);
    144146#endif
    145147
    146148#ifndef task_destroy_arch
    147 extern void task_destroy_arch(task_t *t);
     149extern void task_destroy_arch(task_t *);
    148150#endif
    149151
    150 extern unative_t sys_task_get_id(task_id_t *uspace_task_id);
    151 extern unative_t sys_task_set_name(const char *uspace_name, size_t name_len);
     152extern unative_t sys_task_get_id(task_id_t *);
     153extern unative_t sys_task_set_name(const char *, size_t);
    152154
    153155#endif
Note: See TracChangeset for help on using the changeset viewer.