mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 10:16:41 +00:00
We need to perform dirty page tracking when dumping shmem but there we have only const vmas so we need pmc to work with them. Also pmc concept implies that it won't change its vmas so it would be natural to declared them as const. Signed-off-by: Fyodor Bocharov <fbocharov@yandex.ru> Signed-off-by: Eugene Batalov <eabatalov89@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
30 lines
814 B
C
30 lines
814 B
C
#ifndef __CR_PAGEMAP_H__
|
|
#define __CR_PAGEMAP_H__
|
|
|
|
#include <sys/types.h>
|
|
#include "asm/page.h"
|
|
#include "asm/int.h"
|
|
|
|
#include "list.h"
|
|
|
|
struct vma_area;
|
|
|
|
#define PAGEMAP_PFN_OFF(addr) (PAGE_PFN(addr) * sizeof(u64))
|
|
|
|
typedef struct {
|
|
pid_t pid; /* which process it belongs */
|
|
unsigned long start; /* start of area */
|
|
unsigned long end; /* end of area */
|
|
const struct list_head *vma_head; /* list head of VMAs we're serving */
|
|
u64 *map; /* local buffer */
|
|
size_t map_len; /* length of a buffer */
|
|
int fd; /* file to read PMs from */
|
|
} pmc_t;
|
|
|
|
#define PMC_INIT (pmc_t){ }
|
|
|
|
extern int pmc_init(pmc_t *pmc, pid_t pid, const struct list_head *vma_head, size_t size);
|
|
extern u64 *pmc_get_map(pmc_t *pmc, const struct vma_area *vma);
|
|
extern void pmc_fini(pmc_t *pmc);
|
|
|
|
#endif /* __CR_PAGEMAP_H__ */
|