Ignore:
File:
1 edited

Legend:

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

    r5bcf1f9 rbc18d63  
    11/*
    2  * Copyright (c) 2010 Jakub Jermar
     2 * Copyright (c) 2001-2004 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    4040#include <synch/spinlock.h>
    4141#include <synch/mutex.h>
     42#include <synch/rwlock.h>
    4243#include <synch/futex.h>
    4344#include <adt/avl.h>
     
    5455#include <udebug/udebug.h>
    5556#include <ipc/kbox.h>
    56 #include <mm/as.h>
    57 #include <sysinfo/abi.h>
     57
     58#define TASK_NAME_BUFLEN        20
    5859
    5960struct thread;
     
    6970         * threads.
    7071         */
    71         IRQ_SPINLOCK_DECLARE(lock);
    72        
     72        SPINLOCK_DECLARE(lock);
     73
    7374        char name[TASK_NAME_BUFLEN];
    7475        /** List of threads contained in this task. */
     
    7980        task_id_t taskid;
    8081        /** Task security context. */
    81         context_id_t context;
    82        
     82        context_id_t context;   
     83
    8384        /** Number of references (i.e. threads). */
    8485        atomic_t refcount;
    8586        /** Number of threads that haven't exited yet. */
    8687        atomic_t lifecount;
    87        
     88
    8889        /** Task capabilities. */
    89         cap_t capabilities;
    90        
     90        cap_t capabilities;     
     91
    9192        /* IPC stuff */
    9293        answerbox_t answerbox;  /**< Communication endpoint */
    9394        phone_t phones[IPC_MAX_PHONES];
    94         stats_ipc_t ipc_info;   /**< IPC statistics */
    95         /** List of synchronous answerboxes. */
    96         link_t sync_box_head;
    97        
     95        /**
     96         * Active asynchronous messages. It is used for limiting uspace to
     97         * certain extent.
     98         */
     99        atomic_t active_calls;
     100
    98101#ifdef CONFIG_UDEBUG
    99102        /** Debugging stuff. */
    100103        udebug_task_t udebug;
    101        
     104
    102105        /** Kernel answerbox. */
    103106        kbox_t kb;
    104 #endif /* CONFIG_UDEBUG */
    105        
     107#endif
     108
    106109        /** Architecture specific task data. */
    107110        task_arch_t arch;
     
    113116        mutex_t futexes_lock;
    114117        /** B+tree of futexes referenced by this task. */
    115         btree_t futexes;
     118        btree_t futexes;       
    116119       
    117120        /** Accumulated accounting. */
    118         uint64_t ucycles;
    119         uint64_t kcycles;
     121        uint64_t cycles;
    120122} task_t;
    121123
    122 IRQ_SPINLOCK_EXTERN(tasks_lock);
     124SPINLOCK_EXTERN(tasks_lock);
    123125extern avltree_t tasks_tree;
    124126
    125127extern void task_init(void);
    126128extern void task_done(void);
    127 extern task_t *task_create(as_t *, const char *);
    128 extern void task_destroy(task_t *);
    129 extern void task_hold(task_t *);
    130 extern void task_release(task_t *);
    131 extern task_t *task_find_by_id(task_id_t);
    132 extern int task_kill(task_id_t);
    133 extern void task_kill_self(bool) __attribute__((noreturn));
    134 extern void task_get_accounting(task_t *, uint64_t *, uint64_t *);
    135 extern void task_print_list(bool);
     129extern task_t *task_create(as_t *as, char *name);
     130extern void task_destroy(task_t *t);
     131extern task_t *task_find_by_id(task_id_t id);
     132extern int task_kill(task_id_t id);
     133extern uint64_t task_get_accounting(task_t *t);
    136134
    137 extern void cap_set(task_t *, cap_t);
    138 extern cap_t cap_get(task_t *);
     135extern void cap_set(task_t *t, cap_t caps);
     136extern cap_t cap_get(task_t *t);
    139137
    140138#ifndef task_create_arch
    141 extern void task_create_arch(task_t *);
     139extern void task_create_arch(task_t *t);
    142140#endif
    143141
    144142#ifndef task_destroy_arch
    145 extern void task_destroy_arch(task_t *);
     143extern void task_destroy_arch(task_t *t);
    146144#endif
    147145
    148 #ifdef __32_BITS__
    149 extern sysarg_t sys_task_get_id(sysarg64_t *);
    150 #endif
    151 
    152 #ifdef __64_BITS__
    153 extern sysarg_t sys_task_get_id(void);
    154 #endif
    155 
    156 extern sysarg_t sys_task_set_name(const char *, size_t);
    157 extern sysarg_t sys_task_kill(task_id_t *);
    158 extern sysarg_t sys_task_exit(sysarg_t);
     146extern unative_t sys_task_get_id(task_id_t *uspace_task_id);
     147extern unative_t sys_task_set_name(const char *uspace_name, size_t name_len);
    159148
    160149#endif
Note: See TracChangeset for help on using the changeset viewer.