0001
0002
0003
0004
0005
0006 #ifndef __SELFTESTS_POWERPC_PMU_LIB_H
0007 #define __SELFTESTS_POWERPC_PMU_LIB_H
0008
0009 #include <stdbool.h>
0010 #include <stdio.h>
0011 #include <stdint.h>
0012 #include <string.h>
0013 #include <unistd.h>
0014
0015 union pipe {
0016 struct {
0017 int read_fd;
0018 int write_fd;
0019 };
0020 int fds[2];
0021 };
0022
0023 extern int bind_to_cpu(int cpu);
0024 extern int kill_child_and_wait(pid_t child_pid);
0025 extern int wait_for_child(pid_t child_pid);
0026 extern int sync_with_child(union pipe read_pipe, union pipe write_pipe);
0027 extern int wait_for_parent(union pipe read_pipe);
0028 extern int notify_parent(union pipe write_pipe);
0029 extern int notify_parent_of_error(union pipe write_pipe);
0030 extern pid_t eat_cpu(int (test_function)(void));
0031 extern bool require_paranoia_below(int level);
0032
0033 struct addr_range {
0034 uint64_t first, last;
0035 };
0036
0037 extern struct addr_range libc, vdso;
0038
0039 int parse_proc_maps(void);
0040
0041 #endif