Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset bb75646 in mainline


Ignore:
Timestamp:
2013-08-06T23:26:54Z (7 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
master
Children:
face0c04
Parents:
b3f967c
Message:

arm32: Add barriers to TLB operations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/src/mm/tlb.c

    rb3f967c rbb75646  
    4040#include <typedefs.h>
    4141#include <arch/mm/page.h>
     42#include <arch/cache.h>
    4243
    4344/** Invalidate all entries in TLB.
     
    4849{
    4950        TLBIALL_write(0);
     51        /*
     52         * "A TLB maintenance operation is only guaranteed to be complete after
     53         * the execution of a DSB instruction."
     54         * "An ISB instruction, or a return from an exception, causes the
     55         * effect of all completed TLB maintenance operations that appear in
     56         * program order before the ISB or return from exception to be visible
     57         * to all subsequent instructions, including the instruction fetches
     58         * for those instructions."
     59         * ARM Architecture reference Manual ch. B3.10.1 p. B3-1374 B3-1375
     60         */
     61        read_barrier();
     62        inst_barrier();
    5063}
    5164
     
    6679static inline void invalidate_page(uintptr_t page)
    6780{
     81        //TODO: What about TLBIMVAA?
    6882        TLBIMVA_write(page);
    69         //TODO: What about TLBIMVAA?
     83        /*
     84         * "A TLB maintenance operation is only guaranteed to be complete after
     85         * the execution of a DSB instruction."
     86         * "An ISB instruction, or a return from an exception, causes the
     87         * effect of all completed TLB maintenance operations that appear in
     88         * program order before the ISB or return from exception to be visible
     89         * to all subsequent instructions, including the instruction fetches
     90         * for those instructions."
     91         * ARM Architecture reference Manual ch. B3.10.1 p. B3-1374 B3-1375
     92         */
     93        read_barrier();
     94        inst_barrier();
    7095}
    7196
     
    79104void tlb_invalidate_pages(asid_t asid __attribute__((unused)), uintptr_t page, size_t cnt)
    80105{
    81         unsigned int i;
    82 
    83         for (i = 0; i < cnt; i++)
     106        for (unsigned i = 0; i < cnt; i++)
    84107                invalidate_page(page + i * PAGE_SIZE);
    85108}
Note: See TracChangeset for help on using the changeset viewer.