Thu Apr 18 15:24:21 2024 UTC (21d)
Pull up following revision(s) (requested by riastradh in ticket #655):

	sys/modules/Makefile: revision 1.285
	share/mk/bsd.own.mk: revision 1.1365
	share/mk/bsd.own.mk: revision 1.1366
	sys/arch/aarch64/include/sljit_machdep.h: revision 1.4
	sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c: revision 1.5
	(all via patch)

sljit: Pacify -Wsign-compare.

If these sizes are negative, we're probably in trouble anyway, so
assert nonnegative here.
Needed to resolve PR 58103.

bsd.own.mk: Enable MKLSJIT on aarch64.

Make sure there's only one copy of the conditional, in bsd.own.mk;
just make sys/modules/Makefile conditional on MKSLJIT so we don't
have to keep these in sync.

As a workaround for PR 58106, tweak the conditional definition of
SLJIT_CACHE_FLUSH to use cpu_icache_sync_range only in _HARDKERNEL,
and use __builtin___clear_cache in userland and in rump kernels.

PR 58103: bpfjit.kmod is not built on aarch64
bsd.own.mk: No need for MKSLJIT to be set differently from others.
- Use ?=, not =, so mk.conf setting wins.
- Write out per-architecture tabular settings, not a conditional.
- Add comments for the architectures that look like they should have
  sljit but don't.  (XXX Missing comments about powerpc and mips --
  not sure why, is this because modules don't yet work on those
  architectures, or what?)

Tidying for PR 58103: bpfjit.kmod is not built on aarch64.


(martin)
diff -r1.1149.2.6 -r1.1149.2.7 src/share/mk/bsd.own.mk
diff -r1.2 -r1.2.6.1 src/sys/arch/aarch64/include/sljit_machdep.h
diff -r1.4 -r1.4.4.1 src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c
diff -r1.222.2.1 -r1.222.2.2 src/sys/modules/Makefile

cvs diff -r1.1149.2.6 -r1.1149.2.7 src/share/mk/bsd.own.mk (expand / switch to unified diff)

--- src/share/mk/bsd.own.mk 2021/02/04 19:05:00 1.1149.2.6
+++ src/share/mk/bsd.own.mk 2024/04/18 15:24:20 1.1149.2.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: bsd.own.mk,v 1.1149.2.6 2021/02/04 19:05:00 martin Exp $ 1# $NetBSD: bsd.own.mk,v 1.1149.2.7 2024/04/18 15:24:20 martin Exp $
2 2
3# This needs to be before bsd.init.mk 3# This needs to be before bsd.init.mk
4.if defined(BSD_MK_COMPAT_FILE) 4.if defined(BSD_MK_COMPAT_FILE)
5.include <${BSD_MK_COMPAT_FILE}> 5.include <${BSD_MK_COMPAT_FILE}>
6.endif 6.endif
7 7
8.if !defined(_BSD_OWN_MK_) 8.if !defined(_BSD_OWN_MK_)
9_BSD_OWN_MK_=1 9_BSD_OWN_MK_=1
10 10
11MAKECONF?= /etc/mk.conf 11MAKECONF?= /etc/mk.conf
12.-include "${MAKECONF}" 12.-include "${MAKECONF}"
13 13
14# 14#
@@ -1159,26 +1159,45 @@ EXTERNAL_MESALIB_DIR?= MesaLib.old @@ -1159,26 +1159,45 @@ EXTERNAL_MESALIB_DIR?= MesaLib.old
1159.elif ${HAVE_MESA_VER} == "18" 1159.elif ${HAVE_MESA_VER} == "18"
1160EXTERNAL_MESALIB_DIR?= MesaLib 1160EXTERNAL_MESALIB_DIR?= MesaLib
1161.endif 1161.endif
1162 1162
1163# Default to LLVM run-time if x86 or aarch64 and X11 and Mesa 18 1163# Default to LLVM run-time if x86 or aarch64 and X11 and Mesa 18
1164# XXX This knows that MKX11=no is default below, but would 1164# XXX This knows that MKX11=no is default below, but would
1165# require splitting the below loop in two parts. 1165# require splitting the below loop in two parts.
1166.if ${MKX11:Uno} != "no" && ${HAVE_MESA_VER} == "18" 1166.if ${MKX11:Uno} != "no" && ${HAVE_MESA_VER} == "18"
1167MKLLVMRT.amd64= yes 1167MKLLVMRT.amd64= yes
1168MKLLVMRT.i386= yes 1168MKLLVMRT.i386= yes
1169MKLLVMRT.aarch64= yes 1169MKLLVMRT.aarch64= yes
1170.endif 1170.endif
1171 1171
 1172# Just-in-time compiler for bpf, npf acceleration
 1173MKSLJIT.aarch64= yes
 1174MKSLJIT.i386= yes
 1175MKSLJIT.sparc= yes
 1176#MKSLJIT.sparc64= yes # not suppored in sljit (yet?)
 1177MKSLJIT.x86_64= yes
 1178#MKSLJIT.powerpc= yes # XXX
 1179#MKSLJIT.powerpc64= yes # XXX
 1180#MKSLJIT.mipsel= yes # XXX
 1181#MKSLJIT.mipseb= yes # XXX
 1182#MKSLJIT.mips64el= yes # XXX
 1183#MKSLJIT.mips64eb= yes # XXX
 1184#MKSLJIT.riscv32= yes # not until we update sljit
 1185#MKSLJIT.riscv64= yes # not until we update sljit
 1186
 1187# compat with old names
 1188MKDEBUGKERNEL?=${MKKDEBUG:Uno}
 1189MKDEBUGTOOLS?=${MKTOOLSDEBUG:Uno}
 1190
