summaryrefslogtreecommitdiff
path: root/lib/sbi_ipi.c
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2019-02-13 05:32:06 +0300
committerAnup Patel <anup@brainfault.org>2019-02-14 07:01:18 +0300
commit70a474d2c24dc3e0c8841e6ef5cc96797deadbf5 (patch)
tree0c1456134e4815aadea0f523d7fb570454e23d0d /lib/sbi_ipi.c
parent4cb4d46875dd0f0dd01d3ff1fee4f0d6cefb857a (diff)
downloadopensbi-70a474d2c24dc3e0c8841e6ef5cc96797deadbf5.tar.xz
lib: Use CSR_<FOO> instead of <foo> for csr_*()
Some older toolchains may not have all the csr's defined. Update all the csr functions to use the CSR_ #define values instead of the toolchain defined values. Suggested-by: Olof Johansson <olof@lixom.net> Signed-off-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi_ipi.c')
-rw-r--r--lib/sbi_ipi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sbi_ipi.c b/lib/sbi_ipi.c
index 316b2a0..0e9fb30 100644
--- a/lib/sbi_ipi.c
+++ b/lib/sbi_ipi.c
@@ -27,7 +27,7 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch,
struct sbi_platform *plat = sbi_platform_ptr(scratch);
if (pmask)
- mask &= load_ulong(pmask, csr_read(mepc));
+ mask &= load_ulong(pmask, csr_read(CSR_MEPC));
/* send IPIs to everyone */
for (i = 0, m = mask; m; i++, m >>= 1) {
@@ -46,7 +46,7 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch,
void sbi_ipi_clear_smode(struct sbi_scratch *scratch)
{
- csr_clear(mip, MIP_SSIP);
+ csr_clear(CSR_MIP, MIP_SSIP);
}
void sbi_ipi_process(struct sbi_scratch *scratch)
@@ -64,7 +64,7 @@ void sbi_ipi_process(struct sbi_scratch *scratch)
ipi_event = __ffs(ipi_type);
switch (ipi_event) {
case SBI_IPI_EVENT_SOFT:
- csr_set(mip, MIP_SSIP);
+ csr_set(CSR_MIP, MIP_SSIP);
break;
case SBI_IPI_EVENT_FENCE_I:
__asm__ __volatile("fence.i");
@@ -83,7 +83,7 @@ void sbi_ipi_process(struct sbi_scratch *scratch)
int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot)
{
/* Enable software interrupts */
- csr_set(mie, MIP_MSIP);
+ csr_set(CSR_MIE, MIP_MSIP);
return sbi_platform_ipi_init(sbi_platform_ptr(scratch),
cold_boot);