Rev 814 | Rev 1059 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 814 | Rev 1044 | ||
|---|---|---|---|
| Line 37... | Line 37... | ||
| 37 | #include <memstr.h> |
37 | #include <memstr.h> |
| 38 | #include <arch.h> |
38 | #include <arch.h> |
| 39 | 39 | ||
| 40 | static pte_t *ptl0_create(int flags); |
40 | static pte_t *ptl0_create(int flags); |
| 41 | 41 | ||
| - | 42 | static void pt_lock(as_t *as, bool lock); |
|
| - | 43 | static void pt_unlock(as_t *as, bool unlock); |
|
| - | 44 | ||
| 42 | as_operations_t as_pt_operations = { |
45 | as_operations_t as_pt_operations = { |
| 43 | .page_table_create = ptl0_create |
46 | .page_table_create = ptl0_create, |
| - | 47 | .page_table_lock = pt_lock, |
|
| - | 48 | .page_table_unlock = pt_unlock |
|
| 44 | }; |
49 | }; |
| 45 | 50 | ||
| 46 | /** Create PTL0. |
51 | /** Create PTL0. |
| 47 | * |
52 | * |
| 48 | * PTL0 of 4-level page table will be created for each address space. |
53 | * PTL0 of 4-level page table will be created for each address space. |
| Line 74... | Line 79... | ||
| 74 | interrupts_restore(ipl); |
79 | interrupts_restore(ipl); |
| 75 | } |
80 | } |
| 76 | 81 | ||
| 77 | return (pte_t *) KA2PA((__address) dst_ptl0); |
82 | return (pte_t *) KA2PA((__address) dst_ptl0); |
| 78 | } |
83 | } |
| - | 84 | ||
| - | 85 | /** Lock page tables. |
|
| - | 86 | * |
|
| - | 87 | * Lock only the address space. |
|
| - | 88 | * Interrupts must be disabled. |
|
| - | 89 | * |
|
| - | 90 | * @param as Address space. |
|
| - | 91 | * @param lock If false, do not attempt to lock the address space. |
|
| - | 92 | */ |
|
| - | 93 | void pt_lock(as_t *as, bool lock) |
|
| - | 94 | { |
|
| - | 95 | if (lock) |
|
| - | 96 | spinlock_lock(&as->lock); |
|
| - | 97 | } |
|
| - | 98 | ||
| - | 99 | /** Unlock page tables. |
|
| - | 100 | * |
|
| - | 101 | * Unlock the address space. |
|
| - | 102 | * Interrupts must be disabled. |
|
| - | 103 | * |
|
| - | 104 | * @param as Address space. |
|
| - | 105 | * @param unlock If false, do not attempt to unlock the address space. |
|
| - | 106 | */ |
|
| - | 107 | void pt_unlock(as_t *as, bool unlock) |
|
| - | 108 | { |
|
| - | 109 | if (unlock) |
|
| - | 110 | spinlock_unlock(&as->lock); |
|
| - | 111 | } |
|