unsafe fn timer_handler(a: &ExceptionArguments) {
    #[cfg(feature = "test-timer")]
    {
        // Don't change this print stmt. without changing
        // `s01_timer` in integration-tests.rs:
        sprintln!("Got a timer interrupt");
        debug::shutdown(ExitReason::Ok);
    }

    // Periodically advance replica state, then resume immediately
    nr::KernelNode::synchronize();
    let kcb = get_kcb();
    for pid in 0..crate::process::MAX_PROCESSES {
        nrproc::NrProcess::<Ring3Process>::synchronize(pid);
    }

    if kcb.arch.has_executor() {
        // TODO(process-mgmt): Ensures that we still periodically
        // check and advance replicas even on cores that have a core.
        // Only a single idle core per replica should probably do that,
        // so if cores go properly back to idling when finished execution,
        // this is no longer necessary...
        let is_replica_main_thread = {
            let thread = atopology::MACHINE_TOPOLOGY.current_thread();
            thread.node().is_none()
                || thread
                    .node()
                    .unwrap()
                    .threads()
                    .next()
                    .map(|t| t.id == thread.id)
                    .unwrap_or(false)
        };
        if is_replica_main_thread {
            timer::set(timer::DEFAULT_TIMER_DEADLINE);
        }

        // Return immediately
        let r = kcb_iret_handle(kcb);
        r.resume()
    } else {
        // Go to scheduler instead
        //warn!("got a timer on core {}", kcb.arch.id());
        crate::scheduler::schedule()
    }
}
/// Handler for the timer exception.
///
/// We currently use it to periodically make sure that a replica
/// makes forward progress to avoid liveness issues.
Handler for the timer exception.
We currently use it to periodically make sure that a replica
makes forward progress to avoid liveness issues.
Handler for the timer exception . We currently use it to periodically make sure that a replica makes forward progress to avoid liveness issues .
unsafe fn timer_handler(a: &ExceptionArguments) {
    #[cfg(feature = "test-timer")]
    {
        // Don't change this print stmt. without changing
        // `s01_timer` in integration-tests.rs:
        sprintln!("Got a timer interrupt");
        debug::shutdown(ExitReason::Ok);
    }
    // Periodically advance replica state, then resume immediately
    nr::KernelNode::synchronize();
    let kcb = get_kcb();
    for pid in 0..crate::process::MAX_PROCESSES {
        nrproc::NrProcess::<Ring3Process>::synchronize(pid);
    }
    if kcb.arch.has_executor() {
        // TODO(process-mgmt): Ensures that we still periodically
        // check and advance replicas even on cores that have a core.
        // Only a single idle core per replica should probably do that,
        // so if cores go properly back to idling when finished execution,
        // this is no longer necessary...
        let is_replica_main_thread = {
            let thread = atopology::MACHINE_TOPOLOGY.current_thread();
            thread.node().is_none()
                || thread
                    .node()
                    .unwrap()
                    .threads()
                    .next()
                    .map(|t| t.id == thread.id)
                    .unwrap_or(false)
        };
        if is_replica_main_thread {
            timer::set(timer::DEFAULT_TIMER_DEADLINE);
        }
        // Return immediately
        let r = kcb_iret_handle(kcb);
        r.resume()
    } else {
        // Go to scheduler instead
        //warn!("got a timer on core {}", kcb.arch.id());
        crate::scheduler::schedule()
    }
}
unsafe fn timer_handler ( a : & ExceptionArguments ) { # [ cfg ( feature " " ) ] { // Don't change this print stmt. without changing // `s01_timer` in integration-tests.rs: sprintln ! ( " " ) ; debug :: shutdown ( ExitReason :: Ok ) ; } // Periodically advance replica state, then resume immediately nr :: KernelNode :: synchronize ( ) ; let kcb = get_kcb ( ) ; for pid in 0 .. crate :: process :: MAX_PROCESSES { nrproc :: NrProcess :: < Ring3Process > :: synchronize ( pid ) ; } if kcb . arch . has_executor ( ) { // TODO(process-mgmt): Ensures that we still periodically // check and advance replicas even on cores that have a core. // Only a single idle core per replica should probably do that, // so if cores go properly back to idling when finished execution, // this is no longer necessary... let is_replica_main_thread = { let thread = atopology :: MACHINE_TOPOLOGY . current_thread ( ) ; thread . node ( ) . is_none ( ) || thread . node ( ) . unwrap ( ) . threads ( ) . next ( ) . map ( | t | t . id == thread . id ) . unwrap_or ( false ) } ; if is_replica_main_thread { timer :: set ( timer :: DEFAULT_TIMER_DEADLINE ) ; } // Return immediately let r = kcb_iret_handle ( kcb ) ; r . resume ( ) } else { // Go to scheduler instead //warn!("got a timer on core {}", kcb.arch.id()); crate :: scheduler :: schedule ( ) } }
Handler for the timer exception.
Handler for the timer exception .
a
&ExceptionArguments
a
&ExceptionArguments