Subversion Repositories HelenOS

Rev

Rev 3022 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3022 Rev 4055
Line 50... Line 50...
50
#include <arch/context.h>
50
#include <arch/context.h>
51
#include <arch/fpu_context.h>
51
#include <arch/fpu_context.h>
52
#include <arch/cpu.h>
52
#include <arch/cpu.h>
53
#include <mm/tlb.h>
53
#include <mm/tlb.h>
54
#include <proc/scheduler.h>
54
#include <proc/scheduler.h>
-
 
55
#include <udebug/udebug.h>
-
 
56
#include <ipc/kbox.h>
-
 
57
 
-
 
58
#define TASK_NAME_BUFLEN    20
55
 
59
 
56
struct thread;
60
struct thread;
57
 
61
 
58
/** Task structure. */
62
/** Task structure. */
59
typedef struct task {
63
typedef struct task {
Line 64... Line 68...
64
     *
68
     *
65
     * Must be acquired before threads_lock and thread lock of any of its
69
     * Must be acquired before threads_lock and thread lock of any of its
66
     * threads.
70
     * threads.
67
     */
71
     */
68
    SPINLOCK_DECLARE(lock);
72
    SPINLOCK_DECLARE(lock);
69
   
73
 
70
    char *name;
74
    char name[TASK_NAME_BUFLEN];
71
    /** List of threads contained in this task. */
75
    /** List of threads contained in this task. */
72
    link_t th_head;
76
    link_t th_head;
73
    /** Address space. */
77
    /** Address space. */
74
    as_t *as;
78
    as_t *as;
75
    /** Unique identity of task. */
79
    /** Unique identity of task. */
Line 91... Line 95...
91
    /**
95
    /**
92
     * Active asynchronous messages. It is used for limiting uspace to
96
     * Active asynchronous messages. It is used for limiting uspace to
93
     * certain extent.
97
     * certain extent.
94
     */
98
     */
95
    atomic_t active_calls;
99
    atomic_t active_calls;
-
 
100
 
-
 
101
#ifdef CONFIG_UDEBUG
-
 
102
    /** Debugging stuff. */
-
 
103
    udebug_task_t udebug;
96
   
104
 
-
 
105
    /** Kernel answerbox. */
-
 
106
    kbox_t kb;
-
 
107
#endif
-
 
108
 
97
    /** Architecture specific task data. */
109
    /** Architecture specific task data. */
98
    task_arch_t arch;
110
    task_arch_t arch;
99
   
111
   
100
    /**
112
    /**
101
     * Serializes access to the B+tree of task's futexes. This mutex is
113
     * Serializes access to the B+tree of task's futexes. This mutex is
Line 114... Line 126...
114
 
126
 
115
extern void task_init(void);
127
extern void task_init(void);
116
extern void task_done(void);
128
extern void task_done(void);
117
extern task_t *task_create(as_t *as, char *name);
129
extern task_t *task_create(as_t *as, char *name);
118
extern void task_destroy(task_t *t);
130
extern void task_destroy(task_t *t);
119
extern task_t *task_run_program(void *program_addr, char *name);
-
 
120
extern task_t *task_find_by_id(task_id_t id);
131
extern task_t *task_find_by_id(task_id_t id);
121
extern int task_kill(task_id_t id);
132
extern int task_kill(task_id_t id);
122
extern uint64_t task_get_accounting(task_t *t);
133
extern uint64_t task_get_accounting(task_t *t);
123
 
134
 
124
extern void cap_set(task_t *t, cap_t caps);
135
extern void cap_set(task_t *t, cap_t caps);
Line 131... Line 142...
131
#ifndef task_destroy_arch
142
#ifndef task_destroy_arch
132
extern void task_destroy_arch(task_t *t);
143
extern void task_destroy_arch(task_t *t);
133
#endif
144
#endif
134
 
145
 
135
extern unative_t sys_task_get_id(task_id_t *uspace_task_id);
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);
136
 
148
 
137
#endif
149
#endif
138
 
150
 
139
/** @}
151
/** @}
140
 */
152
 */