Changeset 7ce9284 in mainline for src


Ignore:
Timestamp:
2005-08-30T17:41:19Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b45aa23
Parents:
10caad0
Message:

Dump implementation of THREAD, TASK and CPU.
Implement preemption-safe versions of THREAD, TASK and CPU using THE.
Get rid of CPU_ID_ARCH on all architectures.
Get rid of write_dr0() and read_dr0() on IA-32.
Get rid of cpu_private_data and cpu_private_data_t.

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/Makefile.config

    r10caad0 r7ce9284  
    2121
    2222# Uncomment if you want to run in the test mode
    23 TEST=__TEST__
     23#TEST=__TEST__
    2424
    2525TEST_FILE=test.c
     
    3434#TEST_DIR=synch/semaphore2/
    3535#TEST_DIR=fpu/fpu1
    36 TEST_DIR=print/print1
     36#TEST_DIR=print/print1
  • src/cpu/cpu.c

    r10caad0 r7ce9284  
    4040#include <list.h>
    4141
    42 
    43 cpu_private_data_t *cpu_private_data;
    4442cpu_t *cpus;
    45 
    4643
    4744/** Initialize CPUs
     
    5653        if (config.cpu_active == 1) {
    5754        #endif /* __SMP__ */
    58                 cpu_private_data = (cpu_private_data_t *) malloc(sizeof(cpu_private_data_t) * config.cpu_count);
    59                 if (!cpu_private_data)
    60                         panic("malloc/cpu_private_data");
    61 
    6255                cpus = (cpu_t *) malloc(sizeof(cpu_t) * config.cpu_count);
    6356                if (!cpus)
     
    6558
    6659                /* initialize everything */
    67                 memsetb((__address) cpu_private_data, sizeof(cpu_private_data_t) * config.cpu_count, 0);
    6860                memsetb((__address) cpus, sizeof(cpu_t) * config.cpu_count, 0);
    6961
    7062                for (i=0; i < config.cpu_count; i++) {
    71                         cpus[i].stack = (__u8 *) malloc(CPU_STACK_SIZE);
     63                        cpus[i].stack = (__u8 *) frame_alloc(FRAME_KA | FRAME_PANIC);
    7264                        if (!cpus[i].stack)
    7365                                panic("malloc/cpus[%d].stack\n", i);
     
    8779        }
    8880        #endif /* __SMP__ */
     81
     82        CPU = &cpus[config.cpu_active-1];
    8983       
    9084        CPU->active = 1;
  • src/main/main.c

    r10caad0 r7ce9284  
    180180        t = thread_create(kinit, NULL, k, 0);
    181181        if (!t) panic("can't create kinit thread\n");
    182 
    183182        thread_ready(t);
    184183
     
    211210        config.cpu_active++;
    212211
     212        /*
     213         * The THE structure is well defined because ctx.sp is used as stack.
     214         */
     215        the_initialize(THE);
     216
    213217        arch_pre_mm_init();
    214218        frame_init();
     
    222226        l_apic_debug();
    223227
     228        the_copy(THE, (the_t *) CPU->stack);
    224229
    225230        /*
  • src/proc/scheduler.c

    r10caad0 r7ce9284  
    364364        priority = THREAD->pri;
    365365        spinlock_unlock(&THREAD->lock);
    366        
     366
    367367        relink_rq(priority);           
    368368
Note: See TracChangeset for help on using the changeset viewer.