Subversion Repositories HelenOS-historic

Rev

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

Rev 684 Rev 687
Line 28... Line 28...
28
 
28
 
29
#include <genarch/mm/page_pt.h>
29
#include <genarch/mm/page_pt.h>
30
#include <mm/page.h>
30
#include <mm/page.h>
31
#include <mm/frame.h>
31
#include <mm/frame.h>
32
#include <arch/mm/page.h>
32
#include <arch/mm/page.h>
-
 
33
#include <arch/mm/asid.h>
33
#include <arch/types.h>
34
#include <arch/types.h>
34
#include <typedefs.h>
35
#include <typedefs.h>
35
#include <arch/asm.h>
36
#include <arch/asm.h>
36
#include <memstr.h>
37
#include <memstr.h>
37
 
38
 
38
static void pt_mapping_insert(__address page, __address frame, int flags, __address root);
39
static void pt_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root);
39
static pte_t *pt_mapping_find(__address page, __address root);
40
static pte_t *pt_mapping_find(__address page, asid_t asid, __address root);
40
 
41
 
41
page_operations_t page_pt_operations = {
42
page_operations_t page_pt_operations = {
42
    .mapping_insert = pt_mapping_insert,
43
    .mapping_insert = pt_mapping_insert,
43
    .mapping_find = pt_mapping_find
44
    .mapping_find = pt_mapping_find
44
};
45
};
Line 47... Line 48...
47
 *
48
 *
48
 * Map virtual address 'page' to physical address 'frame'
49
 * Map virtual address 'page' to physical address 'frame'
49
 * using 'flags'.
50
 * using 'flags'.
50
 *
51
 *
51
 * @param page Virtual address of the page to be mapped.
52
 * @param page Virtual address of the page to be mapped.
-
 
53
 * @param asid Ignored.
52
 * @param frame Physical address of memory frame to which the mapping is done.
54
 * @param frame Physical address of memory frame to which the mapping is done.
53
 * @param flags Flags to be used for mapping.
55
 * @param flags Flags to be used for mapping.
54
 * @param root Explicit PTL0 address.
56
 * @param root Explicit PTL0 address.
55
 */
57
 */
56
void pt_mapping_insert(__address page, __address frame, int flags, __address root)
58
void pt_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root)
57
{
59
{
58
    pte_t *ptl0, *ptl1, *ptl2, *ptl3;
60
    pte_t *ptl0, *ptl1, *ptl2, *ptl3;
59
    __address newpt;
61
    __address newpt;
60
 
62
 
61
    ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS());
63
    ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS());
Line 94... Line 96...
94
/** Find mapping for virtual page in hierarchical page tables.
96
/** Find mapping for virtual page in hierarchical page tables.
95
 *
97
 *
96
 * Find mapping for virtual page.
98
 * Find mapping for virtual page.
97
 *
99
 *
98
 * @param page Virtual page.
100
 * @param page Virtual page.
-
 
101
 * @param asid Ignored.
99
 * @param root PTL0 address if non-zero.
102
 * @param root PTL0 address if non-zero.
100
 *
103
 *
101
 * @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise.
104
 * @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise.
102
 */
105
 */
103
pte_t *pt_mapping_find(__address page, __address root)
106
pte_t *pt_mapping_find(__address page, asid_t asid, __address root)
104
{
107
{
105
    pte_t *ptl0, *ptl1, *ptl2, *ptl3;
108
    pte_t *ptl0, *ptl1, *ptl2, *ptl3;
106
 
109
 
107
    ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS());
110
    ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS());
108
 
111