lib.h 955 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright 2014, Michael Ellerman, IBM Corp.
  3. * Licensed under GPLv2.
  4. */
  5. #ifndef __SELFTESTS_POWERPC_PMU_LIB_H
  6. #define __SELFTESTS_POWERPC_PMU_LIB_H
  7. #include <stdio.h>
  8. #include <stdint.h>
  9. #include <string.h>
  10. #include <unistd.h>
  11. union pipe {
  12. struct {
  13. int read_fd;
  14. int write_fd;
  15. };
  16. int fds[2];
  17. };
  18. extern int pick_online_cpu(void);
  19. extern int bind_to_cpu(int cpu);
  20. extern int kill_child_and_wait(pid_t child_pid);
  21. extern int wait_for_child(pid_t child_pid);
  22. extern int sync_with_child(union pipe read_pipe, union pipe write_pipe);
  23. extern int wait_for_parent(union pipe read_pipe);
  24. extern int notify_parent(union pipe write_pipe);
  25. extern int notify_parent_of_error(union pipe write_pipe);
  26. extern pid_t eat_cpu(int (test_function)(void));
  27. extern bool require_paranoia_below(int level);
  28. struct addr_range {
  29. uint64_t first, last;
  30. };
  31. extern struct addr_range libc, vdso;
  32. int parse_proc_maps(void);
  33. #endif /* __SELFTESTS_POWERPC_PMU_LIB_H */