Changeset 6a27d63 in mainline for arch/ia32/src/fpu_context.c


Ignore:
Timestamp:
2005-05-11T21:53:09Z (20 years ago)
Author:
Jakub Vana <jakub.vana@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c884ef1
Parents:
6ba143d
Message:

Finished FPU lazy context switching - first version. I have not tested it and there are many things which must be changed when
it runs first time OK.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/fpu_context.c

    r6ba143d r6a27d63  
    4141void fpu_context_restore(fpu_context_t *fctx)
    4242{
    43         if(THREAD==CPU->arch.fpu_owner) reset_TS_flag();
    44         else set_TS_flag();
     43        if(THREAD==CPU->arch.fpu_owner) {reset_TS_flag(); }
     44        else {set_TS_flag(); ((CPU->arch).fpu_owner)->fpu_context_engaged=1;}
    4545}
    4646
     
    4848void fpu_lazy_context_save(fpu_context_t *fctx)
    4949{
    50 /*
    51         pushl %eax
    52         mov 8(%esp),%eax
    53         fxsave (%eax)
    54         popl %eax
    55         ret
    56 */     
     50    asm(
     51        "mov %0,%%eax;"
     52        "fxsave (%%eax);"
     53        "ret;"
     54        :"=m"(fctx)
     55        :
     56        :"%eax"
     57    ); 
    5758}
    5859
    5960void fpu_lazy_context_restore(fpu_context_t *fctx)
    6061{
    61 /*
    62         pushl %eax
    63         mov 8(%esp),%eax
    64         fxrstor (%eax)
    65         popl %eax
    66         ret
    67 */     
     62    asm(
     63        "mov %0,%%eax;"
     64        "fxrstor (%%eax);"
     65        "ret;"
     66        :"=m"(fctx)
     67        :
     68        :"%eax"
     69    );
    6870}
     71
     72void fpu_init(void)
     73{
     74    asm(
     75        "fninit;"
     76    );
     77}
     78
Note: See TracChangeset for help on using the changeset viewer.