Changeset 473d5d2 in mainline
- Timestamp:
- 2011-05-19T16:44:47Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bcaca55
- Parents:
- 9c757820
- Location:
- kernel/generic
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/arch.h
r9c757820 r473d5d2 41 41 #include <mm/as.h> 42 42 43 #define DEFAULT_CONTEXT 0 43 /* 44 * THE is not an abbreviation, but the English definite article written in 45 * capital letters. It means the current pointer to something, e.g. thread, 46 * processor or address space. Kind reader of this comment shall appreciate 47 * the wit of constructs like THE->thread and similar. 48 */ 49 #define THE ((the_t * )(get_stack_base())) 44 50 45 51 #define CPU THE->cpu … … 47 53 #define TASK THE->task 48 54 #define AS THE->as 49 #define CONTEXT (THE->task ? THE->task->context : DEFAULT_CONTEXT)50 55 #define PREEMPTION_DISABLED THE->preemption_disabled 56 #define MAGIC UINT32_C(0xfacefeed) 51 57 52 #define context_check(ctx1, ctx2) ((ctx1) == (ctx2)) 58 #define container_check(ctn1, ctn2) ((ctn1) == (ctn2)) 59 60 #define DEFAULT_CONTAINER 0 61 #define CONTAINER \ 62 ((THE->task) ? (THE->task->container) : (DEFAULT_CONTAINER)) 53 63 54 64 /** … … 63 73 cpu_t *cpu; /**< Executing cpu. */ 64 74 as_t *as; /**< Current address space. */ 75 uint32_t magic; /**< Magic value */ 65 76 } the_t; 66 67 /*68 * THE is not an abbreviation, but the English definite article written in69 * capital letters. It means the current pointer to something, e.g. thread,70 * processor or address space. Kind reader of this comment shall appreciate71 * the wit of constructs like THE->thread and similar.72 */73 #define THE ((the_t * )(get_stack_base()))74 77 75 78 extern void the_initialize(the_t *); -
kernel/generic/src/ddi/ddi.c
r9c757820 r473d5d2 224 224 task_t *task = task_find_by_id(id); 225 225 226 if ((!task) || (!cont ext_check(CONTEXT, task->context))) {226 if ((!task) || (!container_check(CONTAINER, task->container))) { 227 227 /* 228 228 * There is no task with the specified ID -
kernel/generic/src/debug/panic.c
r9c757820 r473d5d2 95 95 printf("\n"); 96 96 97 printf("THE=%p ", THE);97 printf("THE=%p: ", THE); 98 98 if (THE != NULL) { 99 printf(" : pe=%" PRIun " thr=%p task=%p cpu=%p as=%p",99 printf("pe=%" PRIun " thr=%p task=%p cpu=%p as=%p magic=%#x\n", 100 100 THE->preemption_disabled, THE->thread, THE->task, 101 THE->cpu, THE->as );102 } 103 printf("\n");101 THE->cpu, THE->as, THE->magic); 102 } else 103 printf("invalid\n"); 104 104 105 105 if (istate) { -
kernel/generic/src/proc/task.c
r9c757820 r473d5d2 190 190 str_cpy(task->name, TASK_NAME_BUFLEN, name); 191 191 192 task->cont ext = CONTEXT;192 task->container = CONTAINER; 193 193 task->capabilities = 0; 194 194 task->ucycles = 0; … … 211 211 212 212 if ((ipc_phone_0) && 213 (cont ext_check(ipc_phone_0->task->context, task->context)))213 (container_check(ipc_phone_0->task->container, task->container))) 214 214 ipc_phone_connect(&task->phones[0], ipc_phone_0); 215 215 … … 584 584 printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %10p %10p" 585 585 " %9" PRIu64 "%c %9" PRIu64 "%c\n", task->taskid, 586 task->name, task->cont ext, task, task->as,586 task->name, task->container, task, task->as, 587 587 ucycles, usuffix, kcycles, ksuffix); 588 588 #endif … … 595 595 else 596 596 printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %18p %18p\n", 597 task->taskid, task->name, task->cont ext, task, task->as);597 task->taskid, task->name, task->container, task, task->as); 598 598 #endif 599 599 … … 625 625 printf("[id ] [threads] [calls] [callee\n"); 626 626 else 627 printf("[id ] [name ] [ct x] [address ] [as ]"627 printf("[id ] [name ] [ctn] [address ] [as ]" 628 628 " [ucycles ] [kcycles ]\n"); 629 629 #endif … … 634 634 " [callee\n"); 635 635 else 636 printf("[id ] [name ] [ct x] [address ]"636 printf("[id ] [name ] [ctn] [address ]" 637 637 " [as ]\n"); 638 638 #endif -
kernel/generic/src/proc/the.c
r9c757820 r473d5d2 58 58 the->task = NULL; 59 59 the->as = NULL; 60 the->magic = MAGIC; 60 61 } 61 62 … … 70 71 NO_TRACE void the_copy(the_t *src, the_t *dst) 71 72 { 73 ASSERT(src->magic == MAGIC); 72 74 *dst = *src; 73 75 } -
kernel/generic/src/security/cap.c
r9c757820 r473d5d2 92 92 task_t *task = task_find_by_id(taskid); 93 93 94 if ((!task) || (!cont ext_check(CONTEXT, task->context))) {94 if ((!task) || (!container_check(CONTAINER, task->container))) { 95 95 irq_spinlock_unlock(&tasks_lock, true); 96 96 return (sysarg_t) ENOENT; … … 121 121 122 122 task_t *task = task_find_by_id(taskid); 123 if ((!task) || (!cont ext_check(CONTEXT, task->context))) {123 if ((!task) || (!container_check(CONTAINER, task->container))) { 124 124 irq_spinlock_unlock(&tasks_lock, true); 125 125 return (sysarg_t) ENOENT;
Note:
See TracChangeset
for help on using the changeset viewer.