Changeset e13ba75 in mainline


Ignore:
Timestamp:
2013-08-06T22:46:12Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
46db5c51
Parents:
f9f758e
Message:

arm32: turn more macros into inlin functions, add coherence protection

Location:
kernel/arch/arm32/include/arch/mm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/include/arch/mm/page.h

    rf9f758e re13ba75  
    9595/* Set PTE address accessors for each level. */
    9696#define SET_PTL0_ADDRESS_ARCH(ptl0) \
    97         (set_ptl0_addr((pte_t *) (ptl0)))
     97        set_ptl0_addr((pte_t *) (ptl0))
    9898#define SET_PTL1_ADDRESS_ARCH(ptl0, i, a) \
    99         (((pte_t *) (ptl0))[(i)].l0.coarse_table_addr = (a) >> 10)
     99        set_ptl1_addr((pte_t*) (ptl0), i, a)
    100100#define SET_PTL2_ADDRESS_ARCH(ptl1, i, a)
    101101#define SET_PTL3_ADDRESS_ARCH(ptl2, i, a)
    102102#define SET_FRAME_ADDRESS_ARCH(ptl3, i, a) \
    103         (((pte_t *) (ptl3))[(i)].l1.frame_base_addr = (a) >> 12)
     103        set_ptl3_addr((pte_t*) (ptl3), i, a)
    104104
    105105/* Get PTE flags accessors for each level. */
  • kernel/arch/arm32/include/arch/mm/page_armv4.h

    rf9f758e re13ba75  
    131131{
    132132        TTBR0_write((uint32_t)pt);
     133}
     134
     135NO_TRACE static inline void set_ptl1_addr(pte_t *pt, size_t i, uintptr_t address)
     136{
     137        pt[i].l0.coarse_table_addr = address >> 10;
     138}
     139
     140NO_TRACE static inline void set_ptl3_addr(pte_t *pt, size_t i, uintptr_t address)
     141{
     142        pt[i].l1.frame_base_addr = address >> 12;
    133143}
    134144
  • kernel/arch/arm32/include/arch/mm/page_armv6.h

    rf9f758e re13ba75  
    127127#define PTE_DESCRIPTOR_SMALL_PAGE_NX    3
    128128
     129
     130//TODO: DCCMVAU should be enough but it does not work.
     131#define pt_coherence_m(pt, count) \
     132do { \
     133        for (unsigned i = 0; i < count; ++i) \
     134                DCCMVAC_write((uintptr_t)(pt + i)); \
     135        read_barrier(); \
     136} while (0)
     137#define pt_coherence(page) pt_coherence_m(page, 1)
     138
    129139/** Sets the address of level 0 page table.
    130140 *
     
    135145{
    136146        TTBR0_write((uint32_t)pt);
     147}
     148
     149NO_TRACE static inline void set_ptl1_addr(pte_t *pt, size_t i, uintptr_t address)
     150{
     151        pt[i].l0.coarse_table_addr = address >> 10;
     152        pt_coherence(&pt[i]);
     153}
     154
     155NO_TRACE static inline void set_ptl3_addr(pte_t *pt, size_t i, uintptr_t address)
     156{
     157        pt[i].l1.frame_base_addr = address >> 12;
     158        pt_coherence(&pt[i]);
    137159}
    138160
     
    205227                p->ns = 0;
    206228        }
    207         DCCMVAC_write((uint32_t)p);
    208         //TODO: DCCMVAU should be enough but it does not work.
     229        pt_coherence(p);
    209230}
    210231
     
    269290                        p->access_permission_1 = PTE_AP1_RO;
    270291        }
    271         DCCMVAC_write((uint32_t)p);
    272         //TODO: DCCMVAU should be enough but it does not work.
     292        pt_coherence(p);
    273293}
    274294
     
    281301        write_barrier();
    282302        p->descriptor_type = PTE_DESCRIPTOR_COARSE_TABLE;
    283         DCCMVAC_write((uint32_t)p);
    284         //TODO: DCCMVAU should be enough but it does not work.
     303        pt_coherence(p);
    285304}
    286305
     
    290309
    291310        p->descriptor_type = PTE_DESCRIPTOR_SMALL_PAGE;
    292         DCCMVAC_write((uint32_t)p);
    293         //TODO: DCCMVAU should be enough but it does not work.
     311        pt_coherence(p);
    294312}
    295313
Note: See TracChangeset for help on using the changeset viewer.