Changeset 342616d in mainline


Ignore:
Timestamp:
2005-09-05T11:27:12Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ff4c4f5
Parents:
8fe379b5
Message:

More logical fpu_context_engaged setting.
The sse1 test now correctly tests for thread migration settings.

Files:
3 edited

Legend:

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

    r8fe379b5 r342616d  
    4040        if(THREAD==CPU->fpu_owner)
    4141                reset_TS_flag();
    42         else {
     42        else
    4343                set_TS_flag();
    44                 if (CPU->fpu_owner != NULL)
    45                         CPU->fpu_owner->fpu_context_engaged=1;
    46         }
    4744}
    4845
  • arch/amd64/src/interrupt.c

    r8fe379b5 r342616d  
    135135        }
    136136        CPU->fpu_owner=THREAD;
     137        THREAD->fpu_context_engaged = 1;
    137138}
    138139
  • test/fpu/sse1/test.c

    r8fe379b5 r342616d  
    4545static waitq_t can_start;
    4646
    47 static void testit(void *data)
     47static void testit1(void *data)
    4848{
    4949        int i;
     
    7575}
    7676
     77static void testit2(void *data)
     78{
     79        int i;
     80        volatile long long j;
     81        double e,d,le,f;
     82        int arg __attribute__((aligned(16))) = (int)((__native) data);
     83        int after_arg __attribute__((aligned(16)));
     84       
     85        waitq_sleep(&can_start);
     86
     87        for (i = 0; i<ATTEMPTS; i++) {
     88                __asm__ volatile (
     89                        "movlpd %0, %%xmm2"
     90                        :"=m"(arg)
     91                        );
     92
     93                scheduler();
     94                __asm__ volatile (
     95                        "movlpd %%xmm2, %0"
     96                        :"=m"(after_arg)
     97                        );
     98               
     99                if(arg != after_arg)
     100                        panic("tid%d: arg(%d) != %d\n",
     101                              THREAD->tid, arg, after_arg);
     102        }
     103
     104        atomic_inc(&threads_ok);
     105}
     106
    77107
    78108void test(void)
     
    86116        printf("Creating %d threads... ", THREADS);
    87117
    88         for (i=0; i<THREADS; i++) { 
    89                 if (!(t = thread_create(testit, (void *)((__native)i), TASK, 0)))
     118        for (i=0; i<THREADS/2; i++) { 
     119                if (!(t = thread_create(testit1, (void *)((__native)i*2), TASK, 0)))
     120                        panic("could not create thread\n");
     121                thread_ready(t);
     122                if (!(t = thread_create(testit2, (void *)((__native)i*2+1), TASK, 0)))
    90123                        panic("could not create thread\n");
    91124                thread_ready(t);
    92125        }
     126
    93127        printf("ok\n");
    94128       
Note: See TracChangeset for help on using the changeset viewer.