pudding_kernel/
interrupt.rs

1use crate::system::*;
2use crate::*;
3
4pub unsafe fn initialize(stack: &mut [u8]) {
5    cpu::interrupt_initialize(stack);
6}
7
8// 割り込みコンテキストに移行
9#[no_mangle]
10pub unsafe extern "C" fn _kernel_interrupt_start() {
11    set_interrupt_flag();
12}
13
14// 割り込みハンドラの実行
15#[no_mangle]
16pub unsafe extern "C" fn _kernel_interrupt_handler(intno: isize) {
17    irc::interrupt_handler(intno);
18}
19
20// 割り込みコンテキストを抜けて遅延ディスパッチ実行
21#[no_mangle]
22pub unsafe extern "C" fn _kernel_interrupt_end() {
23    clear_interrupt_flag();
24    if test_dispatch_reserve_flag() && !test_dispatch_disable_flag() {
25        clear_dispatch_reserve_flag();
26        task::task_switch();
27    }
28}