 79be812bdb
			
		
	
	
		79be812bdb
		
	
	
	
	
		
			
			Use dev_t instead of a string, and ino_t instead of uint64_t. The latter is likely to be identical on modern systems but is more type-correct for usage. Tested-by: Helge Deller <deller@gmx.de> Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
		
			
				
	
	
		
			45 lines
		
	
	
		
			733 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			733 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * Utility functions to read our own memory map
 | |
|  *
 | |
|  * Copyright (c) 2020 Linaro Ltd
 | |
|  *
 | |
|  * SPDX-License-Identifier: GPL-2.0-or-later
 | |
|  */
 | |
| 
 | |
| #ifndef SELFMAP_H
 | |
| #define SELFMAP_H
 | |
| 
 | |
| #include "qemu/interval-tree.h"
 | |
| 
 | |
| typedef struct {
 | |
|     IntervalTreeNode itree;
 | |
| 
 | |
|     /* flags */
 | |
|     bool is_read;
 | |
|     bool is_write;
 | |
|     bool is_exec;
 | |
|     bool is_priv;
 | |
| 
 | |
|     dev_t dev;
 | |
|     ino_t inode;
 | |
|     uint64_t offset;
 | |
|     const char *path;
 | |
| } MapInfo;
 | |
| 
 | |
| /**
 | |
|  * read_self_maps:
 | |
|  *
 | |
|  * Read /proc/self/maps and return a tree of MapInfo structures.
 | |
|  */
 | |
| IntervalTreeRoot *read_self_maps(void);
 | |
| 
 | |
| /**
 | |
|  * free_self_maps:
 | |
|  * @info: an interval tree
 | |
|  *
 | |
|  * Free a tree of MapInfo structures.
 | |
|  */
 | |
| void free_self_maps(IntervalTreeRoot *root);
 | |
| 
 | |
| #endif /* SELFMAP_H */
 |