khypervisor  v1
Functions
virq.h File Reference
#include <hvmm_types.h>
Include dependency graph for virq.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

hvmm_status_t virq_inject (vmid_t vmid, uint32_t virq, uint32_t pirq, uint8_t hw)
hvmm_status_t virq_init (void)

Function Documentation

Definition at line 88 of file virq.c.

{
    int i, j;

    for( i = 0; i < NUM_GUESTS_STATIC; i++) {
        for( j = 0; j < (VIRQ_MAX_ENTRIES + 1); j++ ) {
            _guest_virqs[i][j].valid = 0;
        }
    }

    vgic_setcallback_virq_flush(&virq_flush);
    return HVMM_STATUS_SUCCESS;
}

Here is the call graph for this function:

hvmm_status_t virq_inject ( vmid_t  vmid,
uint32_t  virq,
uint32_t  pirq,
uint8_t  hw 
)

Definition at line 26 of file virq.c.

{
    hvmm_status_t result = HVMM_STATUS_BUSY;
    int i;
    struct virq_entry *q = &_guest_virqs[vmid][0];
    int slot = slotvirq_getslot(vmid, virq);
    if ( slot == SLOT_INVALID ) {
        /* Inject only the same virq is not present in a slot */
        for( i = 0; i < VIRQ_MAX_ENTRIES; i++ ) {
            if ( q[i].valid == 0 ) {
                q[i].pirq = pirq;
                q[i].virq = virq;   
                q[i].hw = hw;
                q[i].valid = 1;
                result = HVMM_STATUS_SUCCESS;
                break;
            }
        }
    printh( "virq: queueing virq %d pirq %d to vmid %d %s\n", virq, pirq, vmid, result == HVMM_STATUS_SUCCESS ? "done" : "failed");
    } else {
     printh( "virq: rejected queueing duplicated virq %d pirq %d to vmid %d %s\n", virq, pirq, vmid);    
    }
    return result;
}

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines