Changeset aa4e8d7 in mainline


Ignore:
Timestamp:
2005-05-08T13:59:59Z (20 years ago)
Author:
Jakub Vana <jakub.vana@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
be50915
Parents:
e9b9e12
Message:

Remove fpu_context pointer from context_t.
Add fpu_context statically to thread_t.
Two functions for saving and restoring FPU context on lazy switch.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/include/context.h

    re9b9e12 raa4e8d7  
    4747        __u32 ebp;
    4848        __u32 pri;
    49         struct fpu_context *fpu;       
    5049} __attribute__ ((packed));
    5150
  • arch/ia32/src/context.s

    re9b9e12 raa4e8d7  
    3131.global context_save
    3232.global context_restore
     33
    3334
    3435#
     
    7475        xorl %eax,%eax          # context_restore returns 0
    7576        ret
     77
     78
     79.global fpu_context_save
     80fpu_context_save:
     81    ret
     82.global fpu_context_restore
     83fpu_context_restore:
     84    ret
     85
     86.global fpu_lazy_context_save
     87    mov 4(%esp),%eax;
     88    fxsave (%eax)
     89    xor %eax,%eax;
     90    ret;
     91.global fpu_lazy_context_restore
     92    mov 4(%esp),%eax;
     93    fxrstor (%eax)
     94    xor %eax,%eax;
     95    ret;
     96
  • include/proc/thread.h

    re9b9e12 raa4e8d7  
    7373        context_t saved_context;
    7474        context_t sleep_timeout_context;
    75 
     75        fpu_context_t saved_fpu;                       
     76       
     77       
    7678        waitq_t *sleep_queue;
    7779        timeout_t sleep_timeout;
  • src/Makefile.config

    re9b9e12 raa4e8d7  
    1 #ARCH=ia32
     1ARCH=ia32
    22#ARCH=mips
    3 ARCH=ia64
     3#ARCH=ia64
    44#ARCH=powerpc
    55#ARCH=amd64
  • src/main/main.c

    re9b9e12 raa4e8d7  
    9292        config.kernel_size = hardcoded_ktext_size + hardcoded_kdata_size + CONFIG_HEAP_SIZE + CONFIG_STACK_SIZE;
    9393
    94         context_save(&ctx);
     94        context_save(&ctx); /* There is no nead to save FPU context */
    9595        ctx.sp = config.base + config.kernel_size - 8;
    9696        ctx.pc = (__address) main_bsp_separated_stack;
    97         context_restore(&ctx);
     97        context_restore(&ctx); /* There is no nead to load FPU context */
    9898        /* not reached */
    9999}
     
    193193        CPU->saved_context.sp = (__address) &CPU->stack[CPU_STACK_SIZE-8];
    194194        CPU->saved_context.pc = (__address) main_ap_separated_stack;
    195         context_restore(&CPU->saved_context);
     195        context_restore(&CPU->saved_context); /* There is no nead to load FPU context */
    196196        /* not reached */
    197197}
Note: See TracChangeset for help on using the changeset viewer.