Subversion Repositories HelenOS

Rev

Rev 4347 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4347 Rev 4691
Line 125... Line 125...
125
        *use_addr = pio_addr;
125
        *use_addr = pio_addr;
126
        return iospace_enable(task_get_id(), pio_addr, size);
126
        return iospace_enable(task_get_id(), pio_addr, size);
127
    }
127
    }
128
#endif
128
#endif
129
 
129
 
130
    phys = ALIGN_DOWN((uintptr_t) pio_addr, PAGE_SIZE);
130
    phys = (void *) ALIGN_DOWN((uintptr_t) pio_addr, PAGE_SIZE);
131
    offset = pio_addr - phys;
131
    offset = pio_addr - phys;
132
    pages = ALIGN_UP(offset + size, PAGE_SIZE) >> PAGE_WIDTH;
132
    pages = ALIGN_UP(offset + size, PAGE_SIZE) >> PAGE_WIDTH;
133
    virt = as_get_mappable_page(pages);
133
    virt = as_get_mappable_page(pages << PAGE_WIDTH);
134
    *use_addr = virt + offset;
134
    *use_addr = virt + offset;
135
    return physmem_map(phys, virt, pages, AS_AREA_READ | AS_AREA_WRITE);
135
    return physmem_map(phys, virt, pages, AS_AREA_READ | AS_AREA_WRITE);
136
}
136
}
137
 
137
 
138
/** @}
138
/** @}