@@ -391,7 +391,7 @@ static void op_privileged(vm_t *vm, uint32_t insn)
391391 return ;
392392 }
393393 if (insn & ((MASK (5 ) << 7 ) | (MASK (5 ) << 15 ))) {
394- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
394+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
395395 return ;
396396 }
397397 switch (decode_i_unsigned (insn )) {
@@ -408,7 +408,7 @@ static void op_privileged(vm_t *vm, uint32_t insn)
408408 /* TODO: Implement this */
409409 break ;
410410 default :
411- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
411+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
412412 break ;
413413 }
414414}
@@ -432,7 +432,7 @@ static void csr_read(vm_t *vm, uint16_t addr, uint32_t *value)
432432 if ((addr >> 8 ) == 0xC ) {
433433 uint16_t idx = addr & MASK (7 );
434434 if (idx >= 0x20 || !(vm -> s_mode || ((vm -> scounteren >> idx ) & 1 )))
435- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
435+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
436436 else {
437437 /* Use the instruction counter for all of the counters.
438438 * Ideally, reads should return the value before the increment,
@@ -445,7 +445,7 @@ static void csr_read(vm_t *vm, uint16_t addr, uint32_t *value)
445445 }
446446
447447 if (!vm -> s_mode ) {
448- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
448+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
449449 return ;
450450 }
451451
@@ -488,14 +488,14 @@ static void csr_read(vm_t *vm, uint16_t addr, uint32_t *value)
488488 * value = vm -> stval ;
489489 break ;
490490 default :
491- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
491+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
492492 }
493493}
494494
495495static void csr_write (vm_t * vm , uint16_t addr , uint32_t value )
496496{
497497 if (!vm -> s_mode ) {
498- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
498+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
499499 return ;
500500 }
501501
@@ -540,7 +540,7 @@ static void csr_write(vm_t *vm, uint16_t addr, uint32_t value)
540540 vm -> stval = value ;
541541 break ;
542542 default :
543- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
543+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
544544 }
545545}
546546
@@ -600,7 +600,7 @@ static void op_system(vm_t *vm, uint32_t insn)
600600 break ;
601601
602602 default :
603- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
603+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
604604 return ;
605605 }
606606}
@@ -689,7 +689,7 @@ static bool op_jmp(vm_t *vm, uint32_t insn, uint32_t a, uint32_t b)
689689 case 0b101 : /* BFUNC_BGE */
690690 return ((int32_t ) a ) >= ((int32_t ) b );
691691 }
692- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
692+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
693693 return false;
694694}
695695
@@ -724,15 +724,15 @@ static void op_jump_link(vm_t *vm, uint32_t insn, uint32_t addr)
724724static void op_amo (vm_t * vm , uint32_t insn )
725725{
726726 if (unlikely (decode_func3 (insn ) != 0b010 /* amo.w */ ))
727- return vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
727+ return vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
728728 uint32_t addr = read_rs1 (vm , insn );
729729 uint32_t value , value2 ;
730730 switch (decode_func5 (insn )) {
731731 case 0b00010 : /* AMO_LR */
732732 if (addr & 0b11 )
733733 return vm_set_exception (vm , RV_EXC_LOAD_MISALIGN , addr );
734734 if (decode_rs2 (insn ))
735- return vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
735+ return vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
736736 mmu_load (vm , addr , RV_MEM_LW , & value , true);
737737 if (vm -> error )
738738 return ;
@@ -775,7 +775,7 @@ static void op_amo(vm_t *vm, uint32_t insn)
775775 AMO_OP (value > value2 ? value : value2 );
776776 break ;
777777 default :
778- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
778+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
779779 return ;
780780 }
781781}
@@ -860,7 +860,7 @@ void vm_step(vm_t *vm)
860860 /* TODO: implement for multi-threading */
861861 break ;
862862 default :
863- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
863+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
864864 break ;
865865 }
866866 break ;
@@ -871,7 +871,7 @@ void vm_step(vm_t *vm)
871871 op_system (vm , insn );
872872 break ;
873873 default :
874- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
874+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
875875 break ;
876876 }
877877}
0 commit comments