aboutsummaryrefslogtreecommitdiff
path: root/tests/cris/check_settls1.c
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar@axis.com>2010-07-29 17:15:28 +0200
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2010-07-29 17:15:28 +0200
commit58f5c1eb8984897170e98efb9b194f07cc06cc39 (patch)
tree8420db3196c59ba93fe4104bba7045c65ee3545d /tests/cris/check_settls1.c
parent61eb865acf29cc29043ca6d3ed4770dddd2b9774 (diff)
downloadqemu-58f5c1eb8984897170e98efb9b194f07cc06cc39.zip
qemu-58f5c1eb8984897170e98efb9b194f07cc06cc39.tar.gz
qemu-58f5c1eb8984897170e98efb9b194f07cc06cc39.tar.bz2
cris: Correct settls1 testcase.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'tests/cris/check_settls1.c')
-rw-r--r--tests/cris/check_settls1.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/cris/check_settls1.c b/tests/cris/check_settls1.c
index 0ed99cf..69d2026 100644
--- a/tests/cris/check_settls1.c
+++ b/tests/cris/check_settls1.c
@@ -11,11 +11,15 @@
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 ();
}