Rev 1380 | Rev 1702 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1380 | Rev 1468 | ||
---|---|---|---|
Line 42... | Line 42... | ||
42 | #include <typedefs.h> |
42 | #include <typedefs.h> |
43 | #include <memstr.h> |
43 | #include <memstr.h> |
44 | #include <arch.h> |
44 | #include <arch.h> |
45 | 45 | ||
46 | static pte_t *ptl0_create(int flags); |
46 | static pte_t *ptl0_create(int flags); |
- | 47 | static void ptl0_destroy(pte_t *page_table); |
|
47 | 48 | ||
48 | static void pt_lock(as_t *as, bool lock); |
49 | static void pt_lock(as_t *as, bool lock); |
49 | static void pt_unlock(as_t *as, bool unlock); |
50 | static void pt_unlock(as_t *as, bool unlock); |
50 | 51 | ||
51 | as_operations_t as_pt_operations = { |
52 | as_operations_t as_pt_operations = { |
52 | .page_table_create = ptl0_create, |
53 | .page_table_create = ptl0_create, |
- | 54 | .page_table_destroy = ptl0_destroy, |
|
53 | .page_table_lock = pt_lock, |
55 | .page_table_lock = pt_lock, |
54 | .page_table_unlock = pt_unlock |
56 | .page_table_unlock = pt_unlock |
55 | }; |
57 | }; |
56 | 58 | ||
57 | /** Create PTL0. |
59 | /** Create PTL0. |
Line 92... | Line 94... | ||
92 | } |
94 | } |
93 | 95 | ||
94 | return (pte_t *) KA2PA((__address) dst_ptl0); |
96 | return (pte_t *) KA2PA((__address) dst_ptl0); |
95 | } |
97 | } |
96 | 98 | ||
- | 99 | /** Destroy page table. |
|
- | 100 | * |
|
- | 101 | * Destroy PTL0, other levels are expected to be already deallocated. |
|
- | 102 | * |
|
- | 103 | * @param page_table Physical address of PTL0. |
|
- | 104 | */ |
|
- | 105 | void ptl0_destroy(pte_t *page_table) |
|
- | 106 | { |
|
- | 107 | frame_free(ADDR2PFN((__address) page_table)); |
|
- | 108 | } |
|
- | 109 | ||
97 | /** Lock page tables. |
110 | /** Lock page tables. |
98 | * |
111 | * |
99 | * Lock only the address space. |
112 | * Lock only the address space. |
100 | * Interrupts must be disabled. |
113 | * Interrupts must be disabled. |
101 | * |
114 | * |