Changeset bcdd9aa in mainline


Ignore:
Timestamp:
2005-08-30T09:44:07Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dfbc229
Parents:
a6f8899
Message:

Add lib/the.c.
Add and deploy the_initialize() and the_copy().

Make IA-32's before_thread_runs() use SP_DELTA macro.

Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/proc/scheduler.c

    ra6f8899 rbcdd9aa  
    3131#include <proc/thread.h>
    3232#include <arch.h>
     33#include <arch/context.h>       /* SP_DELTA */
    3334
    3435void before_thread_runs_arch(void)
    3536{
    36         CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-8];
     37        CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA];
    3738        CPU->arch.tss->ss0 = selector(KDATA_DES);
    3839}
  • include/arch.h

    ra6f8899 rbcdd9aa  
    6565#define THE             ((the_t *)(get_stack_base()))   
    6666
     67extern void the_initialize(the_t *the);
     68extern void the_copy(the_t *src, the_t *dst);
     69
    6770extern void arch_pre_mm_init(void);
    6871extern void arch_post_mm_init(void);
  • src/Makefile

    ra6f8899 rbcdd9aa  
    1717        lib/list.c \
    1818        lib/memstr.c \
     19        lib/the.c \
    1920        debug/print.c \
    2021        time/clock.c \
  • src/main/main.c

    ra6f8899 rbcdd9aa  
    135135        thread_t *t;
    136136
    137         THE->preemption_disabled = 0;
    138         THE->cpu = NULL;
    139         THE->thread = NULL;
    140         THE->task = NULL;
     137        the_initialize(THE);
    141138
    142139        arch_pre_mm_init();
  • src/proc/scheduler.c

    ra6f8899 rbcdd9aa  
    253253
    254254        /*
     255         * Through the 'THE' structure, we keep track of THREAD, TASK, CPU
     256         * and preemption counter. At this point THE could be coming either
     257         * from THREAD's or CPU's stack.
     258         */
     259        the_copy(THE, (the_t *) CPU->stack);
     260
     261        /*
    255262         * We may not keep the old stack.
    256263         * Reason: If we kept the old stack and got blocked, for instance, in
     
    398405        #endif 
    399406
     407        the_copy(THE, (the_t *) THREAD->kstack);
     408       
    400409        context_restore(&THREAD->saved_context);
    401410        /* not reached */
  • src/proc/thread.c

    ra6f8899 rbcdd9aa  
    197197                context_save(&t->saved_context);
    198198                context_set(&t->saved_context, FADDR(cushion), t->kstack, THREAD_STACK_SIZE);
     199               
     200                the_initialize((the_t *) t->kstack);
    199201
    200202                pri = cpu_priority_high();
Note: See TracChangeset for help on using the changeset viewer.