1172# 1191#
1173# MK* options which default to "no". Note that MKZFS has a different 1192# MK* options which default to "no". Note that MKZFS has a different
1174# default for some platforms, see above. Please keep alphabetically 1193# default for some platforms, see above. Please keep alphabetically
1175# sorted with at most one letter per line. 1194# sorted with at most one letter per line.
1176# 1195#
1177_MKVARS.no= \ 1196_MKVARS.no= \
1178 MKARZERO \ 1197 MKARZERO \
1179 MKBSDGREP \ 1198 MKBSDGREP \
1180 MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCTF \ 1199 MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCTF \
1181 MKDEBUG MKDEBUGLIB MKDTRACE \ 1200 MKDEBUG MKDEBUGLIB MKDTRACE \
1182 MKEXTSRC \ 1201 MKEXTSRC \
1183 MKFIRMWARE \ 1202 MKFIRMWARE \
1184 MKGROFFHTMLDOC \ 1203 MKGROFFHTMLDOC \
@@ -1188,32 +1207,26 @@ _MKVARS.no= \ @@ -1188,32 +1207,26 @@ _MKVARS.no= \
1188 MKNOUVEAUFIRMWARE MKNSD \ 1207 MKNOUVEAUFIRMWARE MKNSD \
1189 MKOBJDIRS \ 1208 MKOBJDIRS \
1190 MKPCC MKPICINSTALL MKPIGZGZIP \ 1209 MKPCC MKPICINSTALL MKPIGZGZIP \
1191 MKRADEONFIRMWARE MKREPRO \ 1210 MKRADEONFIRMWARE MKREPRO \
1192 MKSLJIT MKSOFTFLOAT MKSTRIPIDENT \ 1211 MKSLJIT MKSOFTFLOAT MKSTRIPIDENT \
1193 MKTEGRAFIRMWARE MKTPM \ 1212 MKTEGRAFIRMWARE MKTPM \
1194 MKUNPRIVED MKUPDATE \ 1213 MKUNPRIVED MKUPDATE \
1195 MKX11 MKX11MOTIF MKXORG_SERVER \ 1214 MKX11 MKX11MOTIF MKXORG_SERVER \
1196 MKZFS 1215 MKZFS
1197.for var in ${_MKVARS.no} 1216.for var in ${_MKVARS.no}
1198${var}?= ${${var}.${MACHINE_ARCH}:U${${var}.${MACHINE}:Uno}} 1217${var}?= ${${var}.${MACHINE_ARCH}:U${${var}.${MACHINE}:Uno}}
1199.endfor 1218.endfor
1200 1219
1201.if ${MACHINE_ARCH} == "i386" || \ 
1202 ${MACHINE_ARCH} == "x86_64" || \ 
1203 ${MACHINE_ARCH} == "sparc"  
1204MKSLJIT= yes 
1205.endif 
1206 
1207# 1220#
1208# Which platforms build the xorg-server drivers (as opposed 1221# Which platforms build the xorg-server drivers (as opposed
1209# to just Xnest and Xvfb.) 1222# to just Xnest and Xvfb.)
1210# 1223#
1211.if ${MACHINE} == "alpha" || \ 1224.if ${MACHINE} == "alpha" || \
1212 ${MACHINE} == "amd64" || \ 1225 ${MACHINE} == "amd64" || \
1213 ${MACHINE} == "amiga" || \ 1226 ${MACHINE} == "amiga" || \
1214 ${MACHINE} == "bebox" || \ 1227 ${MACHINE} == "bebox" || \
1215 ${MACHINE} == "cats" || \ 1228 ${MACHINE} == "cats" || \
1216 ${MACHINE} == "dreamcast" || \ 1229 ${MACHINE} == "dreamcast" || \
1217 ${MACHINE} == "ews4800mips" || \ 1230 ${MACHINE} == "ews4800mips" || \
1218 ${MACHINE} == "evbarm" || \ 1231 ${MACHINE} == "evbarm" || \
1219 ${MACHINE} == "evbmips" || \ 1232 ${MACHINE} == "evbmips" || \

