]> git.proxmox.com Git - mirror_qemu.git/commitdiff
cris: Correct settls1 testcase.
authorEdgar E. Iglesias <edgar@axis.com>
Thu, 29 Jul 2010 15:15:28 +0000 (17:15 +0200)
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>
Thu, 29 Jul 2010 15:15:28 +0000 (17:15 +0200)
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
tests/cris/check_settls1.c

index 0ed99cf4c14a62cab225e05d30863af761080ef5..69d202652ae2a6801bd421edcc68d307afaf4377 100644 (file)
 
 int main (void)
 {
-    unsigned long tp;
+    unsigned long tp, old_tp;
     int ret;
 
+    asm volatile ("move $pid,%0" : "=r" (old_tp));
+    old_tp &= ~0xff;
+
     ret = syscall (SYS_set_thread_area, 0xf0);
     if (ret != -1 || errno != EINVAL) {
+        syscall (SYS_set_thread_area, old_tp);
         perror ("Invalid thread area accepted:");
         abort();
     }
@@ -26,10 +30,12 @@ int main (void)
         abort ();
     }
 
-    asm ("move $pid,%0" : "=r" (tp));
+    asm volatile ("move $pid,%0" : "=r" (tp));
     tp &= ~0xff;
+    syscall (SYS_set_thread_area, old_tp);
 
     if (tp != 0xeddeed00) {
+       * (volatile int *) 0 = 0;
         perror ("tls2");
         abort ();
     }