Changeset d5f8f19 in mainline
- Timestamp:
- 2009-08-08T13:17:08Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 42cfd91, 54d0ddc
- Parents:
- a7de7907 (diff), 8688a6e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/include/cpu.h
ra7de7907 rd5f8f19 36 36 #define KERN_amd64_CPU_H_ 37 37 38 #define RFLAGS_IF (1 << 9) 39 #define RFLAGS_DF (1 << 10) 40 #define RFLAGS_RF (1 << 16) 38 #define RFLAGS_CF (1 << 0) 39 #define RFLAGS_PF (1 << 2) 40 #define RFLAGS_AF (1 << 4) 41 #define RFLAGS_ZF (1 << 6) 42 #define RFLAGS_SF (1 << 7) 43 #define RFLAGS_TF (1 << 8) 44 #define RFLAGS_IF (1 << 9) 45 #define RFLAGS_DF (1 << 10) 46 #define RFLAGS_OF (1 << 11) 47 #define RFLAGS_RF (1 << 16) 41 48 42 49 #define EFER_MSR_NUM 0xc0000080 -
kernel/arch/amd64/src/userspace.c
ra7de7907 rd5f8f19 34 34 35 35 #include <userspace.h> 36 #include <arch/cpu.h> 36 37 #include <arch/pm.h> 37 38 #include <arch/types.h> … … 50 51 ipl_t ipl = interrupts_disable(); 51 52 52 /* Clear CF, PF, AF, ZF, SF, DF, OF */53 ipl &= ~(0xcd4);53 ipl &= ~(RFLAGS_CF | RFLAGS_PF | RFLAGS_AF | RFLAGS_ZF | RFLAGS_SF | 54 RFLAGS_DF | RFLAGS_OF); 54 55 55 56 asm volatile ( 56 57 58 59 60 61 57 "pushq %[udata_des]\n" 58 "pushq %[stack_size]\n" 59 "pushq %[ipl]\n" 60 "pushq %[utext_des]\n" 61 "pushq %[entry]\n" 62 "movq %[uarg], %%rax\n" 62 63 63 64 65 66 67 68 69 70 71 72 73 64 /* %rdi is defined to hold pcb_ptr - set it to 0 */ 65 "xorq %%rdi, %%rdi\n" 66 "iretq\n" 67 :: [udata_des] "i" (gdtselector(UDATA_DES) | PL_USER), 68 [stack_size] "r" (kernel_uarg->uspace_stack + THREAD_STACK_SIZE), 69 [ipl] "r" (ipl), 70 [utext_des] "i" (gdtselector(UTEXT_DES) | PL_USER), 71 [entry] "r" (kernel_uarg->uspace_entry), 72 [uarg] "r" (kernel_uarg->uspace_uarg) 73 : "rax" 74 ); 74 75 75 76 /* Unreachable */ 76 while (1); 77 while (1) 78 ; 77 79 } 78 80 -
kernel/arch/sparc64/src/sparc64.c
ra7de7907 rd5f8f19 135 135 void userspace(uspace_arg_t *kernel_uarg) 136 136 { 137 (void) interrupts_disable(); 137 138 switch_to_userspace((uintptr_t) kernel_uarg->uspace_entry, 138 139 ((uintptr_t) kernel_uarg->uspace_stack) + STACK_SIZE -
kernel/generic/src/main/uinit.c
ra7de7907 rd5f8f19 81 81 free((uspace_arg_t *) arg); 82 82 83 /*84 * Disable interrupts so that the execution of userspace() is not85 * disturbed by any interrupts as some of the userspace()86 * implementations will switch to the userspace stack before switching87 * the mode.88 */89 (void) interrupts_disable();90 83 userspace(&uarg); 91 84 } -
kernel/generic/src/proc/task.c
ra7de7907 rd5f8f19 75 75 static task_id_t task_counter = 0; 76 76 77 /* Forward declarations. */ 78 static void task_kill_internal(task_t *); 79 77 80 /** Initialize kernel tasks support. */ 78 81 void task_init(void) … … 83 86 84 87 /* 85 * The idea behind this walker is to remember a single taskdifferent from88 * The idea behind this walker is to kill and count all tasks different from 86 89 * TASK. 87 90 */ … … 89 92 { 90 93 task_t *t = avltree_get_instance(node, task_t, tasks_tree_node); 91 task_t **tp = (task_t **) arg; 92 93 if (t != TASK) { 94 *tp = t; 95 return false; /* stop walking */ 94 unsigned *cnt = (unsigned *) arg; 95 96 if (t != TASK) { 97 (*cnt)++; 98 #ifdef CONFIG_DEBUG 99 printf("[%"PRIu64"] ", t->taskid); 100 #endif 101 task_kill_internal(t); 96 102 } 97 103 … … 102 108 void task_done(void) 103 109 { 104 task_t *t; 110 unsigned tasks_left; 111 105 112 do { /* Repeat until there are any tasks except TASK */ 106 107 113 /* Messing with task structures, avoid deadlock */ 114 #ifdef CONFIG_DEBUG 115 printf("Killing tasks... "); 116 #endif 108 117 ipl_t ipl = interrupts_disable(); 109 118 spinlock_lock(&tasks_lock); 110 111 t = NULL; 112 avltree_walk(&tasks_tree, task_done_walker, &t); 113 114 if (t != NULL) { 115 task_id_t id = t->taskid; 116 117 spinlock_unlock(&tasks_lock); 118 interrupts_restore(ipl); 119 119 tasks_left = 0; 120 avltree_walk(&tasks_tree, task_done_walker, &tasks_left); 121 spinlock_unlock(&tasks_lock); 122 interrupts_restore(ipl); 123 thread_sleep(1); 120 124 #ifdef CONFIG_DEBUG 121 printf("Killing task %" PRIu64 "\n", id); 122 #endif 123 task_kill(id); 124 thread_usleep(10000); 125 } else { 126 spinlock_unlock(&tasks_lock); 127 interrupts_restore(ipl); 128 } 129 130 } while (t != NULL); 125 printf("\n"); 126 #endif 127 } while (tasks_left); 131 128 } 132 129 … … 350 347 } 351 348 352 /** Kill task. 353 * 354 * This function is idempotent. 355 * It signals all the task's threads to bail it out. 356 * 357 * @param id ID of the task to be killed. 358 * 359 * @return Zero on success or an error code from errno.h. 360 */ 361 int task_kill(task_id_t id) 362 { 363 ipl_t ipl; 364 task_t *ta; 349 static void task_kill_internal(task_t *ta) 350 { 365 351 link_t *cur; 366 352 367 if (id == 1)368 return EPERM;369 370 ipl = interrupts_disable();371 spinlock_lock(&tasks_lock);372 if (!(ta = task_find_by_id(id))) {373 spinlock_unlock(&tasks_lock);374 interrupts_restore(ipl);375 return ENOENT;376 }377 spinlock_unlock(&tasks_lock);378 379 353 /* 380 354 * Interrupt all threads. … … 397 371 } 398 372 spinlock_unlock(&ta->lock); 373 } 374 375 /** Kill task. 376 * 377 * This function is idempotent. 378 * It signals all the task's threads to bail it out. 379 * 380 * @param id ID of the task to be killed. 381 * 382 * @return Zero on success or an error code from errno.h. 383 */ 384 int task_kill(task_id_t id) 385 { 386 ipl_t ipl; 387 task_t *ta; 388 389 if (id == 1) 390 return EPERM; 391 392 ipl = interrupts_disable(); 393 spinlock_lock(&tasks_lock); 394 if (!(ta = task_find_by_id(id))) { 395 spinlock_unlock(&tasks_lock); 396 interrupts_restore(ipl); 397 return ENOENT; 398 } 399 task_kill_internal(ta); 400 spinlock_unlock(&tasks_lock); 399 401 interrupts_restore(ipl); 400 401 402 return 0; 402 403 } -
tools/config.py
ra7de7907 rd5f8f19 225 225 "Create output configuration" 226 226 227 revision = commands.getoutput(' svnversion .2> /dev/null')227 revision = commands.getoutput('bzr version-info --custom --template="{revision_id}" 2> /dev/null') 228 228 timestamp = commands.getoutput('date "+%Y-%m-%d %H:%M:%S"') 229 229
Note:
See TracChangeset
for help on using the changeset viewer.