cvs diff -r1.2 -r1.2.6.1 src/sys/arch/aarch64/include/sljit_machdep.h (expand / switch to unified diff)

--- src/sys/arch/aarch64/include/sljit_machdep.h 2018/12/02 20:54:44 1.2
+++ src/sys/arch/aarch64/include/sljit_machdep.h 2024/04/18 15:24:20 1.2.6.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sljit_machdep.h,v 1.2 2018/12/02 20:54:44 alnsn Exp $ */ 1/* $NetBSD: sljit_machdep.h,v 1.2.6.1 2024/04/18 15:24:20 martin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2014 Alexander Nasonov. 4 * Copyright (c) 2014 Alexander Nasonov.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -32,22 +32,27 @@ @@ -32,22 +32,27 @@
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33 33
34#ifdef _KERNEL 34#ifdef _KERNEL
35#include <machine/types.h> 35#include <machine/types.h>
36#include <aarch64/cpufunc.h> 36#include <aarch64/cpufunc.h>
37#else 37#else
38#include <stddef.h> 38#include <stddef.h>
39#include <stdint.h> 39#include <stdint.h>
40#include <aarch64/sysarch.h> 40#include <aarch64/sysarch.h>
41#endif 41#endif
42 42
43#define SLJIT_CONFIG_ARM_64 1 43#define SLJIT_CONFIG_ARM_64 1
44 44
45#ifdef _KERNEL 45#ifdef _HARDKERNEL
 46/*
 47 * XXX Currently sys/rump/include/machine/cpu.h doesn't have
 48 * ci_cpufuncs for cpu_icache_sync_range, so we do this only for
 49 * non-rump kernels for now.
 50 */
46#define SLJIT_CACHE_FLUSH(from, to) \ 51#define SLJIT_CACHE_FLUSH(from, to) \
47 cpu_icache_sync_range((vaddr_t)(from), (vsize_t)((to) - (from))) 52 cpu_icache_sync_range((vaddr_t)(from), (vsize_t)((to) - (from)))
48#else 53#else
49#define SLJIT_CACHE_FLUSH(from, to) \ 54#define SLJIT_CACHE_FLUSH(from, to) \
50 (void)__builtin___clear_cache((char *)(from), (char *)(to)) 55 (void)__builtin___clear_cache((char *)(from), (char *)(to))
51#endif 56#endif
52 57
53#endif 58#endif

