cris: Correct settls1 testcase.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
This commit is contained in:
Edgar E. Iglesias 2010-07-29 17:15:28 +02:00 committed by Edgar E. Iglesias
parent 61eb865acf
commit 58f5c1eb89

View File

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