Changes in kernel/generic/src/proc/thread.c [c0699467:ae0300b5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
rc0699467 rae0300b5 39 39 #include <proc/thread.h> 40 40 #include <proc/task.h> 41 #include <proc/uarg.h> 41 42 #include <mm/frame.h> 42 43 #include <mm/page.h> … … 44 45 #include <arch/cycle.h> 45 46 #include <arch.h> 47 #include <synch/synch.h> 46 48 #include <synch/spinlock.h> 47 49 #include <synch/waitq.h> … … 53 55 #include <time/clock.h> 54 56 #include <time/timeout.h> 55 #include <time/delay.h>56 57 #include <config.h> 57 58 #include <arch/interrupt.h> … … 66 67 #include <syscall/copy.h> 67 68 #include <errno.h> 69 70 71 #ifndef LOADED_PROG_STACK_PAGES_NO 72 #define LOADED_PROG_STACK_PAGES_NO 1 73 #endif 74 68 75 69 76 /** Thread states */ … … 258 265 */ 259 266 260 list_append(&thread->rq_link, &cpu->rq[i].rq );267 list_append(&thread->rq_link, &cpu->rq[i].rq_head); 261 268 cpu->rq[i].n++; 262 269 irq_spinlock_unlock(&(cpu->rq[i].lock), true); … … 293 300 294 301 /* Not needed, but good for debugging */ 295 memsetb(thread->kstack, STACK_SIZE, 0);302 memsetb(thread->kstack, THREAD_STACK_SIZE * 1 << STACK_FRAMES, 0); 296 303 297 304 irq_spinlock_lock(&tidlock, true); … … 301 308 context_save(&thread->saved_context); 302 309 context_set(&thread->saved_context, FADDR(cushion), 303 (uintptr_t) thread->kstack, STACK_SIZE);310 (uintptr_t) thread->kstack, THREAD_STACK_SIZE); 304 311 305 312 the_initialize((the_t *) thread->kstack); … … 320 327 thread->cpu = NULL; 321 328 thread->flags = flags; 322 thread->nomigrate = 0;323 329 thread->state = Entering; 324 330 … … 421 427 atomic_inc(&task->lifecount); 422 428 423 list_append(&thread->th_link, &task->th reads);429 list_append(&thread->th_link, &task->th_head); 424 430 425 431 irq_spinlock_pass(&task->lock, &threads_lock); … … 483 489 } 484 490 485 /** Prevent the current thread from being migrated to another processor. */486 void thread_migration_disable(void)487 {488 ASSERT(THREAD);489 490 THREAD->nomigrate++;491 }492 493 /** Allow the current thread to be migrated to another processor. */494 void thread_migration_enable(void)495 {496 ASSERT(THREAD);497 ASSERT(THREAD->nomigrate > 0);498 499 THREAD->nomigrate--;500 }501 502 491 /** Thread sleep 503 492 * … … 616 605 printf("%-8" PRIu64 " %-14s %10p %-8s %10p %-5" PRIu32 "\n", 617 606 thread->tid, name, thread, thread_states[thread->state], 618 thread->task, thread->task->cont ainer);607 thread->task, thread->task->context); 619 608 #endif 620 609 … … 628 617 printf("%-8" PRIu64 " %-14s %18p %-8s %18p %-5" PRIu32 "\n", 629 618 thread->tid, name, thread, thread_states[thread->state], 630 thread->task, thread->task->cont ainer);619 thread->task, thread->task->context); 631 620 #endif 632 621 … … 669 658 else 670 659 printf("[id ] [name ] [address ] [state ] [task ]" 671 " [ct n]\n");660 " [ctx]\n"); 672 661 #endif 673 662 … … 678 667 } else 679 668 printf("[id ] [name ] [address ] [state ]" 680 " [task ] [ct n]\n");669 " [task ] [ctx]\n"); 681 670 #endif 682 671 … … 929 918 } 930 919 931 sysarg_t sys_thread_udelay(uint32_t usec)932 {933 delay(usec);934 return 0;935 }936 937 920 /** @} 938 921 */
Note:
See TracChangeset
for help on using the changeset viewer.