cvs diff -r1.4 -r1.4.4.1 src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c (expand / switch to unified diff)

--- src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c 2019/01/20 23:14:16 1.4
+++ src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c 2024/04/18 15:24:21 1.4.4.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sljitNativeARM_64.c,v 1.4 2019/01/20 23:14:16 alnsn Exp $ */ 1/* $NetBSD: sljitNativeARM_64.c,v 1.4.4.1 2024/04/18 15:24:21 martin Exp $ */
2 2
3/* 3/*
4 * Stack-less Just-In-Time compiler 4 * Stack-less Just-In-Time compiler
5 * 5 *
6 * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved. 6 * Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without modification, are 8 * Redistribution and use in source and binary forms, with or without modification, are
9 * permitted provided that the following conditions are met: 9 * permitted provided that the following conditions are met:
10 * 10 *
11 * 1. Redistributions of source code must retain the above copyright notice, this list of 11 * 1. Redistributions of source code must retain the above copyright notice, this list of
12 * conditions and the following disclaimer. 12 * conditions and the following disclaimer.
13 * 13 *
14 * 2. Redistributions in binary form must reproduce the above copyright notice, this list 14 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
@@ -1069,27 +1069,28 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit @@ -1069,27 +1069,28 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit
1069 sljit_s32 fscratches, sljit_s32 fsaveds, sljit_s32 local_size) 1069 sljit_s32 fscratches, sljit_s32 fsaveds, sljit_s32 local_size)
1070{ 1070{
1071 sljit_s32 i, tmp, offs, prev, saved_regs_size; 1071 sljit_s32 i, tmp, offs, prev, saved_regs_size;
1072 1072
1073 CHECK_ERROR(); 1073 CHECK_ERROR();
1074 CHECK(check_sljit_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size)); 1074 CHECK(check_sljit_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
1075 set_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size); 1075 set_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
1076 1076
1077 saved_regs_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 0); 1077 saved_regs_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds, 0);
1078 local_size += saved_regs_size + SLJIT_LOCALS_OFFSET; 1078 local_size += saved_regs_size + SLJIT_LOCALS_OFFSET;
1079 local_size = (local_size + 15) & ~0xf; 1079 local_size = (local_size + 15) & ~0xf;
1080 compiler->local_size = local_size; 1080 compiler->local_size = local_size;
1081 1081
1082 if (local_size <= (63 * sizeof(sljit_sw))) { 1082 SLJIT_ASSERT(local_size >= 0);
 1083 if ((size_t)local_size <= (63 * sizeof(sljit_sw))) {
1083 FAIL_IF(push_inst(compiler, STP_PRE | 29 | RT2(TMP_LR) 1084 FAIL_IF(push_inst(compiler, STP_PRE | 29 | RT2(TMP_LR)
1084 | RN(TMP_SP) | ((-(local_size >> 3) & 0x7f) << 15))); 1085 | RN(TMP_SP) | ((-(local_size >> 3) & 0x7f) << 15)));
1085 FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_SP) | (0 << 10))); 1086 FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_SP) | (0 << 10)));
1086 offs = (local_size - saved_regs_size) << (15 - 3); 1087 offs = (local_size - saved_regs_size) << (15 - 3);
1087 } else { 1088 } else {
1088 offs = 0 << 15; 1089 offs = 0 << 15;
1089 if (saved_regs_size & 0x8) { 1090 if (saved_regs_size & 0x8) {
1090 offs = 1 << 15; 1091 offs = 1 << 15;
1091 saved_regs_size += sizeof(sljit_sw); 1092 saved_regs_size += sizeof(sljit_sw);
1092 } 1093 }
1093 local_size -= saved_regs_size + SLJIT_LOCALS_OFFSET; 1094 local_size -= saved_regs_size + SLJIT_LOCALS_OFFSET;
1094 if (saved_regs_size > 0) 1095 if (saved_regs_size > 0)
1095 FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | (saved_regs_size << 10))); 1096 FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | (saved_regs_size << 10)));
@@ -1119,27 +1120,28 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit @@ -1119,27 +1120,28 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit
1119 continue; 1120 continue;
1120 } 1121 }
1121 FAIL_IF(push_inst(compiler, STRI | RT(i) | RN(TMP_SP) | (offs >> 5))); 1122 FAIL_IF(push_inst(compiler, STRI | RT(i) | RN(TMP_SP) | (offs >> 5)));
1122 offs += 1 << 15; 1123 offs += 1 << 15;
1123 continue; 1124 continue;
1124 } 1125 }
1125 FAIL_IF(push_inst(compiler, STP | RT(prev) | RT2(i) | RN(TMP_SP) | offs)); 1126 FAIL_IF(push_inst(compiler, STP | RT(prev) | RT2(i) | RN(TMP_SP) | offs));
1126 offs += 2 << 15; 1127 offs += 2 << 15;
1127 prev = -1; 1128 prev = -1;
1128 } 1129 }
1129 1130
1130 SLJIT_ASSERT(prev == -1); 1131 SLJIT_ASSERT(prev == -1);
1131 1132
1132 if (compiler->local_size > (63 * sizeof(sljit_sw))) { 1133 SLJIT_ASSERT(compiler->local_size >= 0);
 1134 if ((size_t)compiler->local_size > (63 * sizeof(sljit_sw))) {
1133 /* The local_size is already adjusted by the saved registers. */ 1135 /* The local_size is already adjusted by the saved registers. */
1134 if (local_size > 0xfff) { 1136 if (local_size > 0xfff) {
1135 FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | ((local_size >> 12) << 10) | (1 << 22))); 1137 FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | ((local_size >> 12) << 10) | (1 << 22)));
1136 local_size &= 0xfff; 1138 local_size &= 0xfff;
1137 } 1139 }
1138 if (local_size) 1140 if (local_size)
1139 FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | (local_size << 10))); 1141 FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | (local_size << 10)));
1140 FAIL_IF(push_inst(compiler, STP_PRE | 29 | RT2(TMP_LR) 1142 FAIL_IF(push_inst(compiler, STP_PRE | 29 | RT2(TMP_LR)
1141 | RN(TMP_SP) | ((-(16 >> 3) & 0x7f) << 15))); 1143 | RN(TMP_SP) | ((-(16 >> 3) & 0x7f) << 15)));
1142 FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_SP) | (0 << 10))); 1144 FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_SP) | (0 << 10)));
1143 } 1145 }
1144 1146
1145 if (args >= 1) 1147 if (args >= 1)
@@ -1169,27 +1171,28 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit @@ -1169,27 +1171,28 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit
1169SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 src, sljit_sw srcw) 1171SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 src, sljit_sw srcw)
1170{ 1172{
1171 sljit_s32 local_size; 1173 sljit_s32 local_size;
1172 sljit_s32 i, tmp, offs, prev, saved_regs_size; 1174 sljit_s32 i, tmp, offs, prev, saved_regs_size;
1173 1175
1174 CHECK_ERROR(); 1176 CHECK_ERROR();
1175 CHECK(check_sljit_emit_return(compiler, op, src, srcw)); 1177 CHECK(check_sljit_emit_return(compiler, op, src, srcw));
1176 1178
1177 FAIL_IF(emit_mov_before_return(compiler, op, src, srcw)); 1179 FAIL_IF(emit_mov_before_return(compiler, op, src, srcw));
1178 1180
1179 local_size = compiler->local_size; 1181 local_size = compiler->local_size;
1180 1182
1181 saved_regs_size = GET_SAVED_REGISTERS_SIZE(compiler->scratches, compiler->saveds, 0); 1183 saved_regs_size = GET_SAVED_REGISTERS_SIZE(compiler->scratches, compiler->saveds, 0);
1182 if (local_size <= (63 * sizeof(sljit_sw))) 1184 SLJIT_ASSERT(local_size >= 0);
 1185 if ((size_t)local_size <= (63 * sizeof(sljit_sw)))
1183 offs = (local_size - saved_regs_size) << (15 - 3); 1186 offs = (local_size - saved_regs_size) << (15 - 3);
1184 else { 1187 else {
1185 FAIL_IF(push_inst(compiler, LDP_PST | 29 | RT2(TMP_LR) 1188 FAIL_IF(push_inst(compiler, LDP_PST | 29 | RT2(TMP_LR)
1186 | RN(TMP_SP) | (((16 >> 3) & 0x7f) << 15))); 1189 | RN(TMP_SP) | (((16 >> 3) & 0x7f) << 15)));
1187 offs = 0 << 15; 1190 offs = 0 << 15;
1188 if (saved_regs_size & 0x8) { 1191 if (saved_regs_size & 0x8) {
1189 offs = 1 << 15; 1192 offs = 1 << 15;
1190 saved_regs_size += sizeof(sljit_sw); 1193 saved_regs_size += sizeof(sljit_sw);
1191 } 1194 }
1192 local_size -= saved_regs_size + SLJIT_LOCALS_OFFSET; 1195 local_size -= saved_regs_size + SLJIT_LOCALS_OFFSET;
1193 if (local_size > 0xfff) { 1196 if (local_size > 0xfff) {
1194 FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | ((local_size >> 12) << 10) | (1 << 22))); 1197 FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | ((local_size >> 12) << 10) | (1 << 22)));
1195 local_size &= 0xfff; 1198 local_size &= 0xfff;
@@ -1222,27 +1225,28 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit @@ -1222,27 +1225,28 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit
1222 continue; 1225 continue;
1223 } 1226 }
1224 FAIL_IF(push_inst(compiler, LDRI | RT(i) | RN(TMP_SP) | (offs >> 5))); 1227 FAIL_IF(push_inst(compiler, LDRI | RT(i) | RN(TMP_SP) | (offs >> 5)));
1225 offs += 1 << 15; 1228 offs += 1 << 15;
1226 continue; 1229 continue;
1227 } 1230 }
1228 FAIL_IF(push_inst(compiler, LDP | RT(prev) | RT2(i) | RN(TMP_SP) | offs)); 1231 FAIL_IF(push_inst(compiler, LDP | RT(prev) | RT2(i) | RN(TMP_SP) | offs));
1229 offs += 2 << 15; 1232 offs += 2 << 15;
1230 prev = -1; 1233 prev = -1;
1231 } 1234 }
1232 1235
1233 SLJIT_ASSERT(prev == -1); 1236 SLJIT_ASSERT(prev == -1);
1234 1237
1235 if (compiler->local_size <= (63 * sizeof(sljit_sw))) { 1238 SLJIT_ASSERT(compiler->local_size >= 0);
 1239 if ((size_t)compiler->local_size <= (63 * sizeof(sljit_sw))) {
1236 FAIL_IF(push_inst(compiler, LDP_PST | 29 | RT2(TMP_LR) 1240 FAIL_IF(push_inst(compiler, LDP_PST | 29 | RT2(TMP_LR)
1237 | RN(TMP_SP) | (((local_size >> 3) & 0x7f) << 15))); 1241 | RN(TMP_SP) | (((local_size >> 3) & 0x7f) << 15)));
1238 } else if (saved_regs_size > 0) { 1242 } else if (saved_regs_size > 0) {
1239 FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | (saved_regs_size << 10))); 1243 FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | (saved_regs_size << 10)));
1240 } 1244 }
1241 1245
1242 FAIL_IF(push_inst(compiler, RET | RN(TMP_LR))); 1246 FAIL_IF(push_inst(compiler, RET | RN(TMP_LR)));
1243 return SLJIT_SUCCESS; 1247 return SLJIT_SUCCESS;
1244} 1248}
1245 1249
1246/* --------------------------------------------------------------------- */ 1250/* --------------------------------------------------------------------- */
1247/* Operators */ 1251/* Operators */
1248/* --------------------------------------------------------------------- */ 1252/* --------------------------------------------------------------------- */

