diff options
author | Dietmar Eggemann <dietmar.eggemann@arm.com> | 2012-05-15 11:40:25 +0100 |
---|---|---|
committer | Dietmar Eggemann <dietmar.eggemann@arm.com> | 2012-05-23 12:44:36 +0100 |
commit | edc6843a3a4ac02422bda79f8cfb6894c5d384df (patch) | |
tree | deb8e147a41f3f4064925776d0e1031cf13cbce4 /big-little/lib/ipi.c | |
parent | 27f2efc606df7adbf4477e860c447debf20d4dd1 (diff) |
GNU indent pass over C and header files.
Basically:
$ for f in $(find . -name "*.[ch]"); do indent -linux $f; done
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Diffstat (limited to 'big-little/lib/ipi.c')
-rw-r--r-- | big-little/lib/ipi.c | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/big-little/lib/ipi.c b/big-little/lib/ipi.c index 936cda8..5b49d20 100644 --- a/big-little/lib/ipi.c +++ b/big-little/lib/ipi.c @@ -49,25 +49,25 @@ static unsigned hyp_ipi_check[16]; */ static unsigned get_free_ipi(void) { - unsigned shift, cpu_if_bit, cpu_id = read_cpuid(), cluster_id = - read_clusterid(); - int ctr; + unsigned shift, cpu_if_bit, cpu_id = read_cpuid(), cluster_id = + read_clusterid(); + int ctr; - cpu_if_bit = 1 << get_cpuif(cluster_id, cpu_id); + cpu_if_bit = 1 << get_cpuif(cluster_id, cpu_id); - /* Find the register offset */ - for (ctr = 3; ctr >= 0; ctr--) - /* Check whether IPI<shift> has already been generated by us */ - for (shift = 0; shift < 4; shift++) { - if (read32 - (GIC_ID_PHY_BASE + GICD_SPENDSGIR + - (ctr << 2)) & (cpu_if_bit << (shift << 3))) - continue; + /* Find the register offset */ + for (ctr = 3; ctr >= 0; ctr--) + /* Check whether IPI<shift> has already been generated by us */ + for (shift = 0; shift < 4; shift++) { + if (read32 + (GIC_ID_PHY_BASE + GICD_SPENDSGIR + + (ctr << 2)) & (cpu_if_bit << (shift << 3))) + continue; - return (ctr << 2) + shift; - } + return (ctr << 2) + shift; + } - return MAX_IPI; + return MAX_IPI; } /* @@ -76,38 +76,38 @@ static unsigned get_free_ipi(void) */ unsigned send_hyp_ipi(unsigned cpuif_mask, unsigned type) { - unsigned rc = TRUE; - unsigned ipi_no = 0; - - /* - * First choose a non-pending IPI to avoid a clash with the OS. - */ - ipi_no = get_free_ipi(); - if (ipi_no == MAX_IPI) { - rc = FALSE; - return rc; - } - - /* - * For this IPI set the mask in our global variable. We do it, payload software - * does not. But, first check whether any earlier IPIs have already been acked - */ - while (TRUE) { - spin_lock(&lock_ipi_check); - if (hyp_ipi_check[ipi_no] & 0xff) { - spin_unlock(&lock_ipi_check); - } else { - hyp_ipi_check[ipi_no] = (type << 8) | cpuif_mask; - dsb(); - spin_unlock(&lock_ipi_check); - break; - } - }; - - /* Send the IPI to the cpu_mask */ - gic_send_ipi(cpuif_mask, ipi_no); - - return rc; + unsigned rc = TRUE; + unsigned ipi_no = 0; + + /* + * First choose a non-pending IPI to avoid a clash with the OS. + */ + ipi_no = get_free_ipi(); + if (ipi_no == MAX_IPI) { + rc = FALSE; + return rc; + } + + /* + * For this IPI set the mask in our global variable. We do it, payload software + * does not. But, first check whether any earlier IPIs have already been acked + */ + while (TRUE) { + spin_lock(&lock_ipi_check); + if (hyp_ipi_check[ipi_no] & 0xff) { + spin_unlock(&lock_ipi_check); + } else { + hyp_ipi_check[ipi_no] = (type << 8) | cpuif_mask; + dsb(); + spin_unlock(&lock_ipi_check); + break; + } + }; + + /* Send the IPI to the cpu_mask */ + gic_send_ipi(cpuif_mask, ipi_no); + + return rc; } /* @@ -116,20 +116,20 @@ unsigned send_hyp_ipi(unsigned cpuif_mask, unsigned type) */ unsigned get_hyp_ipi(unsigned cpu_if, unsigned ipi_no) { - unsigned type = 0; - - spin_lock(&lock_ipi_check); - /* - * If this IPI was sent by the big-little code then our cpu_if bit must have - * been set in the ipi_check flag. Reset the bit and indicate that its an - * internal IPI. - */ - if (hyp_ipi_check[ipi_no] & (1 << cpu_if)) { - type = hyp_ipi_check[ipi_no] >> 8; - hyp_ipi_check[ipi_no] &= ~(1 << cpu_if); - dsb(); - } - spin_unlock(&lock_ipi_check); - - return type; + unsigned type = 0; + + spin_lock(&lock_ipi_check); + /* + * If this IPI was sent by the big-little code then our cpu_if bit must have + * been set in the ipi_check flag. Reset the bit and indicate that its an + * internal IPI. + */ + if (hyp_ipi_check[ipi_no] & (1 << cpu_if)) { + type = hyp_ipi_check[ipi_no] >> 8; + hyp_ipi_check[ipi_no] &= ~(1 << cpu_if); + dsb(); + } + spin_unlock(&lock_ipi_check); + + return type; } |