Changeset b7068da in mainline for kernel/arch/arm32/src/ras.c


Ignore:
Timestamp:
2012-02-09T20:35:12Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
591762c6
Parents:
7cede12c (diff), 3d4750f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    r7cede12c rb7068da  
    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.