@@ -531,11 +531,40 @@ mod test {
531
531
#[ test]
532
532
fn test_mpp ( ) {
533
533
let mut mstatus = Mstatus { bits : 0 } ;
534
- mstatus. set_mpp ( MPP :: User ) ;
535
- assert_eq ! ( mstatus. mpp( ) , MPP :: User ) ;
536
- mstatus. set_mpp ( MPP :: Machine ) ;
537
- assert_eq ! ( mstatus. mpp( ) , MPP :: Machine ) ;
538
- mstatus. set_mpp ( MPP :: Supervisor ) ;
539
- assert_eq ! ( mstatus. mpp( ) , MPP :: Supervisor ) ;
534
+
535
+ test_csr_field ! ( mstatus, mpp: MPP :: User ) ;
536
+ test_csr_field ! ( mstatus, mpp: MPP :: Machine ) ;
537
+ test_csr_field ! ( mstatus, mpp: MPP :: Supervisor ) ;
538
+
539
+ test_csr_field ! ( mstatus, spp: SPP :: User ) ;
540
+ test_csr_field ! ( mstatus, spp: SPP :: Supervisor ) ;
541
+
542
+ test_csr_field ! ( mstatus, fs: FS :: Off ) ;
543
+ test_csr_field ! ( mstatus, fs: FS :: Initial ) ;
544
+ test_csr_field ! ( mstatus, fs: FS :: Clean ) ;
545
+ test_csr_field ! ( mstatus, fs: FS :: Dirty ) ;
546
+
547
+ test_csr_field ! ( mstatus, vs: VS :: Off ) ;
548
+ test_csr_field ! ( mstatus, vs: VS :: Initial ) ;
549
+ test_csr_field ! ( mstatus, vs: VS :: Clean ) ;
550
+ test_csr_field ! ( mstatus, vs: VS :: Dirty ) ;
551
+
552
+ test_csr_field ! ( mstatus, xs: XS :: AllOff ) ;
553
+ test_csr_field ! ( mstatus, xs: XS :: NoneDirtyOrClean ) ;
554
+ test_csr_field ! ( mstatus, xs: XS :: NoneDirtySomeClean ) ;
555
+ test_csr_field ! ( mstatus, xs: XS :: SomeDirty ) ;
556
+
557
+ test_csr_field ! ( mstatus, sie) ;
558
+ test_csr_field ! ( mstatus, mie) ;
559
+ test_csr_field ! ( mstatus, spie) ;
560
+ test_csr_field ! ( mstatus, ube) ;
561
+ test_csr_field ! ( mstatus, mpie) ;
562
+ test_csr_field ! ( mstatus, mprv) ;
563
+ test_csr_field ! ( mstatus, sum) ;
564
+ test_csr_field ! ( mstatus, mxr) ;
565
+ test_csr_field ! ( mstatus, tvm) ;
566
+ test_csr_field ! ( mstatus, tw) ;
567
+ test_csr_field ! ( mstatus, tsr) ;
568
+ test_csr_field ! ( mstatus, sd) ;
540
569
}
541
570
}
0 commit comments