khypervisor  v1
Functions | Variables
gic/slotpirq.c File Reference
#include <slotpirq.h>
#include <k-hypervisor-config.h>
#include <vgic.h>
#include <log/print.h>
Include dependency graph for slotpirq.c:

Go to the source code of this file.

Functions

void slotpirq_init (void)
void slotpirq_set (vmid_t vmid, uint32_t slot, uint32_t pirq)
uint32_t slotpirq_get (vmid_t vmid, uint32_t slot)
void slotpirq_clear (vmid_t vmid, uint32_t slot)
void slotvirq_set (vmid_t vmid, uint32_t slot, uint32_t virq)
uint32_t slotvirq_getslot (vmid_t vmid, uint32_t virq)
void slotvirq_clear (vmid_t vmid, uint32_t slot)

Variables

static uint32_t _guest_pirqatslot [NUM_GUESTS_STATIC][VGIC_NUM_MAX_SLOTS]
static uint32_t _guest_virqatslot [NUM_GUESTS_STATIC][VGIC_NUM_MAX_SLOTS]

Function Documentation

void slotpirq_clear ( vmid_t  vmid,
uint32_t  slot 
)

Definition at line 40 of file slotpirq.c.

Here is the call graph for this function:

uint32_t slotpirq_get ( vmid_t  vmid,
uint32_t  slot 
)

Definition at line 29 of file slotpirq.c.

{
    uint32_t pirq = PIRQ_INVALID;

    if ( vmid < NUM_GUESTS_STATIC ) {
        pirq = _guest_pirqatslot[vmid][slot];
        printh( "vgic: reading vmid:%d slot:%d pirq:%d\n", vmid, slot, pirq );
    }
    return pirq;
}
void slotpirq_init ( void  )

Definition at line 10 of file slotpirq.c.

{
    int i, j;
    for( i = 0; i < NUM_GUESTS_STATIC; i++ ) {
        for( j = 0; j < VGIC_NUM_MAX_SLOTS; j++ ) {
            _guest_pirqatslot[i][j] = PIRQ_INVALID;
            _guest_virqatslot[i][j] = VIRQ_INVALID;
        }
    }
}
void slotpirq_set ( vmid_t  vmid,
uint32_t  slot,
uint32_t  pirq 
)

Definition at line 21 of file slotpirq.c.

{
    if ( vmid < NUM_GUESTS_STATIC ) {
        printh( "vgic: setting vmid:%d slot:%d pirq:%d\n", vmid, slot, pirq );
        _guest_pirqatslot[vmid][slot] = pirq;
    }
}
void slotvirq_clear ( vmid_t  vmid,
uint32_t  slot 
)

Definition at line 72 of file slotpirq.c.

Here is the call graph for this function:

uint32_t slotvirq_getslot ( vmid_t  vmid,
uint32_t  virq 
)

Definition at line 55 of file slotpirq.c.

{
    uint32_t slot = SLOT_INVALID;
    int i;

    if ( vmid < NUM_GUESTS_STATIC ) {
        for ( i = 0; i < VGIC_NUM_MAX_SLOTS; i++ ) {
            if ( _guest_virqatslot[vmid][i] == virq ) {
                slot = i;
                printh( "vgic: reading vmid:%d slot:%d virq:%d\n", vmid, slot, virq );
                break;
            }
        }
    }
    return slot;
}
void slotvirq_set ( vmid_t  vmid,
uint32_t  slot,
uint32_t  virq 
)

Definition at line 45 of file slotpirq.c.

{
    if ( vmid < NUM_GUESTS_STATIC ) {
        printh( "vgic: setting vmid:%d slot:%d virq:%d\n", vmid, slot, virq );
        _guest_virqatslot[vmid][slot] = virq;
    } else {
        printh( "vgic: not setting invalid vmid:%d slot:%d virq:%d\n", vmid, slot, virq );
    }
}

Variable Documentation

Definition at line 7 of file slotpirq.c.

Definition at line 8 of file slotpirq.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines