tcg: Add type for vCPU pointers
Adds the 'TCGv_env' type for pointers to 'CPUArchState' objects. The
tracing infrastructure later needs to differentiate between regular
pointers and pointers to vCPUs.
Also changes all targets to use the new 'TCGv_env' type instead of the
generic 'TCGv_ptr'. As of now, the change is merely cosmetic ('TCGv_env'
translates into 'TCGv_ptr'), but that could change in the future to
enforce the difference.
Note that a 'TCGv_env' type (for 'CPUState') is not added, since all
helpers currently receive the architecture-specific
pointer ('CPUArchState').
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Acked-by: Richard Henderson <rth@twiddle.net>
Message-id: 145641859552.30295.7821536833590725201.stgit@localhost
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
			
			
This commit is contained in:
		
							parent
							
								
									56797b1fbc
								
							
						
					
					
						commit
						1bcea73e13
					
				| @ -93,7 +93,7 @@ typedef enum { | ||||
| } ExitStatus; | ||||
| 
 | ||||
| /* global register indexes */ | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv cpu_std_ir[31]; | ||||
| static TCGv cpu_fir[31]; | ||||
| static TCGv cpu_pc; | ||||
|  | ||||
| @ -56,7 +56,7 @@ | ||||
| #define IS_USER(s) (s->user) | ||||
| #endif | ||||
| 
 | ||||
| TCGv_ptr cpu_env; | ||||
| TCGv_env cpu_env; | ||||
| /* We reuse the same 64-bit temporaries for efficiency.  */ | ||||
| static TCGv_i64 cpu_V0, cpu_V1, cpu_M0; | ||||
| static TCGv_i32 cpu_R[16]; | ||||
|  | ||||
| @ -70,7 +70,7 @@ typedef struct DisasCompare { | ||||
| } DisasCompare; | ||||
| 
 | ||||
| /* Share the TCG temporaries common between 32 and 64 bit modes.  */ | ||||
| extern TCGv_ptr cpu_env; | ||||
| extern TCGv_env cpu_env; | ||||
| extern TCGv_i32 cpu_NF, cpu_ZF, cpu_CF, cpu_VF; | ||||
| extern TCGv_i64 cpu_exclusive_addr; | ||||
| extern TCGv_i64 cpu_exclusive_val; | ||||
|  | ||||
| @ -60,7 +60,7 @@ | ||||
| #define CC_MASK_NZVC 0xf | ||||
| #define CC_MASK_RNZV 0x10e | ||||
| 
 | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv cpu_R[16]; | ||||
| static TCGv cpu_PR[16]; | ||||
| static TCGv cc_x; | ||||
|  | ||||
| @ -65,7 +65,7 @@ | ||||
| //#define MACRO_TEST   1
 | ||||
| 
 | ||||
| /* global register indexes */ | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv cpu_A0; | ||||
| static TCGv cpu_cc_dst, cpu_cc_src, cpu_cc_src2, cpu_cc_srcT; | ||||
| static TCGv_i32 cpu_cc_op; | ||||
|  | ||||
| @ -44,7 +44,7 @@ | ||||
| 
 | ||||
| #define MEM_INDEX 0 | ||||
| 
 | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv cpu_R[32]; | ||||
| static TCGv cpu_pc; | ||||
| static TCGv cpu_ie; | ||||
|  | ||||
| @ -50,7 +50,7 @@ | ||||
| static TCGv_i32 cpu_halted; | ||||
| static TCGv_i32 cpu_exception_index; | ||||
| 
 | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| 
 | ||||
| static char cpu_reg_names[3*8*3 + 5*4]; | ||||
| static TCGv cpu_dregs[8]; | ||||
|  | ||||
| @ -46,7 +46,7 @@ | ||||
|             (((src) >> start) & ((1 << (end - start + 1)) - 1)) | ||||
| 
 | ||||
| static TCGv env_debug; | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv cpu_R[32]; | ||||
| static TCGv cpu_SR[18]; | ||||
| static TCGv env_imm; | ||||
|  | ||||
| @ -1355,7 +1355,7 @@ enum { | ||||
| }; | ||||
| 
 | ||||
