ArmPkg/ArmV7Mmu: fix write-through translation table accesses
The definition TTBR_WRITE_THROUGH_NO_ALLOC makes little sense, since a) its meaning is unclear in the context of TTBRx, since write through always implies Read-Allocate and no Write-Allocate b) its definition equals the definition of TTBR_WRITE_BACK_ALLOC So instead, rename it to TTBR_WRITE_THROUGH and update the definition to reflect the name. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18893 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
		
				
					committed by
					
						
						abiesheuvel
					
				
			
			
				
	
			
			
			
						parent
						
							6bc35cbaca
						
					
				
				
					commit
					a6ec831c10
				
			@@ -29,7 +29,7 @@
 | 
				
			|||||||
#define TTBR_RGN_INNER_WRITE_THROUGH         BIT0
 | 
					#define TTBR_RGN_INNER_WRITE_THROUGH         BIT0
 | 
				
			||||||
#define TTBR_RGN_INNER_WRITE_BACK_NO_ALLOC   (BIT0|BIT6)
 | 
					#define TTBR_RGN_INNER_WRITE_BACK_NO_ALLOC   (BIT0|BIT6)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define TTBR_WRITE_THROUGH_NO_ALLOC     ( TTBR_RGN_OUTER_WRITE_BACK_ALLOC | TTBR_RGN_INNER_WRITE_BACK_ALLOC )
 | 
					#define TTBR_WRITE_THROUGH              ( TTBR_RGN_OUTER_WRITE_THROUGH | TTBR_RGN_INNER_WRITE_THROUGH )
 | 
				
			||||||
#define TTBR_WRITE_BACK_NO_ALLOC        ( TTBR_RGN_OUTER_WRITE_BACK_NO_ALLOC | TTBR_RGN_INNER_WRITE_BACK_NO_ALLOC )
 | 
					#define TTBR_WRITE_BACK_NO_ALLOC        ( TTBR_RGN_OUTER_WRITE_BACK_NO_ALLOC | TTBR_RGN_INNER_WRITE_BACK_NO_ALLOC )
 | 
				
			||||||
#define TTBR_NON_CACHEABLE              ( TTBR_RGN_OUTER_NON_CACHEABLE | TTBR_RGN_INNER_NON_CACHEABLE )
 | 
					#define TTBR_NON_CACHEABLE              ( TTBR_RGN_OUTER_NON_CACHEABLE | TTBR_RGN_INNER_NON_CACHEABLE )
 | 
				
			||||||
#define TTBR_WRITE_BACK_ALLOC           ( TTBR_RGN_OUTER_WRITE_BACK_ALLOC | TTBR_RGN_INNER_WRITE_BACK_ALLOC )
 | 
					#define TTBR_WRITE_BACK_ALLOC           ( TTBR_RGN_OUTER_WRITE_BACK_ALLOC | TTBR_RGN_INNER_WRITE_BACK_ALLOC )
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -259,7 +259,7 @@ ArmConfigureMmu (
 | 
				
			|||||||
    TTBRAttributes = TTBR_WRITE_BACK_ALLOC;
 | 
					    TTBRAttributes = TTBR_WRITE_BACK_ALLOC;
 | 
				
			||||||
  } else if ((TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH) ||
 | 
					  } else if ((TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH) ||
 | 
				
			||||||
      (TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH)) {
 | 
					      (TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH)) {
 | 
				
			||||||
    TTBRAttributes = TTBR_WRITE_THROUGH_NO_ALLOC;
 | 
					    TTBRAttributes = TTBR_WRITE_THROUGH;
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    ASSERT (0); // No support has been found for the attributes of the memory region that the translation table belongs to.
 | 
					    ASSERT (0); // No support has been found for the attributes of the memory region that the translation table belongs to.
 | 
				
			||||||
    return RETURN_UNSUPPORTED;
 | 
					    return RETURN_UNSUPPORTED;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user