Changeset 677a6d5 in mainline
- Timestamp:
- 2006-01-08T16:24:32Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f275cb3
- Parents:
- 59adc2b
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/mm/page.c
r59adc2b r677a6d5 57 57 */ 58 58 for (cur = 0; cur < last_frame; cur += FRAME_SIZE) { 59 page_mapping_insert(PA2KA(cur), cur, PAGE_CACHEABLE | PAGE_EXEC, KA2PA(dba));59 page_mapping_insert(PA2KA(cur), 0, cur, PAGE_CACHEABLE | PAGE_EXEC, KA2PA(dba)); 60 60 } 61 61 -
arch/ia32/src/drivers/ega.c
r59adc2b r677a6d5 30 30 #include <putchar.h> 31 31 #include <mm/page.h> 32 #include <mm/asid.h> 32 33 #include <arch/mm/page.h> 33 34 #include <synch/spinlock.h> … … 59 60 __u8 hi, lo; 60 61 61 page_mapping_insert(PA2KA(VIDEORAM), VIDEORAM, PAGE_NOT_CACHEABLE, 0);62 page_mapping_insert(PA2KA(VIDEORAM), ASID_KERNEL, VIDEORAM, PAGE_NOT_CACHEABLE, 0); 62 63 outb(0x3d4,0xe); 63 64 hi = inb(0x3d5); -
arch/ia32/src/mm/page.c
r59adc2b r677a6d5 32 32 #include <mm/frame.h> 33 33 #include <mm/page.h> 34 #include <mm/asid.h> 34 35 #include <arch/types.h> 35 36 #include <config.h> … … 61 62 */ 62 63 for (cur = 0; cur < last_frame; cur += FRAME_SIZE) 63 page_mapping_insert(PA2KA(cur), cur, PAGE_CACHEABLE, KA2PA(dba));64 page_mapping_insert(PA2KA(cur), ASID_KERNEL, cur, PAGE_CACHEABLE, KA2PA(dba)); 64 65 65 66 exc_register(14, "page_fault", page_fault); -
arch/ia32/src/smp/smp.c
r59adc2b r677a6d5 44 44 #include <mm/page.h> 45 45 #include <mm/heap.h> 46 #include <mm/asid.h> 46 47 #include <print.h> 47 48 #include <memstr.h> … … 64 65 65 66 if (config.cpu_count > 1) { 66 page_mapping_insert((__address)l_apic, (__address)l_apic,67 page_mapping_insert((__address)l_apic, ASID_KERNEL, (__address)l_apic, 67 68 PAGE_NOT_CACHEABLE, 0); 68 page_mapping_insert((__address) io_apic, 69 page_mapping_insert((__address) io_apic, ASID_KERNEL, 69 70 (__address) io_apic, 70 71 PAGE_NOT_CACHEABLE, 0); -
arch/mips32/src/mm/tlb.c
r59adc2b r677a6d5 337 337 * Handler cannot succeed if badvaddr has no mapping. 338 338 */ 339 pte = page_mapping_find(badvaddr, 0);339 pte = page_mapping_find(badvaddr, VM->asid, 0); 340 340 if (!pte) { 341 341 printf("No such mapping.\n"); -
genarch/src/acpi/acpi.c
r59adc2b r677a6d5 30 30 #include <genarch/acpi/madt.h> 31 31 #include <arch/bios/bios.h> 32 32 #include <mm/asid.h> 33 33 #include <mm/page.h> 34 34 #include <print.h> … … 80 80 static void map_sdt(struct acpi_sdt_header *sdt) 81 81 { 82 page_mapping_insert((__address) sdt, (__address) sdt, PAGE_NOT_CACHEABLE, 0);82 page_mapping_insert((__address) sdt, ASID_KERNEL, (__address) sdt, PAGE_NOT_CACHEABLE, 0); 83 83 map_structure((__address) sdt, sdt->length); 84 84 } -
genarch/src/mm/page_ht.c
r59adc2b r677a6d5 30 30 #include <mm/page.h> 31 31 #include <mm/frame.h> 32 #include <arch/mm/asid.h> 32 33 #include <arch/types.h> 33 34 #include <typedefs.h> 34 35 #include <arch/asm.h> 35 36 36 static void ht_mapping_insert(__address page, __address frame, int flags, __address root);37 static pte_t *ht_mapping_find(__address page, __address root);37 static void ht_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root); 38 static pte_t *ht_mapping_find(__address page, asid_t asid, __address root); 38 39 39 40 page_operations_t page_ht_operations = { … … 48 49 * 49 50 * @param page Virtual address of the page to be mapped. 51 * @param asid Address space to which page belongs. 50 52 * @param frame Physical address of memory frame to which the mapping is done. 51 53 * @param flags Flags to be used for mapping. 52 54 * @param root Explicit PTL0 address. 53 55 */ 54 void ht_mapping_insert(__address page, __address frame, int flags, __address root)56 void ht_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root) 55 57 { 56 58 } … … 61 63 * 62 64 * @param page Virtual page. 65 * @param asid Address space to wich page belongs. 63 66 * @param root PTL0 address if non-zero. 64 67 * 65 68 * @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise. 66 69 */ 67 pte_t *ht_mapping_find(__address page, __address root)70 pte_t *ht_mapping_find(__address page, asid_t asid, __address root) 68 71 { 69 72 return NULL; -
genarch/src/mm/page_pt.c
r59adc2b r677a6d5 31 31 #include <mm/frame.h> 32 32 #include <arch/mm/page.h> 33 #include <arch/mm/asid.h> 33 34 #include <arch/types.h> 34 35 #include <typedefs.h> … … 36 37 #include <memstr.h> 37 38 38 static void pt_mapping_insert(__address page, __address frame, int flags, __address root);39 static pte_t *pt_mapping_find(__address page, __address root);39 static void pt_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root); 40 static pte_t *pt_mapping_find(__address page, asid_t asid, __address root); 40 41 41 42 page_operations_t page_pt_operations = { … … 50 51 * 51 52 * @param page Virtual address of the page to be mapped. 53 * @param asid Ignored. 52 54 * @param frame Physical address of memory frame to which the mapping is done. 53 55 * @param flags Flags to be used for mapping. 54 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 60 pte_t *ptl0, *ptl1, *ptl2, *ptl3; … … 97 99 * 98 100 * @param page Virtual page. 101 * @param asid Ignored. 99 102 * @param root PTL0 address if non-zero. 100 103 * 101 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 108 pte_t *ptl0, *ptl1, *ptl2, *ptl3; -
generic/include/mm/page.h
r59adc2b r677a6d5 30 30 #define __PAGE_H__ 31 31 32 #include <arch/mm/asid.h> 32 33 #include <arch/types.h> 33 34 #include <typedefs.h> … … 57 58 58 59 struct page_operations { 59 void (* mapping_insert)(__address page, __address frame, int flags, __address root);60 pte_t *(* mapping_find)(__address page, __address root);60 void (* mapping_insert)(__address page, asid_t asid, __address frame, int flags, __address root); 61 pte_t *(* mapping_find)(__address page, asid_t asid, __address root); 61 62 }; 62 63 typedef struct page_operations page_operations_t; … … 65 66 66 67 extern void page_init(void); 67 extern void page_mapping_insert(__address page, __address frame, int flags, __address root);68 extern pte_t *page_mapping_find(__address page, __address root);68 extern void page_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root); 69 extern pte_t *page_mapping_find(__address page, asid_t asid, __address root); 69 70 extern void map_structure(__address s, size_t size); 70 71 -
generic/src/mm/page.c
r59adc2b r677a6d5 28 28 29 29 #include <mm/page.h> 30 #include <arch/mm/page.h> 31 #include <arch/mm/asid.h> 32 #include <mm/asid.h> 30 33 #include <mm/frame.h> 31 #include <arch/mm/page.h>32 34 #include <arch/types.h> 33 35 #include <typedefs.h> … … 35 37 #include <memstr.h> 36 38 #include <debug.h> 39 #include <arch.h> 37 40 38 41 /** Virtual operations for page subsystem. */ … … 42 45 { 43 46 page_arch_init(); 44 page_mapping_insert(0x0, 0 x0, PAGE_NOT_PRESENT, 0);47 page_mapping_insert(0x0, 0, 0x0, PAGE_NOT_PRESENT, 0); 45 48 } 46 49 … … 62 65 63 66 for (i = 0; i < cnt; i++) 64 page_mapping_insert(s + i*PAGE_SIZE, s + i*PAGE_SIZE, PAGE_NOT_CACHEABLE, 0);67 page_mapping_insert(s + i*PAGE_SIZE, ASID_KERNEL, s + i*PAGE_SIZE, PAGE_NOT_CACHEABLE, 0); 65 68 66 69 } … … 72 75 * 73 76 * @param page Virtual address of the page to be mapped. 77 * @param asid Address space to wich page belongs. 74 78 * @param frame Physical address of memory frame to which the mapping is done. 75 79 * @param flags Flags to be used for mapping. 76 80 * @param root Explicit PTL0 address. 77 81 */ 78 void page_mapping_insert(__address page, __address frame, int flags, __address root)82 void page_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root) 79 83 { 80 84 ASSERT(page_operations); 81 85 ASSERT(page_operations->mapping_insert); 82 86 83 page_operations->mapping_insert(page, frame, flags, root);87 page_operations->mapping_insert(page, asid, frame, flags, root); 84 88 } 85 89 … … 89 93 * 90 94 * @param page Virtual page. 95 * @param asid Address space to wich page belongs. 91 96 * @param root PTL0 address if non-zero. 92 97 * 93 98 * @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise. 94 99 */ 95 pte_t *page_mapping_find(__address page, __address root)100 pte_t *page_mapping_find(__address page, asid_t asid, __address root) 96 101 { 97 102 ASSERT(page_operations); 98 103 ASSERT(page_operations->mapping_find); 99 104 100 return page_operations->mapping_find(page, root);105 return page_operations->mapping_find(page, asid, root); 101 106 } -
generic/src/mm/vm.c
r59adc2b r677a6d5 163 163 ASSERT(m->ptl0); 164 164 for (i=0; i<a->size; i++) 165 page_mapping_insert(a->address + i*PAGE_SIZE, a->mapping[i], flags, (__address) m->ptl0);165 page_mapping_insert(a->address + i*PAGE_SIZE, m->asid, a->mapping[i], flags, (__address) m->ptl0); 166 166 167 167 spinlock_unlock(&a->lock); … … 181 181 ASSERT(m->ptl0); 182 182 for (i=0; i<a->size; i++) 183 page_mapping_insert(a->address + i*PAGE_SIZE, 0, PAGE_NOT_PRESENT, (__address) m->ptl0);183 page_mapping_insert(a->address + i*PAGE_SIZE, 0, 0, PAGE_NOT_PRESENT, (__address) m->ptl0); 184 184 185 185 spinlock_unlock(&a->lock); -
test/mm/mapping1/test.c
r59adc2b r677a6d5 30 30 #include <mm/page.h> 31 31 #include <mm/frame.h> 32 #include <mm/asid.h> 32 33 #include <arch/mm/page.h> 33 34 #include <arch/types.h> … … 56 57 57 58 printf("Mapping virtual address %P to physical address %P.\n", PAGE0, KA2PA(frame0)); 58 page_mapping_insert(PAGE0, KA2PA(frame0), PAGE_PRESENT | PAGE_WRITE, 0);59 page_mapping_insert(PAGE0, ASID_KERNEL, KA2PA(frame0), PAGE_PRESENT | PAGE_WRITE, 0); 59 60 printf("Mapping virtual address %P to physical address %P.\n", PAGE1, KA2PA(frame1)); 60 page_mapping_insert(PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE, 0);61 page_mapping_insert(PAGE1, ASID_KERNEL, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE, 0); 61 62 62 63 printf("Value at virtual address %P is %L.\n", PAGE0, v0 = *((__u32 *) PAGE0));
Note:
See TracChangeset
for help on using the changeset viewer.