@ -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 ;
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
* Deduce other fields of the descriptor based on the MT_NS and MT_RW
* memory region attributes .
* memory region attributes .
*/
*/
desc | = LOWER_ATTRS ( ACCESS_FLAG ) ;
desc | = ( attr & MT_NS ) ? LOWER_ATTRS ( NS ) : 0 ;
desc | = ( attr & MT_NS ) ? LOWER_ATTRS ( NS ) : 0 ;
desc | = ( attr & MT_RW ) ? LOWER_ATTRS ( AP_RW ) : LOWER_ATTRS ( AP_RO ) ;
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 */
} else { /* Normal memory */
/*
/*
* Always map read - write normal memory as execute - never .
* Always map read - write normal memory as execute - never .
* ( Trusted Firmware doesn ' t self - modify its code , therefore
* This library assumes that it is used by software that does
* R / W memory is reserved for data storage , which must not be
* not self - modify its code , therefore R / W memory is reserved
* executable . )
* for data storage , which must not be executable .
*
* Note that setting the XN bit here is for consistency only .
* Note that setting the XN bit here is for consistency only .
* The function that enables the MMU sets the SCTLR_ELx . WXN bit ,
* The function that enables the MMU sets the SCTLR_ELx . WXN bit ,
* which makes any writable memory region to be treated as
* which makes any writable memory region to be treated as