- Timestamp:
- 2006-05-20T21:11:08Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 125e944
- Parents:
- 1068f6a
- Location:
- arch
- Files:
-
- 5 edited
-
amd64/src/mm/page.c (modified) (4 diffs)
-
ia32/src/mm/page.c (modified) (3 diffs)
-
sparc64/Makefile.inc (modified) (1 diff)
-
sparc64/src/console.c (modified) (1 diff)
-
sparc64/src/mm/page.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/mm/page.c
r1068f6a rc1982e45 72 72 SET_FRAME_FLAGS_ARCH(ptl3, PTL3_INDEX_ARCH(page), PAGE_WRITE | PAGE_EXEC); \ 73 73 } 74 75 74 76 void page_arch_init(void) 75 77 { … … 108 110 } 109 111 } 112 110 113 111 114 /** Identity page mapper … … 162 165 } 163 166 167 164 168 void page_fault(int n, istate_t *istate) 165 169 { … … 173 177 } 174 178 } 179 180 181 __address hw_map(__address physaddr, size_t size) 182 { 183 if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) 184 panic("Unable to map physical memory %p (%d bytes)", physaddr, size) 185 186 __address virtaddr = PA2KA(last_frame); 187 pfn_t i; 188 for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) 189 page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE); 190 191 last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); 192 193 return virtaddr; 194 } -
arch/ia32/src/mm/page.c
r1068f6a rc1982e45 34 34 #include <mm/as.h> 35 35 #include <arch/types.h> 36 #include <align.h> 36 37 #include <config.h> 37 38 #include <func.h> … … 42 43 #include <print.h> 43 44 #include <interrupt.h> 45 44 46 45 47 void page_arch_init(void) … … 70 72 paging_on(); 71 73 } 74 75 76 __address hw_map(__address physaddr, size_t size) 77 { 78 if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) 79 panic("Unable to map physical memory %p (%d bytes)", physaddr, size) 80 81 __address virtaddr = PA2KA(last_frame); 82 pfn_t i; 83 for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) 84 page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE); 85 86 last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); 87 88 return virtaddr; 89 } -
arch/sparc64/Makefile.inc
r1068f6a rc1982e45 66 66 67 67 CONFIG_FB = y 68 CONFIG_FB_MAP_ARCH = y69 68 70 69 ## Compile with support for i8042 controller. -
arch/sparc64/src/console.c
r1068f6a rc1982e45 70 70 mutex_initialize(&canwork); 71 71 ofw_console_active = 1; 72 }73 74 void fb_map_arch(__address virtaddr, __address physaddr, size_t size)75 {76 dtlb_insert_mapping(virtaddr, physaddr, PAGESIZE_512K, true, false);77 dtlb_insert_mapping(virtaddr + 512*1024, physaddr + 512*1024, PAGESIZE_512K, true, false);78 72 } 79 73 -
arch/sparc64/src/mm/page.c
r1068f6a rc1982e45 28 28 29 29 #include <arch/mm/page.h> 30 #include <arch/mm/tlb.h> 30 31 #include <genarch/mm/page_ht.h> 32 #include <mm/frame.h> 33 #include <bitops.h> 31 34 32 35 void page_arch_init(void) … … 34 37 page_mapping_operations = &ht_mapping_operations; 35 38 } 39 40 __address hw_map(__address physaddr, size_t size) 41 { 42 unsigned int order; 43 44 if (size <= FRAME_SIZE) 45 order = 0; 46 else 47 order = (fnzb32(size - 1) + 1) - FRAME_WIDTH; 48 49 __address virtaddr = PA2KA(PFN2ADDR(frame_alloc(order, FRAME_KA))); 50 51 dtlb_insert_mapping(virtaddr, physaddr, PAGESIZE_512K, true, false); 52 dtlb_insert_mapping(virtaddr + 512 * 1024, physaddr + 512 * 1024, PAGESIZE_512K, true, false); 53 54 return virtaddr; 55 }
Note:
See TracChangeset
for help on using the changeset viewer.
