xlat: Remove references to the Trusted Firmware
authorAntonio Nino Diaz <[email protected]>
Thu, 12 Jul 2018 14:54:10 +0000 (15:54 +0100)
committerAntonio Nino Diaz <[email protected]>
Sun, 15 Jul 2018 15:42:05 +0000 (16:42 +0100)
This library can be used in other projects. All comments that talk about
the Trusted Firmware should be talking about the library itself.

Change-Id: I3b98d42f7132be72c1f8a4900acfaa78dbd2daa2
Signed-off-by: Antonio Nino Diaz <[email protected]>
include/lib/xlat_tables/xlat_tables_defs.h
lib/xlat_tables/xlat_tables_common.c
lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
lib/xlat_tables_v2/xlat_tables_core.c

index 5eb1d309d5c6fdcb7d8a8643b314065f3a4bfd46..c9d54177d5da9980bc7164e73447bc968a2ac15e 100644 (file)
@@ -62,7 +62,7 @@
 
 /*
  * The ARMv8-A architecture allows translation granule sizes of 4KB, 16KB or
- * 64KB. However, TF only supports the 4KB case at the moment.
+ * 64KB. However, only 4KB are supported at the moment.
  */
 #define PAGE_SIZE_SHIFT                FOUR_KB_SHIFT
 #define PAGE_SIZE              (U(1) << PAGE_SIZE_SHIFT)
index b42cd6814245d1cd5fcbb00bd58dca5f820d2529..ce6e341a2fb4a31f27cd9a37f38a8d473d3809e9 100644 (file)
@@ -195,6 +195,10 @@ static uint64_t mmap_desc(unsigned int attr, unsigned long long addr_pa,
        desc |= (level == XLAT_TABLE_LEVEL_MAX) ? PAGE_DESC : BLOCK_DESC;
        desc |= (attr & MT_NS) ? LOWER_ATTRS(NS) : 0;
        desc |= (attr & MT_RW) ? LOWER_ATTRS(AP_RW) : LOWER_ATTRS(AP_RO);
+       /*
+        * Always set the access flag, as this library assumes access flag
+        * faults aren't managed.
+        */
        desc |= LOWER_ATTRS(ACCESS_FLAG);
        desc |= ap1_mask;
 
@@ -222,9 +226,10 @@ static uint64_t mmap_desc(unsigned int attr, unsigned long long addr_pa,
        } else { /* Normal memory */
                /*
                 * Always map read-write normal memory as execute-never.
-                * (Trusted Firmware doesn't self-modify its code, therefore
-                * R/W memory is reserved for data storage, which must not be
-                * executable.)
+                * This library assumes that it is used by software that does
+                * not self-modify its code, therefore R/W memory is reserved
+                * for data storage, which must not be executable.
+                *
                 * Note that setting the XN bit here is for consistency only.
                 * The function that enables the MMU sets the SCTLR_ELx.WXN bit,
                 * which makes any writable memory region to be treated as
index 2f71110c33245030cc9a0ada11e0d2e71459019a..5e3220c606ae5869711a6eb0bfc203b84944d734 100644 (file)
@@ -24,8 +24,8 @@
 int xlat_arch_is_granule_size_supported(size_t size)
 {
        /*
-        * The Trusted Firmware uses long descriptor translation table format,
-        * which supports 4 KiB pages only.
+        * The library uses the long descriptor translation table format, which
+        * supports 4 KiB pages only.
         */
        return (size == (4U * 1024U));
 }
index 104303a48533bb748ce75292a1d1e04c2f35a3aa..e3306e6df78fff4ad1aa8242f21641e72ced12d9 100644 (file)
@@ -103,12 +103,14 @@ uint64_t xlat_desc(const xlat_ctx_t *ctx, uint32_t attr,
         */
        desc |= (level == XLAT_TABLE_LEVEL_MAX) ? PAGE_DESC : BLOCK_DESC;
        /*
-        * Always set the access flag, as TF doesn't manage access flag faults.
+        * Always set the access flag, as this library assumes access flag
+        * faults aren't managed.
+        */
+       desc |= LOWER_ATTRS(ACCESS_FLAG);
+       /*
         * Deduce other fields of the descriptor based on the MT_NS and MT_RW
         * memory region attributes.
         */
-       desc |= LOWER_ATTRS(ACCESS_FLAG);
-
        desc |= (attr & MT_NS) ? LOWER_ATTRS(NS) : 0;
        desc |= (attr & MT_RW) ? LOWER_ATTRS(AP_RW) : LOWER_ATTRS(AP_RO);
 
@@ -154,9 +156,10 @@ uint64_t xlat_desc(const xlat_ctx_t *ctx, uint32_t attr,
        } else { /* Normal memory */
                /*
                 * Always map read-write normal memory as execute-never.
-                * (Trusted Firmware doesn't self-modify its code, therefore
-                * R/W memory is reserved for data storage, which must not be
-                * executable.)
+                * This library assumes that it is used by software that does
+                * not self-modify its code, therefore R/W memory is reserved
+                * for data storage, which must not be executable.
+                *
                 * Note that setting the XN bit here is for consistency only.
                 * The function that enables the MMU sets the SCTLR_ELx.WXN bit,
                 * which makes any writable memory region to be treated as