/kernel/trunk/genarch/src/mm/as_ht.c |
---|
File deleted |
/kernel/trunk/genarch/src/mm/as_pt.c |
---|
File deleted |
/kernel/trunk/genarch/src/mm/page_pt.c |
---|
29,7 → 29,6 |
#include <genarch/mm/page_pt.h> |
#include <mm/page.h> |
#include <mm/frame.h> |
#include <mm/as.h> |
#include <arch/mm/page.h> |
#include <arch/mm/as.h> |
#include <arch/types.h> |
37,8 → 36,8 |
#include <arch/asm.h> |
#include <memstr.h> |
static void pt_mapping_insert(as_t *as, __address page, __address frame, int flags); |
static pte_t *pt_mapping_find(as_t *as, __address page); |
static void pt_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root); |
static pte_t *pt_mapping_find(as_t *as, __address page, __address root); |
page_operations_t page_pt_operations = { |
.mapping_insert = pt_mapping_insert, |
50,19 → 49,18 |
* Map virtual address 'page' to physical address 'frame' |
* using 'flags'. |
* |
* The address space must be locked and interrupts must be disabled. |
* |
* @param as Address space to wich page belongs. |
* @param as Ignored. |
* @param page Virtual address of the page to be mapped. |
* @param frame Physical address of memory frame to which the mapping is done. |
* @param flags Flags to be used for mapping. |
* @param root Explicit PTL0 address. |
*/ |
void pt_mapping_insert(as_t *as, __address page, __address frame, int flags) |
void pt_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root) |
{ |
pte_t *ptl0, *ptl1, *ptl2, *ptl3; |
__address newpt; |
ptl0 = (pte_t *) PA2KA((__address) as->page_table); |
ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS()); |
if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) { |
newpt = frame_alloc(FRAME_KA, ONE_FRAME, NULL); |
99,18 → 97,17 |
* |
* Find mapping for virtual page. |
* |
* The address space must be locked and interrupts must be disabled. |
* |
* @param as Address space to which page belongs. |
* @param as Ignored. |
* @param page Virtual page. |
* @param root PTL0 address if non-zero. |
* |
* @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise. |
*/ |
pte_t *pt_mapping_find(as_t *as, __address page) |
pte_t *pt_mapping_find(as_t *as, __address page, __address root) |
{ |
pte_t *ptl0, *ptl1, *ptl2, *ptl3; |
ptl0 = (pte_t *) PA2KA((__address) as->page_table); |
ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS()); |
if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) |
return NULL; |
/kernel/trunk/genarch/src/mm/page_ht.c |
---|
38,10 → 38,12 |
#include <synch/spinlock.h> |
#include <arch.h> |
#include <debug.h> |
#include <memstr.h> |
/** |
* This lock protects the page hash table. |
* This lock protects the page hash table. Note that software must |
* be still careful about ordering of writes to ensure consistent |
* view of the page hash table for hardware helpers such as VHPT |
* walker on ia64. |
*/ |
SPINLOCK_INITIALIZE(page_ht_lock); |
51,27 → 53,28 |
*/ |
pte_t *page_ht = NULL; |
static void ht_mapping_insert(as_t *as, __address page, __address frame, int flags); |
static pte_t *ht_mapping_find(as_t *as, __address page); |
static void ht_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root); |
static pte_t *ht_mapping_find(as_t *as, __address page, __address root); |
page_operations_t page_ht_operations = { |
.mapping_insert = ht_mapping_insert, |
.mapping_find = ht_mapping_find, |
.mapping_find = ht_mapping_find |
}; |
/** Map page to frame using page hash table. |
* |
* Map virtual address 'page' to physical address 'frame' |
* using 'flags'. |
* using 'flags'. In order not to disturb hardware searching, |
* new mappings are appended to the end of the collision |
* chain. |
* |
* The address space must be locked and interruptsmust be disabled. |
* |
* @param as Address space to which page belongs. |
* @param as Address space to which page belongs. Must be locked prior the call. |
* @param page Virtual address of the page to be mapped. |
* @param frame Physical address of memory frame to which the mapping is done. |
* @param flags Flags to be used for mapping. |
* @param root Ignored. |
*/ |
void ht_mapping_insert(as_t *as, __address page, __address frame, int flags) |
void ht_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root) |
{ |
pte_t *t, *u; |
ipl_t ipl; |
118,14 → 121,15 |
* |
* Find mapping for virtual page. |
* |
* The address space must be locked and interrupts must be disabled. |
* Interrupts must be disabled. |
* |
* @param as Address space to wich page belongs. |
* @param as Address space to wich page belongs. Must be locked prior the call. |
* @param page Virtual page. |
* @param root Ignored. |
* |
* @return NULL if there is no such mapping; requested mapping otherwise. |
*/ |
pte_t *ht_mapping_find(as_t *as, __address page) |
pte_t *ht_mapping_find(as_t *as, __address page, __address root) |
{ |
pte_t *t; |
/kernel/trunk/genarch/src/acpi/acpi.c |
---|
79,7 → 79,7 |
static void map_sdt(struct acpi_sdt_header *sdt) |
{ |
page_mapping_insert(AS_KERNEL, (__address) sdt, (__address) sdt, PAGE_NOT_CACHEABLE); |
page_mapping_insert(AS_KERNEL, (__address) sdt, (__address) sdt, PAGE_NOT_CACHEABLE, 0); |
map_structure((__address) sdt, sdt->length); |
} |