Skip to content

Commit 87ebb28

Browse files
committed
Fix RV32 build. Svpbmt and Memory Attribute Extension (XTheadMae) are
SV39 and above only.
1 parent 87591ee commit 87ebb28

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

sys/arch/riscv/include/pte.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: pte.h,v 1.15 2025/10/12 04:08:26 thorpej Exp $ */
1+
/* $NetBSD: pte.h,v 1.16 2025/10/12 19:44:04 skrll Exp $ */
22

33
/*
44
* Copyright (c) 2014, 2019, 2021 The NetBSD Foundation, Inc.
@@ -216,7 +216,15 @@ pte_flag_bits(struct vm_page_md *mdpg, int flags, bool kernel_p)
216216
return 0;
217217
}
218218

219+
#ifdef _LP64
219220
pt_entry_t pte_enter_flags_to_pbmt(int);
221+
#else
222+
static inline pt_entry_t
223+
pte_enter_flags_to_pbmt(int flags)
224+
{
225+
return 0;
226+
};
227+
#endif
220228

221229
static inline pt_entry_t
222230
pte_make_enter(paddr_t pa, struct vm_page_md *mdpg, vm_prot_t prot,

sys/arch/riscv/riscv/pmap_machdep.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: pmap_machdep.c,v 1.22 2025/10/12 04:08:26 thorpej Exp $ */
1+
/* $NetBSD: pmap_machdep.c,v 1.23 2025/10/12 19:44:04 skrll Exp $ */
22

33
/*
44
* Copyright (c) 2014, 2019, 2021 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
3636
#define __PMAP_PRIVATE
3737

3838
#include <sys/cdefs.h>
39-
__RCSID("$NetBSD: pmap_machdep.c,v 1.22 2025/10/12 04:08:26 thorpej Exp $");
39+
__RCSID("$NetBSD: pmap_machdep.c,v 1.23 2025/10/12 19:44:04 skrll Exp $");
4040

4141
#include <sys/param.h>
4242
#include <sys/buf.h>
@@ -57,10 +57,12 @@ __RCSID("$NetBSD: pmap_machdep.c,v 1.22 2025/10/12 04:08:26 thorpej Exp $");
5757
vaddr_t pmap_direct_base __read_mostly;
5858
vaddr_t pmap_direct_end __read_mostly;
5959

60+
#ifdef _LP64
6061
static pt_entry_t pmap_pte_pbmt_mask __read_mostly;
6162
static pt_entry_t pmap_pte_pma __read_mostly;
6263
static pt_entry_t pmap_pte_nc __read_mostly;
6364
static pt_entry_t pmap_pte_io __read_mostly;
65+
#endif
6466

6567
void
6668
pmap_zero_page(paddr_t pa)
@@ -91,6 +93,7 @@ pmap_copy_page(paddr_t src, paddr_t dst)
9193
#endif
9294
}
9395

96+
#ifdef _LP64
9497
pt_entry_t
9598
pte_enter_flags_to_pbmt(int flags)
9699
{
@@ -101,6 +104,7 @@ pte_enter_flags_to_pbmt(int flags)
101104
}
102105
return pmap_pte_pma;
103106
}
107+
#endif
104108

105109
struct vm_page *
106110
pmap_md_alloc_poolpage(int flags)
@@ -319,6 +323,7 @@ pmap_md_grow(pmap_pdetab_t *ptb, vaddr_t va, vsize_t vshift,
319323
void
320324
pmap_probe_pbmt(void)
321325
{
326+
#ifdef _LP64
322327
const register_t mvendorid = sbi_get_mvendorid().value;
323328

324329
switch (mvendorid) {
@@ -342,6 +347,7 @@ pmap_probe_pbmt(void)
342347
* set above are for new mappings created now that the kernel
343348
* is up and running.
344349
*/
350+
#endif
345351
}
346352

347353
void

0 commit comments

Comments
 (0)