Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Modularise header files for MC
[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
12 SG_BEGIN_DECL()
13
14 /** \file
15  *   These functions and data structures implements a binary interface for
16  *   the proc maps ascii interface                                           */
17
18 /* Each field is defined as documented in proc's manual page  */
19 struct s_map_region {
20
21   void *start_addr;             /* Start address of the map */
22   void *end_addr;               /* End address of the map */
23   int prot;                     /* Memory protection */
24   int flags;                    /* Additional memory flags */
25   void *offset;                 /* Offset in the file/whatever */
26   char dev_major;               /* Major of the device */
27   char dev_minor;               /* Minor of the device */
28   unsigned long inode;          /* Inode in the device */
29   char *pathname;               /* Path name of the mapped file */
30
31 };
32 typedef struct s_map_region s_map_region_t, *map_region_t;
33
34 struct s_memory_map {
35
36   s_map_region_t *regions;      /* Pointer to an array of regions */
37   int mapsize;                  /* Number of regions in the memory */
38
39 };
40
41 void MC_init_memory_map_info(void);
42 memory_map_t MC_get_memory_map(void);
43 void MC_free_memory_map(memory_map_t map);
44
45 SG_END_DECL()
46
47 #endif