Ignore:
File:
1 edited

Legend:

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

    ree42e43 r41df2827  
    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>
     
    5556#include <ipc/kbox.h>
    5657#include <mm/as.h>
    57 #include <sysinfo/abi.h>
     58
     59#define TASK_NAME_BUFLEN        20
    5860
    5961struct thread;
     
    6971         * threads.
    7072         */
    71         IRQ_SPINLOCK_DECLARE(lock);
    72        
     73        SPINLOCK_DECLARE(lock);
     74
    7375        char name[TASK_NAME_BUFLEN];
    7476        /** List of threads contained in this task. */
     
    7981        task_id_t taskid;
    8082        /** Task security context. */
    81         context_id_t context;
    82        
     83        context_id_t context;   
     84
    8385        /** Number of references (i.e. threads). */
    8486        atomic_t refcount;
    8587        /** Number of threads that haven't exited yet. */
    8688        atomic_t lifecount;
    87        
     89
    8890        /** Task capabilities. */
    89         cap_t capabilities;
    90        
     91        cap_t capabilities;     
     92
    9193        /* IPC stuff */
    9294        answerbox_t answerbox;  /**< Communication endpoint */
    9395        phone_t phones[IPC_MAX_PHONES];
    94         stats_ipc_t ipc_info;   /**< IPC statistics */
    9596        /**
    9697         * Active asynchronous messages. It is used for limiting uspace to
     
    100101        /** List of synchronous answerboxes. */
    101102        link_t sync_box_head;
    102        
     103
    103104#ifdef CONFIG_UDEBUG
    104105        /** Debugging stuff. */
    105106        udebug_task_t udebug;
    106        
     107
    107108        /** Kernel answerbox. */
    108109        kbox_t kb;
    109 #endif /* CONFIG_UDEBUG */
    110        
     110#endif
     111
    111112        /** Architecture specific task data. */
    112113        task_arch_t arch;
     
    118119        mutex_t futexes_lock;
    119120        /** B+tree of futexes referenced by this task. */
    120         btree_t futexes;
     121        btree_t futexes;       
    121122       
    122123        /** Accumulated accounting. */
    123         uint64_t ucycles;
    124         uint64_t kcycles;
     124        uint64_t cycles;
    125125} task_t;
    126126
    127 IRQ_SPINLOCK_EXTERN(tasks_lock);
     127SPINLOCK_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 *, const char *);
    133 extern void task_destroy(task_t *);
    134 extern void task_hold(task_t *);
    135 extern void task_release(task_t *);
    136 extern task_t *task_find_by_id(task_id_t);
    137 extern int task_kill(task_id_t);
    138 extern void task_get_accounting(task_t *, uint64_t *, uint64_t *);
    139 extern void task_print_list(bool);
     132extern task_t *task_create(as_t *as, char *name);
     133extern void task_destroy(task_t *t);
     134extern task_t *task_find_by_id(task_id_t id);
     135extern int task_kill(task_id_t id);
     136extern uint64_t task_get_accounting(task_t *t);
     137extern void task_print_list(void);
    140138
    141 extern void cap_set(task_t *, cap_t);
    142 extern cap_t cap_get(task_t *);
     139extern void cap_set(task_t *t, cap_t caps);
     140extern cap_t cap_get(task_t *t);
    143141
    144142#ifndef task_create_arch
    145 extern void task_create_arch(task_t *);
     143extern void task_create_arch(task_t *t);
    146144#endif
    147145
    148146#ifndef task_destroy_arch
    149 extern void task_destroy_arch(task_t *);
     147extern void task_destroy_arch(task_t *t);
    150148#endif
    151149
    152 extern unative_t sys_task_get_id(task_id_t *);
    153 extern unative_t sys_task_set_name(const char *, size_t);
     150extern unative_t sys_task_get_id(task_id_t *uspace_task_id);
     151extern unative_t sys_task_set_name(const char *uspace_name, size_t name_len);
    154152
    155153#endif
Note: See TracChangeset for help on using the changeset viewer.