2020-04-03 21:11:46 +02:00
|
|
|
/*
|
|
|
|
* Utility functions to read our own memory map
|
|
|
|
*
|
|
|
|
* Copyright (c) 2020 Linaro Ltd
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
|
2021-06-05 19:49:38 +02:00
|
|
|
#ifndef SELFMAP_H
|
|
|
|
#define SELFMAP_H
|
2020-04-03 21:11:46 +02:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
unsigned long start;
|
|
|
|
unsigned long end;
|
|
|
|
|
|
|
|
/* flags */
|
|
|
|
bool is_read;
|
|
|
|
bool is_write;
|
|
|
|
bool is_exec;
|
|
|
|
bool is_priv;
|
|
|
|
|
|
|
|
unsigned long offset;
|
|
|
|
gchar *dev;
|
|
|
|
uint64_t inode;
|
|
|
|
gchar *path;
|
|
|
|
} MapInfo;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* read_self_maps:
|
|
|
|
*
|
|
|
|
* Read /proc/self/maps and return a list of MapInfo structures.
|
|
|
|
*/
|
|
|
|
GSList *read_self_maps(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* free_self_maps:
|
|
|
|
* @info: a GSlist
|
|
|
|
*
|
|
|
|
* Free a list of MapInfo structures.
|
|
|
|
*/
|
|
|
|
void free_self_maps(GSList *info);
|
|
|
|
|
2022-05-06 15:49:11 +02:00
|
|
|
#endif /* SELFMAP_H */
|