Changeset ae318d3 in mainline for uspace


Ignore:
Timestamp:
2009-02-16T18:50:48Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
06da55b
Parents:
17f168e
Message:

overhaul pareas: use one single physical area for the physical address space not belonging to physical memory

Location:
uspace/srv
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fb/ega.c

    r17f168e rae318d3  
    374374        scr_height = sysinfo_value("fb.height");
    375375
    376         if(sysinfo_value("fb.blinking")) {
     376        if (sysinfo_value("fb.blinking")) {
    377377                ega_normal_color &= 0x77;
    378378                ega_inverted_color &= 0x77;
     
    386386        scr_addr = as_get_mappable_page(sz);
    387387
    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;
    390391
    391392        async_set_client_connection(ega_client_connection);
  • uspace/srv/fb/fb.c

    r17f168e rae318d3  
    16721672        void *fb_addr = as_get_mappable_page(fbsize);
    16731673       
    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;
    16761677       
    16771678        if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual))
  • uspace/srv/fb/msim.c

    r17f168e rae318d3  
    6060        virt_addr = (char *) as_get_mappable_page(1);
    6161       
    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;
    6364       
    6465        serial_console_init(msim_putc, WIDTH, HEIGHT);
  • uspace/srv/fb/sgcn.c

    r17f168e rae318d3  
    122122int sgcn_init(void)
    123123{
    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;
    136130       
    137131        serial_console_init(sgcn_putc, WIDTH, HEIGHT);
  • uspace/srv/kbd/arch/sparc64/src/sgcn.c

    r17f168e rae318d3  
    9898void sgcn_init(void)
    9999{
    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)
    109104                printf("SGCN: uspace driver could not map physical memory.");
    110         }
    111105       
    112106        sram_buffer_offset = sysinfo_value("sram.buffer.offset");
  • uspace/srv/ns/ns.c

    r17f168e rae318d3  
    109109}
    110110
    111 static void get_as_area(ipc_callid_t callid, ipc_call_t *call, char *name,
    112     void **addr)
     111static void get_as_area(ipc_callid_t callid, ipc_call_t *call, char *name, void **addr)
    113112{
    114113        void *ph_addr;
    115 
     114       
    116115        if (!*addr) {
    117116                ph_addr = (void *) sysinfo_value(name);
     
    121120                }
    122121                *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                }
    125127        }
    126128        ipc_answer_2(callid, EOK, (ipcarg_t) *addr, AS_AREA_READ);
     
    151153                        switch (IPC_GET_ARG3(call)) {
    152154                        case SERVICE_MEM_REALTIME:
    153                                 get_as_area(callid, &call, "clock.faddr",
    154                                     &clockaddr);
     155                                get_as_area(callid, &call, "clock.faddr", &clockaddr);
    155156                                break;
    156157                        case SERVICE_MEM_KLOG:
    157                                 get_as_area(callid, &call, "klog.faddr",
    158                                     &klogaddr);
     158                                get_as_area(callid, &call, "klog.faddr", &klogaddr);
    159159                                break;
    160160                        default:
  • uspace/srv/rd/rd.c

    r17f168e rae318d3  
    258258        int retval = physmem_map(rd_ph_addr, rd_addr,
    259259            ALIGN_UP(rd_size, PAGE_SIZE) >> PAGE_WIDTH, flags);
    260 
     260       
    261261        if (retval < 0) {
    262262                printf(NAME ": Error mapping RAM disk\n");
Note: See TracChangeset for help on using the changeset viewer.