Thu Apr 18 15:21:55 2024 UTC (22d)
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

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.1289.2.2 -r1.1289.2.3 src/share/mk/bsd.own.mk
diff -r1.3 -r1.3.18.1 src/sys/arch/aarch64/include/sljit_machdep.h
diff -r1.4 -r1.4.30.1 src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c
diff -r1.274.2.2 -r1.274.2.3 src/sys/modules/Makefile

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

--- src/share/mk/bsd.own.mk 2023/10/20 16:04:59 1.1289.2.2
+++ src/share/mk/bsd.own.mk 2024/04/18 15:21:55 1.1289.2.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: bsd.own.mk,v 1.1289.2.2 2023/10/20 16:04:59 martin Exp $ 1# $NetBSD: bsd.own.mk,v 1.1289.2.3 2024/04/18 15:21:55 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#
@@ -1275,26 +1275,41 @@ EXTERNAL_MESALIB_DIR?= MesaLib.old @@ -1275,26 +1275,41 @@ EXTERNAL_MESALIB_DIR?= MesaLib.old
1275.elif ${HAVE_MESA_VER} == 21 1275.elif ${HAVE_MESA_VER} == 21
1276EXTERNAL_MESALIB_DIR?= MesaLib 1276EXTERNAL_MESALIB_DIR?= MesaLib
1277.endif 1277.endif
1278 1278
1279# Default to LLVM run-time if x86 or aarch64 and X11 and Mesa 18 or newer 1279# Default to LLVM run-time if x86 or aarch64 and X11 and Mesa 18 or newer
1280# XXX This knows that MKX11=no is default below, but would 1280# XXX This knows that MKX11=no is default below, but would
1281# require splitting the below loop in two parts. 1281# require splitting the below loop in two parts.
1282.if ${MKX11:Uno} != "no" && ${HAVE_MESA_VER} >= 19 1282.if ${MKX11:Uno} != "no" && ${HAVE_MESA_VER} >= 19
1283MKLLVMRT.amd64= yes 1283MKLLVMRT.amd64= yes
1284MKLLVMRT.i386= yes 1284MKLLVMRT.i386= yes
1285MKLLVMRT.aarch64= yes 1285MKLLVMRT.aarch64= yes
1286.endif 1286.endif
1287 1287
 1288# Just-in-time compiler for bpf, npf acceleration
 1289MKSLJIT.aarch64= yes
 1290MKSLJIT.i386= yes
 1291MKSLJIT.sparc= yes
 1292#MKSLJIT.sparc64= yes # not suppored in sljit (yet?)
 1293MKSLJIT.x86_64= yes
 1294#MKSLJIT.powerpc= yes # XXX
 1295#MKSLJIT.powerpc64= yes # XXX
 1296#MKSLJIT.mipsel= yes # XXX
 1297#MKSLJIT.mipseb= yes # XXX
 1298#MKSLJIT.mips64el= yes # XXX
 1299#MKSLJIT.mips64eb= yes # XXX
 1300#MKSLJIT.riscv32= yes # not until we update sljit
 1301#MKSLJIT.riscv64= yes # not until we update sljit
 1302
