* start_addr is 0x7fabbb09b000
* end_addr is 0x7fabbb09f000
* mmap_offset is 0x179000
+ * protections is MMAP_CACHE_PROT_READABLE|MMAP_CACHE_PROT_EXECUTABLE
* binary_filename is "/lib/libc-2.11.1.so"
*/
unsigned long start_addr;
unsigned long end_addr;
unsigned long mmap_offset;
+ unsigned char protections;
char *binary_filename;
};
+enum mmap_cache_protection {
+ MMAP_CACHE_PROT_READABLE = 1 << 0,
+ MMAP_CACHE_PROT_WRITABLE = 1 << 1,
+ MMAP_CACHE_PROT_EXECUTABLE = 1 << 2,
+ MMAP_CACHE_PROT_SHARED = 1 << 3,
+};
+
enum mmap_cache_rebuild_result {
MMAP_CACHE_REBUILD_NOCACHE,
MMAP_CACHE_REBUILD_READY,
MMAP_CACHE_REBUILD_RENEWED,
};
+extern void mmap_cache_enable(void);
+extern bool mmap_cache_is_enabled(void);
extern void mmap_cache_invalidate(struct tcb *tcp);
extern void mmap_cache_delete(struct tcb *tcp, const char *caller);
extern enum mmap_cache_rebuild_result mmap_cache_rebuild_if_invalid(struct tcb *tcp, const char *caller);