Subversion Repositories HelenOS-historic

Rev

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

Rev 1730 Rev 1780
Line 43... Line 43...
43
    if (config.cpu_active == 1)
43
    if (config.cpu_active == 1)
44
        page_mapping_operations = &pt_mapping_operations;
44
        page_mapping_operations = &pt_mapping_operations;
45
}
45
}
46
 
46
 
47
 
47
 
48
__address hw_map(__address physaddr, size_t size)
48
uintptr_t hw_map(uintptr_t physaddr, size_t size)
49
{
49
{
50
    if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))
50
    if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))
51
        panic("Unable to map physical memory %p (%d bytes)", physaddr, size)
51
        panic("Unable to map physical memory %p (%d bytes)", physaddr, size)
52
   
52
   
53
    __address virtaddr = PA2KA(last_frame);
53
    uintptr_t virtaddr = PA2KA(last_frame);
54
    pfn_t i;
54
    pfn_t i;
55
    for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++)
55
    for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++)
56
        page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE);
56
        page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE);
57
   
57
   
58
    last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);
58
    last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);