support private mapped file

This commit is contained in:
NAKAMURA Gou
2013-08-09 20:55:17 +09:00
parent 603ef85454
commit 27172ad413
17 changed files with 1392 additions and 133 deletions

View File

@@ -2,16 +2,28 @@
#define __HEADER_PAGE_H
struct page {
struct list_head list;
uint64_t flags;
int64_t count;
struct list_head list;
uint8_t mode;
uint8_t padding[3];
int32_t count;
off_t offset;
};
/* flags */
#define PAGE_IN_LIST 0x0001UL
/* mode */
enum page_mode {
PM_NONE = 0x00,
PM_PENDING_FREE = 0x01,
PM_WILL_PAGEIO = 0x02,
PM_PAGEIO = 0x03,
PM_DONE_PAGEIO = 0x04,
PM_PAGEIO_EOF = 0x05,
PM_PAGEIO_ERROR = 0x06,
PM_MAPPED = 0x07,
};
struct page *phys_to_page(uintptr_t phys);
uintptr_t page_to_phys(struct page *page);
int page_unmap(struct page *page);
void *allocate_pages(int npages, enum ihk_mc_ap_flag flag);
void free_pages(void *va, int npages);