feat:(riscv/intr) 实现riscv plic驱动,能处理外部中断 (#799)

* feat:(riscv/intr) 实现riscv plic驱动,能处理外部中断

- 实现riscv plic驱动,能处理外部中断
- 能收到virtio-blk的中断
- 实现fasteoi interrupt handler
This commit is contained in:
LoGin
2024-05-01 21:11:32 +08:00
committed by GitHub
parent 17dc558977
commit 0102d69fdd
30 changed files with 1214 additions and 127 deletions

View File

@ -663,3 +663,23 @@ fn test_alloc_bitmap_bitand_128() {
assert_eq!(bitmap3.first_false_index(), Some(2));
assert_eq!(bitmap3.last_index(), Some(67));
}
#[test]
fn test_alloc_bitmap_bitand_assign_128() {
let mut bitmap = AllocBitmap::new(128);
bitmap.set_all(true);
let mut bitmap2 = AllocBitmap::new(128);
bitmap2.set(0, true);
bitmap2.set(1, true);
bitmap2.set(67, true);
bitmap.bitand_assign(&bitmap2);
assert_eq!(bitmap.len(), 128);
assert_eq!(bitmap.size(), 16);
assert_eq!(bitmap.first_index(), Some(0));
assert_eq!(bitmap.first_false_index(), Some(2));
assert_eq!(bitmap.last_index(), Some(67));
}