1288# compat with old names 1303# compat with old names
1289MKDEBUGKERNEL?=${MKKDEBUG:Uno} 1304MKDEBUGKERNEL?=${MKKDEBUG:Uno}
1290MKDEBUGTOOLS?=${MKTOOLSDEBUG:Uno} 1305MKDEBUGTOOLS?=${MKTOOLSDEBUG:Uno}
1291 1306
1292# 1307#
1293# MK* options which default to "no". Note that MKZFS has a different 1308# MK* options which default to "no". Note that MKZFS has a different
1294# default for some platforms, see above. Please keep alphabetically 1309# default for some platforms, see above. Please keep alphabetically
1295# sorted with at most one letter per line. 1310# sorted with at most one letter per line.
1296# 1311#
1297_MKVARS.no= \ 1312_MKVARS.no= \
1298 MKAMDGPUFIRMWARE \ 1313 MKAMDGPUFIRMWARE \
1299 MKARZERO \ 1314 MKARZERO \
1300 MKBSDGREP \ 1315 MKBSDGREP \
@@ -1308,32 +1323,26 @@ _MKVARS.no= \ @@ -1308,32 +1323,26 @@ _MKVARS.no= \
1308 MKNOUVEAUFIRMWARE MKNSD \ 1323 MKNOUVEAUFIRMWARE MKNSD \
1309 MKOBJDIRS \ 1324 MKOBJDIRS \
1310 MKPCC MKPICINSTALL MKPIGZGZIP \ 1325 MKPCC MKPICINSTALL MKPIGZGZIP \
1311 MKRADEONFIRMWARE MKREPRO \ 1326 MKRADEONFIRMWARE MKREPRO \
1312 MKSLJIT MKSOFTFLOAT MKSTRIPIDENT \ 1327 MKSLJIT MKSOFTFLOAT MKSTRIPIDENT \
1313 MKTEGRAFIRMWARE MKTPM \ 1328 MKTEGRAFIRMWARE MKTPM \
1314 MKUNPRIVED MKUPDATE \ 1329 MKUNPRIVED MKUPDATE \
1315 MKX11 MKX11MOTIF MKXORG_SERVER \ 1330 MKX11 MKX11MOTIF MKXORG_SERVER \
1316 MKZFS 1331 MKZFS
1317.for var in ${_MKVARS.no} 1332.for var in ${_MKVARS.no}
1318${var}?= ${${var}.${MACHINE_ARCH}:U${${var}.${MACHINE}:Uno}} 1333${var}?= ${${var}.${MACHINE_ARCH}:U${${var}.${MACHINE}:Uno}}
1319.endfor 1334.endfor
1320 1335
1321.if ${MACHINE_ARCH} == "i386" || \ 
1322 ${MACHINE_ARCH} == "x86_64" || \ 
1323 ${MACHINE_ARCH} == "sparc" 
1324MKSLJIT= yes 
1325.endif 
1326 
1327# 1336#
1328# Which platforms build the xorg-server drivers (as opposed 1337# Which platforms build the xorg-server drivers (as opposed
1329# to just Xnest and Xvfb.) 1338# to just Xnest and Xvfb.)
1330# 1339#
1331.if ${MACHINE} == "alpha" || \ 1340.if ${MACHINE} == "alpha" || \
1332 ${MACHINE} == "amd64" || \ 1341 ${MACHINE} == "amd64" || \
1333 ${MACHINE} == "amiga" || \ 1342 ${MACHINE} == "amiga" || \
1334 ${MACHINE} == "bebox" || \ 1343 ${MACHINE} == "bebox" || \
1335 ${MACHINE} == "cats" || \ 1344 ${MACHINE} == "cats" || \
1336 ${MACHINE} == "dreamcast" || \ 1345 ${MACHINE} == "dreamcast" || \
1337 ${MACHINE} == "ews4800mips" || \ 1346 ${MACHINE} == "ews4800mips" || \
1338 ${MACHINE} == "evbarm" || \ 1347 ${MACHINE} == "evbarm" || \
1339 ${MACHINE} == "evbmips" || \ 1348 ${MACHINE} == "evbmips" || \

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

--- src/sys/arch/aarch64/include/sljit_machdep.h 2020/12/11 18:03:33 1.3
+++ src/sys/arch/aarch64/include/sljit_machdep.h 2024/04/18 15:21:55 1.3.18.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sljit_machdep.h,v 1.3 2020/12/11 18:03:33 skrll Exp $ */ 1/* $NetBSD: sljit_machdep.h,v 1.3.18.1 2024/04/18 15:21:55 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.
@@ -33,22 +33,27 @@ @@ -33,22 +33,27 @@
33 33
34#ifdef _KERNEL 34#ifdef _KERNEL
35#include <machine/types.h> 35#include <machine/types.h>
36 36
37#include <arm/cpufunc.h> 37#include <arm/cpufunc.h>
38#else 38#else
39#include <stddef.h> 39#include <stddef.h>
40#include <stdint.h> 40#include <stdint.h>
41#include <aarch64/sysarch.h> 41#include <aarch64/sysarch.h>
42#endif 42#endif
43 43
44#define SLJIT_CONFIG_ARM_64 1 44#define SLJIT_CONFIG_ARM_64 1
45 45
46#ifdef _KERNEL 46#ifdef _HARDKERNEL
 47/*
 48 * XXX Currently sys/rump/include/machine/cpu.h doesn't have
 49 * ci_cpufuncs for cpu_icache_sync_range, so we do this only for
 50 * non-rump kernels for now.
 51 */
