implement sys_munmap()

This commit is contained in:
NAKAMURA Gou
2013-07-16 19:52:34 +09:00
parent 334662b7fe
commit deb9cd4e75
6 changed files with 254 additions and 87 deletions

View File

@@ -37,6 +37,8 @@ struct cpu_local_var {
int status;
int fs;
struct list_head pending_free_pages;
} __attribute__((aligned(64)));

View File

@@ -1,7 +1,21 @@
#ifndef __HEADER_PAGE_H
#define __HEADER_PAGE_H
struct page {
struct list_head list;
uint64_t flags;
int64_t count;
};
/* flags */
#define PAGE_IN_LIST 0x0001UL
struct page *phys_to_page(uintptr_t phys);
uintptr_t page_to_phys(struct page *page);
void *allocate_pages(int npages, enum ihk_mc_ap_flag flag);
void free_pages(void *va, int npages);
void begin_free_pages_pending(void);
void finish_free_pages_pending(void);
#endif

View File

@@ -131,6 +131,8 @@ struct vm_range *lookup_process_memory_range(
struct process_vm *vm, uintptr_t start, uintptr_t end);
struct vm_range *next_process_memory_range(
struct process_vm *vm, struct vm_range *range);
struct vm_range *previous_process_memory_range(
struct process_vm *vm, struct vm_range *range);
int remove_process_region(struct process *proc,
unsigned long start, unsigned long end);
struct program_load_desc;