Ignore:
File:
1 edited

Legend:

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

    rbc18d63 r5bcf1f9  
    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>
     
    5554#include <udebug/udebug.h>
    5655#include <ipc/kbox.h>
    57 
    58 #define TASK_NAME_BUFLEN        20
     56#include <mm/as.h>
     57#include <sysinfo/abi.h>
    5958
    6059struct thread;
     
    7069         * threads.
    7170         */
    72         SPINLOCK_DECLARE(lock);
    73 
     71        IRQ_SPINLOCK_DECLARE(lock);
     72       
    7473        char name[TASK_NAME_BUFLEN];
    7574        /** List of threads contained in this task. */
     
    8079        task_id_t taskid;
    8180        /** Task security context. */
    82         context_id_t context;   
    83 
     81        context_id_t context;
     82       
    8483        /** Number of references (i.e. threads). */
    8584        atomic_t refcount;
    8685        /** Number of threads that haven't exited yet. */
    8786        atomic_t lifecount;
    88 
     87       
    8988        /** Task capabilities. */
    90         cap_t capabilities;     
    91 
     89        cap_t capabilities;
     90       
    9291        /* IPC stuff */
    9392        answerbox_t answerbox;  /**< Communication endpoint */
    9493        phone_t phones[IPC_MAX_PHONES];
    95         /**
    96          * Active asynchronous messages. It is used for limiting uspace to
    97          * certain extent.
    98          */
    99         atomic_t active_calls;
    100 
     94        stats_ipc_t ipc_info;   /**< IPC statistics */
     95        /** List of synchronous answerboxes. */
     96        link_t sync_box_head;
     97       
    10198#ifdef CONFIG_UDEBUG
    10299        /** Debugging stuff. */
    103100        udebug_task_t udebug;
    104 
     101       
    105102        /** Kernel answerbox. */
    106103        kbox_t kb;
    107 #endif
    108 
     104#endif /* CONFIG_UDEBUG */
     105       
    109106        /** Architecture specific task data. */
    110107        task_arch_t arch;
     
    116113        mutex_t futexes_lock;
    117114        /** B+tree of futexes referenced by this task. */
    118         btree_t futexes;       
     115        btree_t futexes;
    119116       
    120117        /** Accumulated accounting. */
    121         uint64_t cycles;
     118        uint64_t ucycles;
     119        uint64_t kcycles;
    122120} task_t;
    123121
    124 SPINLOCK_EXTERN(tasks_lock);
     122IRQ_SPINLOCK_EXTERN(tasks_lock);
    125123extern avltree_t tasks_tree;
    126124
    127125extern void task_init(void);
    128126extern void task_done(void);
    129 extern task_t *task_create(as_t *as, char *name);
    130 extern void task_destroy(task_t *t);
    131 extern task_t *task_find_by_id(task_id_t id);
    132 extern int task_kill(task_id_t id);
    133 extern uint64_t task_get_accounting(task_t *t);
     127extern task_t *task_create(as_t *, const char *);
     128extern void task_destroy(task_t *);
     129extern void task_hold(task_t *);
     130extern void task_release(task_t *);
     131extern task_t *task_find_by_id(task_id_t);
     132extern int task_kill(task_id_t);
     133extern void task_kill_self(bool) __attribute__((noreturn));
     134extern void task_get_accounting(task_t *, uint64_t *, uint64_t *);
     135extern void task_print_list(bool);
    134136
    135 extern void cap_set(task_t *t, cap_t caps);
    136 extern cap_t cap_get(task_t *t);
     137extern void cap_set(task_t *, cap_t);
     138extern cap_t cap_get(task_t *);
    137139
    138140#ifndef task_create_arch
    139 extern void task_create_arch(task_t *t);
     141extern void task_create_arch(task_t *);
    140142#endif
    141143
    142144#ifndef task_destroy_arch
    143 extern void task_destroy_arch(task_t *t);
     145extern void task_destroy_arch(task_t *);
    144146#endif
    145147
    146 extern unative_t sys_task_get_id(task_id_t *uspace_task_id);
    147 extern unative_t sys_task_set_name(const char *uspace_name, size_t name_len);
     148#ifdef __32_BITS__
     149extern sysarg_t sys_task_get_id(sysarg64_t *);
     150#endif
     151
     152#ifdef __64_BITS__
     153extern sysarg_t sys_task_get_id(void);
     154#endif
     155
     156extern sysarg_t sys_task_set_name(const char *, size_t);
     157extern sysarg_t sys_task_kill(task_id_t *);
     158extern sysarg_t sys_task_exit(sysarg_t);
    148159
    149160#endif
Note: See TracChangeset for help on using the changeset viewer.