Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / mc / mc_memory_map.h
1 /* Copyright (c) 2007-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef MC_MEMORY_MAP_H
8 #define MC_MEMORY_MAP_H
9
10 #include <simgrid_config.h>
11 #include "mc_forward.h"
12
13 SG_BEGIN_DECL()
14
15 /** \file
16  *   These functions and data structures implements a binary interface for
17  *   the proc maps ascii interface                                           */
18
19 /* Each field is defined as documented in proc's manual page  */
20 struct s_map_region {
21
22   void *start_addr;             /* Start address of the map */
23   void *end_addr;               /* End address of the map */
24   int prot;                     /* Memory protection */
25   int flags;                    /* Additional memory flags */
26   void *offset;                 /* Offset in the file/whatever */
27   char dev_major;               /* Major of the device */
28   char dev_minor;               /* Minor of the device */
29   unsigned long inode;          /* Inode in the device */
30   char *pathname;               /* Path name of the mapped file */
31
32 };
33 typedef struct s_map_region s_map_region_t, *map_region_t;
34
35 struct s_memory_map {
36
37   s_map_region_t *regions;      /* Pointer to an array of regions */
38   int mapsize;                  /* Number of regions in the memory */
39
40 };
41
42 void MC_init_memory_map_info(void);
43 memory_map_t MC_get_memory_map(void);
44 void MC_free_memory_map(memory_map_t map);
45
46 SG_END_DECL()
47
48 #endif