diff options
Diffstat (limited to 'big-little/common/vgiclib.c')
-rw-r--r-- | big-little/common/vgiclib.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/big-little/common/vgiclib.c b/big-little/common/vgiclib.c index 9acee57..d05f81a 100644 --- a/big-little/common/vgiclib.c +++ b/big-little/common/vgiclib.c @@ -1,23 +1,23 @@ /* * Copyright (c) 2012, ARM Limited. All rights reserved. - * + * * Redistribution and use in source and binary forms, with * or without modification, are permitted provided that the * following conditions are met: - * + * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the + * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the - * above copyright notice, this list of conditions and - * the following disclaimer in the documentation + * above copyright notice, this list of conditions and + * the following disclaimer in the documentation * and/or other materials provided with the distribution. - * + * * Neither the name of ARM nor the names of its * contributors may be used to endorse or promote products * derived from this software without specific prior written - * permission. + * permission. */ #include "vgiclib.h" @@ -30,7 +30,7 @@ extern unsigned get_cpuinfo(unsigned); /* - * Manage overflowints somehow.. static pool with recycling allocators. + * Manage overflowints somehow.. static pool with recycling allocators. */ #define MAXOVERFLOWINTS 200 @@ -284,8 +284,8 @@ void vgic_init(void) free_overflowint(&(theoverflowints[cpuid][i]), cpuid); } - /* - * Find the number of List registers + /* + * Find the number of List registers * TODO: Will not work if individual cpus can have different number * of list registers across clusters. Needs to be detected for each * access then. @@ -299,7 +299,7 @@ void vgic_init(void) } /* - * Abstracted entry accessor functions. Work for live or saved state + * Abstracted entry accessor functions. Work for live or saved state */ static void set_vgic_entry(unsigned int descr, unsigned int slot) { @@ -312,7 +312,7 @@ static unsigned int get_vgic_entry(unsigned int slot) } /* - * Abstracted status accessor functions, as above + * Abstracted status accessor functions, as above */ static void set_vgic_status(unsigned int status) { @@ -337,13 +337,13 @@ static void set_vgic_queue_entry(struct gic_cpuif *cpuif, unsigned int descr) unsigned cpuid = read_cpuid(); /* - * If we are queuing something and there is currently no queue, set the interrupt bit + * If we are queuing something and there is currently no queue, set the interrupt bit */ if (!(cpuif->overflow)) set_vgic_status(get_vgic_status() | 0x2); /* - * Determine insertion point, might be the end of the list + * Determine insertion point, might be the end of the list */ for (oflowh = &(cpuif->overflow); *oflowh; oflowh = &((*oflowh)->next)) if ((*oflowh)->priority > pri) @@ -377,7 +377,7 @@ void vgic_savestate(unsigned int cpu) /* Clear the saved bit index */ cur_elrsr &= ~(1 << i); - /* + /* * Invalidate the pending/active virtual interrupt. Since its a shared vGIC * this irq will persist till the next switch and hence create a duplicate. */ @@ -451,12 +451,12 @@ void vgic_loadstate(unsigned int cpu) * vgic_refresh: Generic "maintenance" routine for the VGIC * * * * This is called: - * * - On maintenance interrupt. We get maintenance interrupts for - * * two reasons: + * * - On maintenance interrupt. We get maintenance interrupts for + * * two reasons: * * o Non-zero EOI skid. This routine deals with the skid and sets * * the field to 0, quenching the interrupt source. - * * o "Nearly empty" interrupt bit set, and nearly empty condition - * * exists. This interrupt source is quenched by filling the + * * o "Nearly empty" interrupt bit set, and nearly empty condition + * * exists. This interrupt source is quenched by filling the * * slots (and clearing the interrupt bit if the queue is now empty) * * - When a new interrupt arrives and the cached "free slot" value * * indicates that there are no free slots. We expect to scavenge some @@ -476,31 +476,31 @@ void vgic_refresh(unsigned int cpu) struct overflowint **oflowh, *oflowp; /* - * Grab a copy of the status. + * Grab a copy of the status. */ status = get_vgic_status(); /* * "newstatus" is the value to be written back if needed. Whatever - * * happens, we will clear the slipped EOI count by the time we are done + * * happens, we will clear the slipped EOI count by the time we are done */ newstatus = status & 0x07FFFFFF; /* - * See if there are any "slipped" EOIs + * See if there are any "slipped" EOIs */ i = (status >> 27) & 0x1F; if (i) { /* - * If there are, let's deal with them. + * If there are, let's deal with them. * * * * We will walk through the list of queued interrupts, deactivating the * * ACTIVE ones as needed until we either have no more slipped EOI's to * * do or run out of queued interrupts. If we run out of queued * * interrupts first, that's UNPREDICTABLE behaviour (and the fault of * * the VM). In this case we will just ignore the surplus EOIs. - * * + * * * * After EOI'ing, we delete the entry if it was just ACTIVE or set it * * to PENDING if it was PENDING+ACTIVE. * * @@ -513,14 +513,14 @@ void vgic_refresh(unsigned int cpu) value = (*oflowh)->value; if (value & VGIC_ENTRY_ACTIVE) { /* - * It's ACTIVE (or PENDING+ACTIVE) + * It's ACTIVE (or PENDING+ACTIVE) */ i--; if (value & VGIC_ENTRY_HW) { /* * HW bit set, so we need to pass on an EOI. This doesn't ever happen - * * for IPIs, so just pass on the 10-bit "Hardware ID" + * * for IPIs, so just pass on the 10-bit "Hardware ID" */ gic_deactivate_int((value >> 10) & 0x3FF); @@ -528,12 +528,12 @@ void vgic_refresh(unsigned int cpu) if (value & VGIC_ENTRY_PENDING) { /* - * It was PENDING+ACTIVE, clear the ACTIVE bit and move on + * It was PENDING+ACTIVE, clear the ACTIVE bit and move on */ (*oflowh)->value &= ~VGIC_ENTRY_ACTIVE; } else { /* - * It was only ACTIVE, so we need to delete it.. + * It was only ACTIVE, so we need to delete it.. */ oflowp = *oflowh; oflowh = &(oflowp->next); @@ -541,7 +541,7 @@ void vgic_refresh(unsigned int cpu) } } else { /* - * It wasn't ACTIVE :( Try the next one. + * It wasn't ACTIVE :( Try the next one. */ oflowh = &((*oflowh)->next); } @@ -549,26 +549,26 @@ void vgic_refresh(unsigned int cpu) } /* - * Now populate any spare slots with entries from the list (if any). Also fix up the free slot bitmap + * Now populate any spare slots with entries from the list (if any). Also fix up the free slot bitmap */ for (i = 0; i < hv_lr_count[cpu]; i++) { value = get_vgic_entry(i); if (value & 0x30000000) { /* - * This entry already contains a valid interrupt, skip + * This entry already contains a valid interrupt, skip */ continue; } /* - * Not a valid interrupt + * Not a valid interrupt */ oflowp = cpuif->overflow; if (oflowp) { /* * If there's a queue, move the top entry out of the queue and into - * * this slot.. + * * this slot.. */ cpuif->overflow = oflowp->next; @@ -576,21 +576,21 @@ void vgic_refresh(unsigned int cpu) free_overflowint(oflowp, cpu); } else { /* - * .. otherwise mark it as available. + * .. otherwise mark it as available. */ cpuif->freelist |= (1 << i); } } /* - * If we now don't have any overflow, clear the status bit + * If we now don't have any overflow, clear the status bit */ if (!(cpuif->overflow)) { newstatus &= ~0x2; } /* - * Refresh status if needed + * Refresh status if needed */ if (newstatus != status) { set_vgic_status(newstatus); @@ -613,7 +613,7 @@ void enqueue_interrupt(unsigned int descr, unsigned int cpu) cpuif = &(cpuifs[cpu]); /* - * If there are no free slots, trigger a maintenance + * If there are no free slots, trigger a maintenance */ if (!(cpuif->freelist)) { vgic_refresh(cpu); @@ -621,7 +621,7 @@ void enqueue_interrupt(unsigned int descr, unsigned int cpu) if (cpuif->freelist) { /* - * There is a free slot, use it. + * There is a free slot, use it. */ slot = cpuif->freelist; /* Take the free list.. */ slot &= (-slot); /* .. extract one set bit .. */ @@ -631,7 +631,7 @@ void enqueue_interrupt(unsigned int descr, unsigned int cpu) set_vgic_entry(descr, slot); } else { /* - * There are no free slots, we are either queuing this one or swapping another out + * There are no free slots, we are either queuing this one or swapping another out */ unsigned int pri = (descr >> 20) & 0xFF; unsigned int minpri = 0; @@ -640,14 +640,14 @@ void enqueue_interrupt(unsigned int descr, unsigned int cpu) if (cpuif->overflow && cpuif->overflow->priority <= pri) { /* - * There are already queued interrupts with the same or higher priority, just queue this one + * There are already queued interrupts with the same or higher priority, just queue this one */ set_vgic_queue_entry(cpuif, descr); return; } /* - * Otherwise find the lowest priority entry.. + * Otherwise find the lowest priority entry.. */ for (i = 0; i < hv_lr_count[cpu]; i++) { j = (get_vgic_entry(i) >> 20) & 0xFF; /* Get the priority for the current thing in this slot */ @@ -659,13 +659,13 @@ void enqueue_interrupt(unsigned int descr, unsigned int cpu) if (minpri > pri) { /* - * If it's lower priority than this new one we kick it out + * If it's lower priority than this new one we kick it out */ set_vgic_queue_entry(cpuif, get_vgic_entry(minslot)); set_vgic_entry(descr, minslot); } else { /* - * Otherwise just queue the new one + * Otherwise just queue the new one */ set_vgic_queue_entry(cpuif, descr); } |