aboutsummaryrefslogtreecommitdiffstats
path: root/include/internal.h
blob: 07253b769f3f4fa99b77f18e0a187945080daeab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef INTERNAL_H
#define INTERNAL_H

/* low level operations, not intended for API use */

/* prepare a real-time task */
typedef int (*rt_setup_fn_t)(int pid, void* arg);
int __launch_rt_task(rt_fn_t rt_prog, void *rt_arg,
		     rt_setup_fn_t setup, void* setup_arg);

#define check(str)	 \
	if (ret == -1) { \
		perror(str); \
		fprintf(stderr,	\
			"Warning: Could not initialize LITMUS^RT, " \
			"%s failed.\n",	str			    \
			); \
	}


#define likely(x)   __builtin_expect((x), 1)
#define unlikely(x) __builtin_expect((x), 0)

#endif