| /* global register indices */ | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv cpu_gpr[32], cpu_PC; | ||||
| static TCGv cpu_HI[MIPS_DSP_ACC], cpu_LO[MIPS_DSP_ACC]; | ||||
| static TCGv cpu_dspctrl, btarget, bcond; | ||||
|  | ||||
| @ -56,7 +56,7 @@ enum { | ||||
| 
 | ||||
| static TCGv cpu_pc; | ||||
| static TCGv cpu_gregs[16]; | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv cc_a, cc_b; | ||||
| 
 | ||||
| #include "exec/gen-icount.h" | ||||
|  | ||||
| @ -53,7 +53,7 @@ typedef struct DisasContext { | ||||
|     uint32_t delayed_branch; | ||||
| } DisasContext; | ||||
| 
 | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv cpu_sr; | ||||
| static TCGv cpu_R[32]; | ||||
| static TCGv cpu_pc; | ||||
|  | ||||
| @ -49,7 +49,7 @@ | ||||
| /* Code translation helpers                                                  */ | ||||
| 
 | ||||
| /* global register indexes */ | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static char cpu_reg_names[10*3 + 22*4 /* GPR */ | ||||
|     + 10*4 + 22*5 /* SPE GPRh */ | ||||
|     + 10*4 + 22*5 /* FPR */ | ||||
|  | ||||
| @ -37,7 +37,7 @@ | ||||
| #include "exec/cpu_ldst.h" | ||||
| 
 | ||||
| /* global register indexes */ | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| 
 | ||||
| #include "exec/gen-icount.h" | ||||
| #include "exec/helper-proto.h" | ||||
|  | ||||
| @ -61,7 +61,7 @@ enum { | ||||
| }; | ||||
| 
 | ||||
| /* global register indexes */ | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv cpu_gregs[24]; | ||||
| static TCGv cpu_sr, cpu_sr_m, cpu_sr_q, cpu_sr_t; | ||||
| static TCGv cpu_pc, cpu_ssr, cpu_spc, cpu_gbr; | ||||
|  | ||||
| @ -39,7 +39,8 @@ | ||||
|                          according to jump_pc[T2] */ | ||||
| 
 | ||||
| /* global register indexes */ | ||||
| static TCGv_ptr cpu_env, cpu_regwptr; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv_ptr cpu_regwptr; | ||||
| static TCGv cpu_cc_src, cpu_cc_src2, cpu_cc_dst; | ||||
| static TCGv_i32 cpu_cc_op; | ||||
| static TCGv_i32 cpu_psr; | ||||
| @ -2291,7 +2292,7 @@ static void gen_fmovq(DisasContext *dc, DisasCompare *cmp, int rd, int rs) | ||||
| } | ||||
| 
 | ||||
| #ifndef CONFIG_USER_ONLY | ||||
| static inline void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr, TCGv_ptr cpu_env) | ||||
| static inline void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr, TCGv_env cpu_env) | ||||
| { | ||||
|     TCGv_i32 r_tl = tcg_temp_new_i32(); | ||||
| 
 | ||||
|  | ||||
| @ -32,7 +32,7 @@ | ||||
| 
 | ||||
| #define FMT64X                          "%016" PRIx64 | ||||
| 
 | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv cpu_pc; | ||||
| static TCGv cpu_regs[TILEGX_R_COUNT]; | ||||
| 
 | ||||
|  | ||||
| @ -47,7 +47,7 @@ static TCGv cpu_PSW_SV; | ||||
| static TCGv cpu_PSW_AV; | ||||
| static TCGv cpu_PSW_SAV; | ||||
| /* CPU env */ | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| 
 | ||||
| #include "exec/gen-icount.h" | ||||
| 
 | ||||
|  | ||||
| @ -48,7 +48,7 @@ typedef struct DisasContext { | ||||
|    conditional executions state has been updated.  */ | ||||
| #define DISAS_SYSCALL 5 | ||||
| 
 | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv_i32 cpu_R[32]; | ||||
| 
 | ||||
| /* FIXME:  These should be removed.  */ | ||||
|  | ||||
| @ -74,7 +74,7 @@ typedef struct DisasContext { | ||||
|     unsigned cpenable; | ||||
| } DisasContext; | ||||
| 
 | ||||
| static TCGv_ptr cpu_env; | ||||
| static TCGv_env cpu_env; | ||||
| static TCGv_i32 cpu_pc; | ||||
| static TCGv_i32 cpu_R[16]; | ||||
| static TCGv_i32 cpu_FR[16]; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Lluís Vilanova
						Lluís Vilanova