|
[ source navigation ] [ diff markup ] [ identifier search ] [ general search ] |
|||
|
001 /* Copyright (C) 2004,2005 David Decotigny 001 /* Copyright (C) 2004,2005 David Decotigny 002 002 003 This program is free software; you can redi 003 This program is free software; you can redistribute it and/or 004 modify it under the terms of the GNU Genera 004 modify it under the terms of the GNU General Public License 005 as published by the Free Software Foundatio 005 as published by the Free Software Foundation; either version 2 006 of the License, or (at your option) any lat 006 of the License, or (at your option) any later version. 007 007 008 This program is distributed in the hope tha 008 This program is distributed in the hope that it will be useful, 009 but WITHOUT ANY WARRANTY; without even the 009 but WITHOUT ANY WARRANTY; without even the implied warranty of 010 MERCHANTABILITY or FITNESS FOR A PARTICULAR 010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 011 GNU General Public License for more details 011 GNU General Public License for more details. 012 012 013 You should have received a copy of the GNU 013 You should have received a copy of the GNU General Public License 014 along with this program; if not, write to t 014 along with this program; if not, write to the Free Software 015 Foundation, Inc., 59 Temple Place - Suite 3 015 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 016 USA. 016 USA. 017 */ 017 */ 018 #ifndef _SOS_THREAD_H_ 018 #ifndef _SOS_THREAD_H_ 019 #define _SOS_THREAD_H_ 019 #define _SOS_THREAD_H_ 020 020 021 /** 021 /** 022 * @file thread.h 022 * @file thread.h 023 * 023 * 024 * SOS Thread management API 024 * SOS Thread management API 025 */ 025 */ 026 026 027 #include <sos/errno.h> 027 #include <sos/errno.h> 028 028 029 /* Forward declaration */ 029 /* Forward declaration */ 030 struct sos_thread; 030 struct sos_thread; 031 031 032 #include <hwcore/cpu_context.h> 032 #include <hwcore/cpu_context.h> 033 #include <sos/sched.h> 033 #include <sos/sched.h> 034 #include <sos/kwaitq.h> 034 #include <sos/kwaitq.h> 035 #include <sos/time.h> 035 #include <sos/time.h> 036 #include <sos/process.h> 036 #include <sos/process.h> 037 #include <sos/umem_vmm.h> << 038 037 039 /** 038 /** 040 * The possible states of a valid thread 039 * The possible states of a valid thread 041 */ 040 */ 042 typedef enum { SOS_THR_CREATED, /**< Thread cr 041 typedef enum { SOS_THR_CREATED, /**< Thread created, not fully initialized */ 043 SOS_THR_READY, /**< Thread fu 042 SOS_THR_READY, /**< Thread fully initialized or 044 waiting f 043 waiting for CPU after having been 045 blocked o 044 blocked or preempted */ 046 SOS_THR_RUNNING, /**< Thread cu 045 SOS_THR_RUNNING, /**< Thread currently running on CPU */ 047 SOS_THR_BLOCKED, /**< Thread wa 046 SOS_THR_BLOCKED, /**< Thread waiting for I/O (+ in at LEAST 048 one kwait 047 one kwaitq) and/or sleeping (+ in NO 049 kwaitq) * 048 kwaitq) */ 050 SOS_THR_ZOMBIE, /**< Thread te 049 SOS_THR_ZOMBIE, /**< Thread terminated execution, waiting to 051 be delete 050 be deleted by kernel */ 052 } sos_thread_state_t; 051 } sos_thread_state_t; 053 052 054 053 055 /** 054 /** 056 * TCB (Thread Control Block): structure descr 055 * TCB (Thread Control Block): structure describing a thread. Don't 057 * access these fields directly: prefer using 056 * access these fields directly: prefer using the accessor functions 058 * below. 057 * below. 059 */ 058 */ 060 struct sos_thread 059 struct sos_thread 061 { 060 { 062 #define SOS_THR_MAX_NAMELEN 32 061 #define SOS_THR_MAX_NAMELEN 32 063 char name[SOS_THR_MAX_NAMELEN]; 062 char name[SOS_THR_MAX_NAMELEN]; 064 063 065 sos_thread_state_t state; 064 sos_thread_state_t state; 066 sos_sched_priority_t priority; 065 sos_sched_priority_t priority; 067 066 068 /** 067 /** 069 * The hardware context of the thread. 068 * The hardware context of the thread. 070 * 069 * 071 * It will reflect the CPU state of the thre 070 * It will reflect the CPU state of the thread: 072 * - From an interrupt handler: the state o 071 * - From an interrupt handler: the state of the thread at the time 073 * of the OUTERMOST irq. An IRQ is not al 072 * of the OUTERMOST irq. An IRQ is not allowed to make context 074 * switches, so this context will remain 073 * switches, so this context will remain valid from the begining of 075 * the outermost IRQ handler to the end o 074 * the outermost IRQ handler to the end of it, no matter if there 076 * are other IRQ handlers nesting in one 075 * are other IRQ handlers nesting in one another. You may safely 077 * use it from IRQ handlers to query the 076 * use it from IRQ handlers to query the state of the interrupted 078 * thread, no matter if there has been ot 077 * thread, no matter if there has been other IRQ handlers 079 * executing meanwhile. 078 * executing meanwhile. 080 * - From normal kernel code, exceptions an 079 * - From normal kernel code, exceptions and syscall: the state of 081 * the thread the last time there was a c 080 * the thread the last time there was a context switch from this 082 * thread to another one. Thus this field 081 * thread to another one. Thus this field WON'T reflect the 083 * current's thread cpu_state in these ca 082 * current's thread cpu_state in these cases. So, in these cases, 084 * simply DO NOT USE IT outside thread.c 083 * simply DO NOT USE IT outside thread.c ! Note: for syscall and 085 * exception handlers, the VALID state of 084 * exception handlers, the VALID state of the interrupted thread is 086 * passed as an argument to the handlers. 085 * passed as an argument to the handlers. 087 */ 086 */ 088 struct sos_cpu_state *cpu_state; 087 struct sos_cpu_state *cpu_state; 089 088 090 /* Kernel stack parameters */ 089 /* Kernel stack parameters */ 091 sos_vaddr_t kernel_stack_base_addr; 090 sos_vaddr_t kernel_stack_base_addr; 092 sos_size_t kernel_stack_size; 091 sos_size_t kernel_stack_size; 093 092 094 /* Process this thread belongs to. Always NU 093 /* Process this thread belongs to. Always NULL for a kernel 095 thread */ 094 thread */ 096 struct sos_process *process; 095 struct sos_process *process; 097 096 098 /** 097 /** 099 * Address space currently "squatted" by the 098 * Address space currently "squatted" by the thread, or used to be 100 * active when the thread was interrupted/pr 099 * active when the thread was interrupted/preempted. This is the MMU 101 * configuration expected before the cpu_sta 100 * configuration expected before the cpu_state of the thread is 102 * restored on CPU. 101 * restored on CPU. 103 * - For kernel threads: should normally b 102 * - For kernel threads: should normally be NULL, meaning that the 104 * thread will squat the current mm_cont 103 * thread will squat the current mm_context currently set in the 105 * MMU. Might be NON NULL when a kernel 104 * MMU. Might be NON NULL when a kernel thread squats a given 106 * process to manipulate its address spa 105 * process to manipulate its address space. 107 * - For user threads: should normally be 106 * - For user threads: should normally be NULL. More precisely: 108 * - in user mode: the thread->process 107 * - in user mode: the thread->process.mm_context is ALWAYS 109 * set on MMU. squatted_mm_context i 108 * set on MMU. squatted_mm_context is ALWAYS NULL in this 110 * situation, meaning that the threa 109 * situation, meaning that the thread in user mode uses its 111 * process-space as expected 110 * process-space as expected 112 * - in kernel mode: NULL means that w 111 * - in kernel mode: NULL means that we keep on using the 113 * mm_context currently set on MMU, 112 * mm_context currently set on MMU, which might be the 114 * mm_context of another process. Th 113 * mm_context of another process. This is natural since a 115 * thread in kernel mode normally on 114 * thread in kernel mode normally only uses data in kernel 116 * space. BTW, this limits the numbe 115 * space. BTW, this limits the number of TLB flushes. However, 117 * there are exceptions where this s 116 * there are exceptions where this squatted_mm_context will 118 * NOT be NULL. One is the copy_from 117 * NOT be NULL. One is the copy_from/to_user API, which can 119 * force the effective mm_context so 118 * force the effective mm_context so that the MMU will be 120 * (re)configured upon every context 119 * (re)configured upon every context to the thread to match 121 * the squatted_mm_context. Another 120 * the squatted_mm_context. Another exception is when a parent 122 * thread creates the address space 121 * thread creates the address space of a child process, in 123 * which case the parent thread migh 122 * which case the parent thread might temporarilly decide to 124 * switch to the child's process spa 123 * switch to the child's process space. 125 * 124 * 126 * This is the SOS implementation of the Lin 125 * This is the SOS implementation of the Linux "Lazy TLB" and 127 * address-space loaning. 126 * address-space loaning. 128 */ 127 */ 129 struct sos_mm_context *squatted_mm_context; 128 struct sos_mm_context *squatted_mm_context; 130 129 131 /* Data specific to each state */ 130 /* Data specific to each state */ 132 union 131 union 133 { 132 { 134 struct 133 struct 135 { 134 { 136 struct sos_sched_queue *rdy_queue; 135 struct sos_sched_queue *rdy_queue; 137 struct sos_thread *rdy_prev, *rdy_ne 136 struct sos_thread *rdy_prev, *rdy_next; 138 } ready; 137 } ready; 139 }; /* Anonymous union (gcc extenion) */ << 140 << 141 struct sos_time user_time_spent_in_slice; << 142 << 143 138 144 /** !! 139 struct 145 * When a thread in kernel mode is accessing !! 140 { 146 * page fault in the usual way only if retur !! 141 struct sos_time user_time_spent_in_slice; 147 * set. This structure holds information reg !! 142 } running; 148 * page fault from kernel into user space co !! 143 }; /* Anonymous union (gcc extenion) */ 149 * << 150 * @note the fields below should be consider << 151 * sos_thread_prepare_user_space_access() an << 152 * sos_thread_end_user_space_access() to mod << 153 */ << 154 struct << 155 { << 156 /** This is the address (in kernel code) t << 157 user-space page fault from a kernel-mo << 158 resolved. @see sos_thread_prepare_use << 159 sos_vaddr_t return_vaddr; << 160 << 161 /** This is the address of the user-space << 162 unresolved page fault (set by the page << 163 sos_uaddr_t faulted_uaddr; << 164 } fixup_uaccess; << 165 144 166 145 167 /* 146 /* 168 * Data used by the kwaitq subsystem: list o 147 * Data used by the kwaitq subsystem: list of kwaitqueues the thread 169 * is waiting for. 148 * is waiting for. 170 * 149 * 171 * @note: a RUNNING or READY thread might be 150 * @note: a RUNNING or READY thread might be in one or more 172 * waitqueues ! The only property we have is 151 * waitqueues ! The only property we have is that, among these 173 * waitqueues (if any), _at least_ one has w 152 * waitqueues (if any), _at least_ one has woken the thread. 174 */ 153 */ 175 struct sos_kwaitq_entry *kwaitq_list; 154 struct sos_kwaitq_entry *kwaitq_list; 176 155 177 156 178 /** 157 /** 179 * Some statistics 158 * Some statistics 180 */ 159 */ 181 struct rusage 160 struct rusage 182 { 161 { 183 /* Updated by sched.c */ 162 /* Updated by sched.c */ 184 struct sos_time ru_utime; /* Time spent in 163 struct sos_time ru_utime; /* Time spent in user mode */ 185 struct sos_time ru_stime; /* Time spent in 164 struct sos_time ru_stime; /* Time spent in kernel mode */ 186 } rusage; 165 } rusage; 187 166 188 167 189 /** 168 /** 190 * Chaining pointers for the list of threads 169 * Chaining pointers for the list of threads in the parent process 191 */ 170 */ 192 struct sos_thread *prev_in_process, *next_in 171 struct sos_thread *prev_in_process, *next_in_process; 193 172 194 173 195 /** 174 /** 196 * Chaining pointers for global ("gbl") list 175 * Chaining pointers for global ("gbl") list of threads (debug) 197 */ 176 */ 198 struct sos_thread *gbl_prev, *gbl_next; 177 struct sos_thread *gbl_prev, *gbl_next; 199 }; 178 }; 200 179 201 180 202 /** 181 /** 203 * Definition of the function executed by a ke 182 * Definition of the function executed by a kernel thread 204 */ 183 */ 205 typedef void (*sos_kernel_thread_start_routine 184 typedef void (*sos_kernel_thread_start_routine_t)(void *arg); 206 185 207 186 208 /** 187 /** 209 * Initialize the subsystem responsible for th 188 * Initialize the subsystem responsible for thread management 210 * 189 * 211 * Initialize the primary kernel thread so tha 190 * Initialize the primary kernel thread so that it can be handled the 212 * same way as an ordinary thread created by s 191 * same way as an ordinary thread created by sos_thread_create(). 213 */ 192 */ 214 sos_ret_t sos_thread_subsystem_setup(sos_vaddr 193 sos_ret_t sos_thread_subsystem_setup(sos_vaddr_t init_thread_stack_base_addr, 215 sos_size_ 194 sos_size_t init_thread_stack_size); 216 195 217 196 218 /** 197 /** 219 * Create a new kernel thread 198 * Create a new kernel thread 220 */ 199 */ 221 struct sos_thread * 200 struct sos_thread * 222 sos_create_kernel_thread(const char *name, 201 sos_create_kernel_thread(const char *name, 223 sos_kernel_thread_sta 202 sos_kernel_thread_start_routine_t start_func, 224 void *start_arg, 203 void *start_arg, 225 sos_sched_priority_t 204 sos_sched_priority_t priority); 226 205 227 206 228 /** 207 /** 229 * Create a new user thread 208 * Create a new user thread 230 */ 209 */ 231 struct sos_thread * 210 struct sos_thread * 232 sos_create_user_thread(const char *name, 211 sos_create_user_thread(const char *name, 233 struct sos_process *pro 212 struct sos_process *process, 234 sos_uaddr_t user_initia 213 sos_uaddr_t user_initial_PC, 235 sos_ui32_t user_start_ 214 sos_ui32_t user_start_arg1, 236 sos_ui32_t user_start_ 215 sos_ui32_t user_start_arg2, 237 sos_uaddr_t user_initia 216 sos_uaddr_t user_initial_SP, 238 sos_sched_priority_t pr 217 sos_sched_priority_t priority); 239 218 240 219 241 /** 220 /** 242 * Create a new user thread, copy of the given << 243 * given user context << 244 */ << 245 struct sos_thread * << 246 sos_duplicate_user_thread(const char *name, << 247 struct sos_process * << 248 const struct sos_thr << 249 const struct sos_cpu << 250 sos_ui32_t retval); << 251 << 252 << 253 /** << 254 * Terminate the execution of the current thre 221 * Terminate the execution of the current thread. For kernel threads, 255 * it is called by default when the start rout 222 * it is called by default when the start routine returns. 256 */ 223 */ 257 void sos_thread_exit() __attribute__((noreturn 224 void sos_thread_exit() __attribute__((noreturn)); 258 225 259 226 260 /** 227 /** 261 * Get the identifier of the thread currently 228 * Get the identifier of the thread currently running on CPU. Trivial 262 * function. 229 * function. 263 */ 230 */ 264 struct sos_thread *sos_thread_get_current(); 231 struct sos_thread *sos_thread_get_current(); 265 232 266 233 267 /** 234 /** 268 * If thr == NULL, set the priority of the cur 235 * If thr == NULL, set the priority of the current thread. Trivial 269 * function. 236 * function. 270 * 237 * 271 * @note NOT protected against interrupts 238 * @note NOT protected against interrupts 272 */ 239 */ 273 sos_sched_priority_t sos_thread_get_priority(s 240 sos_sched_priority_t sos_thread_get_priority(struct sos_thread *thr); 274 241 275 242 276 /** 243 /** 277 * If thr == NULL, get the state of the curren 244 * If thr == NULL, get the state of the current thread. Trivial 278 * function. 245 * function. 279 * 246 * 280 * @note NOT protected against interrupts 247 * @note NOT protected against interrupts 281 */ 248 */ 282 sos_thread_state_t sos_thread_get_state(struct 249 sos_thread_state_t sos_thread_get_state(struct sos_thread *thr); 283 250 284 251 285 /** 252 /** 286 * If thr == NULL, set the priority of the cur 253 * If thr == NULL, set the priority of the current thread 287 * 254 * 288 * @note NO context-switch ever occurs in this 255 * @note NO context-switch ever occurs in this function ! 289 */ 256 */ 290 sos_ret_t sos_thread_set_priority(struct sos_t 257 sos_ret_t sos_thread_set_priority(struct sos_thread *thr, 291 sos_sched_pr 258 sos_sched_priority_t priority); 292 259 293 260 294 /** 261 /** 295 * Yield CPU to another ready thread. 262 * Yield CPU to another ready thread. 296 * 263 * 297 * @note This is a BLOCKING FUNCTION 264 * @note This is a BLOCKING FUNCTION 298 */ 265 */ 299 sos_ret_t sos_thread_yield(); 266 sos_ret_t sos_thread_yield(); 300 267 301 268 302 /** 269 /** 303 * Release the CPU for (at least) the given de 270 * Release the CPU for (at least) the given delay. 304 * 271 * 305 * @param delay The delay to wait for. If dela 272 * @param delay The delay to wait for. If delay == NULL then wait 306 * forever that any event occurs. 273 * forever that any event occurs. 307 * 274 * 308 * @return SOS_OK when delay expired (and dela 275 * @return SOS_OK when delay expired (and delay is reset to zero), 309 * -SOS_EINTR otherwise (and delay contains th 276 * -SOS_EINTR otherwise (and delay contains the amount of time 310 * remaining). 277 * remaining). 311 * 278 * 312 * @note This is a BLOCKING FUNCTION 279 * @note This is a BLOCKING FUNCTION 313 */ 280 */ 314 sos_ret_t sos_thread_sleep(/* in/out */struct 281 sos_ret_t sos_thread_sleep(/* in/out */struct sos_time *delay); 315 282 316 283 317 /** 284 /** 318 * Mark the given thread as READY (if not alre 285 * Mark the given thread as READY (if not already ready) even if it is 319 * blocked in a kwaitq or in a sleep ! As a re 286 * blocked in a kwaitq or in a sleep ! As a result, the interrupted 320 * kwaitq/sleep function call of the thread wi 287 * kwaitq/sleep function call of the thread will return with 321 * -SOS_EINTR. 288 * -SOS_EINTR. 322 * 289 * 323 * @return -SOS_EINVAL if thread does not exis 290 * @return -SOS_EINVAL if thread does not exist, or -SOS_EFATAL if 324 * marked ZOMBIE. 291 * marked ZOMBIE. 325 * 292 * 326 * @note As a result, the semaphore/mutex/cond 293 * @note As a result, the semaphore/mutex/conditions/... functions 327 * return values SHOULD ALWAYS be checked ! If 294 * return values SHOULD ALWAYS be checked ! If they are != SOS_OK, 328 * then the caller should consider that the re 295 * then the caller should consider that the resource is not aquired 329 * because somebody woke the thread by some wa 296 * because somebody woke the thread by some way. 330 */ 297 */ 331 sos_ret_t sos_thread_force_unblock(struct sos_ 298 sos_ret_t sos_thread_force_unblock(struct sos_thread *thread); 332 299 333 /** 300 /** 334 * Dump the backtrace of the current thread to 301 * Dump the backtrace of the current thread to console and/or bochs 335 */ 302 */ 336 void sos_thread_dump_backtrace(sos_bool_t on_c 303 void sos_thread_dump_backtrace(sos_bool_t on_console, 337 sos_bool_t on_b 304 sos_bool_t on_bochs); 338 305 339 306 340 /* ******************************************* 307 /* ********************************************** 341 * Restricted functions 308 * Restricted functions 342 */ 309 */ 343 310 344 311 345 /** 312 /** 346 * Restricted function to indicate that we are !! 313 * Restricted function to change the current mm_context AND the 347 * user address space from inside the kernel. !! 314 * squatted_mm_context of the current thread in order to access the data 348 * !! 315 * in this context 349 * @param dest_as The address space we want to !! 316 * 350 * access current thread's address space !! 317 * @param mm_ctxt The mm_ctxt to restore. Might be NULL, meaning that: >> 318 * - for a Kernel thread: the current MMU configuration is never >> 319 * modified. The address space to use is limited to the kernel >> 320 * space, user space might change due to preemptions to other >> 321 * processes >> 322 * - for a User thread in kernel mode: same as for kernel threads >> 323 * - when a User thread will go back in user context: the MMU will >> 324 * be reconfigured to match the mm_context of the thread's >> 325 * process >> 326 * >> 327 * @note A non NULL parameter is allowed only if the >> 328 * squatted_mm_context is not already set. A NULL parameter is allowed >> 329 * only if the squatted_mm_context was already set. 351 * 330 * 352 * @param fixup_retvaddr When != 0, then dest_ !! 331 * @note The use of this function is RESERVED to the syscall handler 353 * don't allow controlled access from kernel i !! 332 * and the copy_from/to_user functions 354 * foreign thread). In this case, the page fau << 355 * page faults from the kernel in user space, << 356 * usual way. The value in retvaddr is where t << 357 * has to return to in case the page fault rem << 358 * address of the faulting address is kept in << 359 * éthread->fixup_uaccess.faulted_uaddr << 360 * << 361 * @note typical values for fixup_retvaddr are << 362 * values" (see gcc's doc: operator "&&"). See << 363 * code. << 364 */ << 365 sos_ret_t << 366 sos_thread_prepare_user_space_access(struct so << 367 sos_vaddr << 368 << 369 << 370 /** << 371 * Restricted function to signal we are not ac << 372 * space anymore << 373 */ 333 */ 374 sos_ret_t 334 sos_ret_t 375 sos_thread_end_user_space_access(void); !! 335 sos_thread_change_current_mm_context(struct sos_mm_context *mm_ctxt); 376 336 377 337 378 /** 338 /** 379 * Restricted callback called when a syscall g 339 * Restricted callback called when a syscall goes back in user mode, 380 * to reconfigure the MMU to match that of the 340 * to reconfigure the MMU to match that of the current thread's 381 * process MMU context. 341 * process MMU context. 382 * 342 * 383 * @note The use of this function is RESERVED 343 * @note The use of this function is RESERVED to the syscall wrapper 384 */ 344 */ 385 void sos_thread_prepare_syscall_switch_back(st 345 void sos_thread_prepare_syscall_switch_back(struct sos_cpu_state *cpu_state); 386 346 387 347 388 /** 348 /** 389 * Restricted callback called when an exceptio 349 * Restricted callback called when an exception handler goes back to 390 * the interrupted thread to reconfigure the M 350 * the interrupted thread to reconfigure the MMU to match that of the 391 * current thread's process MMU context. 351 * current thread's process MMU context. 392 * 352 * 393 * @note The use of this function is RESERVED 353 * @note The use of this function is RESERVED to the exception wrappers 394 */ 354 */ 395 void sos_thread_prepare_exception_switch_back( 355 void sos_thread_prepare_exception_switch_back(struct sos_cpu_state *cpu_state); 396 356 397 357 398 /** 358 /** 399 * Restricted callback called when an IRQ is e 359 * Restricted callback called when an IRQ is entered while the CPU was 400 * NOT already servicing any other IRQ (ie the 360 * NOT already servicing any other IRQ (ie the outermost IRQ handler 401 * is entered). This callback simply updates t 361 * is entered). This callback simply updates the "cpu_state" field so 402 * that IRQ handlers always know the state of 362 * that IRQ handlers always know the state of the interrupted thread, 403 * even if they are imbricated in other IRQ ha 363 * even if they are imbricated in other IRQ handlers. 404 * 364 * 405 * @note The use of this function is RESERVED 365 * @note The use of this function is RESERVED to the irq wrappers 406 */ 366 */ 407 void 367 void 408 sos_thread_prepare_irq_servicing(struct sos_cp 368 sos_thread_prepare_irq_servicing(struct sos_cpu_state *interrupted_state); 409 369 410 370 411 /** 371 /** 412 * Restricted callback called when the outermo 372 * Restricted callback called when the outermost IRQ handler returns, 413 * to select the thread to return to. This cal 373 * to select the thread to return to. This callbacks implements: 414 * - preemption of user threads in user mode 374 * - preemption of user threads in user mode (time sharing / FIFO) 415 * - non-preemption of user threads in kerne 375 * - non-preemption of user threads in kernel mode (interrupted thread 416 * is restored on CPU "as is") 376 * is restored on CPU "as is") 417 * - non-preemption of kernel threads (same 377 * - non-preemption of kernel threads (same remark) 418 * The MMU is reconfigured correctly to match 378 * The MMU is reconfigured correctly to match the address space of the 419 * selected thread. 379 * selected thread. 420 * 380 * 421 * @return The CPU context of the thread to re 381 * @return The CPU context of the thread to return to 422 * 382 * 423 * @note The use of this function is RESERVED 383 * @note The use of this function is RESERVED to the irq wrappers 424 */ 384 */ 425 struct sos_cpu_state * 385 struct sos_cpu_state * 426 sos_thread_prepare_irq_switch_back(void); 386 sos_thread_prepare_irq_switch_back(void); 427 387 428 388 429 #endif /* _SOS_THREAD_H_ */ 389 #endif /* _SOS_THREAD_H_ */
[ source navigation ] | [ diff markup ] | [ identifier search ] | [ general search ] |