ALSA: hda - Adding one more ALC255 pin definition for headset problem
[linux/fpc-iii.git] / tools / testing / selftests / powerpc / tm / tm-exec.c
blob3d27fa0ece04fb4fc69f8f3fbdeceeec973ad5a0
1 /*
2 * Copyright 2016, Cyril Bur, IBM Corp.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
9 * Syscalls can be performed provided the transactions are suspended.
10 * The exec() class of syscall is unique as a new process is loaded.
12 * It makes little sense for after an exec() call for the previously
13 * suspended transaction to still exist.
16 #define _GNU_SOURCE
17 #include <errno.h>
18 #include <inttypes.h>
19 #include <libgen.h>
20 #include <pthread.h>
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <unistd.h>
26 #include "utils.h"
27 #include "tm.h"
29 static char *path;
31 static int test_exec(void)
33 SKIP_IF(!have_htm());
35 asm __volatile__(
36 "tbegin.;"
37 "blt 1f; "
38 "tsuspend.;"
39 "1: ;"
40 : : : "memory");
42 execl(path, "tm-exec", "--child", NULL);
44 /* Shouldn't get here */
45 perror("execl() failed");
46 return 1;
49 static int after_exec(void)
51 asm __volatile__(
52 "tbegin.;"
53 "blt 1f;"
54 "tsuspend.;"
55 "1: ;"
56 : : : "memory");
58 FAIL_IF(failure_is_nesting());
59 return 0;
62 int main(int argc, char *argv[])
64 path = argv[0];
66 if (argc > 1 && strcmp(argv[1], "--child") == 0)
67 return after_exec();
69 return test_harness(test_exec, "tm_exec");