@@ -300,7 +300,7 @@ static void guest_sync_handler(struct ex_regs *regs)
300300 uint64_t esr , ec ;
301301
302302 esr = read_sysreg (esr_el1 );
303- ec = (esr >> ESR_EC_SHIFT ) & ESR_EC_MASK ;
303+ ec = ESR_ELx_EC (esr ) ;
304304
305305 __GUEST_ASSERT (expected_ec == ec ,
306306 "PC: 0x%lx; ESR: 0x%lx; EC: 0x%lx; EC expected: 0x%lx" ,
@@ -338,10 +338,10 @@ static void test_access_invalid_pmc_regs(struct pmc_accessor *acc, int pmc_idx)
338338 * Reading/writing the event count/type registers should cause
339339 * an UNDEFINED exception.
340340 */
341- TEST_EXCEPTION (ESR_EC_UNKNOWN , acc -> read_cntr (pmc_idx ));
342- TEST_EXCEPTION (ESR_EC_UNKNOWN , acc -> write_cntr (pmc_idx , 0 ));
343- TEST_EXCEPTION (ESR_EC_UNKNOWN , acc -> read_typer (pmc_idx ));
344- TEST_EXCEPTION (ESR_EC_UNKNOWN , acc -> write_typer (pmc_idx , 0 ));
341+ TEST_EXCEPTION (ESR_ELx_EC_UNKNOWN , acc -> read_cntr (pmc_idx ));
342+ TEST_EXCEPTION (ESR_ELx_EC_UNKNOWN , acc -> write_cntr (pmc_idx , 0 ));
343+ TEST_EXCEPTION (ESR_ELx_EC_UNKNOWN , acc -> read_typer (pmc_idx ));
344+ TEST_EXCEPTION (ESR_ELx_EC_UNKNOWN , acc -> write_typer (pmc_idx , 0 ));
345345 /*
346346 * The bit corresponding to the (unimplemented) counter in
347347 * {PMCNTEN,PMINTEN,PMOVS}{SET,CLR} registers should be RAZ.
@@ -425,7 +425,7 @@ static void create_vpmu_vm(void *guest_code)
425425
426426 vpmu_vm .vm = vm_create (1 );
427427 vm_init_descriptor_tables (vpmu_vm .vm );
428- for (ec = 0 ; ec < ESR_EC_NUM ; ec ++ ) {
428+ for (ec = 0 ; ec < ESR_ELx_EC_MAX + 1 ; ec ++ ) {
429429 vm_install_sync_handler (vpmu_vm .vm , VECTOR_SYNC_CURRENT , ec ,
430430 guest_sync_handler );
431431 }
0 commit comments