Subversion Repositories HelenOS-historic

Rev

Rev 756 | Rev 826 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 756 Rev 793
Line 41... Line 41...
41
#include <memstr.h>
41
#include <memstr.h>
42
#include <debug.h>
42
#include <debug.h>
43
#include <arch.h>
43
#include <arch.h>
44
 
44
 
45
/** Virtual operations for page subsystem. */
45
/** Virtual operations for page subsystem. */
46
page_operations_t *page_operations = NULL;
46
page_mapping_operations_t *page_mapping_operations = NULL;
47
 
47
 
48
void page_init(void)
48
void page_init(void)
49
{
49
{
50
    page_arch_init();
50
    page_arch_init();
51
}
51
}
Line 83... Line 83...
83
 * @param frame Physical address of memory frame to which the mapping is done.
83
 * @param frame Physical address of memory frame to which the mapping is done.
84
 * @param flags Flags to be used for mapping.
84
 * @param flags Flags to be used for mapping.
85
 */
85
 */
86
void page_mapping_insert(as_t *as, __address page, __address frame, int flags)
86
void page_mapping_insert(as_t *as, __address page, __address frame, int flags)
87
{
87
{
88
    ASSERT(page_operations);
88
    ASSERT(page_mapping_operations);
89
    ASSERT(page_operations->mapping_insert);
89
    ASSERT(page_mapping_operations->mapping_insert);
90
   
90
   
91
    page_operations->mapping_insert(as, page, frame, flags);
91
    page_mapping_operations->mapping_insert(as, page, frame, flags);
92
}
92
}
93
 
93
 
94
/** Find mapping for virtual page
94
/** Find mapping for virtual page
95
 *
95
 *
96
 * Find mapping for virtual page.
96
 * Find mapping for virtual page.
Line 102... Line 102...
102
 *
102
 *
103
 * @return NULL if there is no such mapping; requested mapping otherwise.
103
 * @return NULL if there is no such mapping; requested mapping otherwise.
104
 */
104
 */
105
pte_t *page_mapping_find(as_t *as, __address page)
105
pte_t *page_mapping_find(as_t *as, __address page)
106
{
106
{
107
    ASSERT(page_operations);
107
    ASSERT(page_mapping_operations);
108
    ASSERT(page_operations->mapping_find);
108
    ASSERT(page_mapping_operations->mapping_find);
109
 
109
 
110
    return page_operations->mapping_find(as, page);
110
    return page_mapping_operations->mapping_find(as, page);
111
}
111
}