| 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | #ifndef __PIP_STRESS_H |
| 3 | #define __PIP_STRESS_H |
| 4 | |
| 5 | #include <stdio.h> |
| 6 | #include <stdlib.h> |
| 7 | #include <unistd.h> |
| 8 | #include <errno.h> |
| 9 | #include <sys/mman.h> |
| 10 | #include <string.h> |
| 11 | #include <stdarg.h> |
| 12 | #include <pthread.h> |
| 13 | #include <sys/types.h> |
| 14 | #include <sys/wait.h> |
| 15 | #include <signal.h> |
| 16 | #include <sched.h> |
| 17 | |
| 18 | #include "rt-utils.h" |
| 19 | #include "rt-error.h" |
| 20 | |
| 21 | void low(pid_t pid); /* low priority process */ |
| 22 | void medium(void); /* medium priority process */ |
| 23 | void high(pid_t pid); /* high priority process */ |
| 24 | void init_state(void); |
| 25 | |
| 26 | void *mmap_page(void); |
| 27 | long process_shared_mutex_available(void); |
| 28 | void Pthread_mutexattr_init(pthread_mutexattr_t *attr); |
| 29 | void Pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared); |
| 30 | void Pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int protocol); |
| 31 | void Pthread_mutex_init(pthread_mutex_t *mutex, pthread_mutexattr_t *attr); |
| 32 | void Pthread_mutex_lock(pthread_mutex_t *mutex); |
| 33 | void Pthread_mutex_unlock(pthread_mutex_t *mutex); |
| 34 | |
| 35 | void init_shared_pthread_mutex(pthread_mutex_t *mutex, int protocol); |
| 36 | int set_rt_prio(pid_t pid, int prio, int policy); |
| 37 | int get_rt_prio(pid_t pid); |
| 38 | |
| 39 | #define PROTRW PROT_READ|PROT_WRITE |
| 40 | #define MMAP_FLAGS MAP_SHARED|MAP_ANONYMOUS |
| 41 | |
| 42 | #endif /* __PIP_STRESS_H */ |