mirror of
				https://github.com/yuzu-emu/unicorn.git
				synced 2025-11-04 10:54:56 +00:00 
			
		
		
		
	cpu: Introduce env_archcpu
This will replace foo_env_get_cpu with a generic definition. No changes to the target specific code so far. Backports commit 083dc73d7a3cf2a75b5625fd8f0669b57a855d16 from qemu
This commit is contained in:
		
							parent
							
								
									fbf91a6535
								
							
						
					
					
						commit
						8b108f3607
					
				| 
						 | 
				
			
			@ -375,6 +375,17 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
 | 
			
		|||
 | 
			
		||||
int cpu_exec(struct uc_struct *uc, CPUState *cpu);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * env_archcpu(env)
 | 
			
		||||
 * @env: The architecture environment
 | 
			
		||||
 *
 | 
			
		||||
 * Return the ArchCPU associated with the environment.
 | 
			
		||||
 */
 | 
			
		||||
static inline ArchCPU *env_archcpu(CPUArchState *env)
 | 
			
		||||
{
 | 
			
		||||
    return container_of(env, ArchCPU, env);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * env_cpu(env)
 | 
			
		||||
 * @env: The architecture environment
 | 
			
		||||
| 
						 | 
				
			
			@ -383,8 +394,7 @@ int cpu_exec(struct uc_struct *uc, CPUState *cpu);
 | 
			
		|||
 */
 | 
			
		||||
static inline CPUState *env_cpu(CPUArchState *env)
 | 
			
		||||
{
 | 
			
		||||
    ArchCPU *arch_cpu = container_of(env, ArchCPU, env);
 | 
			
		||||
    return &arch_cpu->parent_obj;
 | 
			
		||||
    return &env_archcpu(env)->parent_obj;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif /* CPU_ALL_H */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue