-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdsm.h
44 lines (35 loc) · 924 Bytes
/
dsm.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
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>
#include <poll.h>
#include "common_impl.h"
/* fin des includes */
#define TOP_ADDR (0x40000000)
#define PAGE_NUMBER (100)
#define PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
#define BASE_ADDR (TOP_ADDR - (PAGE_NUMBER * PAGE_SIZE))
#define MAXNAME 256
typedef enum {
NO_ACCESS, READ_ACCESS, WRITE_ACCESS, UNKNOWN_ACCESS
} dsm_page_access_t;
typedef enum {
INVALID, READ_ONLY, WRITE, NO_CHANGE
} dsm_page_state_t;
typedef int dsm_page_owner_t;
typedef struct {
dsm_page_state_t status;
dsm_page_owner_t owner;
} dsm_page_info_t;
dsm_page_info_t table_page[PAGE_NUMBER];
pthread_t comm_daemon;
extern int DSM_NODE_ID;
extern int DSM_NODE_NUM;
char *dsm_init(int argc, char **argv);
void dsm_finalize(void);