import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_irq_handlers.c
//
//  p9_pgpe_irq_handler_pcb_type4
//
//  Handles PCB Type4 interrupts from CME which are CME registration
//  messages. In this handler, PGPE simply takes note of which CMEs
//  sent registration message. The actual processing is handled in the
//  process thread.
//
p9_pgpe_irq_handler_pcb_type4
Handles PCB Type4 interrupts from CME which are CME registration
messages. In this handler, PGPE simply takes note of which CMEs
sent registration message. The actual processing is handled in the
process thread.
p9_pgpe_irq_handler_pcb_type4 Handles PCB Type4 interrupts from CME which are CME registration messages . In this handler PGPE simply takes note of which CMEs sent registration message . The actual processing is handled in the process thread .
void p9_pgpe_irq_handler_pcb_type4(void* arg, PkIrqId irq)
{
    PkMachineContext ctx;
    PK_TRACE_DBG("PCB4: Enter");
    volatile uint32_t opit4pr;
    uint32_t opit4prQuad, q;
    opit4pr = in32(OCB_OPIT4PRA);
    out32(OCB_OPIT4PRA_CLR, opit4pr);
    PK_TRACE_INF("PCB4: opit4pr 0x%x", opit4pr);
    for (q = 0; q < MAX_QUADS; q++)
    {
        opit4prQuad = (opit4pr >> ((MAX_QUADS - q + 1) << 2)) & 0xf;
        if (opit4prQuad)
        {
            if (G_pgpe_pstate_record.activeQuads & QUAD_MASK(q))
            {
                PK_TRACE_ERR("PCB4: Quad %d Already Registered. opit4pra=0x%x", q, opit4pr);
                PGPE_TRACE_AND_PANIC(PGPE_CME_UNEXPECTED_REGISTRATION);
            }
            G_pgpe_pstate_record.pendQuadsRegisterProcess |= QUAD_MASK(q);
        }
    }
    if ((G_pgpe_pstate_record.semProcessPosted == 0) &&
        G_pgpe_pstate_record.pendQuadsRegisterProcess != 0)
    {
        PK_TRACE_DBG("PCB4: posted");
        G_pgpe_pstate_record.semProcessPosted = 1;
        pk_semaphore_post(&G_pgpe_pstate_record.sem_process_req);
    }
    G_pgpe_pstate_record.semProcessSrc |= SEM_PROCESS_SRC_TYPE4_IRQ;
    pk_irq_vec_restore(&ctx);
    PK_TRACE_DBG("PCB4: Exit");
}
void p9_pgpe_irq_handler_pcb_type4 ( void * arg , PkIrqId irq ) { PkMachineContext ctx ; PK_TRACE_DBG ( " " ) ; volatile uint32_t opit4pr ; uint32_t opit4prQuad , q ; opit4pr = in32 ( OCB_OPIT4PRA ) ; out32 ( OCB_OPIT4PRA_CLR , opit4pr ) ; PK_TRACE_INF ( " " , opit4pr ) ; for ( q = 0 ; q < MAX_QUADS ; q ++ ) { opit4prQuad = ( opit4pr >> ( ( MAX_QUADS - q + 1 ) << 2 ) ) & 0xf ; if ( opit4prQuad ) { if ( G_pgpe_pstate_record . activeQuads & QUAD_MASK ( q ) ) { PK_TRACE_ERR ( " " , q , opit4pr ) ; PGPE_TRACE_AND_PANIC ( PGPE_CME_UNEXPECTED_REGISTRATION ) ; } G_pgpe_pstate_record . pendQuadsRegisterProcess |= QUAD_MASK ( q ) ; } } if ( ( G_pgpe_pstate_record . semProcessPosted == 0 ) && G_pgpe_pstate_record . pendQuadsRegisterProcess != 0 ) { PK_TRACE_DBG ( " " ) ; G_pgpe_pstate_record . semProcessPosted = 1 ; pk_semaphore_post ( & G_pgpe_pstate_record . sem_process_req ) ; } G_pgpe_pstate_record . semProcessSrc |= SEM_PROCESS_SRC_TYPE4_IRQ ; pk_irq_vec_restore ( & ctx ) ; PK_TRACE_DBG ( " " ) ; }
p9_pgpe_irq_handler_pcb_type4
Handles PCB Type4 interrupts from CME which are CME registration
messages.
p9_pgpe_irq_handler_pcb_type4 Handles PCB Type4 interrupts from CME which are CME registration messages .
//Check which CMEs sent Registration Type4 //Already registered //Restore the interrupt here. However, it will be processed inside the process thread //This doesn't cause an issue because back to back type4 interrupts will just //set a bit in pendQuadsRegisterProcess bit field. However, semaphore to the process //thread will be posted only once. Also, once process thread starts processing it enters //sub-critical section, and masks all external interrupt through UIH priority mechanism.