View of xos/mm/map.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 MAP_H
#define MAP_H
 
struct map_struct;
struct file_struct;
struct map_info_struct;
 
void init_zero_page();
 
int alloc_mem_map(unsigned long start, unsigned long length, int prot, void *mem_start, struct map_struct **mem_map);
int alloc_anon_map(unsigned long start, unsigned long length, int prot, int grows_down, const char *name, struct map_struct **anon_map);
int alloc_file_map(unsigned long start, unsigned long length, int prot, struct file_struct *file, unsigned long offset, struct map_struct **file_map);
void free_map(struct map_struct *map);
 
int map_clone(const struct map_struct *map, unsigned long start, unsigned long length, int *status, struct map_struct **new_map);
int map_split(struct map_struct *map, unsigned long start, struct map_struct **new_map);
int map_merge(struct map_struct *map, struct map_struct *map1);
void map_grow_down(struct map_struct *map, unsigned long laddr);
void map_protect(struct map_struct *map, int prot);
 
int map_verify_access(const struct map_struct *map, int access);
int map_grows_down(const struct map_struct *map);
int map_fill_page(const struct map_struct *map, unsigned long page);
unsigned long map_get_clean_page_frame(const struct map_struct *map, unsigned long laddr);
void map_set_clean_page_frame(const struct map_struct *map, unsigned long laddr, unsigned long page_frame);
void map_dirty_page(const struct map_struct *map, unsigned long laddr, unsigned long page_frame);
int map_get_info(const struct map_struct *map, struct map_info_struct *map_info);
 
int compare_map_laddr(const struct map_struct *map, unsigned long laddr);
int compare_map_prot(const struct map_struct *map, int prot);
int compare_maps(const struct map_struct *map1, const struct map_struct *map2);
int hole_intersect(const struct map_struct *map1, const struct map_struct *map2, unsigned long base, unsigned long size, unsigned long *start, unsigned long *length);
 
#endif