qemu/include/qemu/selfmap.h
<<
>>
Prefs
   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
  12typedef 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 */
  34GSList *read_self_maps(void);
  35
  36/**
  37 * free_self_maps:
  38 * @info: a GSlist
  39 *
  40 * Free a list of MapInfo structures.
  41 */
  42void free_self_maps(GSList *info);
  43
  44#endif /* _SELFMAP_H_ */
  45