Changeset 764c302 in mainline


Ignore:
Timestamp:
2006-07-28T23:25:10Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c049309
Parents:
42d3be3
Message:

initial security context support

Location:
kernel/generic
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/arch.h

    r42d3be3 r764c302  
    6161        cpu_t *cpu;                     /**< Executing cpu. */
    6262        as_t *as;                       /**< Current address space. */
     63        context_id_t context;   /**< Current security context. */
    6364};
    6465
  • kernel/generic/include/proc/scheduler.h

    r42d3be3 r764c302  
    2727 */
    2828
    29  /** @addtogroup genericproc
     29/** @addtogroup genericproc
    3030 * @{
    3131 */
     
    7070#endif
    7171
    72  /** @}
     72/** @}
    7373 */
    74 
  • kernel/generic/include/proc/task.h

    r42d3be3 r764c302  
    2727 */
    2828
    29  /** @addtogroup genericproc
     29/** @addtogroup genericproc
    3030 * @{
    3131 */
     
    5959        as_t *as;               /**< Address space. */
    6060        task_id_t taskid;       /**< Unique identity of task */
     61        context_id_t context;   /**< Task security context */
    6162
    6263        /** If this is true, new threads can become part of the task. */
  • kernel/generic/include/proc/thread.h

    r42d3be3 r764c302  
    2727 */
    2828
    29  /** @addtogroup genericproc
     29/** @addtogroup genericproc
    3030 * @{
    3131 */
     
    147147        int priority;                           /**< Thread's priority. Implemented as index to CPU->rq */
    148148        uint32_t tid;                           /**< Thread ID. */
     149        context_id_t context;           /**< Thread security context */
    149150       
    150151        thread_arch_t arch;                     /**< Architecture-specific data. */
     
    193194#endif
    194195
    195  /** @}
     196/** @}
    196197 */
    197 
  • kernel/generic/include/proc/uarg.h

    r42d3be3 r764c302  
    2727 */
    2828
    29  /** @addtogroup genericproc
     29/** @addtogroup genericproc
    3030 * @{
    3131 */
     
    4949#endif
    5050
    51  /** @}
     51/** @}
    5252 */
    53 
  • kernel/generic/include/typedefs.h

    r42d3be3 r764c302  
    4646
    4747typedef unsigned long long task_id_t;
     48typedef unsigned long context_id_t;
    4849
    4950typedef struct cpu_info cpu_info_t;
  • kernel/generic/src/proc/task.c

    r42d3be3 r764c302  
    116116        ta->main_thread = NULL;
    117117        ta->refcount = 0;
     118        ta->context = THE->context;
    118119
    119120        ta->capabilities = 0;
     
    356357               
    357358                        spinlock_lock(&t->lock);
    358                         printf("%s(%lld): address=%#zx, as=%#zx, ActiveCalls: %zd",
    359                                 t->name, t->taskid, t, t->as, atomic_get(&t->active_calls));
     359                        printf("%s(%lld): context=%ld, address=%#zx, as=%#zx, ActiveCalls: %zd",
     360                                t->name, t->taskid, t->context, t, t->as, atomic_get(&t->active_calls));
    360361                        for (j=0; j < IPC_MAX_PHONES; j++) {
    361362                                if (t->phones[j].callee)
  • kernel/generic/src/proc/the.c

    r42d3be3 r764c302  
    5959        the->task = NULL;
    6060        the->as = NULL;
     61        the->context = 0;
    6162}
    6263
  • kernel/generic/src/proc/thread.c

    r42d3be3 r764c302  
    124124static int thr_constructor(void *obj, int kmflags)
    125125{
    126         thread_t *t = (thread_t *)obj;
     126        thread_t *t = (thread_t *) obj;
    127127
    128128        spinlock_initialize(&t->lock, "thread_t_lock");
     
    156156static int thr_destructor(void *obj)
    157157{
    158         thread_t *t = (thread_t *)obj;
     158        thread_t *t = (thread_t *) obj;
    159159
    160160        frame_free(KA2PA(t->kstack));
     
    300300       
    301301        /* Not needed, but good for debugging */
    302         memsetb((uintptr_t)t->kstack, THREAD_STACK_SIZE * 1<<STACK_FRAMES, 0);
     302        memsetb((uintptr_t) t->kstack, THREAD_STACK_SIZE * 1 << STACK_FRAMES, 0);
    303303       
    304304        ipl = interrupts_disable();
     
    319319        memcpy(t->name, name, THREAD_NAME_BUFLEN);
    320320       
     321        t->context = THE->context;
    321322        t->thread_code = func;
    322323        t->thread_arg = arg;
     
    534535               
    535536                        t = (thread_t *) node->value[i];
    536                         printf("%s: address=%#zx, tid=%zd, state=%s, task=%#zx, code=%#zx, stack=%#zx, cpu=",
    537                                 t->name, t, t->tid, thread_states[t->state], t->task, t->thread_code, t->kstack);
     537                        printf("%s: address=%#zx, tid=%zd, context=%ld, state=%s, task=%#zx, code=%#zx, stack=%#zx, cpu=",
     538                                t->name, t, t->tid, t->context, thread_states[t->state], t->task, t->thread_code, t->kstack);
    538539                        if (t->cpu)
    539540                                printf("cpu%zd", t->cpu->id);
Note: See TracChangeset for help on using the changeset viewer.