summaryrefslogtreecommitdiffstats
path: root/kernel/tests/include/libnewipc.h
blob: 30288cd68ca6e8e0521a06313d27c11b55859ddd (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Copyright (c) 2016 Xiao Yang <yangx.jy@cn.fujitsu.com>
 *
 * This program is free software;  you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY;  without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 * the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.
 */

/*
 * common definitions for the IPC system calls.
 */

#ifndef __LIBNEWIPC_H
#define __LIBNEWIPC_H	1

#include <sys/types.h>

#define MSG_RD	0400
#define MSG_WR	0200
#define MSG_RW	(MSG_RD | MSG_WR)
#define MSGSIZE	1024
#define MSGTYPE	1
#define NR_MSGQUEUES	16
#define min(a, b)	(((a) < (b)) ? (a) : (b))

#define SEM_RD	0400
#define SEM_ALT	0200
#define SEM_RA	(SEM_RD | SEM_ALT)
#define PSEMS	10

#define SHM_RD	0400
#define SHM_WR	0200
#define SHM_RW	(SHM_RD | SHM_WR)
#define SHM_SIZE	2048
#define INT_SIZE	4
#define MODE_MASK	0x01FF

key_t getipckey(const char *file, const int lineno);
#define GETIPCKEY() \
	getipckey(__FILE__, __LINE__)

int get_used_queues(const char *file, const int lineno);
#define GET_USED_QUEUES() \
	get_used_queues(__FILE__, __LINE__)

void *probe_free_addr(const char *file, const int lineno);
#define PROBE_FREE_ADDR() \
	probe_free_addr(__FILE__, __LINE__)

#endif /* newlibipc.h */