You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/20 13:22:43 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5291: arch/risc-v: Unify common irq code

pkarashchenko commented on a change in pull request #5291:
URL: https://github.com/apache/incubator-nuttx/pull/5291#discussion_r788756984



##########
File path: arch/risc-v/src/qemu-rv/qemu_rv_irq.c
##########
@@ -108,17 +108,17 @@ void up_disable_irq(int irq)
   int extirq;
   uint32_t oldstat;
 
-  if (irq == QEMU_RV_IRQ_MTIMER)
+  if (irq == RISCV_IRQ_MTIMER)
     {
       /* Read mstatus & clear machine timer interrupt enable in mie */
 
       asm volatile("csrrc %0, mie, %1"
                   : "=r"(oldstat)
                   : "r"(MIE_MTIE));
     }
-  else if (irq > QEMU_RV_IRQ_MEXT)
+  else if (irq > RISCV_IRQ_MEXT)

Review comment:
       shouldn't we have `irq >= RISCV_IRQ_MEXT` here?

##########
File path: arch/risc-v/src/qemu-rv/qemu_rv_irq.c
##########
@@ -147,17 +147,17 @@ void up_enable_irq(int irq)
   int extirq;
   uint32_t oldstat;
 
-  if (irq == QEMU_RV_IRQ_MTIMER)
+  if (irq == RISCV_IRQ_MTIMER)
     {
       /* Read mstatus & set machine timer interrupt enable in mie */
 
       asm volatile("csrrs %0, mie, %1"
                   : "=r"(oldstat)
                   : "r"(MIE_MTIE));
     }
-  else if (irq > QEMU_RV_IRQ_MEXT)
+  else if (irq > RISCV_IRQ_MEXT)

Review comment:
       shouldn't we have `irq >= RISCV_IRQ_MEXT` here?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org