]>
git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blob - tools/testing/selftests/powerpc/math/vmx_syscall.c
2 * Copyright 2015, 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 * This test attempts to see if the VMX registers change across a syscall (fork).
15 #include <sys/syscall.h>
18 #include <sys/types.h>
22 vector
int varray
[] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10,11,12},
23 {13,14,15,16},{17,18,19,20},{21,22,23,24},
24 {25,26,27,28},{29,30,31,32},{33,34,35,36},
25 {37,38,39,40},{41,42,43,44},{45,46,47,48}};
27 extern int test_vmx(vector
int *varray
, pid_t
*pid
);
35 for (i
= 0; i
< 1000; i
++) {
36 /* test_vmx will fork() */
37 ret
= test_vmx(varray
, &fork_pid
);
42 waitpid(fork_pid
, &child_ret
, 0);
50 int test_vmx_syscall(void)
53 * Setup an environment with much context switching
63 /* Can't FAIL_IF(pid2 == -1); because we've already forked */
66 * Couldn't fork, ensure child_ret is set and is a fail
71 waitpid(pid2
, &child_ret
, 0);
79 waitpid(pid
, &child_ret
, 0);
83 FAIL_IF(ret
|| child_ret
);
87 int main(int argc
, char *argv
[])
89 return test_harness(test_vmx_syscall
, "vmx_syscall");