@@ -22,7 +22,7 @@ void aborts_data_lower(unsigned long iss, unsigned long far, unsigned long il, u
2222 ERROR ("no information to handle data abort (0x%x)" , far );
2323 }
2424
25- unsigned long DSFC = bit64_extract (iss , ESR_ISS_DA_DSFC_OFF , ESR_ISS_DA_DSFC_LEN ) & (0xf << 2 );
25+ unsigned long DSFC = bit_extract (iss , ESR_ISS_DA_DSFC_OFF , ESR_ISS_DA_DSFC_LEN ) & (0xf << 2 );
2626
2727 if (DSFC != ESR_ISS_DA_DSFC_TRNSLT && DSFC != ESR_ISS_DA_DSFC_PERMIS ) {
2828 ERROR ("data abort is not translation fault - cant deal with it" );
@@ -33,11 +33,11 @@ void aborts_data_lower(unsigned long iss, unsigned long far, unsigned long il, u
3333 if (handler != NULL ) {
3434 struct emul_access emul ;
3535 emul .addr = addr ;
36- emul .width = (1 << bit64_extract (iss , ESR_ISS_DA_SAS_OFF , ESR_ISS_DA_SAS_LEN ));
36+ emul .width = (1U << bit_extract (iss , ESR_ISS_DA_SAS_OFF , ESR_ISS_DA_SAS_LEN ));
3737 emul .write = iss & ESR_ISS_DA_WnR_BIT ? true : false;
38- emul .reg = bit64_extract (iss , ESR_ISS_DA_SRT_OFF , ESR_ISS_DA_SRT_LEN );
39- emul .reg_width = 4 + (4 * bit64_extract (iss , ESR_ISS_DA_SF_OFF , ESR_ISS_DA_SF_LEN ));
40- emul .sign_ext = bit64_extract (iss , ESR_ISS_DA_SSE_OFF , ESR_ISS_DA_SSE_LEN );
38+ emul .reg = bit_extract (iss , ESR_ISS_DA_SRT_OFF , ESR_ISS_DA_SRT_LEN );
39+ emul .reg_width = 4 + (4 * bit_extract (iss , ESR_ISS_DA_SF_OFF , ESR_ISS_DA_SF_LEN ));
40+ emul .sign_ext = bit_extract (iss , ESR_ISS_DA_SSE_OFF , ESR_ISS_DA_SSE_LEN );
4141
4242 // TODO: check if the access is aligned. If not, inject an exception in the vm
4343
@@ -56,15 +56,15 @@ long int standard_service_call(unsigned long _fn_num)
5656{
5757 UNUSED_ARG (_fn_num );
5858
59- int64_t ret = -1 ;
59+ long int ret = -1 ;
6060
6161 unsigned long smc_fid = vcpu_readreg (cpu ()-> vcpu , 0 );
6262 unsigned long x1 = vcpu_readreg (cpu ()-> vcpu , 1 );
6363 unsigned long x2 = vcpu_readreg (cpu ()-> vcpu , 2 );
6464 unsigned long x3 = vcpu_readreg (cpu ()-> vcpu , 3 );
6565
6666 if (is_psci_fid (smc_fid )) {
67- ret = psci_smc_handler (smc_fid , x1 , x2 , x3 );
67+ ret = psci_smc_handler (( uint32_t ) smc_fid , x1 , x2 , x3 );
6868 } else {
6969 INFO ("unknown smc_fid 0x%lx" , smc_fid );
7070 }
@@ -96,7 +96,7 @@ static inline void syscall_handler(unsigned long iss, unsigned long far, unsigne
9696 WARNING ("Unknown system call fid 0x%x" , fid );
9797 }
9898
99- vcpu_writereg (cpu ()-> vcpu , 0 , ret );
99+ vcpu_writereg (cpu ()-> vcpu , 0 , ( unsigned long ) ret );
100100}
101101
102102void hvc_handler (unsigned long iss , unsigned long far , unsigned long il , unsigned long ec )
@@ -145,8 +145,8 @@ void sysreg_handler(unsigned long iss, unsigned long far, unsigned long il, unsi
145145 emul .addr = reg_addr ;
146146 emul .width = 8 ;
147147 emul .write = iss & ESR_ISS_SYSREG_DIR ? false : true;
148- emul .reg = bit64_extract (iss , ESR_ISS_SYSREG_REG_OFF , ESR_ISS_SYSREG_REG_LEN );
149- emul .reg_high = bit64_extract (iss , ESR_ISS_SYSREG_REG2_OFF , ESR_ISS_SYSREG_REG2_LEN );
148+ emul .reg = bit_extract (iss , ESR_ISS_SYSREG_REG_OFF , ESR_ISS_SYSREG_REG_LEN );
149+ emul .reg_high = bit_extract (iss , ESR_ISS_SYSREG_REG2_OFF , ESR_ISS_SYSREG_REG2_LEN );
150150 emul .reg_width = 8 ;
151151 emul .multi_reg = (ec == ESR_EC_RG_64 ) ? true : false;
152152 emul .sign_ext = false;
@@ -187,9 +187,9 @@ void aborts_sync_handler()
187187 ipa_fault_addr = far ;
188188 }
189189
190- unsigned long ec = bit64_extract (esr , ESR_EC_OFF , ESR_EC_LEN );
191- unsigned long il = bit64_extract (esr , ESR_IL_OFF , ESR_IL_LEN );
192- unsigned long iss = bit64_extract (esr , ESR_ISS_OFF , ESR_ISS_LEN );
190+ unsigned long ec = bit_extract (esr , ESR_EC_OFF , ESR_EC_LEN );
191+ unsigned long il = bit_extract (esr , ESR_IL_OFF , ESR_IL_LEN );
192+ unsigned long iss = bit_extract (esr , ESR_ISS_OFF , ESR_ISS_LEN );
193193
194194 abort_handler_t handler = abort_handlers [ec ];
195195 if (handler ) {
0 commit comments