Changeset cb4b61d in mainline


Ignore:
Timestamp:
2005-04-17T18:09:26Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7eade45
Parents:
2968fe29
Message:

Added before_thread_runs() to cope with TSS of user space tasks.

Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/Makefile.inc

    r2968fe29 rcb4b61d  
    2323        arch/delay.s \
    2424        arch/asm.s \
     25        arch/proc/scheduler.c \
    2526        arch/smp/ap.S \
    2627        arch/smp/apic.c \
  • arch/ia32/src/cpu/cpu.c

    r2968fe29 rcb4b61d  
    105105}
    106106
    107 void cpu_print_report(struct cpu* m)
     107void cpu_print_report(cpu_t* m)
    108108{
    109109        printf("cpu%d: (%s family=%d model=%d stepping=%d) %dMHz\n",
  • arch/ia32/src/interrupt.c

    r2968fe29 rcb4b61d  
    3535#include <arch/asm.h>
    3636#include <mm/tlb.h>
     37#include <arch.h>
    3738
    3839/*
     
    9192void syscall(__u8 n, __u32 stack[])
    9293{
    93         printf("syscall... ");
    94         thread_sleep(1);
     94        printf("cpu%d: syscall\n", CPU->id);
     95        thread_usleep(600);
    9596}
    9697
  • arch/ia32/src/pm.c

    r2968fe29 rcb4b61d  
    6666struct tss *tss_p = NULL;
    6767
    68 /* gdtr changes everytime new CPU is initialized */
     68/* gdtr is changed by kmp before next CPU is initialized */
    6969struct ptr_16_32 gdtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(gdt), .base = (__address) gdt };
    7070struct ptr_16_32 idtr __attribute__ ((section ("K_DATA_START")))= { .limit = sizeof(idt), .base = (__address) idt };
  • arch/ia32/src/userspace.c

    r2968fe29 rcb4b61d  
    3939       
    4040        pri = cpu_priority_high();
    41        
    42         /*
    43          * Prepare TSS stack selector and pointers for next syscall.
    44          */
    45         CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-8];
    46         CPU->arch.tss->ss0 = selector(KDATA_DES);
    47        
     41
    4842        __asm__ volatile (""
    4943            "pushl %0\n"
  • arch/mips/src/fake.s

    r2968fe29 rcb4b61d  
    3333.global asm_delay_loop
    3434.global userspace
     35.global before_thread_runs
    3536
     37before_thread_runs:
    3638userspace:
    3739calibrate_delay_loop:
  • include/proc/scheduler.h

    r2968fe29 rcb4b61d  
    5656extern void kcpulb(void *arg);
    5757
     58/*
     59 * To be defined by architectures:
     60 */
     61 
     62extern void before_thread_runs(void);
     63
    5864#endif
  • src/Makefile.config

    r2968fe29 rcb4b61d  
    66
    77# Support for symetric multiprocessors
    8 SMP=__SMP__
     8#SMP=__SMP__
    99
    1010# Improved support for hyperthreading
  • src/proc/scheduler.c

    r2968fe29 rcb4b61d  
    202202                         * This is the place where threads leave scheduler();
    203203                         */
     204                        before_thread_runs();
    204205                        spinlock_unlock(&THREAD->lock);
    205206                        cpu_priority_restore(THREAD->saved_context.pri);
  • src/proc/thread.c

    r2968fe29 rcb4b61d  
    7070        void *arg = THREAD->thread_arg;
    7171
     72        before_thread_runs();
     73
    7274        /* this is where each thread wakes up after its creation */
    7375        spinlock_unlock(&THREAD->lock);
Note: See TracChangeset for help on using the changeset viewer.