src/dev/arm/vgic.cc
/* Update state (in general); something concerned with ctx_id has changed.
 * This may raise a maintenance interrupt.
 */
Update state (in general); something concerned with ctx_id has changed.
This may raise a maintenance interrupt.
Update state ( in general ) ; something concerned with ctx_id has changed . This may raise a maintenance interrupt .
void
VGic::updateIntState(ContextID ctx_id)
{
    struct vcpuIntData *tvid = &vcpuData[ctx_id];
    tvid->eisr = 0;
    for (int i = 0; i < NUM_LR; i++) {
        if (!tvid->LR[i].State && tvid->LR[i].EOI) {
            tvid->eisr |= 1 << i;
        }
    }
    assert(sys->threads.numRunning() <= VGIC_CPU_MAX);
    for (int i = 0; i < sys->threads.numRunning(); i++) {
        struct vcpuIntData *vid = &vcpuData[i];
        if (!vIntPosted[i]) {
            if (lrPending(vid) && vid->vctrl.En) {
                vIntPosted[i] = true;
                postVInt(i, curTick() + 1);
            }
        } else if (!lrPending(vid)) {
            vIntPosted[i] = false;
            unPostVInt(i);
        }
        if (!maintIntPosted[i]) {
            if (vid->hcr.En && getMISR(vid)) {
                maintIntPosted[i] = true;
                postMaintInt(i);
            }
        } else {
            if (!vid->hcr.En || !getMISR(vid)) {
                unPostMaintInt(i);
                maintIntPosted[i] = false;
            }
        }
    }
}
void VGic :: updateIntState ( ContextID ctx_id ) { struct vcpuIntData * tvid = & vcpuData [ ctx_id ] ; tvid -> eisr = 0 ; for ( int i = 0 ; i < NUM_LR ; i ++ ) { if ( ! tvid -> LR [ i ] . State && tvid -> LR [ i ] . EOI ) { tvid -> eisr |= 1 << i ; } } assert ( sys -> threads . numRunning ( ) <= VGIC_CPU_MAX ) ; for ( int i = 0 ; i < sys -> threads . numRunning ( ) ; i ++ ) { struct vcpuIntData * vid = & vcpuData [ i ] ; if ( ! vIntPosted [ i ] ) { if ( lrPending ( vid ) && vid -> vctrl . En ) { vIntPosted [ i ] = true ; postVInt ( i , curTick ( ) + 1 ) ; } } else if ( ! lrPending ( vid ) ) { vIntPosted [ i ] = false ; unPostVInt ( i ) ; } if ( ! maintIntPosted [ i ] ) { if ( vid -> hcr . En && getMISR ( vid ) ) { maintIntPosted [ i ] = true ; postMaintInt ( i ) ; } } else { if ( ! vid -> hcr . En || ! getMISR ( vid ) ) { unPostMaintInt ( i ) ; maintIntPosted [ i ] = false ; } } } }
Update state (in general); something concerned with ctx_id has changed.
Update state ( in general ) ; something concerned with ctx_id has changed .
// @todo This should update APRs! // Build EISR contents: // (Cached so that regs can read them without messing about again) // Are any LRs active that weren't before? // Any maintenance ints to send?