View of xos/include/vm.h


XOS | Parent Directory | View | Download

/* Copyright (C) 2008  Emmanuel Varoquaux
 
   This file is part of XOS.
 
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
 
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
 
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
#ifndef _VM_H
#define _VM_H
 
struct vm_struct;
struct map_info_struct;
struct file_struct;
 
int vm_copy(const struct vm_struct *vm, struct vm_struct *dest_vm, unsigned long *dest_page_directory);
void vm_free(struct vm_struct *vm);
int vm_map_mem(struct vm_struct *vm, unsigned long start, unsigned long end);
int vm_map_anon(struct vm_struct *vm, unsigned long start, unsigned long length, int prot, int grows_down, const char *name);
int vm_map_file(struct vm_struct *vm, unsigned long start, unsigned long length, int prot, struct file_struct *file, unsigned long offset);
int vm_unmap(struct vm_struct *vm, unsigned long start, unsigned long length);
int vm_protect(struct vm_struct *vm, unsigned long start, unsigned long length, int prot);
unsigned long vm_get_free_area(const struct vm_struct *vm, unsigned long base, unsigned long size, unsigned long length, int side);
int vm_verify_area(const struct vm_struct *vm, unsigned long start, unsigned long length, int access);
int vm_verify_str(const struct vm_struct *vm, unsigned long start, unsigned int n, unsigned int *len);
int vm_get_maps(const struct vm_struct *vm, struct map_info_struct **map_info_array, unsigned int *count);
int vm_handle_page_fault(const struct vm_struct *vm, int cause, int access, unsigned long stack_top, unsigned long laddr);
 
#endif