version 1.1.1.1, 2008/06/03 10:38:45 |
version 1.1.1.1.2.1, 2008/08/13 17:12:31 |
|
|
/*- |
/*- |
* Copyright (c) 2005-2007, Kohsuke Ohtani |
* Copyright (c) 2005-2008, Kohsuke Ohtani |
* All rights reserved. |
* All rights reserved. |
* |
* |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
|
|
#ifndef _VM_H |
#ifndef _VM_H |
#define _VM_H |
#define _VM_H |
|
|
#include <arch.h> |
#include <arch.h> /* for pgd_t */ |
|
|
/* |
/* |
* One structure per allocated region. |
* One structure per allocated region. |
|
|
struct region *next; |
struct region *next; |
struct region *sh_prev; /* link for all shared region */ |
struct region *sh_prev; /* link for all shared region */ |
struct region *sh_next; |
struct region *sh_next; |
u_long addr; /* base address */ |
void *addr; /* base address */ |
size_t size; /* size */ |
size_t size; /* size */ |
int flags; /* flag */ |
int flags; /* flag */ |
#ifdef CONFIG_MMU |
#ifdef CONFIG_MMU |
u_long phys; /* physical address */ |
void *phys; /* physical address */ |
#endif |
#endif |
}; |
}; |
|
|
|
|
*/ |
*/ |
struct vm_map { |
struct vm_map { |
struct region head; /* list head of regions */ |
struct region head; /* list head of regions */ |
int ref_count; /* reference count */ |
int refcnt; /* reference count */ |
pgd_t pgd; /* page directory */ |
pgd_t pgd; /* page directory */ |
}; |
}; |
|
|
|
|
extern void vm_switch(vm_map_t); |
extern void vm_switch(vm_map_t); |
extern int vm_load(vm_map_t, struct module *, void **); |
extern int vm_load(vm_map_t, struct module *, void **); |
extern void *vm_translate(void *, size_t); |
extern void *vm_translate(void *, size_t); |
extern int vm_access(void *, size_t, int); |
|
extern void vm_dump(void); |
extern void vm_dump(void); |
extern void vm_init(void); |
extern void vm_init(void); |
|
|