Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging
[qemu/ar7.git] / include / qemu / selfmap.h
blob3479a2a61862d591f4e631ff653aadc97463e10b
1 /*
2 * Utility functions to read our own memory map
4 * Copyright (c) 2020 Linaro Ltd
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
9 #ifndef SELFMAP_H
10 #define SELFMAP_H
12 typedef struct {
13 unsigned long start;
14 unsigned long end;
16 /* flags */
17 bool is_read;
18 bool is_write;
19 bool is_exec;
20 bool is_priv;
22 unsigned long offset;
23 gchar *dev;
24 uint64_t inode;
25 gchar *path;
26 } MapInfo;
29 /**
30 * read_self_maps:
32 * Read /proc/self/maps and return a list of MapInfo structures.
34 GSList *read_self_maps(void);
36 /**
37 * free_self_maps:
38 * @info: a GSlist
40 * Free a list of MapInfo structures.
42 void free_self_maps(GSList *info);
44 #endif /* SELFMAP_H */