@@ -391,7 +391,7 @@ static void op_privileged(vm_t *vm, uint32_t insn)
391
391
return ;
392
392
}
393
393
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 );
395
395
return ;
396
396
}
397
397
switch (decode_i_unsigned (insn )) {
@@ -408,7 +408,7 @@ static void op_privileged(vm_t *vm, uint32_t insn)
408
408
/* TODO: Implement this */
409
409
break ;
410
410
default :
411
- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
411
+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
412
412
break ;
413
413
}
414
414
}
@@ -432,7 +432,7 @@ static void csr_read(vm_t *vm, uint16_t addr, uint32_t *value)
432
432
if ((addr >> 8 ) == 0xC ) {
433
433
uint16_t idx = addr & MASK (7 );
434
434
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 );
436
436
else {
437
437
/* Use the instruction counter for all of the counters.
438
438
* 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)
445
445
}
446
446
447
447
if (!vm -> s_mode ) {
448
- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
448
+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
449
449
return ;
450
450
}
451
451
@@ -488,14 +488,14 @@ static void csr_read(vm_t *vm, uint16_t addr, uint32_t *value)
488
488
* value = vm -> stval ;
489
489
break ;
490
490
default :
491
- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
491
+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
492
492
}
493
493
}
494
494
495
495
static void csr_write (vm_t * vm , uint16_t addr , uint32_t value )
496
496
{
497
497
if (!vm -> s_mode ) {
498
- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
498
+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
499
499
return ;
500
500
}
501
501
@@ -540,7 +540,7 @@ static void csr_write(vm_t *vm, uint16_t addr, uint32_t value)
540
540
vm -> stval = value ;
541
541
break ;
542
542
default :
543
- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
543
+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
544
544
}
545
545
}
546
546
@@ -600,7 +600,7 @@ static void op_system(vm_t *vm, uint32_t insn)
600
600
break ;
601
601
602
602
default :
603
- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
603
+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
604
604
return ;
605
605
}
606
606
}
@@ -689,7 +689,7 @@ static bool op_jmp(vm_t *vm, uint32_t insn, uint32_t a, uint32_t b)
689
689
case 0b101 : /* BFUNC_BGE */
690
690
return ((int32_t ) a ) >= ((int32_t ) b );
691
691
}
692
- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
692
+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
693
693
return false;
694
694
}
695
695
@@ -724,15 +724,15 @@ static void op_jump_link(vm_t *vm, uint32_t insn, uint32_t addr)
724
724
static void op_amo (vm_t * vm , uint32_t insn )
725
725
{
726
726
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 );
728
728
uint32_t addr = read_rs1 (vm , insn );
729
729
uint32_t value , value2 ;
730
730
switch (decode_func5 (insn )) {
731
731
case 0b00010 : /* AMO_LR */
732
732
if (addr & 0b11 )
733
733
return vm_set_exception (vm , RV_EXC_LOAD_MISALIGN , addr );
734
734
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 );
736
736
mmu_load (vm , addr , RV_MEM_LW , & value , true);
737
737
if (vm -> error )
738
738
return ;
@@ -775,7 +775,7 @@ static void op_amo(vm_t *vm, uint32_t insn)
775
775
AMO_OP (value > value2 ? value : value2 );
776
776
break ;
777
777
default :
778
- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
778
+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
779
779
return ;
780
780
}
781
781
}
@@ -860,7 +860,7 @@ void vm_step(vm_t *vm)
860
860
/* TODO: implement for multi-threading */
861
861
break ;
862
862
default :
863
- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
863
+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
864
864
break ;
865
865
}
866
866
break ;
@@ -871,7 +871,7 @@ void vm_step(vm_t *vm)
871
871
op_system (vm , insn );
872
872
break ;
873
873
default :
874
- vm_set_exception (vm , RV_EXC_ILLEGAL_INSTR , 0 );
874
+ vm_set_exception (vm , RV_EXC_ILLEGAL_INSN , 0 );
875
875
break ;
876
876
}
877
877
}
0 commit comments