-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmmpi_internal.h
83 lines (69 loc) · 1.43 KB
/
mmpi_internal.h
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* mmpi_internal.h
*
* Copyright 2007 Jean-Marc Saffroy <[email protected]>
* This file is part of the Driller library.
* Driller is free software, distributed under the terms of the
* GNU Lesser General Public License version 2.1.
*
*/
#ifndef MMPI_INTERNAL_H
#define MMPI_INTERNAL_H
/*
* lists for shared mem
*/
#define LIST_MAGIC 0xf001157
struct list_head {
#ifndef NDEBUG
int magic;
#endif
intptr_t off_next, off_prev;
};
/*
* shared mem and messages
*/
#define SHMEM_KEY_MAGIC 0xf003333
#define __cacheline_aligned __attribute__((__aligned__(CACHELINE_ALIGN)))
enum msg_type {
MSG_FREE = -1,
MSG_DATA = 0,
MSG_FRAG = 1,
MSG_DRILLER = 2,
MSG_DRILLER_INVAL = 3,
};
struct driller_payload {
struct map_rec map;
struct fdkey key;
off_t offset;
size_t length;
};
struct message {
struct list_head m_list;
enum msg_type m_type;
int m_size;
int m_src;
union {
char m_payload[MSG_PAYLOAD_SIZE_BYTES];
struct driller_payload m_drill;
};
};
struct message_queue {
struct spinlock q_lock __cacheline_aligned;
struct list_head q_list;
int q_length;
};
struct shmem {
volatile int barrier_box __cacheline_aligned;
volatile int driller_send_running;
struct message_queue free_q;
struct message_queue recv_q;
struct message msg_pool[MSG_POOL_SIZE];
};
/*
* interaction with driller
*/
struct driller_udata {
struct fdkey key;
char references[];
};
#endif /* MMPI_INTERNAL_H */