Changeset 00aece0 in mainline for kernel/arch/mips32/src
- Timestamp:
- 2012-02-18T16:47:38Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4449c6c
- Parents:
- bd5f3b7 (diff), f943dd3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- kernel/arch/mips32/src
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/mips32.c
rbd5f3b7 r00aece0 34 34 35 35 #include <arch.h> 36 #include <arch/cp0.h> 37 #include <arch/exception.h> 38 #include <arch/debug.h> 39 #include <mm/as.h> 36 #include <typedefs.h> 37 #include <errno.h> 38 #include <interrupt.h> 39 #include <macros.h> 40 #include <str.h> 41 #include <memstr.h> 40 42 #include <userspace.h> 41 #include <memstr.h>42 #include <proc/thread.h>43 #include <abi/proc/uarg.h>44 #include <print.h>45 43 #include <console/console.h> 46 44 #include <syscall/syscall.h> 47 45 #include <sysinfo/sysinfo.h> 48 #include <arch/interrupt.h> 49 #include <interrupt.h> 50 #include <console/chardev.h> 51 #include <arch/barrier.h> 46 #include <arch/debug.h> 52 47 #include <arch/debugger.h> 48 #include <arch/drivers/msim.h> 53 49 #include <genarch/fb/fb.h> 54 #include <abi/fb/visuals.h>55 50 #include <genarch/drivers/dsrln/dsrlnin.h> 56 51 #include <genarch/drivers/dsrln/dsrlnout.h> 57 52 #include <genarch/srln/srln.h> 58 #include <macros.h>59 #include <config.h>60 #include <str.h>61 #include <arch/drivers/msim.h>62 #include <arch/asm/regname.h>63 53 64 54 /* Size of the code jumping to the exception handler code … … 88 78 size_t i; 89 79 for (i = 0; i < init.cnt; i++) { 90 init.tasks[i]. addr = (uintptr_t) bootinfo->tasks[i].addr;80 init.tasks[i].paddr = KA2PA(bootinfo->tasks[i].addr); 91 81 init.tasks[i].size = bootinfo->tasks[i].size; 92 82 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, … … 206 196 sysinfo_set_item_val("kbd", NULL, true); 207 197 sysinfo_set_item_val("kbd.inr", NULL, MSIM_KBD_IRQ); 208 sysinfo_set_item_val("kbd.address.virtual", NULL, MSIM_KBD_ADDRESS); 198 sysinfo_set_item_val("kbd.address.physical", NULL, 199 PA2KA(MSIM_KBD_ADDRESS)); 209 200 #endif 210 201 } … … 248 239 * possible to have it separately in the future. 249 240 */ 250 sysarg_t sys_tls_set( sysarg_t addr)251 { 252 return 0;241 sysarg_t sys_tls_set(uintptr_t addr) 242 { 243 return EOK; 253 244 } 254 245 -
kernel/arch/mips32/src/mm/frame.c
rbd5f3b7 r00aece0 123 123 for (i = 0; i < init.cnt; i++) 124 124 if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE, 125 KA2PA(init.tasks[i].addr), init.tasks[i].size)) {125 init.tasks[i].paddr, init.tasks[i].size)) { 126 126 safe = false; 127 127 break; … … 131 131 } 132 132 133 static void frame_add_region(pfn_t start_frame, pfn_t end_frame) 134 { 135 if (end_frame > start_frame) { 136 /* Convert 1M frames to 16K frames */ 137 pfn_t first = ADDR2PFN(start_frame << ZERO_PAGE_WIDTH); 138 pfn_t count = ADDR2PFN((end_frame - start_frame) << ZERO_PAGE_WIDTH); 139 133 static void frame_add_region(pfn_t start_frame, pfn_t end_frame, bool low) 134 { 135 if (end_frame <= start_frame) 136 return; 137 138 uintptr_t base = start_frame << ZERO_PAGE_WIDTH; 139 size_t size = (end_frame - start_frame) << ZERO_PAGE_WIDTH; 140 141 if (!frame_adjust_zone_bounds(low, &base, &size)) 142 return; 143 144 pfn_t first = ADDR2PFN(base); 145 size_t count = SIZE2FRAMES(size); 146 pfn_t conf_frame; 147 148 if (low) { 140 149 /* Interrupt vector frame is blacklisted */ 141 pfn_t conf_frame;142 150 if (first == 0) 143 151 conf_frame = 1; 144 152 else 145 153 conf_frame = first; 146 147 zone_create(first, count, conf_frame, 0); 148 149 if (phys_regions_count < MAX_REGIONS) { 150 phys_regions[phys_regions_count].start = first; 151 phys_regions[phys_regions_count].count = count; 152 phys_regions_count++; 153 } 154 zone_create(first, count, conf_frame, 155 ZONE_AVAILABLE | ZONE_LOWMEM); 156 } else { 157 conf_frame = zone_external_conf_alloc(count); 158 if (conf_frame != 0) 159 zone_create(first, count, conf_frame, 160 ZONE_AVAILABLE | ZONE_HIGHMEM); 161 } 162 163 if (phys_regions_count < MAX_REGIONS) { 164 phys_regions[phys_regions_count].start = first; 165 phys_regions[phys_regions_count].count = count; 166 phys_regions_count++; 154 167 } 155 168 } … … 165 178 * 166 179 */ 167 void frame_ arch_init(void)180 void frame_low_arch_init(void) 168 181 { 169 182 ipl_t ipl = interrupts_disable(); … … 224 237 225 238 if (!avail) { 226 frame_add_region(start_frame, frame );239 frame_add_region(start_frame, frame, true); 227 240 start_frame = frame + 1; 228 241 avail = true; … … 230 243 } 231 244 232 frame_add_region(start_frame, frame );245 frame_add_region(start_frame, frame, true); 233 246 234 247 /* Blacklist interrupt vector frame */ … … 246 259 } 247 260 261 void frame_high_arch_init(void) 262 { 263 } 248 264 249 265 void physmem_print(void) -
kernel/arch/mips32/src/mm/page.c
rbd5f3b7 r00aece0 41 41 { 42 42 page_mapping_operations = &pt_mapping_operations; 43 } 44 45 /** Map device into kernel space 46 * - on mips, all devices are already mapped into kernel space, 47 * translate the physical address to uncached area 48 */ 49 uintptr_t hw_map(uintptr_t physaddr, size_t size) 50 { 51 return physaddr + 0xa0000000; 43 as_switch(NULL, AS_KERNEL); 52 44 } 53 45 -
kernel/arch/mips32/src/mm/tlb.c
rbd5f3b7 r00aece0 95 95 96 96 badvaddr = cp0_badvaddr_read(); 97 98 mutex_lock(&AS->lock);99 97 asid = AS->asid; 100 mutex_unlock(&AS->lock);101 98 102 99 pte = find_mapping_and_check(badvaddr, PF_ACCESS_READ, istate, &pfrc);
Note:
See TracChangeset
for help on using the changeset viewer.
