示例#1
0
NTSTATUS
CHardwareSimulation::
Reset()
{
    PAGED_CODE();

    KScopedMutex Lock( m_ListLock );
    DBG_ENTER("(): m_PinID=%d", m_PinID);

    FreeSGList( &m_ScatterGatherMappings, L"StreamPointer Reset SG List" );

    m_ScatterGatherMappingsQueued=0;
    m_NumMappingsCompleted = 0;
    m_ScatterGatherBytesQueued = 0;

    DBG_LEAVE("(): m_PinID=%d", m_PinID);
    return STATUS_SUCCESS;
}
NTSTATUS
CImageHardwareSimulation::
Reset()
{
    PAGED_CODE();

    KScopedMutex Lock( m_ListLock );
    DBG_ENTER("(): m_PinID=%d", m_PinID);

    //  Parent class reset first...
    CHardwareSimulation::Reset();

    FreeSGList( &m_ScatterGatherMappings, L"StreamPointer Reset Burst List" );

    m_bTriggered = FALSE;
    m_bEndOfSequence = FALSE;
    m_pClone = NULL;
    m_bPastBufferTrigger = FALSE;
    m_TriggerTime = 0;

    DBG_LEAVE("(): m_PinID=%d", m_PinID);

    return STATUS_SUCCESS;
}
示例#3
0
NTSTATUS
CHardwareSimulation::
Stop()

/*++

Routine Description:

    Stop the hardware simulation...

    For us, stop the timer, free the synthesizer and flush the queue.

Arguments:

    None

Return Value:

    Success / Failure

--*/

{
    PAGED_CODE();

    //
    // If the hardware is told to stop while it's running, we need to
    // halt the interrupts first.  If we're already paused, this has
    // already been done.
    //

    DBG_ENTER("(): m_PinID=%d", m_PinID);

    BOOLEAN bCancel = FALSE;

    {
        //  Prevent state-changes during this call.
        KScopedMutex    Lock(m_ListLock);

        bCancel = (m_PinState == PinRunning);
        m_PinState = PinStopped;

        //  Free the synthesis buffer.
        m_Synthesizer->Destroy();

        //
        // Free S/G buffer
        //
        FreeSGList( &m_ScatterGatherMappings, L"StreamPointer Stop SG List" );

        m_ScatterGatherMappingsQueued=0;
        m_NumMappingsCompleted = 0;
        m_ScatterGatherBytesQueued = 0;
    }

    //  If running, stop the timer to make sure we don't try to deliver one last frame.
    if( bCancel )
    {
        m_IsrTimer.Cancel();
    }

    return STATUS_SUCCESS;
}
NTSTATUS
CImageHardwareSimulation::
Stop()

/*++

Routine Description:

    Stop the hardware simulation...
    
    Wait until the timer has stopped, flush the queue, dereference the clock 
    and reset our state before returning.

Arguments:

    None

Return Value:

    Success / Failure

--*/

{
    PAGED_CODE();

    // If the hardware is told to stop while it's running, we need to
    // halt the interrupts first.  If we're already paused, this has
    // already been done.
    //

    DBG_ENTER("(): m_PinID=%d", m_PinID);

    //
    // Protect the S/G list
    //
    KScopedMutex Lock( m_ListLock );

    CHardwareSimulation::Stop();

    //
    // Free S/G buffer
    //
    FreeSGList( &m_ScatterGatherMappings, L"StreamPointer Stop Burst List" );

    if (m_Clock)
    {
        m_Clock -> Release ();
        m_Clock = NULL;
    }

    m_bTriggered = FALSE;
    m_bEndOfSequence = FALSE;
    m_pClone = NULL;
    m_bPastBufferTrigger = FALSE;
    m_PinMode = PinNormalMode;
    m_TriggerTime = 0;

    DBG_TRACE("m_bTriggered=FALSE, m_bPastBufferTrigger=FALSE");

    DBG_LEAVE("(): m_PinID=%d", m_PinID);

    return STATUS_SUCCESS;
}