Changeset ae318d3 in mainline
- Timestamp:
- 2009-02-16T18:50:48Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 06da55b
- Parents:
- 17f168e
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/include/mm/frame.h
r17f168e rae318d3 45 45 #ifndef __ASM__ 46 46 extern uintptr_t last_frame; 47 extern uintptr_t end_frame; 47 48 extern void frame_arch_init(void); 48 49 extern void physmem_print(void); -
kernel/arch/amd64/src/mm/page.c
r17f168e rae318d3 215 215 } 216 216 217 void hw_area(uintptr_t *physaddr, pfn_t *frames) 218 { 219 *physaddr = end_frame; 220 *frames = ADDR2PFN(0xfffffffffffff - end_frame); 221 } 222 217 223 /** @} 218 224 */ -
kernel/arch/arm32/include/mm/frame.h
r17f168e rae318d3 52 52 53 53 extern uintptr_t last_frame; 54 extern uintptr_t end_frame; 54 55 55 56 extern void frame_arch_init(void); -
kernel/arch/arm32/src/mm/frame.c
r17f168e rae318d3 42 42 /** Address of the last frame in the memory. */ 43 43 uintptr_t last_frame = 0; 44 uintptr_t end_frame = 0; 44 45 45 46 /** Creates memory zones. */ … … 50 51 BOOT_PAGE_TABLE_START_FRAME + BOOT_PAGE_TABLE_SIZE_IN_FRAMES, 0); 51 52 last_frame = machine_get_memory_size(); 52 53 end_frame = last_frame; 54 53 55 /* blacklist boot page table */ 54 56 frame_mark_unavailable(BOOT_PAGE_TABLE_START_FRAME, -
kernel/arch/arm32/src/mm/page.c
r17f168e rae318d3 107 107 } 108 108 109 void hw_area(uintptr_t *physaddr, pfn_t *frames) 110 { 111 *physaddr = end_frame; 112 *frames = ADDR2PFN(0xffffffff - end_frame); 113 } 114 109 115 /** @} 110 116 */ -
kernel/arch/ia32/include/mm/frame.h
r17f168e rae318d3 45 45 46 46 extern uintptr_t last_frame; 47 extern uintptr_t end_frame; 47 48 48 49 extern void frame_arch_init(void); -
kernel/arch/ia32/src/mm/frame.c
r17f168e rae318d3 51 51 52 52 uintptr_t last_frame = 0; 53 uintptr_t end_frame = 0; 53 54 54 55 static void init_e820_memory(pfn_t minconf) … … 74 75 last_frame = 75 76 ALIGN_UP(e820table[i].base_address + e820table[i].size, FRAME_SIZE); 76 } 77 } 77 78 } 79 80 end_frame = last_frame; 78 81 } 79 82 … … 114 117 if (config.cpu_active == 1) { 115 118 minconf = 1; 119 116 120 #ifdef CONFIG_SMP 117 121 minconf = max(minconf, … … 120 124 #endif 121 125 init_e820_memory(minconf); 122 126 123 127 /* Reserve frame 0 (BIOS data) */ 124 128 frame_mark_unavailable(0, 1); -
kernel/arch/ia32/src/mm/page.c
r17f168e rae318d3 94 94 } 95 95 96 void hw_area(uintptr_t *physaddr, pfn_t *frames) 97 { 98 *physaddr = end_frame; 99 *frames = ADDR2PFN(0xffffffff - end_frame); 100 } 101 96 102 void page_fault(int n __attribute__((unused)), istate_t *istate) 97 103 { … … 103 109 if (istate->error_word & PFERR_CODE_RSVD) 104 110 panic("Reserved bit set in page directory."); 105 111 106 112 if (istate->error_word & PFERR_CODE_RW) 107 113 access = PF_ACCESS_WRITE; -
kernel/arch/ia64/include/mm/frame.h
r17f168e rae318d3 45 45 46 46 extern uintptr_t last_frame; 47 extern uintptr_t end_frame; 47 48 48 49 extern void frame_arch_init(void); -
kernel/arch/ia64/src/mm/frame.c
r17f168e rae318d3 52 52 53 53 uintptr_t last_frame = 0; 54 uintptr_t end_frame = 0; 54 55 55 56 void frame_arch_init(void) -
kernel/arch/ia64/src/mm/page.c
r17f168e rae318d3 275 275 } 276 276 277 void hw_area(uintptr_t *physaddr, pfn_t *frames) 278 { 279 *physaddr = end_frame; 280 *frames = ADDR2PFN(0x7fffffffffffffffUL - end_frame); 281 } 282 277 283 /** @} 278 284 */ -
kernel/arch/mips32/include/mm/frame.h
r17f168e rae318d3 36 36 #define KERN_mips32_FRAME_H_ 37 37 38 #define FRAME_WIDTH 14/* 16K */39 #define FRAME_SIZE 38 #define FRAME_WIDTH 14 /* 16K */ 39 #define FRAME_SIZE (1 << FRAME_WIDTH) 40 40 41 41 #ifdef KERNEL 42 42 #ifndef __ASM__ 43 43 44 #include <typedefs.h> 45 44 46 extern void frame_arch_init(void); 45 47 extern void physmem_print(void); 48 49 extern uintptr_t end_frame; 46 50 47 51 #endif /* __ASM__ */ -
kernel/arch/mips32/src/drivers/msim.c
r17f168e rae318d3 42 42 #include <ddi/ddi.h> 43 43 44 static parea_t msim_parea;45 44 static chardev_t console; 46 45 static irq_t msim_irq; … … 157 156 sysinfo_set_item_val("kbd.address.virtual", NULL, MSIM_KBD_ADDRESS); 158 157 159 msim_parea.pbase = KA2PA(MSIM_VIDEORAM);160 msim_parea.vbase = MSIM_VIDEORAM;161 msim_parea.frames = 1;162 msim_parea.cacheable = false;163 ddi_parea_register(&msim_parea);164 165 158 sysinfo_set_item_val("fb", NULL, true); 166 159 sysinfo_set_item_val("fb.kind", NULL, 3); -
kernel/arch/mips32/src/mm/frame.c
r17f168e rae318d3 65 65 static count_t phys_regions_count = 0; 66 66 static phys_region_t phys_regions[MAX_REGIONS]; 67 68 uintptr_t end_frame = 0; 67 69 68 70 … … 237 239 } 238 240 239 frame_add_region(start_frame, frame); 241 end_frame = frame; 242 243 frame_add_region(start_frame, end_frame); 240 244 241 245 /* Blacklist interrupt vector frame */ -
kernel/arch/mips32/src/mm/page.c
r17f168e rae318d3 27 27 */ 28 28 29 /** @addtogroup mips32mm 29 /** @addtogroup mips32mm 30 30 * @{ 31 31 */ … … 36 36 #include <genarch/mm/page_pt.h> 37 37 #include <mm/page.h> 38 #include <mm/frame.h> 38 39 39 40 void page_arch_init(void) … … 51 52 } 52 53 54 void hw_area(uintptr_t *physaddr, pfn_t *frames) 55 { 56 *physaddr = end_frame; 57 *frames = ADDR2PFN(0xffffffff - end_frame); 58 } 59 53 60 /** @} 54 61 */ -
kernel/arch/ppc32/include/mm/frame.h
r17f168e rae318d3 42 42 #ifndef __ASM__ 43 43 44 #include <arch/types.h> 44 #include <arch/types.h> 45 45 46 46 extern uintptr_t last_frame; 47 extern uintptr_t end_frame; 47 48 48 49 extern void frame_arch_init(void); -
kernel/arch/ppc32/src/mm/frame.c
r17f168e rae318d3 41 41 42 42 uintptr_t last_frame = 0; 43 uintptr_t end_frame = 0; 43 44 44 45 void physmem_print(void) … … 75 76 last_frame = ALIGN_UP(bootinfo.memmap.zones[i].start + bootinfo.memmap.zones[i].size, FRAME_SIZE); 76 77 } 77 78 79 end_frame = last_frame; 80 78 81 /* First is exception vector, second is 'implementation specific', 79 82 third and fourth is reserved, other contain real mode code */ -
kernel/arch/ppc32/src/mm/page.c
r17f168e rae318d3 64 64 } 65 65 66 void hw_area(uintptr_t *physaddr, pfn_t *frames) 67 { 68 *physaddr = end_frame; 69 *frames = ADDR2PFN(0xffffffff - end_frame); 70 } 71 66 72 /** @} 67 73 */ -
kernel/arch/sparc64/include/mm/frame.h
r17f168e rae318d3 74 74 75 75 extern uintptr_t last_frame; 76 extern uintptr_t end_frame; 76 77 extern void frame_arch_init(void); 77 78 #define physmem_print() -
kernel/arch/sparc64/src/drivers/sgcn.c
r17f168e rae318d3 162 162 163 163 /** 164 * Registers the physical area of the SRAM so that the userspace SGCN 165 * driver can map it. Moreover, it sets some sysinfo values (SRAM address 166 * and SRAM size). 167 */ 168 static void register_sram_parea(uintptr_t sram_begin_physical) 169 { 170 static parea_t sram_parea; 171 sram_parea.pbase = sram_begin_physical; 172 sram_parea.vbase = (uintptr_t) sram_begin; 173 sram_parea.frames = MAPPED_AREA_SIZE / FRAME_SIZE; 174 sram_parea.cacheable = false; 175 ddi_parea_register(&sram_parea); 176 164 * Set some sysinfo values (SRAM address and SRAM size). 165 */ 166 static void register_sram(uintptr_t sram_begin_physical) 167 { 177 168 sysinfo_set_item_val("sram.area.size", NULL, MAPPED_AREA_SIZE); 178 169 sysinfo_set_item_val("sram.address.physical", NULL, … … 212 203 sram_begin = hw_map(sram_begin_physical, MAPPED_AREA_SIZE); 213 204 214 register_sram _parea(sram_begin_physical);205 register_sram(sram_begin_physical); 215 206 } 216 207 -
kernel/arch/sparc64/src/mm/frame.c
r17f168e rae318d3 42 42 43 43 uintptr_t last_frame = NULL; 44 uintptr_t end_frame = NULL; 44 45 45 46 /** Create memory zones according to information stored in bootinfo. … … 81 82 } 82 83 84 end_frame = last_frame; 83 85 } 84 86 -
kernel/arch/sparc64/src/mm/page.c
r17f168e rae318d3 148 148 sizemap[order].pagesize_code, true, false); 149 149 150 #ifdef CONFIG_SMP 150 #ifdef CONFIG_SMP 151 151 /* 152 152 * Second, save the information about the mapping for APs. … … 165 165 } 166 166 167 void hw_area(uintptr_t *physaddr, pfn_t *frames) 168 { 169 *physaddr = end_frame; 170 *frames = ADDR2PFN(0x7ffffffffff - end_frame); 171 } 172 167 173 /** @} 168 174 */ 169 -
kernel/genarch/src/drivers/ega/ega.c
r17f168e rae318d3 54 54 * Simple and short. Function for displaying characters and "scrolling". 55 55 */ 56 57 static parea_t ega_parea; /**< Physical memory area for EGA video RAM. */58 56 59 57 SPINLOCK_INITIALIZE(egalock); … … 153 151 stdout = &ega_console; 154 152 155 ega_parea.pbase = videoram_phys;156 ega_parea.vbase = (uintptr_t) videoram;157 ega_parea.frames = 1;158 ega_parea.cacheable = false;159 ddi_parea_register(&ega_parea);160 161 153 sysinfo_set_item_val("fb", NULL, true); 162 154 sysinfo_set_item_val("fb.kind", NULL, 2); -
kernel/genarch/src/fb/fb.c
r17f168e rae318d3 52 52 53 53 SPINLOCK_INITIALIZE(fb_lock); 54 55 /**< Physical memory area for fb. */56 static parea_t fb_parea;57 54 58 55 static uint8_t *fb_addr; … … 520 517 fb_addr = (uint8_t *) hw_map((uintptr_t) props->addr, fbsize); 521 518 522 fb_parea.pbase = (uintptr_t) props->addr + props->offset;523 fb_parea.vbase = (uintptr_t) fb_addr;524 fb_parea.frames = SIZE2FRAMES(fbsize);525 fb_parea.cacheable = false;526 ddi_parea_register(&fb_parea);527 528 519 sysinfo_set_item_val("fb", NULL, true); 529 520 sysinfo_set_item_val("fb.kind", NULL, 1); -
kernel/generic/include/ddi/ddi.h
r17f168e rae318d3 39 39 #include <arch/types.h> 40 40 #include <proc/task.h> 41 #include <adt/list.h> 41 42 42 43 /** Structure representing contiguous physical memory area. */ 43 44 typedef struct { 44 uintptr_t pbase; 45 uintptr_t vbase; /**< Virtual base ofthe area. */46 count_t frames; /**< Number of frames in the area. */47 bool cacheable; /**< Cacheability.*/45 uintptr_t pbase; /**< Physical base of the area. */ 46 pfn_t frames; /**< Number of frames in the area. */ 47 48 link_t link; /**< Linked list link */ 48 49 } parea_t; 49 50 -
kernel/generic/include/mm/page.h
r17f168e rae318d3 43 43 typedef struct { 44 44 void (* mapping_insert)(as_t *as, uintptr_t page, uintptr_t frame, 45 45 int flags); 46 46 void (* mapping_remove)(as_t *as, uintptr_t page); 47 47 pte_t *(* mapping_find)(as_t *as, uintptr_t page); … … 60 60 extern void page_table_destroy(pte_t *page_table); 61 61 extern void map_structure(uintptr_t s, size_t size); 62 62 63 extern uintptr_t hw_map(uintptr_t physaddr, size_t size); 64 extern void hw_area(uintptr_t *physaddr, pfn_t *frames); 63 65 64 66 #endif -
kernel/generic/src/adt/avl.c
r17f168e rae318d3 44 44 * Every node has a pointer to its parent which allows insertion of multiple 45 45 * identical keys into the tree. 46 * 46 * 47 47 * Be careful when using this tree because of the base atribute which is added 48 48 * to every inserted node key. There is no rule in which order nodes with the -
kernel/generic/src/console/cmd.c
r17f168e rae318d3 530 530 } 531 531 532 spinlock_unlock(&cmd_lock); 532 spinlock_unlock(&cmd_lock); 533 533 534 534 return 1; -
kernel/generic/src/console/console.c
r17f168e rae318d3 127 127 128 128 klog_parea.pbase = (uintptr_t) faddr; 129 klog_parea.vbase = (uintptr_t) klog;130 129 klog_parea.frames = SIZE2FRAMES(KLOG_SIZE); 131 klog_parea.cacheable = true;132 130 ddi_parea_register(&klog_parea); 133 131 -
kernel/generic/src/ddi/ddi.c
r17f168e rae318d3 48 48 #include <synch/spinlock.h> 49 49 #include <syscall/copy.h> 50 #include <adt/ btree.h>50 #include <adt/list.h> 51 51 #include <arch.h> 52 52 #include <align.h> … … 56 56 SPINLOCK_INITIALIZE(parea_lock); 57 57 58 /** B+tree with enabled physical memory areas. */ 59 static btree_t parea_btree; 58 /** List with enabled physical memory areas. */ 59 static LIST_INITIALIZE(parea_head); 60 61 /** Physical memory area for devices. */ 62 static parea_t dev_area; 60 63 61 64 /** Initialize DDI. */ 62 65 void ddi_init(void) 63 66 { 64 btree_create(&parea_btree); 67 hw_area(&dev_area.pbase, &dev_area.frames); 68 ddi_parea_register(&dev_area); 65 69 } 66 70 … … 75 79 { 76 80 ipl_t ipl; 77 81 78 82 ipl = interrupts_disable(); 79 83 spinlock_lock(&parea_lock); … … 81 85 /* 82 86 * TODO: we should really check for overlaps here. 83 * However, we should be safe because the kernel is pretty sane and84 * memory of different devices doesn't overlap.85 */86 btree_insert(&parea_btree, (btree_key_t) parea->pbase, parea, NULL);87 87 * However, we should be safe because the kernel is pretty sane. 88 */ 89 link_initialize(&parea->link); 90 list_append(&parea->link, &parea_head); 91 88 92 spinlock_unlock(&parea_lock); 89 interrupts_restore(ipl); 93 interrupts_restore(ipl); 90 94 } 91 95 … … 98 102 * 99 103 * @return 0 on success, EPERM if the caller lacks capabilities to use this 100 * 101 * 102 * 103 */ 104 static int ddi_physmem_map(uintptr_t pf, uintptr_t vp, count_t pages, int flags)104 * syscall, ENOENT if there is no task matching the specified ID or the 105 * physical address space is not enabled for mapping and ENOMEM if there 106 * was a problem in creating address space area. 107 */ 108 static int ddi_physmem_map(uintptr_t pf, uintptr_t vp, pfn_t pages, int flags) 105 109 { 106 110 ipl_t ipl; 107 111 cap_t caps; 108 112 mem_backend_data_t backend_data; 109 113 110 114 backend_data.base = pf; 111 115 backend_data.frames = pages; … … 117 121 if (!(caps & CAP_MEM_MANAGER)) 118 122 return EPERM; 119 123 120 124 ipl = interrupts_disable(); 121 125 122 126 /* 123 127 * Check if the physical memory area is enabled for mapping. 124 * If the architecture supports virtually indexed caches, intercept125 * attempts to create an illegal address alias.126 128 */ 127 129 spinlock_lock(&parea_lock); 128 parea_t *parea; 129 btree_node_t *nodep; 130 parea = (parea_t *) btree_search(&parea_btree, (btree_key_t) pf, &nodep); 131 if (!parea || parea->frames < pages || ((flags & AS_AREA_CACHEABLE) && 132 !parea->cacheable) || (!(flags & AS_AREA_CACHEABLE) && 133 parea->cacheable)) { 130 131 bool fnd = false; 132 link_t *cur; 133 134 for (cur = parea_head.next; cur != &parea_head; cur = cur->next) { 135 parea_t *parea = list_get_instance(cur, parea_t, link); 136 if ((parea->pbase <= pf) && (ADDR2PFN(pf - parea->pbase) + pages <= parea->frames)) { 137 fnd = true; 138 break; 139 } 140 } 141 142 spinlock_unlock(&parea_lock); 143 144 if (!fnd) { 134 145 /* 135 * This physical memory area cannot be mapped.146 * Physical memory area cannot be mapped. 136 147 */ 137 spinlock_unlock(&parea_lock);138 148 interrupts_restore(ipl); 139 149 return ENOENT; 140 150 } 141 spinlock_unlock(&parea_lock); 142 151 143 152 spinlock_lock(&TASK->lock); 144 153 … … 227 236 return (unative_t) ddi_physmem_map(ALIGN_DOWN((uintptr_t) phys_base, 228 237 FRAME_SIZE), ALIGN_DOWN((uintptr_t) virt_base, PAGE_SIZE), 229 ( count_t) pages, (int) flags);238 (pfn_t) pages, (int) flags); 230 239 } 231 240 … … 259 268 unative_t sys_preempt_control(int enable) 260 269 { 261 262 263 264 265 266 267 270 if (!cap_get(TASK) & CAP_PREEMPT_CONTROL) 271 return EPERM; 272 if (enable) 273 preemption_enable(); 274 else 275 preemption_disable(); 276 return 0; 268 277 } 269 278 -
kernel/generic/src/lib/rd.c
r17f168e rae318d3 89 89 rd_parea.pbase = ALIGN_DOWN((uintptr_t) KA2PA((void *) header + hsize), 90 90 FRAME_SIZE); 91 rd_parea.vbase = (uintptr_t) ((void *) header + hsize);92 91 rd_parea.frames = SIZE2FRAMES(dsize); 93 rd_parea.cacheable = true;94 92 ddi_parea_register(&rd_parea); 95 93 -
kernel/generic/src/proc/task.c
r17f168e rae318d3 340 340 341 341 thr = list_get_instance(cur, thread_t, th_link); 342 342 343 343 spinlock_lock(&thr->lock); 344 344 thr->interrupted = true; -
kernel/generic/src/time/clock.c
r17f168e rae318d3 89 89 90 90 clock_parea.pbase = (uintptr_t) faddr; 91 clock_parea.vbase = (uintptr_t) uptime;92 91 clock_parea.frames = 1; 93 clock_parea.cacheable = true;94 92 ddi_parea_register(&clock_parea); 95 93 -
uspace/srv/fb/ega.c
r17f168e rae318d3 374 374 scr_height = sysinfo_value("fb.height"); 375 375 376 if (sysinfo_value("fb.blinking")) {376 if (sysinfo_value("fb.blinking")) { 377 377 ega_normal_color &= 0x77; 378 378 ega_inverted_color &= 0x77; … … 386 386 scr_addr = as_get_mappable_page(sz); 387 387 388 physmem_map(ega_ph_addr, scr_addr, ALIGN_UP(sz, PAGE_SIZE) >> 389 PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE); 388 if (physmem_map(ega_ph_addr, scr_addr, ALIGN_UP(sz, PAGE_SIZE) >> 389 PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE) != 0) 390 return -1; 390 391 391 392 async_set_client_connection(ega_client_connection); -
uspace/srv/fb/fb.c
r17f168e rae318d3 1672 1672 void *fb_addr = as_get_mappable_page(fbsize); 1673 1673 1674 physmem_map(fb_ph_addr + fb_offset, fb_addr, 1675 ALIGN_UP(fbsize, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE); 1674 if (physmem_map(fb_ph_addr + fb_offset, fb_addr, 1675 ALIGN_UP(fbsize, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE) != 0) 1676 return -1; 1676 1677 1677 1678 if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual)) -
uspace/srv/fb/msim.c
r17f168e rae318d3 60 60 virt_addr = (char *) as_get_mappable_page(1); 61 61 62 physmem_map(phys_addr, virt_addr, 1, AS_AREA_READ | AS_AREA_WRITE); 62 if (physmem_map(phys_addr, virt_addr, 1, AS_AREA_READ | AS_AREA_WRITE) != 0) 63 return -1; 63 64 64 65 serial_console_init(msim_putc, WIDTH, HEIGHT); -
uspace/srv/fb/sgcn.c
r17f168e rae318d3 122 122 int sgcn_init(void) 123 123 { 124 sram_virt_addr = (uintptr_t) as_get_mappable_page( 125 sysinfo_value("sram.area.size")); 126 int result = physmem_map( 127 (void *) sysinfo_value("sram.address.physical"), 128 (void *) sram_virt_addr, 129 sysinfo_value("sram.area.size") / PAGE_SIZE, 130 AS_AREA_READ | AS_AREA_WRITE 131 ); 132 if (result != 0) { 133 printf("SGCN: uspace driver couldn't map physical memory: %d\n", 134 result); 135 } 124 sram_virt_addr = (uintptr_t) as_get_mappable_page(sysinfo_value("sram.area.size")); 125 126 if (physmem_map((void *) sysinfo_value("sram.address.physical"), 127 (void *) sram_virt_addr, sysinfo_value("sram.area.size") / PAGE_SIZE, 128 AS_AREA_READ | AS_AREA_WRITE) != 0) 129 return -1; 136 130 137 131 serial_console_init(sgcn_putc, WIDTH, HEIGHT); -
uspace/srv/kbd/arch/sparc64/src/sgcn.c
r17f168e rae318d3 98 98 void sgcn_init(void) 99 99 { 100 sram_virt_addr = (uintptr_t) as_get_mappable_page( 101 sysinfo_value("sram.area.size")); 102 int result = physmem_map( 103 (void *) sysinfo_value("sram.address.physical"), 104 (void *) sram_virt_addr, 105 sysinfo_value("sram.area.size") / PAGE_SIZE, 106 AS_AREA_READ | AS_AREA_WRITE 107 ); 108 if (result != 0) { 100 sram_virt_addr = (uintptr_t) as_get_mappable_page(sysinfo_value("sram.area.size")); 101 if (physmem_map((void *) sysinfo_value("sram.address.physical"), 102 (void *) sram_virt_addr, sysinfo_value("sram.area.size") / PAGE_SIZE, 103 AS_AREA_READ | AS_AREA_WRITE) != 0) 109 104 printf("SGCN: uspace driver could not map physical memory."); 110 }111 105 112 106 sram_buffer_offset = sysinfo_value("sram.buffer.offset"); -
uspace/srv/ns/ns.c
r17f168e rae318d3 109 109 } 110 110 111 static void get_as_area(ipc_callid_t callid, ipc_call_t *call, char *name, 112 void **addr) 111 static void get_as_area(ipc_callid_t callid, ipc_call_t *call, char *name, void **addr) 113 112 { 114 113 void *ph_addr; 115 114 116 115 if (!*addr) { 117 116 ph_addr = (void *) sysinfo_value(name); … … 121 120 } 122 121 *addr = as_get_mappable_page(PAGE_SIZE); 123 physmem_map(ph_addr, *addr, 1, 124 AS_AREA_READ | AS_AREA_CACHEABLE); 122 if (physmem_map(ph_addr, *addr, 1, 123 AS_AREA_READ | AS_AREA_CACHEABLE) != 0) { 124 ipc_answer_0(callid, ENOENT); 125 return; 126 } 125 127 } 126 128 ipc_answer_2(callid, EOK, (ipcarg_t) *addr, AS_AREA_READ); … … 151 153 switch (IPC_GET_ARG3(call)) { 152 154 case SERVICE_MEM_REALTIME: 153 get_as_area(callid, &call, "clock.faddr", 154 &clockaddr); 155 get_as_area(callid, &call, "clock.faddr", &clockaddr); 155 156 break; 156 157 case SERVICE_MEM_KLOG: 157 get_as_area(callid, &call, "klog.faddr", 158 &klogaddr); 158 get_as_area(callid, &call, "klog.faddr", &klogaddr); 159 159 break; 160 160 default: -
uspace/srv/rd/rd.c
r17f168e rae318d3 258 258 int retval = physmem_map(rd_ph_addr, rd_addr, 259 259 ALIGN_UP(rd_size, PAGE_SIZE) >> PAGE_WIDTH, flags); 260 260 261 261 if (retval < 0) { 262 262 printf(NAME ": Error mapping RAM disk\n");
Note:
See TracChangeset
for help on using the changeset viewer.