Hi Hakan, Diego,

I'd like to introduce myself, since this is my first message to the list. My 
name is Stefan Yohansson. I'm a software engineer and mathematician, and I've 
worked mostly in systems and telephony (FreeSWITCH, Asterisk, WebRTC). I've 
contributed to Mozilla Firefox, FreeSWITCH, GNOME Settings. I've been following 
the riscv64 port with interest and I'd like to help.

My setup is a DC-ROMA RISC-V Mainboard II (ESWIN EIC7700X SoC) installed in a 
Framework Laptop 13. I build gnumach natively on that machine with GCC 13.

With the latest changes, the build fails in riscv64/riscv64/pmap.c:

  ../riscv64/riscv64/pmap.c: In function 'pmap_walk_range':
  ../riscv64/riscv64/pmap.c:181:26: error: 'false' undeclared (first use in 
this function)
    181 |                 } while (false);
        |                          ^~~~~

probably it is a toolchain mismatch problem since I think this build ok
in GCC 15 (maybe your case).

To keep the port building with the GCC versions most riscv64
distributions currently ship, I think that using FALSE
which this file already uses elsewhere:

  --- a/riscv64/riscv64/pmap.c
  +++ b/riscv64/riscv64/pmap.c
  @@ -181 +181 @@
  -             } while (false);
  +             } while (FALSE);

If it is the case, here it is the commit with the fix I am using here
(this is my first commit here, let me know if this is not the right process):

>From 09ad783cf43a62acdf3c529083c012acf9c9cbe4 Mon Sep 17 00:00:00 2001
From: StefanYohansson <[email protected]>
Date: Sat, 7 Nov 2026 14:24:32 +0000
Subject: [PATCH] riscv64: Use FALSE instead of C23 false in pmap_walk_range
To: [email protected]
Cc: [email protected],
    [email protected]

* riscv64/riscv64/pmap.c (pmap_walk_range): Use FALSE instead of
false, which is only a keyword in C23 and is otherwise undeclared
without <stdbool.h>.

Commit c152687434bc ("riscv64: Bootstrap VM and map NS16550 registers
through pmap") fails to build with GCC 13 and 14, which default to
-std=gnu17. Use FALSE from <mach/boolean.h>, as the rest of the file
does.

Signed-off-by: StefanYohansson <[email protected]>
---
 riscv64/riscv64/pmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/riscv64/riscv64/pmap.c b/riscv64/riscv64/pmap.c
index 9ee17f4b..e25e09c3 100644
--- a/riscv64/riscv64/pmap.c
+++ b/riscv64/riscv64/pmap.c
@@ -178,7 +178,7 @@ pmap_walk_range(pmap_t pmap, vm_offset_t virt, vm_offset_t 
vend,
 
                        tmp = (pt_entry_t *) phystokv(pte_to_pa(*tmp));
                        ppage = &tmp[i & RISCV_VPN_MASK];
-               } while (false);
+               } while (FALSE);
 
                va = virt + ((vm_offset_t)(i - page_start) << PAGE_SHIFT);
                visit(va, ppage, arg);
-- 
2.43.0

Thank you both for the work on this port.

Regards,
Stefan

Reply via email to