Changeset 61ac34d in mainline


Ignore:
Timestamp:
2012-01-28T13:10:30Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
20de14d
Parents:
8757be86
Message:

Map the RAS page using km_map().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/src/ras.c

    r8757be86 r61ac34d  
    3838#include <mm/frame.h>
    3939#include <mm/page.h>
     40#include <mm/km.h>
    4041#include <mm/tlb.h>
    4142#include <mm/asid.h>
     
    5051void ras_init(void)
    5152{
    52         ras_page = frame_alloc(ONE_FRAME, FRAME_KA);
    53         memsetb(ras_page, FRAME_SIZE, 0);
     53        uintptr_t frame;
     54
     55        frame = (uintptr_t) frame_alloc(ONE_FRAME,
     56            FRAME_ATOMIC | FRAME_HIGHMEM);
     57        if (!frame)
     58                frame = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_LOWMEM);
     59        ras_page = (uintptr_t *) km_map(frame,
     60            PAGE_SIZE, PAGE_READ | PAGE_WRITE | PAGE_USER | PAGE_CACHEABLE);
     61
     62        memsetb(ras_page, PAGE_SIZE, 0);
    5463        ras_page[RAS_START] = 0;
    5564        ras_page[RAS_END] = 0xffffffff;
    56         /*
    57          * Userspace needs to be able to write to this page. The page is
    58          * cached in TLB as PAGE_KERNEL. Purge it from TLB and map it
    59          * read/write PAGE_USER.
    60          */
    61         tlb_invalidate_pages(ASID_KERNEL, (uintptr_t)ras_page, 1);
    62         page_table_lock(AS, true);
    63         page_mapping_insert(AS, (uintptr_t)ras_page, (uintptr_t)KA2PA(ras_page),
    64             PAGE_READ | PAGE_WRITE | PAGE_USER);
    65         page_table_unlock(AS, true);
    6665}
    6766
Note: See TracChangeset for help on using the changeset viewer.