47#define SLJIT_CACHE_FLUSH(from, to) \ 52#define SLJIT_CACHE_FLUSH(from, to) \
48 cpu_icache_sync_range((vaddr_t)(from), (vsize_t)((to) - (from))) 53 cpu_icache_sync_range((vaddr_t)(from), (vsize_t)((to) - (from)))
49#else 54#else
50#define SLJIT_CACHE_FLUSH(from, to) \ 55#define SLJIT_CACHE_FLUSH(from, to) \
51 (void)__builtin___clear_cache((char *)(from), (char *)(to)) 56 (void)__builtin___clear_cache((char *)(from), (char *)(to))
52#endif 57#endif
53 58
54#endif 59#endif

cvs diff -r1.4 -r1.4.30.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:21:55 1.4.30.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.30.1 2024/04/18 15:21:55 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.274.2.2 -r1.274.2.3 src/sys/modules/Makefile (expand / switch to unified diff)

--- src/sys/modules/Makefile 2023/12/30 19:13:50 1.274.2.2
+++ src/sys/modules/Makefile 2024/04/18 15:21:55 1.274.2.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.274.2.2 2023/12/30 19:13:50 martin Exp $ 1# $NetBSD: Makefile,v 1.274.2.3 2024/04/18 15:21:55 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 compatibility with earlier versions of NetBSD 7# Modules for compatibility 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 compat_90 13SUBDIR+= compat_60 compat_70 compat_80 compat_90
14 14
@@ -248,35 +248,29 @@ SUBDIR+= nvmm @@ -248,35 +248,29 @@ SUBDIR+= nvmm
248 248
249# Builds on architectures with PCI bus 249# Builds on architectures with PCI bus
250.if \ 250.if \
251 ${MACHINE} == "evbarm" || \ 251 ${MACHINE} == "evbarm" || \
252 ${MACHINE_ARCH} == "i386" || \ 252 ${MACHINE_ARCH} == "i386" || \
253 ${MACHINE_ARCH} == "x86_64" 253 ${MACHINE_ARCH} == "x86_64"
254#SUBDIR+= hifn 254#SUBDIR+= hifn
255SUBDIR+= if_iavf 255SUBDIR+= if_iavf
256SUBDIR+= if_ixl 256SUBDIR+= if_ixl
257SUBDIR+= ubsec 257SUBDIR+= ubsec
258.endif 258.endif
259 259
260.if ${MKSLJIT} != "no" 260.if ${MKSLJIT} != "no"
261# No modules for 32-bit arm, mips and powerpc yet. 
262.if ${MACHINE_ARCH} == "aarch64" || \ 
263 ${MACHINE_ARCH} == "i386" || \ 
264 ${MACHINE_ARCH} == "sparc" || \ 
265 ${MACHINE_ARCH} == "x86_64" 
266SUBDIR+= bpfjit 261SUBDIR+= bpfjit
267SUBDIR+= sljit 262SUBDIR+= sljit
268.endif 263.endif
269.endif 
270 264
271# 265#
272# ACPI modules 266# ACPI modules
273# 267#
274.if ${MACHINE_ARCH} == "i386" || \ 268.if ${MACHINE_ARCH} == "i386" || \
275 ${MACHINE_ARCH} == "ia64" || \ 269 ${MACHINE_ARCH} == "ia64" || \
276 ${MACHINE_ARCH} == "x86_64" 270 ${MACHINE_ARCH} == "x86_64"
277SUBDIR+= acpiverbose 271SUBDIR+= acpiverbose
278.endif 272.endif
279 273
280.if ${MACHINE_ARCH} == "i386" || \ 274.if ${MACHINE_ARCH} == "i386" || \
281 ${MACHINE_ARCH} == "x86_64" 275 ${MACHINE_ARCH} == "x86_64"
282SUBDIR+= acpiacad 276SUBDIR+= acpiacad