summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorskrll <skrll@NetBSD.org>2023-05-07 12:41:45 +0000
committerskrll <skrll@NetBSD.org>2023-05-07 12:41:45 +0000
commit0cdd33139a1c60797bd5002b4944b2faa9e2f9c6 (patch)
tree6358f451321d60c76649dcd34633a6c1799fdb77 /lib/libc/stdlib
parent67090cda0ba82dccb26f986c355d2b5926cf73c4 (diff)
RISC-V support that works on QEMU with a single hart.
Thanks for Simon Burge for plic(4).
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/jemalloc.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/libc/stdlib/jemalloc.c b/lib/libc/stdlib/jemalloc.c
index 6cc6326d37c..feb22612252 100644
--- a/lib/libc/stdlib/jemalloc.c
+++ b/lib/libc/stdlib/jemalloc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: jemalloc.c,v 1.55 2022/11/30 04:35:53 skrll Exp $ */
+/* $NetBSD: jemalloc.c,v 1.56 2023/05/07 12:41:47 skrll Exp $ */
/*-
* Copyright (C) 2006,2007 Jason Evans <jasone@FreeBSD.org>.
@@ -117,7 +117,7 @@
#include <sys/cdefs.h>
/* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */
-__RCSID("$NetBSD: jemalloc.c,v 1.55 2022/11/30 04:35:53 skrll Exp $");
+__RCSID("$NetBSD: jemalloc.c,v 1.56 2023/05/07 12:41:47 skrll Exp $");
#ifdef __FreeBSD__
#include "libc_private.h"
@@ -275,7 +275,7 @@ __RCSID("$NetBSD: jemalloc.c,v 1.55 2022/11/30 04:35:53 skrll Exp $");
# define NO_TLS
# endif
#endif
-#if defined(__mips__) || defined(__riscv__)
+#if defined(__mips__)
# ifdef _LP64
# define SIZEOF_PTR_2POW 3
# define TINY_MIN_2POW 3
@@ -288,6 +288,17 @@ __RCSID("$NetBSD: jemalloc.c,v 1.55 2022/11/30 04:35:53 skrll Exp $");
# define NO_TLS
# endif
#endif
+#if defined(__riscv__)
+# ifdef _LP64
+# define SIZEOF_PTR_2POW 3
+# define TINY_MIN_2POW 3
+# else
+# define SIZEOF_PTR_2POW 2
+# endif
+# define QUANTUM_2POW_MIN 4
+# define USE_BRK
+# define NO_TLS
+#endif
#ifdef __hppa__
# define QUANTUM_2POW_MIN 4
# define TINY_MIN_2POW 4