Changeset 3fb72b0f in rtems


Ignore:
Timestamp:
Oct 28, 2019, 8:15:58 AM (4 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
f9648ba
Parents:
044687d3
git-author:
Sebastian Huber <sebastian.huber@…> (10/28/19 08:15:58)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/31/19 08:45:46)
Message:

arm: Add defines for small pages MMU

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/arm/include/libcpu/arm-cp15.h

    r044687d3 r3fb72b0f  
    9393    + ((((uint32_t) (mva) - 1U)) & ~((1U << ARM_MMU_SECT_BASE_SHIFT) - 1U)))
    9494
     95#define ARM_MMU_PAGE_TABLE_BASE_SHIFT 10
     96#define ARM_MMU_PAGE_TABLE_BASE_MASK (0x3fffffU << ARM_MMU_PAGE_TABLE_BASE_SHIFT)
     97#define ARM_MMU_PAGE_TABLE_DOMAIN_SHIFT 5
     98#define ARM_MMU_PAGE_TABLE_DOMAIN_MASK (0xfU << ARM_MMU_PAGE_TABLE_DOMAIN_SHIFT)
     99#define ARM_MMU_PAGE_TABLE_NS (1U << 3)
     100#define ARM_MMU_PAGE_TABLE_PXN (1U << 2)
     101#define ARM_MMU_PAGE_TABLE_DEFAULT 0x1U
     102
     103#define ARM_MMU_SMALL_PAGE_BASE_SHIFT 12
     104#define ARM_MMU_SMALL_PAGE_BASE_MASK (0xfffffU << ARM_MMU_SMALL_PAGE_BASE_SHIFT)
     105#define ARM_MMU_SMALL_PAGE_NG (1U << 11)
     106#define ARM_MMU_SMALL_PAGE_S (1U << 10)
     107#define ARM_MMU_SMALL_PAGE_AP_2 (1U << 9)
     108#define ARM_MMU_SMALL_PAGE_TEX_2 (1U << 8)
     109#define ARM_MMU_SMALL_PAGE_TEX_1 (1U << 7)
     110#define ARM_MMU_SMALL_PAGE_TEX_0 (1U << 6)
     111#define ARM_MMU_SMALL_PAGE_TEX_SHIFT 6
     112#define ARM_MMU_SMALL_PAGE_TEX_MASK (0x3U << ARM_MMU_SMALL_PAGE_TEX_SHIFT)
     113#define ARM_MMU_SMALL_PAGE_AP_1 (1U << 5)
     114#define ARM_MMU_SMALL_PAGE_AP_0 (1U << 4)
     115#define ARM_MMU_SMALL_PAGE_AP_SHIFT 4
     116#define ARM_MMU_SMALL_PAGE_AP_MASK (0x23U << ARM_MMU_SMALL_PAGE_AP_SHIFT)
     117#define ARM_MMU_SMALL_PAGE_C (1U << 3)
     118#define ARM_MMU_SMALL_PAGE_B (1U << 2)
     119#define ARM_MMU_SMALL_PAGE_XN (1U << 0)
     120#define ARM_MMU_SMALL_PAGE_DEFAULT 0x2U
     121#define ARM_MMU_SMALL_PAGE_GET_INDEX(mva) \
     122  (((uint32_t) (mva)) >> ARM_MMU_SMALL_PAGE_BASE_SHIFT)
     123#define ARM_MMU_SMALL_PAGE_MVA_ALIGN_UP(mva) \
     124  ((1U << ARM_MMU_SMALL_PAGE_BASE_SHIFT) \
     125    + ((((uint32_t) (mva) - 1U)) & ~((1U << ARM_MMU_SMALL_PAGE_BASE_SHIFT) - 1U)))
     126
     127#define ARM_MMU_SECT_FLAGS_TO_PAGE_TABLE(flags) \
     128  (ARM_MMU_PAGE_TABLE_DEFAULT \
     129    | ((flags) & ARM_MMU_SECT_DOMAIN_MASK) \
     130    | (((flags) & ARM_MMU_SECT_NS) >> 16) \
     131    | (((flags) & ARM_MMU_SECT_PXN) << 2))
     132
     133#define ARM_MMU_PAGE_TABLE_FLAGS_TO_SECT(flags) \
     134  (ARM_MMU_SECT_DEFAULT \
     135    | ((flags) & ARM_MMU_PAGE_TABLE_DOMAIN_MASK) \
     136    | (((flags) & ARM_MMU_PAGE_TABLE_NS) << 16) \
     137    | (((flags) & ARM_MMU_PAGE_TABLE_PXN) >> 2))
     138
     139#define ARM_MMU_SECT_FLAGS_TO_SMALL_PAGE(flags) \
     140  ((((flags) & 0x3fc00) >> 6) \
     141    | ((flags) & (ARM_MMU_SECT_C | ARM_MMU_SECT_B | 0x2)) \
     142    | (((flags) & ARM_MMU_SECT_XN) >> 4))
     143
     144#define ARM_MMU_SMALL_PAGE_FLAGS_TO_SECT(flags) \
     145  ((((flags) & 0xff0) << 6) \
     146    | ((flags) & (ARM_MMU_SMALL_PAGE_C | ARM_MMU_SMALL_PAGE_B | 0x2)) \
     147    | (((flags) & ARM_MMU_SMALL_PAGE_XN) << 4))
     148
    95149#define ARM_MMU_TRANSLATION_TABLE_ENTRY_SIZE 4U
    96150#define ARM_MMU_TRANSLATION_TABLE_ENTRY_COUNT 4096U
     151
     152#define ARM_MMU_SMALL_PAGE_TABLE_ENTRY_SIZE 4U
     153#define ARM_MMU_SMALL_PAGE_TABLE_ENTRY_COUNT 256U
    97154
    98155#define ARM_MMU_DEFAULT_CLIENT_DOMAIN 15U
Note: See TracChangeset for help on using the changeset viewer.