xref: /qemu/include/qemu/selfmap.h (revision b2a3cbb8)
1 /*
2  * Utility functions to read our own memory map
3  *
4  * Copyright (c) 2020 Linaro Ltd
5  *
6  * SPDX-License-Identifier: GPL-2.0-or-later
7  */
8 
9 #ifndef SELFMAP_H
10 #define SELFMAP_H
11 
12 typedef struct {
13     unsigned long start;
14     unsigned long end;
15 
16     /* flags */
17     bool is_read;
18     bool is_write;
19     bool is_exec;
20     bool is_priv;
21 
22     unsigned long offset;
23     gchar *dev;
24     uint64_t inode;
25     gchar *path;
26 } MapInfo;
27 
28 
29 /**
30  * read_self_maps:
31  *
32  * Read /proc/self/maps and return a list of MapInfo structures.
33  */
34 GSList *read_self_maps(void);
35 
36 /**
37  * free_self_maps:
38  * @info: a GSlist
39  *
40  * Free a list of MapInfo structures.
41  */
42 void free_self_maps(GSList *info);
43 
44 #endif /* SELFMAP_H */
45