Changeset 2bf4936 in mainline for kernel/arch/sparc64/src/mm/page.c


Ignore:
Timestamp:
2009-04-14T15:50:56Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
47a6708
Parents:
577b531
Message:

On sparc64, do fast indentity mapping only for physical memory.
For addresses above physical memory, such as I/O devices,
fall through to the C miss handler and map the memory noncacheably.
Replace deprecated Bicc instructions with proper Bcc instructions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/mm/page.c

    r577b531 r2bf4936  
    6363uintptr_t hw_map(uintptr_t physaddr, size_t size)
    6464{
    65         if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))
    66                 panic("Unable to map physical memory %p (%d bytes).", physaddr, size)
    67        
    68         uintptr_t virtaddr = PA2KA(last_frame);
    69         pfn_t i;
    70         for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) {
    71                 uintptr_t addr = PFN2ADDR(i);
    72                 page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr, PAGE_NOT_CACHEABLE | PAGE_WRITE);
    73         }
    74        
    75         last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);
    76        
    77         return virtaddr;
     65        return KA2PA(physaddr);
    7866}
    7967
Note: See TracChangeset for help on using the changeset viewer.