Lines Matching refs:chip
45 pub fn test_get_pic(mut chip: impl IrqChipX86_64) { in test_get_pic()
46 let state = chip in test_get_pic()
54 chip.service_irq(0, true).expect("could not service irq"); in test_get_pic()
56 let state = chip in test_get_pic()
64 pub fn test_set_pic(mut chip: impl IrqChipX86_64) { in test_set_pic()
65 let mut state = chip in test_set_pic()
72 chip.set_pic_state(PicSelect::Primary, &state) in test_set_pic()
75 let state = chip in test_set_pic()
83 pub fn test_get_ioapic(mut chip: impl IrqChipX86_64) { in test_get_ioapic()
84 let state = chip.get_ioapic_state().expect("could not get ioapic state"); in test_get_ioapic()
97 chip.service_irq(1, true).expect("could not set irq line"); in test_get_ioapic()
99 let state = chip.get_ioapic_state().expect("could not get ioapic state"); in test_get_ioapic()
105 pub fn test_set_ioapic(mut chip: impl IrqChipX86_64) { in test_set_ioapic()
106 let mut state = chip.get_ioapic_state().expect("could not get ioapic state"); in test_set_ioapic()
113 chip.set_ioapic_state(&state) in test_set_ioapic()
116 let state = chip.get_ioapic_state().expect("could not get ioapic state"); in test_set_ioapic()
123 pub fn test_get_pit(chip: impl IrqChipX86_64) { in test_get_pit()
124 let state = chip.get_pit().expect("failed to get pit state"); in test_get_pit()
134 pub fn test_set_pit(mut chip: impl IrqChipX86_64) { in test_set_pit()
135 let mut state = chip.get_pit().expect("failed to get pit state"); in test_set_pit()
142 chip.set_pit(&state).expect("failed to set pit state"); in test_set_pit()
144 let state = chip.get_pit().expect("failed to get pit state"); in test_set_pit()
151 pub fn test_get_lapic(chip: impl IrqChipX86_64) { in test_get_lapic()
152 let state = chip.get_lapic_state(0).expect("failed to get lapic state"); in test_get_lapic()
161 pub fn test_set_lapic(mut chip: impl IrqChipX86_64) { in test_set_lapic()
163 let mut state = chip.get_lapic_state(0).expect("failed to get lapic state"); in test_set_lapic()
169 chip.set_lapic_state(0, &state) in test_set_lapic()
173 let state = chip.get_lapic_state(0).expect("failed to get lapic state"); in test_set_lapic()
178 fn check_pic_interrupts(chip: &impl IrqChipX86_64, select: PicSelect, value: u8) { in check_pic_interrupts()
179 let state = chip in check_pic_interrupts()
187 fn check_ioapic_interrupts(chip: &impl IrqChipX86_64, value: u32) { in check_ioapic_interrupts()
188 let state = chip.get_ioapic_state().expect("could not get ioapic state"); in check_ioapic_interrupts()
194 pub fn test_route_irq(mut chip: impl IrqChipX86_64) { in test_route_irq()
196 chip.set_irq_routes(&[]) in test_route_irq()
199 chip.service_irq(1, true).expect("could not set irq line"); in test_route_irq()
202 check_pic_interrupts(&chip, PicSelect::Primary, 0); in test_route_irq()
203 check_ioapic_interrupts(&chip, 0); in test_route_irq()
206 chip.route_irq(IrqRoute { in test_route_irq()
209 chip: IrqSourceChip::Ioapic, in test_route_irq()
215 chip.service_irq(1, true).expect("could not set irq line"); in test_route_irq()
218 check_pic_interrupts(&chip, PicSelect::Primary, 0); in test_route_irq()
219 check_ioapic_interrupts(&chip, 1 << 3); in test_route_irq()
222 chip.service_irq(1, false).expect("could not set irq line"); in test_route_irq()
225 check_pic_interrupts(&chip, PicSelect::Primary, 0); in test_route_irq()
226 check_ioapic_interrupts(&chip, 0); in test_route_irq()
229 chip.route_irq(IrqRoute { in test_route_irq()
232 chip: IrqSourceChip::PicPrimary, in test_route_irq()
239 chip.service_irq(1, true).expect("could not set irq line"); in test_route_irq()
242 check_pic_interrupts(&chip, PicSelect::Primary, 0); in test_route_irq()
243 check_ioapic_interrupts(&chip, 1 << 3); in test_route_irq()
246 chip.service_irq(2, true).expect("could not set irq line"); in test_route_irq()
249 check_pic_interrupts(&chip, PicSelect::Primary, 1 << 6); in test_route_irq()
250 check_ioapic_interrupts(&chip, 1 << 3); in test_route_irq()