Changeset 59e4864 in mainline for kernel/arch/ia64/src/mm/page.c


Ignore:
Timestamp:
2008-11-11T08:00:42Z (17 years ago)
Author:
Jakub Vana <jakub.vana@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f3c4a26
Parents:
a2a5529
Message:

Alfa of SMP support on IA64

File:
1 edited

Legend:

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

    ra2a5529 r59e4864  
    4848#include <arch/barrier.h>
    4949#include <memstr.h>
     50#include <align.h>
    5051
    5152static void set_environment(void);
     
    263264}
    264265
     266extern uintptr_t last_frame;
     267
     268
     269uintptr_t hw_map(uintptr_t physaddr, size_t size)
     270{
     271        if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))
     272                panic("Unable to map physical memory %p (%d bytes)", physaddr, size)
     273       
     274        uintptr_t virtaddr = PA2KA(last_frame);
     275        pfn_t i;
     276        for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) {
     277                uintptr_t addr = PFN2ADDR(i);
     278                page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr, PAGE_NOT_CACHEABLE | PAGE_WRITE);
     279        }
     280       
     281        last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);
     282       
     283        return virtaddr;
     284}
     285
     286
     287
    265288/** @}
    266289 */
Note: See TracChangeset for help on using the changeset viewer.