diff options
author | Bin Meng <bmeng@tinylab.org> | 2022-12-21 14:38:06 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2023-01-06 14:56:35 +0300 |
commit | 440fa818fbffd0771d75890c4fcda062ceab7ebd (patch) | |
tree | ddc51462269d7532149eab1bd60000158c37a535 /lib/sbi/sbi_emulate_csr.c | |
parent | 6b5188ca14e59ce7bf71afe4e7d3d557c3d31bf8 (diff) | |
download | opensbi-440fa818fbffd0771d75890c4fcda062ceab7ebd.tar.xz |
treewide: Replace TRUE/FALSE with true/false
C language standard uses true/false for the boolean type.
Let's switch to that for better language compatibility.
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Tested-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'lib/sbi/sbi_emulate_csr.c')
-rw-r--r-- | lib/sbi/sbi_emulate_csr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sbi/sbi_emulate_csr.c b/lib/sbi/sbi_emulate_csr.c index aec9d3c..64bebd8 100644 --- a/lib/sbi/sbi_emulate_csr.c +++ b/lib/sbi/sbi_emulate_csr.c @@ -39,7 +39,7 @@ static bool hpm_allowed(int hpm_num, ulong prev_mode, bool virt) cen = 0; } - return ((cen >> hpm_num) & 1) ? TRUE : FALSE; + return ((cen >> hpm_num) & 1) ? true : false; } int sbi_emulate_csr_read(int csr_num, struct sbi_trap_regs *regs, @@ -49,9 +49,9 @@ int sbi_emulate_csr_read(int csr_num, struct sbi_trap_regs *regs, struct sbi_scratch *scratch = sbi_scratch_thishart_ptr(); ulong prev_mode = (regs->mstatus & MSTATUS_MPP) >> MSTATUS_MPP_SHIFT; #if __riscv_xlen == 32 - bool virt = (regs->mstatusH & MSTATUSH_MPV) ? TRUE : FALSE; + bool virt = (regs->mstatusH & MSTATUSH_MPV) ? true : false; #else - bool virt = (regs->mstatus & MSTATUS_MPV) ? TRUE : FALSE; + bool virt = (regs->mstatus & MSTATUS_MPV) ? true : false; #endif switch (csr_num) { @@ -164,9 +164,9 @@ int sbi_emulate_csr_write(int csr_num, struct sbi_trap_regs *regs, int ret = 0; ulong prev_mode = (regs->mstatus & MSTATUS_MPP) >> MSTATUS_MPP_SHIFT; #if __riscv_xlen == 32 - bool virt = (regs->mstatusH & MSTATUSH_MPV) ? TRUE : FALSE; + bool virt = (regs->mstatusH & MSTATUSH_MPV) ? true : false; #else - bool virt = (regs->mstatus & MSTATUS_MPV) ? TRUE : FALSE; + bool virt = (regs->mstatus & MSTATUS_MPV) ? true : false; #endif switch (csr_num) { |