Changeset c1982e45 in mainline
- Timestamp:
- 2006-05-20T21:11:08Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 125e944
- Parents:
- 1068f6a
- Files:
-
- 1 deleted
- 9 edited
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 } -
genarch/Makefile.inc
r1068f6a rc1982e45 68 68 genarch/src/fb/fb.c 69 69 DEFS += -DCONFIG_FB 70 ifneq ($(CONFIG_FB_MAP_ARCH),y)71 GENARCH_SOURCES += \72 genarch/src/fb/fb_map.c73 endif74 70 endif 75 71 -
genarch/include/fb/fb.h
r1068f6a rc1982e45 36 36 void fb_init(__address addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan); 37 37 38 /* To be implemented by architecture. */39 void fb_map_arch(__address virtaddr, __address physaddr, size_t size);40 41 38 #endif -
genarch/src/fb/fb.c
r1068f6a rc1982e45 33 33 #include <sysinfo/sysinfo.h> 34 34 #include <mm/slab.h> 35 #include <bitops.h>36 35 #include <align.h> 37 36 #include <panic.h> … … 350 349 351 350 unsigned int fbsize = scan * y; 352 unsigned int fborder;353 354 if (fbsize <= FRAME_SIZE)355 fborder = 0;356 else357 fborder = (fnzb32(fbsize - 1) + 1) - FRAME_WIDTH;358 351 359 352 /* Map the framebuffer */ 360 fbaddress = (__u8 *) PA2KA(PFN2ADDR(frame_alloc(fborder, FRAME_KA))); 361 362 fb_map_arch((__address) fbaddress, (__address) addr, fbsize); 353 fbaddress = (__u8 *) hw_map((__address) addr, fbsize); 363 354 364 355 xres = x; -
generic/include/mm/page.h
r1068f6a rc1982e45 79 79 extern pte_t *page_table_create(int flags); 80 80 extern void map_structure(__address s, size_t size); 81 extern __address hw_map(__address physaddr, size_t size); 81 82 82 83 #endif
Note:
See TracChangeset
for help on using the changeset viewer.