cvs diff -r1.222.2.1 -r1.222.2.2 src/sys/modules/Makefile (expand / switch to unified diff)

--- src/sys/modules/Makefile 2019/09/01 13:00:37 1.222.2.1
+++ src/sys/modules/Makefile 2024/04/18 15:24:20 1.222.2.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.222.2.1 2019/09/01 13:00:37 martin Exp $ 1# $NetBSD: Makefile,v 1.222.2.2 2024/04/18 15:24:20 martin Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
5# For all platforms 5# For all platforms
6 6
7# Modules for compatability with earlier versions of NetBSD 7# Modules for compatability with earlier versions of NetBSD
8 8
9SUBDIR+= compat_util 9SUBDIR+= compat_util
10SUBDIR+= compat_43 compat_sysctl_09_43 10SUBDIR+= compat_43 compat_sysctl_09_43
11SUBDIR+= compat_09 compat_10 compat_12 compat_13 compat_14 11SUBDIR+= compat_09 compat_10 compat_12 compat_13 compat_14
12SUBDIR+= compat_16 compat_20 compat_30 compat_40 compat_50 12SUBDIR+= compat_16 compat_20 compat_30 compat_40 compat_50
13SUBDIR+= compat_60 compat_70 compat_80  13SUBDIR+= compat_60 compat_70 compat_80
14 14
@@ -220,35 +220,29 @@ SUBDIR+= tprof_x86 @@ -220,35 +220,29 @@ SUBDIR+= tprof_x86
220SUBDIR+= vmt 220SUBDIR+= vmt
221.endif 221.endif
222 222
223.if ${MACHINE_ARCH} == "x86_64" 223.if ${MACHINE_ARCH} == "x86_64"
224SUBDIR+= nvmm 224SUBDIR+= nvmm
225.endif 225.endif
226 226
227.if ${MACHINE_ARCH} == "i386" || \ 227.if ${MACHINE_ARCH} == "i386" || \
228 ${MACHINE_ARCH} == "x86_64" 228 ${MACHINE_ARCH} == "x86_64"
229SUBDIR+= ubsec # Builds on architectures with PCI bus 229SUBDIR+= ubsec # Builds on architectures with PCI bus
230.endif 230.endif
231 231
232.if ${MKSLJIT} != "no" 232.if ${MKSLJIT} != "no"
233# No modules for 32-bit arm, mips and powerpc yet. 
234.if ${MACHINE_ARCH} == "aarch64" || \ 
235 ${MACHINE_ARCH} == "i386" || \ 
236 ${MACHINE_ARCH} == "sparc" || \ 
237 ${MACHINE_ARCH} == "x86_64" 
238SUBDIR+= bpfjit 233SUBDIR+= bpfjit
239SUBDIR+= sljit 234SUBDIR+= sljit
240.endif 235.endif
241.endif 
242 236
243# 237#
244# ACPI modules 238# ACPI modules
245# 239#
246.if ${MACHINE_ARCH} == "i386" || \ 240.if ${MACHINE_ARCH} == "i386" || \
247 ${MACHINE_ARCH} == "ia64" || \ 241 ${MACHINE_ARCH} == "ia64" || \
248 ${MACHINE_ARCH} == "x86_64" 242 ${MACHINE_ARCH} == "x86_64"
249SUBDIR+= acpiverbose 243SUBDIR+= acpiverbose
250.endif 244.endif
251 245
252.if ${MACHINE_ARCH} == "i386" || \ 246.if ${MACHINE_ARCH} == "i386" || \
253 ${MACHINE_ARCH} == "x86_64" 247 ${MACHINE_ARCH} == "x86_64"
254SUBDIR+= acpiacad 248SUBDIR+= acpiacad