menvcfg also
This commit is contained in:
		
							parent
							
								
									4060b671d8
								
							
						
					
					
						commit
						de247db5e6
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -196,14 +196,16 @@ static inline uint64
 | 
			
		|||
r_menvcfg()
 | 
			
		||||
{
 | 
			
		||||
  uint64 x;
 | 
			
		||||
  asm volatile("csrr %0, menvcfg" : "=r" (x) );
 | 
			
		||||
  // asm volatile("csrr %0, menvcfg" : "=r" (x) );
 | 
			
		||||
  asm volatile("csrr %0, 0x30a" : "=r" (x) );
 | 
			
		||||
  return x;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void 
 | 
			
		||||
w_menvcfg(uint64 x)
 | 
			
		||||
{
 | 
			
		||||
  asm volatile("csrw menvcfg, %0" : : "r" (x));
 | 
			
		||||
  // asm volatile("csrw menvcfg, %0" : : "r" (x));
 | 
			
		||||
  asm volatile("csrw 0x30a, %0" : : "r" (x));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Physical Memory Protection
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue