aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile18
-rw-r--r--lib/atf/Makefile4
-rw-r--r--lib/clang/Makefile2
-rw-r--r--lib/clang/freebsd_cc_version.h2
-rw-r--r--lib/clang/headers/Makefile15
-rw-r--r--lib/clang/include/Plugins/Plugins.def2
-rw-r--r--lib/clang/include/VCSVersion.inc8
-rw-r--r--lib/clang/include/clang/Basic/Version.inc8
-rw-r--r--lib/clang/include/clang/Config/config.h2
-rw-r--r--lib/clang/include/lld/Common/Version.inc2
-rw-r--r--lib/clang/include/llvm/Config/config.h28
-rw-r--r--lib/clang/include/llvm/Config/llvm-config.h21
-rw-r--r--lib/clang/include/llvm/Support/VCSRevision.h2
-rw-r--r--lib/clang/libclang/Makefile26
-rw-r--r--lib/clang/liblldb/LLDBWrapLua.cpp1535
-rw-r--r--lib/clang/liblldb/Makefile18
-rw-r--r--lib/clang/libllvm/Makefile82
-rw-r--r--lib/clang/libllvmminimal/Makefile4
-rw-r--r--lib/csu/Makefile.inc1
-rw-r--r--lib/csu/mips/Makefile28
-rw-r--r--lib/csu/mips/Makefile.depend12
-rw-r--r--lib/csu/mips/crt1_c.c91
-rw-r--r--lib/csu/mips/crti.S53
-rw-r--r--lib/csu/mips/crtn.S25
-rw-r--r--lib/geom/multipath/gmultipath.82
-rw-r--r--lib/geom/part/gpart.85
-rw-r--r--lib/libbe/Makefile5
-rw-r--r--lib/libbsddialog/Makefile28
-rw-r--r--lib/libc++/Makefile295
-rw-r--r--lib/libc++/__config_site2
-rw-r--r--lib/libc++experimental/Makefile1
-rw-r--r--lib/libc/Makefile5
-rw-r--r--lib/libc/aarch64/Symbol.map1
-rw-r--r--lib/libc/aarch64/gen/Makefile.inc2
-rw-r--r--lib/libc/aarch64/gen/_set_tp.c43
-rw-r--r--lib/libc/aarch64/string/Makefile.inc51
-rw-r--r--lib/libc/aarch64/string/memcpy.S6
-rw-r--r--lib/libc/aarch64/string/memmove.S5
-rw-r--r--lib/libc/aarch64/string/strchr.S5
-rw-r--r--lib/libc/aarch64/string/strrchr.S5
-rw-r--r--lib/libc/aarch64/sys/Makefile.inc3
-rw-r--r--lib/libc/amd64/Symbol.map1
-rw-r--r--lib/libc/amd64/gen/Makefile.inc2
-rw-r--r--lib/libc/amd64/gen/_set_tp.c41
-rw-r--r--lib/libc/arm/Symbol.map1
-rw-r--r--lib/libc/arm/gen/Makefile.inc2
-rw-r--r--lib/libc/arm/sys/Makefile.inc3
-rw-r--r--lib/libc/gen/Makefile.inc7
-rw-r--r--lib/libc/gen/Symbol.map11
-rw-r--r--lib/libc/gen/cpuset_alloc.c (renamed from lib/libc/i386/gen/_set_tp.c)21
-rw-r--r--lib/libc/gen/cpuset_free.c (renamed from lib/libc/powerpc/gen/_set_tp.c)16
-rw-r--r--lib/libc/gen/getgrent.c13
-rw-r--r--lib/libc/gen/getpwent.c12
-rw-r--r--lib/libc/gen/posix_spawn.328
-rw-r--r--lib/libc/gen/posix_spawn.c92
-rw-r--r--lib/libc/gen/posix_spawn_file_actions_addopen.384
-rw-r--r--lib/libc/gen/posix_spawn_file_actions_init.33
-rw-r--r--lib/libc/gen/sched_getaffinity.c (renamed from lib/libc/aarch64/gen/_get_tp.c)37
-rw-r--r--lib/libc/gen/sched_getcpu_gen.c (renamed from lib/libc/powerpc64/gen/_set_tp.c)17
-rw-r--r--lib/libc/gen/sched_setaffinity.c (renamed from lib/libc/arm/gen/_get_tp.c)29
-rw-r--r--lib/libc/gen/setproctitle.c4
-rw-r--r--lib/libc/gen/tls.c30
-rw-r--r--lib/libc/i386/Symbol.map1
-rw-r--r--lib/libc/i386/gen/Makefile.inc2
-rw-r--r--lib/libc/i386/gen/_get_tp.c45
-rw-r--r--lib/libc/iconv/citrus_bcs.c4
-rw-r--r--lib/libc/iconv/citrus_prop.c9
-rw-r--r--lib/libc/include/compat.h2
-rw-r--r--lib/libc/include/libc_private.h7
-rw-r--r--lib/libc/mips/Makefile.inc5
-rw-r--r--lib/libc/mips/SYS.h153
-rw-r--r--lib/libc/mips/Symbol.map53
-rw-r--r--lib/libc/mips/_fpmath.h58
-rw-r--r--lib/libc/mips/arith.h26
-rw-r--r--lib/libc/mips/gd_qnan.h48
-rw-r--r--lib/libc/mips/gen/Makefile.inc11
-rw-r--r--lib/libc/mips/gen/_ctx_start.S55
-rw-r--r--lib/libc/mips/gen/_get_tp.c103
-rw-r--r--lib/libc/mips/gen/_setjmp.S200
-rw-r--r--lib/libc/mips/gen/fabs.S58
-rw-r--r--lib/libc/mips/gen/fabs.c47
-rw-r--r--lib/libc/mips/gen/flt_rounds.c42
-rw-r--r--lib/libc/mips/gen/hardfloat/fpgetmask.c29
-rw-r--r--lib/libc/mips/gen/hardfloat/fpgetround.c29
-rw-r--r--lib/libc/mips/gen/hardfloat/fpgetsticky.c29
-rw-r--r--lib/libc/mips/gen/hardfloat/fpsetmask.c38
-rw-r--r--lib/libc/mips/gen/hardfloat/fpsetround.c37
-rw-r--r--lib/libc/mips/gen/hardfloat/fpsetsticky.c38
-rw-r--r--lib/libc/mips/gen/infinity.c26
-rw-r--r--lib/libc/mips/gen/ldexp.S219
-rw-r--r--lib/libc/mips/gen/makecontext.c123
-rw-r--r--lib/libc/mips/gen/setjmp.S237
-rw-r--r--lib/libc/mips/gen/signalcontext.c55
-rw-r--r--lib/libc/mips/gen/sigsetjmp.S76
-rw-r--r--lib/libc/mips/net/Makefile.inc4
-rw-r--r--lib/libc/mips/net/htonl.S51
-rw-r--r--lib/libc/mips/net/htons.S47
-rw-r--r--lib/libc/mips/net/ntohl.S51
-rw-r--r--lib/libc/mips/net/ntohs.S46
-rw-r--r--lib/libc/mips/softfloat/milieu.h48
-rw-r--r--lib/libc/mips/softfloat/mips-gcc.h91
-rw-r--r--lib/libc/mips/softfloat/softfloat.h315
-rw-r--r--lib/libc/mips/static_tls.h64
-rw-r--r--lib/libc/mips/string/Makefile.inc13
-rw-r--r--lib/libc/mips/string/bcmp.S130
-rw-r--r--lib/libc/mips/string/bcopy.S297
-rw-r--r--lib/libc/mips/string/bzero.S83
-rw-r--r--lib/libc/mips/string/ffs.S59
-rw-r--r--lib/libc/mips/string/memcpy.S7
-rw-r--r--lib/libc/mips/string/memmove.S7
-rw-r--r--lib/libc/mips/string/strchr.S66
-rw-r--r--lib/libc/mips/string/strcmp.S68
-rw-r--r--lib/libc/mips/string/strlen.S55
-rw-r--r--lib/libc/mips/string/strrchr.S64
-rw-r--r--lib/libc/mips/sys/Makefile.inc8
-rw-r--r--lib/libc/mips/sys/Ovfork.S64
-rw-r--r--lib/libc/mips/sys/cerror.S72
-rw-r--r--lib/libc/mips/sys/syscall.S44
-rw-r--r--lib/libc/net/gethostnamadr.c16
-rw-r--r--lib/libc/net/getnameinfo.c2
-rw-r--r--lib/libc/net/getnetnamadr.c16
-rw-r--r--lib/libc/net/getprotoent.c12
-rw-r--r--lib/libc/net/getservent.c16
-rw-r--r--lib/libc/net/inet.324
-rw-r--r--lib/libc/net/inet_net.312
-rw-r--r--lib/libc/net/nscachedcli.c6
-rw-r--r--lib/libc/net/nsdispatch.c2
-rw-r--r--lib/libc/net/sctp_sys_calls.c36
-rw-r--r--lib/libc/posix1e/acl_delete_entry.c3
-rw-r--r--lib/libc/powerpc/Symbol.map1
-rw-r--r--lib/libc/powerpc/gen/Makefile.common4
-rw-r--r--lib/libc/powerpc/gen/_get_tp.c47
-rw-r--r--lib/libc/powerpc/sys/Makefile.inc4
-rw-r--r--lib/libc/powerpc64/Symbol.map1
-rw-r--r--lib/libc/powerpc64/gen/Makefile.inc5
-rw-r--r--lib/libc/powerpc64/gen/_get_tp.c47
-rw-r--r--lib/libc/powerpc64/sys/Makefile.inc4
-rw-r--r--lib/libc/regex/regexec.c4
-rw-r--r--lib/libc/resolv/res_init.c8
-rw-r--r--lib/libc/riscv/Symbol.map1
-rw-r--r--lib/libc/riscv/gen/Makefile.inc4
-rw-r--r--lib/libc/riscv/gen/_get_tp.c47
-rw-r--r--lib/libc/riscv/gen/_set_tp.c51
-rw-r--r--lib/libc/riscv/sys/Makefile.inc3
-rw-r--r--lib/libc/rpc/getrpcent.c12
-rw-r--r--lib/libc/rpc/rpc_soc.c2
-rw-r--r--lib/libc/stdio/fflush.c9
-rw-r--r--lib/libc/stdio/fread.c12
-rw-r--r--lib/libc/stdio/vfwscanf.c2
-rw-r--r--lib/libc/stdlib/Makefile.inc3
-rw-r--r--lib/libc/stdlib/Symbol.map4
-rw-r--r--lib/libc/stdlib/getenv.320
-rw-r--r--lib/libc/stdlib/getenv.c25
-rw-r--r--lib/libc/stdlib/qsort.c2
-rw-r--r--lib/libc/string/strstr.c4
-rw-r--r--lib/libc/sys/Makefile.inc16
-rw-r--r--lib/libc/sys/Symbol.map2
-rw-r--r--lib/libc/sys/fcntl.227
-rw-r--r--lib/libc/sys/getfh.25
-rw-r--r--lib/libc/sys/intro.22
-rw-r--r--lib/libc/sys/kqueue.210
-rw-r--r--lib/libc/sys/open.23
-rw-r--r--lib/libc/sys/pdfork.c2
-rw-r--r--lib/libc/sys/ptrace.251
-rw-r--r--lib/libc/sys/rtprio.217
-rw-r--r--lib/libc/sys/swapon.220
-rw-r--r--lib/libc/tests/net/getaddrinfo/Makefile2
-rw-r--r--lib/libc/tests/ssp/Makefile2
-rw-r--r--lib/libc/tests/stdlib/Makefile1
-rw-r--r--lib/libc/tests/stdlib/clearenv_test.c176
-rw-r--r--lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c1
-rw-r--r--lib/libc/uuid/uuid.363
-rw-r--r--lib/libc/x86/sys/Makefile.inc3
-rw-r--r--lib/libc/x86/sys/__vdso_gettc.c5
-rw-r--r--lib/libc/x86/sys/sched_getcpu_x86.c (renamed from lib/libc/amd64/gen/_get_tp.c)63
-rw-r--r--lib/libcam/camlib.c9
-rw-r--r--lib/libcasper/libcasper/libcasper.3105
-rw-r--r--lib/libcasper/libcasper/libcasper_service.342
-rw-r--r--lib/libcasper/services/cap_net/cap_net.310
-rw-r--r--lib/libcasper/services/cap_net/cap_net.c12
-rw-r--r--lib/libclang_rt/Makefile10
-rw-r--r--lib/libclang_rt/asan/Makefile2
-rw-r--r--lib/libclang_rt/asan_dynamic/Makefile2
-rw-r--r--lib/libclang_rt/cfi/Makefile1
-rw-r--r--lib/libclang_rt/cfi_diag/Makefile2
-rw-r--r--lib/libclang_rt/compiler-rt-vars.mk2
-rw-r--r--lib/libclang_rt/dd/Makefile1
-rw-r--r--lib/libclang_rt/msan/Makefile2
-rw-r--r--lib/libclang_rt/profile/Makefile2
-rw-r--r--lib/libclang_rt/stats/Makefile2
-rw-r--r--lib/libclang_rt/tsan/Makefile4
-rw-r--r--lib/libclang_rt/ubsan_standalone/Makefile2
-rw-r--r--lib/libclang_rt/xray/Makefile1
-rw-r--r--lib/libcompiler_rt/Makefile.inc3
-rw-r--r--lib/libcrypt/Makefile2
-rw-r--r--lib/libcrypt/crypt.c1
-rw-r--r--lib/libcxxrt/Makefile18
-rw-r--r--lib/libdpv/Makefile2
-rw-r--r--lib/libdwarf/Makefile5
-rw-r--r--lib/libefivar/Makefile2
-rw-r--r--lib/libelf/Makefile2
-rw-r--r--lib/libexpat/expat_config.h18
-rw-r--r--lib/libfetch/Makefile2
-rw-r--r--lib/libfido2/Makefile73
-rw-r--r--lib/libiscsiutil/Makefile10
-rw-r--r--lib/libiscsiutil/chap.c419
-rw-r--r--lib/libiscsiutil/connection.c (renamed from lib/libc/arm/gen/_set_tp.c)29
-rw-r--r--lib/libiscsiutil/keys.c191
-rw-r--r--lib/libiscsiutil/libiscsiutil.h168
-rw-r--r--lib/libiscsiutil/log.c198
-rw-r--r--lib/libiscsiutil/pdu.c228
-rw-r--r--lib/libiscsiutil/text.c333
-rw-r--r--lib/libiscsiutil/utils.c (renamed from lib/libc/mips/gen/_set_tp.c)22
-rw-r--r--lib/libkvm/Makefile1
-rw-r--r--lib/libkvm/kvm.39
-rw-r--r--lib/libkvm/kvm_getloadavg.c9
-rw-r--r--lib/libkvm/kvm_minidump_mips.c372
-rw-r--r--lib/libkvm/kvm_mips.h117
-rw-r--r--lib/libkvm/kvm_nlist.35
-rw-r--r--lib/libkvm/kvm_open.35
-rw-r--r--lib/libkvm/kvm_private.c4
-rw-r--r--lib/libkvm/kvm_read.35
-rw-r--r--lib/libmagic/config.h45
-rw-r--r--lib/libmd/Makefile6
-rw-r--r--lib/libmemstat/memstat_uma.c2
-rw-r--r--lib/libmixer/mixer.32
-rw-r--r--lib/libmixer/mixer.c2
-rw-r--r--lib/libnetgraph/debug.c2
-rw-r--r--lib/libnv/msgio.c4
-rw-r--r--lib/libnv/msgio.h2
-rw-r--r--lib/libnv/tests/nvlist_send_recv_test.c102
-rw-r--r--lib/libomp/kmp_config.h6
-rw-r--r--lib/libomp/kmp_i18n_default.inc47
-rw-r--r--lib/libomp/kmp_i18n_id.inc59
-rw-r--r--lib/libomp/omp-tools.h201
-rw-r--r--lib/libomp/omp.h55
-rw-r--r--lib/libpam/modules/pam_lastlog/Makefile2
-rw-r--r--lib/libpam/modules/pam_login_access/Makefile2
-rw-r--r--lib/libpam/modules/pam_nologin/Makefile2
-rw-r--r--lib/libpam/modules/pam_opie/Makefile2
-rw-r--r--lib/libpam/modules/pam_opieaccess/Makefile2
-rw-r--r--lib/libpam/modules/pam_securetty/Makefile2
-rw-r--r--lib/libpam/modules/pam_self/Makefile2
-rw-r--r--lib/libpam/modules/pam_unix/Makefile2
-rw-r--r--lib/libpam/pam.d/Makefile2
-rw-r--r--lib/libpfctl/libpfctl.c46
-rw-r--r--lib/libpfctl/libpfctl.h127
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen1/branch.json5
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen1/cache.json83
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen1/core.json14
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen1/data-fabric.json2766
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen1/floating-point.json42
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen1/l3cache.json5411
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen1/memory.json42
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen1/other.json12
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen1/recommended.json178
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen2/branch.json8
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen2/cache.json79
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen2/core.json14
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen2/data-fabric.json98
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen2/floating-point.json42
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen2/memory.json86
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen2/other.json20
-rw-r--r--lib/libpmc/pmu-events/arch/x86/amdzen2/recommended.json178
-rw-r--r--lib/libpmc/pmu-events/arch/x86/broadwell/bdw-metrics.json2
-rw-r--r--lib/libpmc/pmu-events/arch/x86/broadwellde/bdwde-metrics.json2
-rw-r--r--lib/libpmc/pmu-events/arch/x86/broadwellx/bdx-metrics.json2
-rw-r--r--lib/libpmc/pmu-events/arch/x86/cascadelakex/cache.json5404
-rw-r--r--lib/libpmc/pmu-events/arch/x86/cascadelakex/clx-metrics.json322
-rw-r--r--lib/libpmc/pmu-events/arch/x86/cascadelakex/floating-point.json48
-rw-r--r--lib/libpmc/pmu-events/arch/x86/cascadelakex/frontend.json530
-rw-r--r--lib/libpmc/pmu-events/arch/x86/cascadelakex/memory.json5428
-rw-r--r--lib/libpmc/pmu-events/arch/x86/cascadelakex/other.json4146
-rw-r--r--lib/libpmc/pmu-events/arch/x86/cascadelakex/pipeline.json1052
-rw-r--r--lib/libpmc/pmu-events/arch/x86/cascadelakex/uncore-memory.json9
-rw-r--r--lib/libpmc/pmu-events/arch/x86/cascadelakex/uncore-other.json180
-rw-r--r--lib/libpmc/pmu-events/arch/x86/cascadelakex/virtual-memory.json256
-rw-r--r--lib/libpmc/pmu-events/arch/x86/elkhartlake/cache.json226
-rw-r--r--lib/libpmc/pmu-events/arch/x86/elkhartlake/ehl-metrics.json57
-rw-r--r--lib/libpmc/pmu-events/arch/x86/elkhartlake/floating-point.json24
-rw-r--r--lib/libpmc/pmu-events/arch/x86/elkhartlake/frontend.json93
-rw-r--r--lib/libpmc/pmu-events/arch/x86/elkhartlake/memory.json86
-rw-r--r--lib/libpmc/pmu-events/arch/x86/elkhartlake/other.json424
-rw-r--r--lib/libpmc/pmu-events/arch/x86/elkhartlake/pipeline.json278
-rw-r--r--lib/libpmc/pmu-events/arch/x86/elkhartlake/virtual-memory.json273
-rw-r--r--lib/libpmc/pmu-events/arch/x86/haswell/hsw-metrics.json2
-rw-r--r--lib/libpmc/pmu-events/arch/x86/haswellx/hsx-metrics.json2
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelake/cache.json724
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelake/floating-point.json101
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelake/frontend.json610
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelake/icl-metrics.json273
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelake/memory.json654
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelake/other.json1089
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelake/pipeline.json1169
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelake/virtual-memory.json251
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelakex/cache.json706
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelakex/floating-point.json95
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelakex/frontend.json469
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelakex/icx-metrics.json315
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelakex/memory.json291
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelakex/other.json181
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelakex/pipeline.json972
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelakex/uncore-memory.json333
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelakex/uncore-other.json2476
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelakex/uncore-power.json10
-rw-r--r--lib/libpmc/pmu-events/arch/x86/icelakex/virtual-memory.json245
-rw-r--r--lib/libpmc/pmu-events/arch/x86/ivybridge/ivb-metrics.json2
-rw-r--r--lib/libpmc/pmu-events/arch/x86/ivytown/ivt-metrics.json2
-rw-r--r--lib/libpmc/pmu-events/arch/x86/jaketown/jkt-metrics.json2
-rw-r--r--lib/libpmc/pmu-events/arch/x86/mapfile.csv6
-rw-r--r--lib/libpmc/pmu-events/arch/x86/sandybridge/snb-metrics.json2
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylake/cache.json4092
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylake/floating-point.json76
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylake/frontend.json644
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylake/memory.json2273
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylake/other.json60
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylake/pipeline.json1264
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylake/skl-metrics.json273
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylake/virtual-memory.json374
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylakex/cache.json2246
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylakex/floating-point.json88
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylakex/frontend.json732
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylakex/memory.json1973
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylakex/other.json154
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylakex/pipeline.json1290
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylakex/skx-metrics.json304
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylakex/uncore-memory.json35
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylakex/uncore-other.json901
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylakex/virtual-memory.json314
-rw-r--r--lib/libpmc/pmu-events/arch/x86/tigerlake/cache.json595
-rw-r--r--lib/libpmc/pmu-events/arch/x86/tigerlake/floating-point.json94
-rw-r--r--lib/libpmc/pmu-events/arch/x86/tigerlake/frontend.json463
-rw-r--r--lib/libpmc/pmu-events/arch/x86/tigerlake/memory.json295
-rw-r--r--lib/libpmc/pmu-events/arch/x86/tigerlake/other.json189
-rw-r--r--lib/libpmc/pmu-events/arch/x86/tigerlake/pipeline.json982
-rw-r--r--lib/libpmc/pmu-events/arch/x86/tigerlake/tgl-metrics.json231
-rw-r--r--lib/libpmc/pmu-events/arch/x86/tigerlake/virtual-memory.json225
-rw-r--r--lib/libpmcstat/libpmcstat_image.c9
-rw-r--r--lib/libprocstat/libprocstat.c4
-rw-r--r--lib/libradius/radlib.c3
-rw-r--r--lib/libregex/Makefile2
-rw-r--r--lib/librpcsvc/Makefile2
-rw-r--r--lib/librtld_db/rtld_db.c8
-rw-r--r--lib/libsecureboot/h/libsecureboot.h3
-rw-r--r--lib/libsecureboot/libsecureboot-priv.h3
-rw-r--r--lib/libsysdecode/mktables2
-rw-r--r--lib/libthr/arch/aarch64/include/pthread_md.h33
-rw-r--r--lib/libthr/arch/amd64/include/pthread_md.h58
-rw-r--r--lib/libthr/arch/arm/include/pthread_md.h33
-rw-r--r--lib/libthr/arch/i386/include/pthread_md.h60
-rw-r--r--lib/libthr/arch/mips/include/pthread_md.h133
-rw-r--r--lib/libthr/arch/mips/include/pthread_tls.h46
-rw-r--r--lib/libthr/arch/powerpc/include/pthread_md.h45
-rw-r--r--lib/libthr/arch/riscv/include/pthread_md.h34
-rw-r--r--lib/libthr/thread/thr_ctrdtr.c4
-rw-r--r--lib/libthr/thread/thr_init.c19
-rw-r--r--lib/libthr/thread/thr_private.h2
-rw-r--r--lib/libthr/thread/thr_stack.c22
-rw-r--r--lib/libthr/thread/thr_symbols.c2
-rw-r--r--lib/libthread_db/arch/mips/libpthread_md.c93
-rw-r--r--lib/libufs/libufs.h6
-rw-r--r--lib/libusb/Makefile8
-rw-r--r--lib/libusb/libusb20.c12
-rw-r--r--lib/libusb/libusb20_int.h10
-rw-r--r--lib/libusb/libusb20_ugen20.c16
-rw-r--r--lib/libusbhid/Makefile4
-rw-r--r--lib/libusbhid/data.c4
-rw-r--r--lib/libusbhid/descr.c4
-rw-r--r--lib/libusbhid/usbvar.h6
-rw-r--r--lib/libutil/kinfo_getvmobject.c20
-rw-r--r--lib/libutil/libutil.h2
-rw-r--r--lib/libwrap/Makefile2
-rw-r--r--lib/libypclnt/Makefile1
-rw-r--r--lib/libz/Makefile7
-rw-r--r--lib/msun/Makefile33
-rw-r--r--lib/msun/Symbol.map14
-rw-r--r--lib/msun/aarch64/Makefile.inc12
-rw-r--r--lib/msun/bsdsrc/b_exp.c143
-rw-r--r--lib/msun/bsdsrc/b_log.c166
-rw-r--r--lib/msun/bsdsrc/b_tgamma.c455
-rw-r--r--lib/msun/ld128/b_tgammal.c (renamed from lib/msun/src/imprecise.c)0
-rw-r--r--lib/msun/ld128/k_cosl.c32
-rw-r--r--lib/msun/ld128/k_cospil.h (renamed from lib/csu/mips/crt.h)60
-rw-r--r--lib/msun/ld128/k_sinpil.h42
-rw-r--r--lib/msun/ld128/s_cexpl.c94
-rw-r--r--lib/msun/ld128/s_cospil.c112
-rw-r--r--lib/msun/ld128/s_sinpil.c121
-rw-r--r--lib/msun/ld128/s_tanpil.c123
-rw-r--r--lib/msun/ld80/b_expl.c113
-rw-r--r--lib/msun/ld80/b_logl.c375
-rw-r--r--lib/msun/ld80/b_tgammal.c419
-rw-r--r--lib/msun/ld80/k_cospil.h42
-rw-r--r--lib/msun/ld80/k_sinpil.h42
-rw-r--r--lib/msun/ld80/s_cexpl.c107
-rw-r--r--lib/msun/ld80/s_cospil.c129
-rw-r--r--lib/msun/ld80/s_sinpil.c140
-rw-r--r--lib/msun/ld80/s_tanpil.c139
-rw-r--r--lib/msun/man/cexp.317
-rw-r--r--lib/msun/man/complex.38
-rw-r--r--lib/msun/man/cospi.3111
-rw-r--r--lib/msun/man/sinpi.3102
-rw-r--r--lib/msun/man/tanpi.3106
-rw-r--r--lib/msun/mips/Makefile.inc4
-rw-r--r--lib/msun/mips/Symbol.map16
-rw-r--r--lib/msun/mips/fenv.c68
-rw-r--r--lib/msun/mips/fenv.h283
-rw-r--r--lib/msun/src/e_sqrt.c18
-rw-r--r--lib/msun/src/e_sqrtf.c8
-rw-r--r--lib/msun/src/k_cospi.h44
-rw-r--r--lib/msun/src/k_sincosl.h29
-rw-r--r--lib/msun/src/k_sinpi.h43
-rw-r--r--lib/msun/src/math.h9
-rw-r--r--lib/msun/src/s_ccoshf.c2
-rw-r--r--lib/msun/src/s_cexp.c16
-rw-r--r--lib/msun/src/s_cexpf.c11
-rw-r--r--lib/msun/src/s_cosl.c7
-rw-r--r--lib/msun/src/s_cospi.c152
-rw-r--r--lib/msun/src/s_cospif.c109
-rw-r--r--lib/msun/src/s_ctanh.c2
-rw-r--r--lib/msun/src/s_ctanhf.c2
-rw-r--r--lib/msun/src/s_fma.c8
-rw-r--r--lib/msun/src/s_fmaf.c8
-rw-r--r--lib/msun/src/s_fmax.c8
-rw-r--r--lib/msun/src/s_fmaxf.c8
-rw-r--r--lib/msun/src/s_fmin.c8
-rw-r--r--lib/msun/src/s_fminf.c8
-rw-r--r--lib/msun/src/s_scalbn.c8
-rw-r--r--lib/msun/src/s_scalbnf.c8
-rw-r--r--lib/msun/src/s_scalbnl.c8
-rw-r--r--lib/msun/src/s_sincosl.c3
-rw-r--r--lib/msun/src/s_sinpi.c169
-rw-r--r--lib/msun/src/s_sinpif.c122
-rw-r--r--lib/msun/src/s_tanpi.c177
-rw-r--r--lib/msun/src/s_tanpif.c114
-rw-r--r--lib/ncurses/ncurses/Makefile21
-rw-r--r--lib/ncurses/ncurses/libncursesw.aldscript1
436 files changed, 41132 insertions, 34076 deletions
diff --git a/lib/Makefile b/lib/Makefile
index d39bbd37c910..d34f40616396 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -36,6 +36,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \
libauditd \
libbegemot \
libblocksruntime \
+ libbsddialog \
libbsdstat \
libbsm \
libbz2 \
@@ -62,6 +63,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \
libgeom \
libifconfig \
libipsec \
+ libiscsiutil \
libjail \
libkiconv \
libkvm \
@@ -116,6 +118,7 @@ SUBDIR_DEPEND_geom= libufs
SUBDIR_DEPEND_googletest= libregex
SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd
SUBDIR_DEPEND_libauditdm= libbsm
+SUBDIR_DEPEND_libbsddialog= ncurses
SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
SUBDIR_DEPEND_libc++:= libcxxrt
# libssp_nonshared doesn't need to be linked into libc on every arch, but it is
@@ -176,16 +179,15 @@ SUBDIR.${MK_KERBEROS_SUPPORT}+= libcom_err
SUBDIR.${MK_LDNS}+= libldns
SUBDIR.${MK_STATS}+= libstats
-# The libraries under libclang_rt can only be built by clang, and only make
-# sense to build when clang is enabled at all. Furthermore, they can only be
-# built for certain architectures.
-.if ${COMPILER_TYPE} == "clang" && \
+# The libraries under libclang_rt can only be built by clang and when we enable
+# C++ support. Furthermore, they can only be built for certain architectures.
+.if ${COMPILER_TYPE} == "clang" && ${MK_CXX} != "no" && \
(${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386" || \
${MACHINE_CPUARCH} == "powerpc")
_libclang_rt= libclang_rt
-.elif ${MK_ASAN} != "no" || ${MK_UBSAN} != "no"
-.error "Requested build with sanitizers but cannot build runtime libraries!"
+.elif (${MK_ASAN} != "no" || ${MK_UBSAN} != "no") && make(all)
+.error Requested build with sanitizers but cannot build runtime libraries!
.endif
.if ${MK_CXX} != "no"
@@ -215,8 +217,8 @@ SUBDIR.${MK_BHYVE}+= libvmmapi
.if ${MACHINE_ARCH} != "powerpc"
SUBDIR.${MK_OPENMP}+= libomp
.endif
-.if !defined(COMPAT_32BIT)
-SUBDIR.${MK_OPENSSH}+= libcbor
+.if !defined(COMPAT_32BIT) && ${MK_USB} != "no"
+SUBDIR.${MK_OPENSSH}+= libcbor libfido2
.endif
SUBDIR.${MK_OPENSSL}+= libmp
SUBDIR.${MK_PF}+= libpfctl
diff --git a/lib/atf/Makefile b/lib/atf/Makefile
index baadf535b424..05c7973fdc02 100644
--- a/lib/atf/Makefile
+++ b/lib/atf/Makefile
@@ -27,8 +27,8 @@
.include <src.opts.mk>
-SUBDIR= libatf-c \
- libatf-c++ \
+SUBDIR= libatf-c
+SUBDIR.${MK_CXX}+= libatf-c++
SUBDIR.${MK_TESTS}+= tests
diff --git a/lib/clang/Makefile b/lib/clang/Makefile
index df4aa01a2653..cbb2c2a7175f 100644
--- a/lib/clang/Makefile
+++ b/lib/clang/Makefile
@@ -4,7 +4,7 @@
# These have to be built in order.
SUBDIR= libllvm
-.if ${MK_CLANG} != "no"
+.if ${MK_CLANG} != "no" || ${MK_LLDB} != "no"
SUBDIR+= libclang
SUBDIR+= headers
.endif
diff --git a/lib/clang/freebsd_cc_version.h b/lib/clang/freebsd_cc_version.h
index ea02e53b3f00..21c675d28e2c 100644
--- a/lib/clang/freebsd_cc_version.h
+++ b/lib/clang/freebsd_cc_version.h
@@ -1,3 +1,3 @@
/* $FreeBSD$ */
-#define FREEBSD_CC_VERSION 1400001
+#define FREEBSD_CC_VERSION 1400002
diff --git a/lib/clang/headers/Makefile b/lib/clang/headers/Makefile
index 5cd962a3fd69..d4a31b767523 100644
--- a/lib/clang/headers/Makefile
+++ b/lib/clang/headers/Makefile
@@ -5,7 +5,7 @@
.PATH: ${CLANG_SRCS}/lib/Headers
INCSGROUPS= INCS CUDA OMP PPC
-INCSDIR= ${LIBDIR}/clang/12.0.1/include
+INCSDIR= ${LIBDIR}/clang/13.0.0/include
CUDADIR= ${INCSDIR}/cuda_wrappers
OMPDIR= ${INCSDIR}/openmp_wrappers
PPCDIR= ${INCSDIR}/ppc_wrappers
@@ -65,6 +65,7 @@ INCS+= avxintrin.h
INCS+= avxvnniintrin.h
INCS+= bmi2intrin.h
INCS+= bmiintrin.h
+INCS+= builtins.h
INCS+= cet.h
INCS+= cetintrin.h
INCS+= cldemoteintrin.h
@@ -79,9 +80,13 @@ INCS+= fma4intrin.h
INCS+= fmaintrin.h
INCS+= fxsrintrin.h
INCS+= gfniintrin.h
+INCS+= hexagon_circ_brev_intrinsics.h
+INCS+= hexagon_protos.h
+INCS+= hexagon_types.h
INCS+= hresetintrin.h
INCS+= htmintrin.h
INCS+= htmxlintrin.h
+INCS+= hvx_hexagon_protos.h
INCS+= ia32intrin.h
INCS+= immintrin.h
INCS+= invpcidintrin.h
@@ -182,6 +187,14 @@ arm_${hdr:H}.h: ${CLANG_SRCS}/include/clang/Basic/arm_${hdr:H}.td
GENINCS+= arm_${hdr:H}.h
.endfor
+.for hdr in vector/vector-header
+riscv_${hdr:H}.h: ${CLANG_SRCS}/include/clang/Basic/riscv_${hdr:H}.td
+ ${CLANG_TBLGEN} -gen-riscv-${hdr:T} \
+ -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/$/.d/} \
+ -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/riscv_${hdr:H}.td
+GENINCS+= riscv_${hdr:H}.h
+.endfor
+
CLEANFILES= ${GENINCS} ${GENINCS:C/$/.d/}
.include <bsd.prog.mk>
diff --git a/lib/clang/include/Plugins/Plugins.def b/lib/clang/include/Plugins/Plugins.def
index 2dd2ddba3d66..31445a0449dd 100644
--- a/lib/clang/include/Plugins/Plugins.def
+++ b/lib/clang/include/Plugins/Plugins.def
@@ -38,6 +38,7 @@ LLDB_PLUGIN(ABIX86)
LLDB_PLUGIN(ArchitectureArm)
LLDB_PLUGIN(ArchitectureMips)
LLDB_PLUGIN(ArchitecturePPC64)
+LLDB_PLUGIN(ArchitectureAArch64)
LLDB_PLUGIN(DisassemblerLLVMC)
LLDB_PLUGIN(DynamicLoaderPosixDYLD)
LLDB_PLUGIN(DynamicLoaderStatic)
@@ -60,6 +61,7 @@ LLDB_PLUGIN(ObjectFileELF)
LLDB_PLUGIN(ObjectFileJIT)
LLDB_PLUGIN(PlatformFreeBSD)
LLDB_PLUGIN(PlatformGDB)
+LLDB_PLUGIN(ScriptedProcess)
LLDB_PLUGIN(ProcessElfCore)
LLDB_SCRIPT_PLUGIN(ScriptInterpreterNone)
LLDB_SCRIPT_PLUGIN(ScriptInterpreterLua)
diff --git a/lib/clang/include/VCSVersion.inc b/lib/clang/include/VCSVersion.inc
index 8c1798de59ee..98c0198a4aaf 100644
--- a/lib/clang/include/VCSVersion.inc
+++ b/lib/clang/include/VCSVersion.inc
@@ -1,14 +1,14 @@
// $FreeBSD$
-#define LLVM_REVISION "llvmorg-12.0.1-0-gfed41342a82f"
+#define LLVM_REVISION "llvmorg-13.0.0-0-gd7b669b3a303"
#define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git"
-#define CLANG_REVISION "llvmorg-12.0.1-0-gfed41342a82f"
+#define CLANG_REVISION "llvmorg-13.0.0-0-gd7b669b3a303"
#define CLANG_REPOSITORY "git@github.com:llvm/llvm-project.git"
// <Upstream revision at import>-<Local identifier in __FreeBSD_version style>
-#define LLD_REVISION "llvmorg-12.0.1-0-gfed41342a82f-1400002"
+#define LLD_REVISION "llvmorg-13.0.0-0-gd7b669b3a303-1400002"
#define LLD_REPOSITORY "FreeBSD"
-#define LLDB_REVISION "llvmorg-12.0.1-0-gfed41342a82f"
+#define LLDB_REVISION "llvmorg-13.0.0-0-gd7b669b3a303"
#define LLDB_REPOSITORY "git@github.com:llvm/llvm-project.git"
diff --git a/lib/clang/include/clang/Basic/Version.inc b/lib/clang/include/clang/Basic/Version.inc
index 7e28da22ce5c..74977f61929b 100644
--- a/lib/clang/include/clang/Basic/Version.inc
+++ b/lib/clang/include/clang/Basic/Version.inc
@@ -1,9 +1,9 @@
/* $FreeBSD$ */
-#define CLANG_VERSION 12.0.1
-#define CLANG_VERSION_STRING "12.0.1"
-#define CLANG_VERSION_MAJOR 12
+#define CLANG_VERSION 13.0.0
+#define CLANG_VERSION_STRING "13.0.0"
+#define CLANG_VERSION_MAJOR 13
#define CLANG_VERSION_MINOR 0
-#define CLANG_VERSION_PATCHLEVEL 1
+#define CLANG_VERSION_PATCHLEVEL 0
#define CLANG_VENDOR "FreeBSD "
diff --git a/lib/clang/include/clang/Config/config.h b/lib/clang/include/clang/Config/config.h
index a9d765b327b2..0882737f125b 100644
--- a/lib/clang/include/clang/Config/config.h
+++ b/lib/clang/include/clang/Config/config.h
@@ -65,7 +65,7 @@
#define CLANG_HAVE_RLIMITS 1
/* The LLVM product name and version */
-#define BACKEND_PACKAGE_STRING "LLVM 12.0.1"
+#define BACKEND_PACKAGE_STRING "LLVM 13.0.0"
/* Linker version detected at compile time. */
/* #undef HOST_LINK_VERSION */
diff --git a/lib/clang/include/lld/Common/Version.inc b/lib/clang/include/lld/Common/Version.inc
index 65472b919842..3de8405e7c35 100644
--- a/lib/clang/include/lld/Common/Version.inc
+++ b/lib/clang/include/lld/Common/Version.inc
@@ -1,3 +1,3 @@
// $FreeBSD$
-#define LLD_VERSION_STRING "12.0.1"
+#define LLD_VERSION_STRING "13.0.0"
diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h
index 35ce8c189d2b..d02d06c088de 100644
--- a/lib/clang/include/llvm/Config/config.h
+++ b/lib/clang/include/llvm/Config/config.h
@@ -155,6 +155,9 @@
#define HAVE_MALLINFO 1
#endif
+/* Define to 1 if you have the `mallinfo2' function. */
+/* #undef HAVE_MALLINFO2 */
+
/* Define to 1 if you have the <malloc/malloc.h> header file. */
#if __has_include(<malloc/malloc.h>)
#define HAVE_MALLOC_MALLOC_H 1
@@ -252,11 +255,6 @@
#define LLVM_ENABLE_TERMINFO 1
#endif
-/* Define if the xar_open() function is supported this platform. */
-#if defined(__APPLE__)
-#define HAVE_LIBXAR
-#endif
-
/* Define to 1 if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1
@@ -348,7 +346,7 @@
#define LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO 1
/* Define if libxml2 is supported on this platform. */
-/* #undef LLVM_LIBXML2_ENABLED */
+/* #undef LLVM_ENABLE_LIBXML2 */
/* Define to the extension used for shared libraries, say, ".so". */
#if defined(__APPLE__)
@@ -357,6 +355,13 @@
#define LTDL_SHLIB_EXT ".so"
#endif
+/* Define to the extension used for plugin libraries, say, ".so". */
+#if defined(__APPLE__)
+#define LLVM_PLUGIN_EXT ".dylib"
+#else
+#define LLVM_PLUGIN_EXT ".so"
+#endif
+
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "https://bugs.freebsd.org/submit/"
@@ -364,10 +369,10 @@
#define PACKAGE_NAME "LLVM"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "LLVM 12.0.1"
+#define PACKAGE_STRING "LLVM 13.0.0"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "12.0.1"
+#define PACKAGE_VERSION "13.0.0"
/* Define to the vendor of this package. */
/* #undef PACKAGE_VENDOR */
@@ -390,11 +395,6 @@
/* Define to the default GlobalISel coverage file prefix */
/* #undef LLVM_GISEL_COV_PREFIX */
-/* Whether Timers signpost passes in Xcode Instruments */
-#if defined(__APPLE__)
-#define LLVM_SUPPORT_XCODE_SIGNPOSTS 1
-#else
-#define LLVM_SUPPORT_XCODE_SIGNPOSTS 0
-#endif
+/* #undef HAVE_PROC_PID_RUSAGE */
#endif
diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h
index 11299564108c..7932c7d9435a 100644
--- a/lib/clang/include/llvm/Config/llvm-config.h
+++ b/lib/clang/include/llvm/Config/llvm-config.h
@@ -64,16 +64,16 @@
#define LLVM_USE_PERF 0
/* Major version of the LLVM API */
-#define LLVM_VERSION_MAJOR 12
+#define LLVM_VERSION_MAJOR 13
/* Minor version of the LLVM API */
#define LLVM_VERSION_MINOR 0
/* Patch version of the LLVM API */
-#define LLVM_VERSION_PATCH 1
+#define LLVM_VERSION_PATCH 0
/* LLVM version string */
-#define LLVM_VERSION_STRING "12.0.1"
+#define LLVM_VERSION_STRING "13.0.0"
/* Whether LLVM records statistics for use with GetStatistics(),
* PrintStatistics() or PrintStatisticsJSON()
@@ -93,6 +93,19 @@
#define HAVE_SYSEXITS_H 1
/* Define to 1 to enable the experimental new pass manager by default */
-#define LLVM_ENABLE_NEW_PASS_MANAGER 0
+#define LLVM_ENABLE_NEW_PASS_MANAGER 1
+
+/* Define if the xar_open() function is supported on this platform. */
+#if defined(__APPLE__)
+#define LLVM_HAVE_LIBXAR 1
+#endif
+
+/* Whether Timers signpost passes in Xcode Instruments */
+#if defined(__APPLE__)
+#define LLVM_SUPPORT_XCODE_SIGNPOSTS 1
+#else
+#define LLVM_SUPPORT_XCODE_SIGNPOSTS 0
+#endif
+
#endif
diff --git a/lib/clang/include/llvm/Support/VCSRevision.h b/lib/clang/include/llvm/Support/VCSRevision.h
index ef3416c7ffcd..76c4f00a938c 100644
--- a/lib/clang/include/llvm/Support/VCSRevision.h
+++ b/lib/clang/include/llvm/Support/VCSRevision.h
@@ -1,3 +1,3 @@
/* $FreeBSD$ */
-#define LLVM_REVISION "llvmorg-12.0.1-0-gfed41342a82f"
+#define LLVM_REVISION "llvmorg-13.0.0-0-gd7b669b3a303"
#define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git"
diff --git a/lib/clang/libclang/Makefile b/lib/clang/libclang/Makefile
index 13ab76a80349..217417811846 100644
--- a/lib/clang/libclang/Makefile
+++ b/lib/clang/libclang/Makefile
@@ -163,6 +163,7 @@ SRCS_FUL+= Analysis/Dominators.cpp
SRCS_MIN+= Analysis/ExprMutationAnalyzer.cpp
SRCS_FUL+= Analysis/IssueHash.cpp
SRCS_MIN+= Analysis/LiveVariables.cpp
+SRCS_FUL+= Analysis/MacroExpansionContext.cpp
SRCS_MIN+= Analysis/ObjCNoReturn.cpp
SRCS_FUL+= Analysis/PathDiagnostic.cpp
SRCS_MIN+= Analysis/PostOrderCFGView.cpp
@@ -178,6 +179,7 @@ SRCS_MIN+= Basic/Builtins.cpp
SRCS_MIN+= Basic/CharInfo.cpp
SRCS_MIN+= Basic/CodeGenOptions.cpp
SRCS_MIN+= Basic/Cuda.cpp
+SRCS_MIN+= Basic/DarwinSDKInfo.cpp
SRCS_MIN+= Basic/Diagnostic.cpp
SRCS_MIN+= Basic/DiagnosticIDs.cpp
SRCS_MIN+= Basic/DiagnosticOptions.cpp
@@ -189,12 +191,12 @@ SRCS_MIN+= Basic/IdentifierTable.cpp
SRCS_MIN+= Basic/LangOptions.cpp
SRCS_MIN+= Basic/LangStandards.cpp
SRCS_MIN+= Basic/Module.cpp
+SRCS_MIN+= Basic/NoSanitizeList.cpp
SRCS_MIN+= Basic/ObjCRuntime.cpp
SRCS_MIN+= Basic/OpenCLOptions.cpp
SRCS_MIN+= Basic/OpenMPKinds.cpp
SRCS_MIN+= Basic/OperatorPrecedence.cpp
SRCS_MIN+= Basic/ProfileList.cpp
-SRCS_MIN+= Basic/SanitizerBlacklist.cpp
SRCS_MIN+= Basic/SanitizerSpecialCaseList.cpp
SRCS_MIN+= Basic/Sanitizers.cpp
SRCS_MIN+= Basic/SourceLocation.cpp
@@ -212,8 +214,9 @@ SRCS_MIN+= Basic/Targets/BPF.cpp
SRCS_MIN+= Basic/Targets/Hexagon.cpp
SRCS_MIN+= Basic/Targets/Lanai.cpp
SRCS_MIN+= Basic/Targets/Le64.cpp
-SRCS_MIN+= Basic/Targets/MSP430.cpp
+SRCS_MIN+= Basic/Targets/M68k.cpp
SRCS_MIN+= Basic/Targets/Mips.cpp
+SRCS_MIN+= Basic/Targets/MSP430.cpp
SRCS_MIN+= Basic/Targets/NVPTX.cpp
SRCS_MIN+= Basic/Targets/OSTargets.cpp
SRCS_MIN+= Basic/Targets/PNaCl.cpp
@@ -293,7 +296,6 @@ SRCS_MIN+= CodeGen/VarBypassDetector.cpp
SRCS_FUL+= CrossTU/CrossTranslationUnit.cpp
SRCS_MIN+= Driver/Action.cpp
SRCS_MIN+= Driver/Compilation.cpp
-SRCS_MIN+= Driver/DarwinSDKInfo.cpp
SRCS_MIN+= Driver/Distro.cpp
SRCS_MIN+= Driver/Driver.cpp
SRCS_MIN+= Driver/DriverOptions.cpp
@@ -306,10 +308,12 @@ SRCS_MIN+= Driver/Tool.cpp
SRCS_MIN+= Driver/ToolChain.cpp
SRCS_MIN+= Driver/ToolChains/AIX.cpp
SRCS_MIN+= Driver/ToolChains/AMDGPU.cpp
+SRCS_MIN+= Driver/ToolChains/AMDGPUOpenMP.cpp
SRCS_MIN+= Driver/ToolChains/AVR.cpp
SRCS_MIN+= Driver/ToolChains/Ananas.cpp
SRCS_MIN+= Driver/ToolChains/Arch/AArch64.cpp
SRCS_MIN+= Driver/ToolChains/Arch/ARM.cpp
+SRCS_MIN+= Driver/ToolChains/Arch/M68k.cpp
SRCS_MIN+= Driver/ToolChains/Arch/Mips.cpp
SRCS_MIN+= Driver/ToolChains/Arch/PPC.cpp
SRCS_MIN+= Driver/ToolChains/Arch/RISCV.cpp
@@ -666,7 +670,7 @@ SRCS_FUL+= StaticAnalyzer/Core/CheckerRegistryData.cpp
SRCS_FUL+= StaticAnalyzer/Core/CommonBugCategories.cpp
SRCS_FUL+= StaticAnalyzer/Core/ConstraintManager.cpp
SRCS_FUL+= StaticAnalyzer/Core/CoreEngine.cpp
-SRCS_FUL+= StaticAnalyzer/Core/DynamicSize.cpp
+SRCS_FUL+= StaticAnalyzer/Core/DynamicExtent.cpp
SRCS_FUL+= StaticAnalyzer/Core/DynamicType.cpp
SRCS_FUL+= StaticAnalyzer/Core/Environment.cpp
SRCS_FUL+= StaticAnalyzer/Core/ExplodedGraph.cpp
@@ -983,6 +987,20 @@ clang/Basic/arm_sve_typeflags.inc: \
-o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/arm_sve.td
TGHDRS+= clang/Basic/arm_sve_typeflags.inc
+clang/Basic/riscv_vector_builtins.inc: \
+ ${CLANG_SRCS}/include/clang/Basic/riscv_vector.td
+ ${CLANG_TBLGEN} -gen-riscv-vector-builtins \
+ -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/$/.d/} \
+ -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/riscv_vector.td
+TGHDRS+= clang/Basic/riscv_vector_builtins.inc
+
+clang/Basic/riscv_vector_builtin_cg.inc: \
+ ${CLANG_SRCS}/include/clang/Basic/riscv_vector.td
+ ${CLANG_TBLGEN} -gen-riscv-vector-builtin-codegen \
+ -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/$/.d/} \
+ -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/riscv_vector.td
+TGHDRS+= clang/Basic/riscv_vector_builtin_cg.inc
+
clang/Driver/Options.inc: ${CLANG_SRCS}/include/clang/Driver/Options.td
${LLVM_TBLGEN} -gen-opt-parser-defs \
-I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \
diff --git a/lib/clang/liblldb/LLDBWrapLua.cpp b/lib/clang/liblldb/LLDBWrapLua.cpp
index 2e1e9e7a9a4e..2db9ba035173 100644
--- a/lib/clang/liblldb/LLDBWrapLua.cpp
+++ b/lib/clang/liblldb/LLDBWrapLua.cpp
@@ -2763,73 +2763,73 @@ SWIG_Lua_dostring(lua_State *L, const char *str) {
#define SWIGTYPE_p_lldb__SBThreadCollection swig_types[63]
#define SWIGTYPE_p_lldb__SBThreadPlan swig_types[64]
#define SWIGTYPE_p_lldb__SBTrace swig_types[65]
-#define SWIGTYPE_p_lldb__SBTraceOptions swig_types[66]
-#define SWIGTYPE_p_lldb__SBType swig_types[67]
-#define SWIGTYPE_p_lldb__SBTypeCategory swig_types[68]
-#define SWIGTYPE_p_lldb__SBTypeEnumMember swig_types[69]
-#define SWIGTYPE_p_lldb__SBTypeEnumMemberList swig_types[70]
-#define SWIGTYPE_p_lldb__SBTypeFilter swig_types[71]
-#define SWIGTYPE_p_lldb__SBTypeFormat swig_types[72]
-#define SWIGTYPE_p_lldb__SBTypeList swig_types[73]
-#define SWIGTYPE_p_lldb__SBTypeMember swig_types[74]
-#define SWIGTYPE_p_lldb__SBTypeMemberFunction swig_types[75]
-#define SWIGTYPE_p_lldb__SBTypeNameSpecifier swig_types[76]
-#define SWIGTYPE_p_lldb__SBTypeSummary swig_types[77]
-#define SWIGTYPE_p_lldb__SBTypeSummaryOptions swig_types[78]
-#define SWIGTYPE_p_lldb__SBTypeSynthetic swig_types[79]
-#define SWIGTYPE_p_lldb__SBUnixSignals swig_types[80]
-#define SWIGTYPE_p_lldb__SBValue swig_types[81]
-#define SWIGTYPE_p_lldb__SBValueList swig_types[82]
-#define SWIGTYPE_p_lldb__SBVariablesOptions swig_types[83]
-#define SWIGTYPE_p_lldb__SBWatchpoint swig_types[84]
-#define SWIGTYPE_p_long_double swig_types[85]
-#define SWIGTYPE_p_long_long swig_types[86]
-#define SWIGTYPE_p_p_char swig_types[87]
-#define SWIGTYPE_p_p_void swig_types[88]
-#define SWIGTYPE_p_pthread_rwlock_t swig_types[89]
-#define SWIGTYPE_p_pthread_t swig_types[90]
-#define SWIGTYPE_p_short swig_types[91]
-#define SWIGTYPE_p_signed_char swig_types[92]
-#define SWIGTYPE_p_size_t swig_types[93]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__ABI_t swig_types[94]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Baton_t swig_types[95]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Block_t swig_types[96]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__BreakpointLocation_t swig_types[97]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__BreakpointPrecondition_t swig_types[98]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__BreakpointResolver_t swig_types[99]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__BreakpointSite_t swig_types[100]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Breakpoint_t swig_types[101]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__BroadcasterManager_t swig_types[102]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Broadcaster_t swig_types[103]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__CommandObject_t swig_types[104]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Communication_t swig_types[105]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__CompileUnit_t swig_types[106]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Connection_t swig_types[107]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__DataBuffer_t swig_types[108]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__DataExtractor_t swig_types[109]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Debugger_t swig_types[110]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Disassembler_t swig_types[111]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__DynamicLoader_t swig_types[112]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__EventDataStructuredData_t swig_types[113]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__EventData_t swig_types[114]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t swig_types[115]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__ExecutionContextRef_t swig_types[116]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__ExpressionVariable_t swig_types[117]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t swig_types[118]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__FuncUnwinders_t swig_types[119]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__FunctionCaller_t swig_types[120]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Function_t swig_types[121]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__IOHandler_t swig_types[122]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__IOObject_t swig_types[123]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__IRExecutionUnit_t swig_types[124]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__InlineFunctionInfo_t swig_types[125]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Instruction_t swig_types[126]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__InstrumentationRuntime_t swig_types[127]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__JITLoader_t swig_types[128]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__LanguageRuntime_t swig_types[129]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__LineTable_t swig_types[130]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Listener_t swig_types[131]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__MemoryHistory_t swig_types[132]
+#define SWIGTYPE_p_lldb__SBType swig_types[66]
+#define SWIGTYPE_p_lldb__SBTypeCategory swig_types[67]
+#define SWIGTYPE_p_lldb__SBTypeEnumMember swig_types[68]
+#define SWIGTYPE_p_lldb__SBTypeEnumMemberList swig_types[69]
+#define SWIGTYPE_p_lldb__SBTypeFilter swig_types[70]
+#define SWIGTYPE_p_lldb__SBTypeFormat swig_types[71]
+#define SWIGTYPE_p_lldb__SBTypeList swig_types[72]
+#define SWIGTYPE_p_lldb__SBTypeMember swig_types[73]
+#define SWIGTYPE_p_lldb__SBTypeMemberFunction swig_types[74]
+#define SWIGTYPE_p_lldb__SBTypeNameSpecifier swig_types[75]
+#define SWIGTYPE_p_lldb__SBTypeSummary swig_types[76]
+#define SWIGTYPE_p_lldb__SBTypeSummaryOptions swig_types[77]
+#define SWIGTYPE_p_lldb__SBTypeSynthetic swig_types[78]
+#define SWIGTYPE_p_lldb__SBUnixSignals swig_types[79]
+#define SWIGTYPE_p_lldb__SBValue swig_types[80]
+#define SWIGTYPE_p_lldb__SBValueList swig_types[81]
+#define SWIGTYPE_p_lldb__SBVariablesOptions swig_types[82]
+#define SWIGTYPE_p_lldb__SBWatchpoint swig_types[83]
+#define SWIGTYPE_p_long_double swig_types[84]
+#define SWIGTYPE_p_long_long swig_types[85]
+#define SWIGTYPE_p_p_char swig_types[86]
+#define SWIGTYPE_p_p_void swig_types[87]
+#define SWIGTYPE_p_pthread_rwlock_t swig_types[88]
+#define SWIGTYPE_p_pthread_t swig_types[89]
+#define SWIGTYPE_p_short swig_types[90]
+#define SWIGTYPE_p_signed_char swig_types[91]
+#define SWIGTYPE_p_size_t swig_types[92]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__ABI_t swig_types[93]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Baton_t swig_types[94]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Block_t swig_types[95]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__BreakpointLocation_t swig_types[96]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__BreakpointPrecondition_t swig_types[97]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__BreakpointResolver_t swig_types[98]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__BreakpointSite_t swig_types[99]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Breakpoint_t swig_types[100]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__BroadcasterManager_t swig_types[101]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Broadcaster_t swig_types[102]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__CommandObject_t swig_types[103]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Communication_t swig_types[104]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__CompileUnit_t swig_types[105]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Connection_t swig_types[106]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__DataBuffer_t swig_types[107]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__DataExtractor_t swig_types[108]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Debugger_t swig_types[109]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Disassembler_t swig_types[110]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__DynamicLoader_t swig_types[111]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__EventDataStructuredData_t swig_types[112]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__EventData_t swig_types[113]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t swig_types[114]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__ExecutionContextRef_t swig_types[115]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__ExpressionVariable_t swig_types[116]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t swig_types[117]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__FuncUnwinders_t swig_types[118]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__FunctionCaller_t swig_types[119]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Function_t swig_types[120]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__IOHandler_t swig_types[121]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__IOObject_t swig_types[122]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__IRExecutionUnit_t swig_types[123]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__InlineFunctionInfo_t swig_types[124]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Instruction_t swig_types[125]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__InstrumentationRuntime_t swig_types[126]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__JITLoader_t swig_types[127]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__LanguageRuntime_t swig_types[128]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__LineTable_t swig_types[129]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Listener_t swig_types[130]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__MemoryHistory_t swig_types[131]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__MemoryRegionInfo_t swig_types[132]
#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Module_t swig_types[133]
#define SWIGTYPE_p_std__shared_ptrT_lldb_private__ObjectFileJITDelegate_t swig_types[134]
#define SWIGTYPE_p_std__shared_ptrT_lldb_private__ObjectFile_t swig_types[135]
@@ -2887,8 +2887,8 @@ SWIG_Lua_dostring(lua_State *L, const char *str) {
#define SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadCollection_t swig_types[187]
#define SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlanTracer_t swig_types[188]
#define SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t swig_types[189]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Thread_t swig_types[190]
-#define SWIGTYPE_p_std__shared_ptrT_lldb_private__TraceOptions_t swig_types[191]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPostMortemTrace_t swig_types[190]
+#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Thread_t swig_types[191]
#define SWIGTYPE_p_std__shared_ptrT_lldb_private__Trace_t swig_types[192]
#define SWIGTYPE_p_std__shared_ptrT_lldb_private__TypeCategoryImpl_t swig_types[193]
#define SWIGTYPE_p_std__shared_ptrT_lldb_private__TypeEnumMemberImpl_t swig_types[194]
@@ -2921,42 +2921,45 @@ SWIG_Lua_dostring(lua_State *L, const char *str) {
#define SWIGTYPE_p_std__unique_ptrT_lldb_private__MemoryRegionInfo_t swig_types[221]
#define SWIGTYPE_p_std__unique_ptrT_lldb_private__OperatingSystem_t swig_types[222]
#define SWIGTYPE_p_std__unique_ptrT_lldb_private__ScriptInterpreter_t swig_types[223]
-#define SWIGTYPE_p_std__unique_ptrT_lldb_private__SectionList_t swig_types[224]
-#define SWIGTYPE_p_std__unique_ptrT_lldb_private__SourceManager_t swig_types[225]
-#define SWIGTYPE_p_std__unique_ptrT_lldb_private__StackFrameRecognizerManager_t swig_types[226]
-#define SWIGTYPE_p_std__unique_ptrT_lldb_private__StackFrame_t swig_types[227]
-#define SWIGTYPE_p_std__unique_ptrT_lldb_private__StructuredDataImpl_t swig_types[228]
-#define SWIGTYPE_p_std__unique_ptrT_lldb_private__SymbolVendor_t swig_types[229]
-#define SWIGTYPE_p_std__unique_ptrT_lldb_private__SystemRuntime_t swig_types[230]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__BreakpointLocation_t swig_types[231]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__BreakpointSite_t swig_types[232]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Breakpoint_t swig_types[233]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__BroadcasterManager_t swig_types[234]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Debugger_t swig_types[235]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Listener_t swig_types[236]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Module_t swig_types[237]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__ObjectFileJITDelegate_t swig_types[238]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__ObjectFile_t swig_types[239]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__OptionValue_t swig_types[240]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Process_t swig_types[241]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Queue_t swig_types[242]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Section_t swig_types[243]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__StackFrame_t swig_types[244]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Stream_t swig_types[245]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__StructuredDataPlugin_t swig_types[246]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__SymbolFileType_t swig_types[247]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Target_t swig_types[248]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__ThreadPlan_t swig_types[249]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Thread_t swig_types[250]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Type_t swig_types[251]
-#define SWIGTYPE_p_std__weak_ptrT_lldb_private__UnixSignals_t swig_types[252]
-#define SWIGTYPE_p_unsigned_char swig_types[253]
-#define SWIGTYPE_p_unsigned_int swig_types[254]
-#define SWIGTYPE_p_unsigned_long_long swig_types[255]
-#define SWIGTYPE_p_unsigned_short swig_types[256]
-#define SWIGTYPE_p_void swig_types[257]
-static swig_type_info *swig_types[259];
-static swig_module_info swig_module = {swig_types, 258, 0, 0, 0, 0};
+#define SWIGTYPE_p_std__unique_ptrT_lldb_private__ScriptedProcessInterface_t swig_types[224]
+#define SWIGTYPE_p_std__unique_ptrT_lldb_private__SectionList_t swig_types[225]
+#define SWIGTYPE_p_std__unique_ptrT_lldb_private__SourceManager_t swig_types[226]
+#define SWIGTYPE_p_std__unique_ptrT_lldb_private__StackFrameRecognizerManager_t swig_types[227]
+#define SWIGTYPE_p_std__unique_ptrT_lldb_private__StackFrame_t swig_types[228]
+#define SWIGTYPE_p_std__unique_ptrT_lldb_private__StructuredDataImpl_t swig_types[229]
+#define SWIGTYPE_p_std__unique_ptrT_lldb_private__SymbolVendor_t swig_types[230]
+#define SWIGTYPE_p_std__unique_ptrT_lldb_private__SystemRuntime_t swig_types[231]
+#define SWIGTYPE_p_std__unique_ptrT_lldb_private__TraceCursor_t swig_types[232]
+#define SWIGTYPE_p_std__unique_ptrT_lldb_private__TraceExporter_t swig_types[233]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__BreakpointLocation_t swig_types[234]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__BreakpointSite_t swig_types[235]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Breakpoint_t swig_types[236]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__BroadcasterManager_t swig_types[237]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Debugger_t swig_types[238]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Listener_t swig_types[239]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Module_t swig_types[240]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__ObjectFileJITDelegate_t swig_types[241]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__ObjectFile_t swig_types[242]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__OptionValue_t swig_types[243]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Process_t swig_types[244]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Queue_t swig_types[245]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Section_t swig_types[246]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__StackFrame_t swig_types[247]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Stream_t swig_types[248]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__StructuredDataPlugin_t swig_types[249]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__SymbolFileType_t swig_types[250]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Target_t swig_types[251]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__ThreadPlan_t swig_types[252]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Thread_t swig_types[253]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__Type_t swig_types[254]
+#define SWIGTYPE_p_std__weak_ptrT_lldb_private__UnixSignals_t swig_types[255]
+#define SWIGTYPE_p_unsigned_char swig_types[256]
+#define SWIGTYPE_p_unsigned_int swig_types[257]
+#define SWIGTYPE_p_unsigned_long_long swig_types[258]
+#define SWIGTYPE_p_unsigned_short swig_types[259]
+#define SWIGTYPE_p_void swig_types[260]
+static swig_type_info *swig_types[262];
+static swig_module_info swig_module = {swig_types, 261, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
@@ -3201,7 +3204,6 @@ SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_typ
#include "lldb/API/SBThreadCollection.h"
#include "lldb/API/SBThreadPlan.h"
#include "lldb/API/SBTrace.h"
-#include "lldb/API/SBTraceOptions.h"
#include "lldb/API/SBType.h"
#include "lldb/API/SBTypeCategory.h"
#include "lldb/API/SBTypeEnumMember.h"
@@ -12979,6 +12981,56 @@ fail:
}
+static int _wrap_SBCommandInterpreterRunOptions_GetPrintErrors(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ;
+ bool result;
+
+ SWIG_check_num_args("lldb::SBCommandInterpreterRunOptions::GetPrintErrors",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBCommandInterpreterRunOptions::GetPrintErrors",1,"lldb::SBCommandInterpreterRunOptions const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBCommandInterpreterRunOptions,0))){
+ SWIG_fail_ptr("SBCommandInterpreterRunOptions_GetPrintErrors",1,SWIGTYPE_p_lldb__SBCommandInterpreterRunOptions);
+ }
+
+ result = (bool)((lldb::SBCommandInterpreterRunOptions const *)arg1)->GetPrintErrors();
+ lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_SBCommandInterpreterRunOptions_SetPrintErrors(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ;
+ bool arg2 ;
+
+ SWIG_check_num_args("lldb::SBCommandInterpreterRunOptions::SetPrintErrors",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBCommandInterpreterRunOptions::SetPrintErrors",1,"lldb::SBCommandInterpreterRunOptions *");
+ if(!lua_isboolean(L,2)) SWIG_fail_arg("lldb::SBCommandInterpreterRunOptions::SetPrintErrors",2,"bool");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBCommandInterpreterRunOptions,0))){
+ SWIG_fail_ptr("SBCommandInterpreterRunOptions_SetPrintErrors",1,SWIGTYPE_p_lldb__SBCommandInterpreterRunOptions);
+ }
+
+ arg2 = (lua_toboolean(L, 2)!=0);
+ (arg1)->SetPrintErrors(arg2);
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
static int _wrap_SBCommandInterpreterRunOptions_GetAddToHistory(lua_State* L) {
int SWIG_arg = 0;
lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ;
@@ -13055,6 +13107,8 @@ static swig_lua_method swig_SBCommandInterpreterRunOptions_methods[]= {
{ "SetEchoCommands", _wrap_SBCommandInterpreterRunOptions_SetEchoCommands},
{ "GetPrintResults", _wrap_SBCommandInterpreterRunOptions_GetPrintResults},
{ "SetPrintResults", _wrap_SBCommandInterpreterRunOptions_SetPrintResults},
+ { "GetPrintErrors", _wrap_SBCommandInterpreterRunOptions_GetPrintErrors},
+ { "SetPrintErrors", _wrap_SBCommandInterpreterRunOptions_SetPrintErrors},
{ "GetAddToHistory", _wrap_SBCommandInterpreterRunOptions_GetAddToHistory},
{ "SetAddToHistory", _wrap_SBCommandInterpreterRunOptions_SetAddToHistory},
{0,0}
@@ -31674,6 +31728,115 @@ fail:
}
+static int _wrap_SBLaunchInfo_GetScriptedProcessClassName(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ;
+ char *result = 0 ;
+
+ SWIG_check_num_args("lldb::SBLaunchInfo::GetScriptedProcessClassName",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBLaunchInfo::GetScriptedProcessClassName",1,"lldb::SBLaunchInfo const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBLaunchInfo,0))){
+ SWIG_fail_ptr("SBLaunchInfo_GetScriptedProcessClassName",1,SWIGTYPE_p_lldb__SBLaunchInfo);
+ }
+
+ result = (char *)((lldb::SBLaunchInfo const *)arg1)->GetScriptedProcessClassName();
+ lua_pushstring(L,(const char *)result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_SBLaunchInfo_SetScriptedProcessClassName(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ;
+ char *arg2 = (char *) 0 ;
+
+ SWIG_check_num_args("lldb::SBLaunchInfo::SetScriptedProcessClassName",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBLaunchInfo::SetScriptedProcessClassName",1,"lldb::SBLaunchInfo *");
+ if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("lldb::SBLaunchInfo::SetScriptedProcessClassName",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBLaunchInfo,0))){
+ SWIG_fail_ptr("SBLaunchInfo_SetScriptedProcessClassName",1,SWIGTYPE_p_lldb__SBLaunchInfo);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ (arg1)->SetScriptedProcessClassName((char const *)arg2);
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_SBLaunchInfo_GetScriptedProcessDictionary(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ;
+ lldb::SBStructuredData result;
+
+ SWIG_check_num_args("lldb::SBLaunchInfo::GetScriptedProcessDictionary",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBLaunchInfo::GetScriptedProcessDictionary",1,"lldb::SBLaunchInfo const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBLaunchInfo,0))){
+ SWIG_fail_ptr("SBLaunchInfo_GetScriptedProcessDictionary",1,SWIGTYPE_p_lldb__SBLaunchInfo);
+ }
+
+ result = ((lldb::SBLaunchInfo const *)arg1)->GetScriptedProcessDictionary();
+ {
+ lldb::SBStructuredData * resultptr = new lldb::SBStructuredData((const lldb::SBStructuredData &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_lldb__SBStructuredData,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_SBLaunchInfo_SetScriptedProcessDictionary(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ;
+ lldb::SBStructuredData arg2 ;
+ lldb::SBStructuredData *argp2 ;
+
+ SWIG_check_num_args("lldb::SBLaunchInfo::SetScriptedProcessDictionary",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBLaunchInfo::SetScriptedProcessDictionary",1,"lldb::SBLaunchInfo *");
+ if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBLaunchInfo::SetScriptedProcessDictionary",2,"lldb::SBStructuredData");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBLaunchInfo,0))){
+ SWIG_fail_ptr("SBLaunchInfo_SetScriptedProcessDictionary",1,SWIGTYPE_p_lldb__SBLaunchInfo);
+ }
+
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_lldb__SBStructuredData,0))){
+ SWIG_fail_ptr("SBLaunchInfo_SetScriptedProcessDictionary",2,SWIGTYPE_p_lldb__SBStructuredData);
+ }
+ arg2 = *argp2;
+
+ (arg1)->SetScriptedProcessDictionary(arg2);
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
static void swig_delete_SBLaunchInfo(void *obj) {
lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) obj;
delete arg1;
@@ -31730,6 +31893,10 @@ static swig_lua_method swig_SBLaunchInfo_methods[]= {
{ "GetLaunchEventData", _wrap_SBLaunchInfo_GetLaunchEventData},
{ "GetDetachOnError", _wrap_SBLaunchInfo_GetDetachOnError},
{ "SetDetachOnError", _wrap_SBLaunchInfo_SetDetachOnError},
+ { "GetScriptedProcessClassName", _wrap_SBLaunchInfo_GetScriptedProcessClassName},
+ { "SetScriptedProcessClassName", _wrap_SBLaunchInfo_SetScriptedProcessClassName},
+ { "GetScriptedProcessDictionary", _wrap_SBLaunchInfo_GetScriptedProcessDictionary},
+ { "SetScriptedProcessDictionary", _wrap_SBLaunchInfo_SetScriptedProcessDictionary},
{0,0}
};
static swig_lua_method swig_SBLaunchInfo_meta[] = {
@@ -33241,6 +33408,105 @@ fail:
}
+static int _wrap_SBMemoryRegionInfo_HasDirtyMemoryPageList(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ;
+ bool result;
+
+ SWIG_check_num_args("lldb::SBMemoryRegionInfo::HasDirtyMemoryPageList",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBMemoryRegionInfo::HasDirtyMemoryPageList",1,"lldb::SBMemoryRegionInfo *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBMemoryRegionInfo,0))){
+ SWIG_fail_ptr("SBMemoryRegionInfo_HasDirtyMemoryPageList",1,SWIGTYPE_p_lldb__SBMemoryRegionInfo);
+ }
+
+ result = (bool)(arg1)->HasDirtyMemoryPageList();
+ lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_SBMemoryRegionInfo_GetNumDirtyPages(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ;
+ uint32_t result;
+
+ SWIG_check_num_args("lldb::SBMemoryRegionInfo::GetNumDirtyPages",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBMemoryRegionInfo::GetNumDirtyPages",1,"lldb::SBMemoryRegionInfo *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBMemoryRegionInfo,0))){
+ SWIG_fail_ptr("SBMemoryRegionInfo_GetNumDirtyPages",1,SWIGTYPE_p_lldb__SBMemoryRegionInfo);
+ }
+
+ result = (uint32_t)(arg1)->GetNumDirtyPages();
+ lua_pushinteger(L, (lua_Integer) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_SBMemoryRegionInfo_GetDirtyPageAddressAtIndex(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ;
+ uint32_t arg2 ;
+ lldb::addr_t result;
+
+ SWIG_check_num_args("lldb::SBMemoryRegionInfo::GetDirtyPageAddressAtIndex",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBMemoryRegionInfo::GetDirtyPageAddressAtIndex",1,"lldb::SBMemoryRegionInfo *");
+ if(!lua_isinteger(L,2)) SWIG_fail_arg("lldb::SBMemoryRegionInfo::GetDirtyPageAddressAtIndex",2,"uint32_t");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBMemoryRegionInfo,0))){
+ SWIG_fail_ptr("SBMemoryRegionInfo_GetDirtyPageAddressAtIndex",1,SWIGTYPE_p_lldb__SBMemoryRegionInfo);
+ }
+
+ arg2 = (unsigned int)lua_tointeger(L, 2);
+ result = (lldb::addr_t)(arg1)->GetDirtyPageAddressAtIndex(arg2);
+ lua_pushinteger(L, (lua_Integer) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_SBMemoryRegionInfo_GetPageSize(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ;
+ int result;
+
+ SWIG_check_num_args("lldb::SBMemoryRegionInfo::GetPageSize",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBMemoryRegionInfo::GetPageSize",1,"lldb::SBMemoryRegionInfo *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBMemoryRegionInfo,0))){
+ SWIG_fail_ptr("SBMemoryRegionInfo_GetPageSize",1,SWIGTYPE_p_lldb__SBMemoryRegionInfo);
+ }
+
+ result = (int)(arg1)->GetPageSize();
+ lua_pushinteger(L, (lua_Integer) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
static int _wrap_SBMemoryRegionInfo___eq(lua_State* L) {
int SWIG_arg = 0;
lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ;
@@ -33351,6 +33617,10 @@ static swig_lua_method swig_SBMemoryRegionInfo_methods[]= {
{ "IsExecutable", _wrap_SBMemoryRegionInfo_IsExecutable},
{ "IsMapped", _wrap_SBMemoryRegionInfo_IsMapped},
{ "GetName", _wrap_SBMemoryRegionInfo_GetName},
+ { "HasDirtyMemoryPageList", _wrap_SBMemoryRegionInfo_HasDirtyMemoryPageList},
+ { "GetNumDirtyPages", _wrap_SBMemoryRegionInfo_GetNumDirtyPages},
+ { "GetDirtyPageAddressAtIndex", _wrap_SBMemoryRegionInfo_GetDirtyPageAddressAtIndex},
+ { "GetPageSize", _wrap_SBMemoryRegionInfo_GetPageSize},
{ "__eq", _wrap_SBMemoryRegionInfo___eq},
{ "GetDescription", _wrap_SBMemoryRegionInfo_GetDescription},
{ "__tostring", _wrap_SBMemoryRegionInfo___tostring},
@@ -40571,47 +40841,6 @@ fail:
}
-static int _wrap_SBProcess_StartTrace(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ;
- lldb::SBTraceOptions *arg2 = 0 ;
- lldb::SBError *arg3 = 0 ;
- lldb::SBTrace result;
-
- SWIG_check_num_args("lldb::SBProcess::StartTrace",3,3)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBProcess::StartTrace",1,"lldb::SBProcess *");
- if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBProcess::StartTrace",2,"lldb::SBTraceOptions &");
- if(!lua_isuserdata(L,3)) SWIG_fail_arg("lldb::SBProcess::StartTrace",3,"lldb::SBError &");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBProcess,0))){
- SWIG_fail_ptr("SBProcess_StartTrace",1,SWIGTYPE_p_lldb__SBProcess);
- }
-
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBProcess_StartTrace",2,SWIGTYPE_p_lldb__SBTraceOptions);
- }
-
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_lldb__SBError,0))){
- SWIG_fail_ptr("SBProcess_StartTrace",3,SWIGTYPE_p_lldb__SBError);
- }
-
- result = (arg1)->StartTrace(*arg2,*arg3);
- {
- lldb::SBTrace * resultptr = new lldb::SBTrace((const lldb::SBTrace &) result);
- SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_lldb__SBTrace,1); SWIG_arg++;
- }
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
static int _wrap_SBProcess_GetMemoryRegionInfo(lua_State* L) {
int SWIG_arg = 0;
lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ;
@@ -40703,6 +40932,73 @@ fail:
}
+static int _wrap_SBProcess_AllocateMemory(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ;
+ size_t arg2 ;
+ uint32_t arg3 ;
+ lldb::SBError *arg4 = 0 ;
+ lldb::addr_t result;
+
+ SWIG_check_num_args("lldb::SBProcess::AllocateMemory",4,4)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBProcess::AllocateMemory",1,"lldb::SBProcess *");
+ if(!lua_isinteger(L,2)) SWIG_fail_arg("lldb::SBProcess::AllocateMemory",2,"size_t");
+ if(!lua_isinteger(L,3)) SWIG_fail_arg("lldb::SBProcess::AllocateMemory",3,"uint32_t");
+ if(!lua_isuserdata(L,4)) SWIG_fail_arg("lldb::SBProcess::AllocateMemory",4,"lldb::SBError &");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBProcess,0))){
+ SWIG_fail_ptr("SBProcess_AllocateMemory",1,SWIGTYPE_p_lldb__SBProcess);
+ }
+
+ arg2 = (unsigned long)lua_tointeger(L, 2);
+ arg3 = (unsigned int)lua_tointeger(L, 3);
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_lldb__SBError,0))){
+ SWIG_fail_ptr("SBProcess_AllocateMemory",4,SWIGTYPE_p_lldb__SBError);
+ }
+
+ result = (lldb::addr_t)(arg1)->AllocateMemory(arg2,arg3,*arg4);
+ lua_pushinteger(L, (lua_Integer) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_SBProcess_DeallocateMemory(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ;
+ lldb::addr_t arg2 ;
+ lldb::SBError result;
+
+ SWIG_check_num_args("lldb::SBProcess::DeallocateMemory",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBProcess::DeallocateMemory",1,"lldb::SBProcess *");
+ if(!lua_isinteger(L,2)) SWIG_fail_arg("lldb::SBProcess::DeallocateMemory",2,"lldb::addr_t");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBProcess,0))){
+ SWIG_fail_ptr("SBProcess_DeallocateMemory",1,SWIGTYPE_p_lldb__SBProcess);
+ }
+
+ arg2 = (unsigned long long)lua_tointeger(L, 2);
+ result = (arg1)->DeallocateMemory(arg2);
+ {
+ lldb::SBError * resultptr = new lldb::SBError((const lldb::SBError &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_lldb__SBError,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
static int _wrap_SBProcess___tostring(lua_State* L) {
int SWIG_arg = 0;
lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ;
@@ -40801,10 +41097,11 @@ static swig_lua_method swig_SBProcess_methods[]= {
{ "GetHistoryThreads", _wrap_SBProcess_GetHistoryThreads},
{ "IsInstrumentationRuntimePresent", _wrap_SBProcess_IsInstrumentationRuntimePresent},
{ "SaveCore", _wrap_SBProcess_SaveCore},
- { "StartTrace", _wrap_SBProcess_StartTrace},
{ "GetMemoryRegionInfo", _wrap_SBProcess_GetMemoryRegionInfo},
{ "GetMemoryRegions", _wrap_SBProcess_GetMemoryRegions},
{ "GetProcessInfo", _wrap_SBProcess_GetProcessInfo},
+ { "AllocateMemory", _wrap_SBProcess_AllocateMemory},
+ { "DeallocateMemory", _wrap_SBProcess_DeallocateMemory},
{ "__tostring", _wrap_SBProcess___tostring},
{0,0}
};
@@ -41243,6 +41540,30 @@ fail:
}
+static int _wrap_SBProcessInfo_GetTriple(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ;
+ char *result = 0 ;
+
+ SWIG_check_num_args("lldb::SBProcessInfo::GetTriple",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBProcessInfo::GetTriple",1,"lldb::SBProcessInfo *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBProcessInfo,0))){
+ SWIG_fail_ptr("SBProcessInfo_GetTriple",1,SWIGTYPE_p_lldb__SBProcessInfo);
+ }
+
+ result = (char *)(arg1)->GetTriple();
+ lua_pushstring(L,(const char *)result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
static void swig_delete_SBProcessInfo(void *obj) {
lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) obj;
delete arg1;
@@ -41272,6 +41593,7 @@ static swig_lua_method swig_SBProcessInfo_methods[]= {
{ "EffectiveUserIDIsValid", _wrap_SBProcessInfo_EffectiveUserIDIsValid},
{ "EffectiveGroupIDIsValid", _wrap_SBProcessInfo_EffectiveGroupIDIsValid},
{ "GetParentProcessID", _wrap_SBProcessInfo_GetParentProcessID},
+ { "GetTriple", _wrap_SBProcessInfo_GetTriple},
{0,0}
};
static swig_lua_method swig_SBProcessInfo_meta[] = {
@@ -44637,7 +44959,7 @@ fail:
}
-static int _wrap_SBStructuredData_SetFromJSON(lua_State* L) {
+static int _wrap_SBStructuredData_SetFromJSON__SWIG_0(lua_State* L) {
int SWIG_arg = 0;
lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ;
lldb::SBStream *arg2 = 0 ;
@@ -44671,6 +44993,95 @@ fail:
}
+static int _wrap_SBStructuredData_SetFromJSON__SWIG_1(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ;
+ char *arg2 = (char *) 0 ;
+ lldb::SBError result;
+
+ SWIG_check_num_args("lldb::SBStructuredData::SetFromJSON",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBStructuredData::SetFromJSON",1,"lldb::SBStructuredData *");
+ if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("lldb::SBStructuredData::SetFromJSON",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBStructuredData,0))){
+ SWIG_fail_ptr("SBStructuredData_SetFromJSON",1,SWIGTYPE_p_lldb__SBStructuredData);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (arg1)->SetFromJSON((char const *)arg2);
+ {
+ lldb::SBError * resultptr = new lldb::SBError((const lldb::SBError &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_lldb__SBError,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_SBStructuredData_SetFromJSON(lua_State* L) {
+ int argc;
+ int argv[3]={
+ 1,2,3
+ };
+
+ argc = lua_gettop(L);
+ if (argc == 2) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_lldb__SBStructuredData, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ {
+ void *ptr;
+ if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_lldb__SBStream, SWIG_POINTER_NO_NULL)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ return _wrap_SBStructuredData_SetFromJSON__SWIG_0(L);
+ }
+ }
+ }
+ if (argc == 2) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_lldb__SBStructuredData, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ {
+ _v = SWIG_lua_isnilstring(L,argv[1]);
+ }
+ if (_v) {
+ return _wrap_SBStructuredData_SetFromJSON__SWIG_1(L);
+ }
+ }
+ }
+
+ SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'SBStructuredData_SetFromJSON'\n"
+ " Possible C/C++ prototypes are:\n"
+ " lldb::SBStructuredData::SetFromJSON(lldb::SBStream &)\n"
+ " lldb::SBStructuredData::SetFromJSON(char const *)\n");
+ lua_error(L);return 0;
+}
+
+
static void swig_delete_SBStructuredData(void *obj) {
lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) obj;
delete arg1;
@@ -52295,6 +52706,37 @@ fail:
}
+static int _wrap_SBTarget_IsLoaded(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ;
+ lldb::SBModule *arg2 = 0 ;
+ bool result;
+
+ SWIG_check_num_args("lldb::SBTarget::IsLoaded",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTarget::IsLoaded",1,"lldb::SBTarget const *");
+ if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBTarget::IsLoaded",2,"lldb::SBModule const &");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTarget,0))){
+ SWIG_fail_ptr("SBTarget_IsLoaded",1,SWIGTYPE_p_lldb__SBTarget);
+ }
+
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_lldb__SBModule,0))){
+ SWIG_fail_ptr("SBTarget_IsLoaded",2,SWIGTYPE_p_lldb__SBModule);
+ }
+
+ result = (bool)((lldb::SBTarget const *)arg1)->IsLoaded((lldb::SBModule const &)*arg2);
+ lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
static int _wrap_SBTarget_GetLaunchInfo(lua_State* L) {
int SWIG_arg = 0;
lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ;
@@ -52615,6 +53057,67 @@ fail:
}
+static int _wrap_SBTarget_GetTrace(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ;
+ lldb::SBTrace result;
+
+ SWIG_check_num_args("lldb::SBTarget::GetTrace",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTarget::GetTrace",1,"lldb::SBTarget *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTarget,0))){
+ SWIG_fail_ptr("SBTarget_GetTrace",1,SWIGTYPE_p_lldb__SBTarget);
+ }
+
+ result = (arg1)->GetTrace();
+ {
+ lldb::SBTrace * resultptr = new lldb::SBTrace((const lldb::SBTrace &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_lldb__SBTrace,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_SBTarget_CreateTrace(lua_State* L) {
+ int SWIG_arg = 0;
+ lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ;
+ lldb::SBError *arg2 = 0 ;
+ lldb::SBTrace result;
+
+ SWIG_check_num_args("lldb::SBTarget::CreateTrace",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTarget::CreateTrace",1,"lldb::SBTarget *");
+ if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBTarget::CreateTrace",2,"lldb::SBError &");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTarget,0))){
+ SWIG_fail_ptr("SBTarget_CreateTrace",1,SWIGTYPE_p_lldb__SBTarget);
+ }
+
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_lldb__SBError,0))){
+ SWIG_fail_ptr("SBTarget_CreateTrace",2,SWIGTYPE_p_lldb__SBError);
+ }
+
+ result = (arg1)->CreateTrace(*arg2);
+ {
+ lldb::SBTrace * resultptr = new lldb::SBTrace((const lldb::SBTrace &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_lldb__SBTrace,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
static void swig_delete_SBTarget(void *obj) {
lldb::SBTarget *arg1 = (lldb::SBTarget *) obj;
delete arg1;
@@ -52714,6 +53217,7 @@ static swig_lua_method swig_SBTarget_methods[]= {
{ "FindSymbols", _wrap_SBTarget_FindSymbols},
{ "GetDescription", _wrap_SBTarget_GetDescription},
{ "GetStackRedZoneSize", _wrap_SBTarget_GetStackRedZoneSize},
+ { "IsLoaded", _wrap_SBTarget_IsLoaded},
{ "GetLaunchInfo", _wrap_SBTarget_GetLaunchInfo},
{ "SetLaunchInfo", _wrap_SBTarget_SetLaunchInfo},
{ "SetCollectingStats", _wrap_SBTarget_SetCollectingStats},
@@ -52722,6 +53226,8 @@ static swig_lua_method swig_SBTarget_methods[]= {
{ "__eq", _wrap_SBTarget___eq},
{ "EvaluateExpression", _wrap_SBTarget_EvaluateExpression},
{ "__tostring", _wrap_SBTarget___tostring},
+ { "GetTrace", _wrap_SBTarget_GetTrace},
+ { "CreateTrace", _wrap_SBTarget_CreateTrace},
{0,0}
};
static swig_lua_method swig_SBTarget_meta[] = {
@@ -56825,39 +57331,20 @@ fail:
}
-static int _wrap_SBTrace_GetTraceData(lua_State* L) {
+static int _wrap_SBTrace_GetStartConfigurationHelp(lua_State* L) {
int SWIG_arg = 0;
lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ;
- lldb::SBError *arg2 = 0 ;
- void *arg3 = (void *) 0 ;
- size_t arg4 ;
- size_t arg5 ;
- lldb::tid_t arg6 ;
- size_t result;
+ char *result = 0 ;
- SWIG_check_num_args("lldb::SBTrace::GetTraceData",6,6)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTrace::GetTraceData",1,"lldb::SBTrace *");
- if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBTrace::GetTraceData",2,"lldb::SBError &");
- if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("lldb::SBTrace::GetTraceData",3,"void *");
- if(!lua_isinteger(L,4)) SWIG_fail_arg("lldb::SBTrace::GetTraceData",4,"size_t");
- if(!lua_isinteger(L,5)) SWIG_fail_arg("lldb::SBTrace::GetTraceData",5,"size_t");
- if(!lua_isinteger(L,6)) SWIG_fail_arg("lldb::SBTrace::GetTraceData",6,"lldb::tid_t");
+ SWIG_check_num_args("lldb::SBTrace::GetStartConfigurationHelp",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTrace::GetStartConfigurationHelp",1,"lldb::SBTrace *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTrace,0))){
- SWIG_fail_ptr("SBTrace_GetTraceData",1,SWIGTYPE_p_lldb__SBTrace);
+ SWIG_fail_ptr("SBTrace_GetStartConfigurationHelp",1,SWIGTYPE_p_lldb__SBTrace);
}
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_lldb__SBError,0))){
- SWIG_fail_ptr("SBTrace_GetTraceData",2,SWIGTYPE_p_lldb__SBError);
- }
-
- arg3=(void *)SWIG_MustGetPtr(L,3,0,0,3,"SBTrace_GetTraceData");
- arg4 = (unsigned long)lua_tointeger(L, 4);
- arg5 = (unsigned long)lua_tointeger(L, 5);
- arg6 = (unsigned long long)lua_tointeger(L, 6);
- result = (arg1)->GetTraceData(*arg2,arg3,arg4,arg5,arg6);
- lua_pushinteger(L, (lua_Integer) result); SWIG_arg++;
+ result = (char *)(arg1)->GetStartConfigurationHelp();
+ lua_pushstring(L,(const char *)result); SWIG_arg++;
return SWIG_arg;
if(0) SWIG_fail;
@@ -56868,39 +57355,30 @@ fail:
}
-static int _wrap_SBTrace_GetMetaData(lua_State* L) {
+static int _wrap_SBTrace_Start__SWIG_0(lua_State* L) {
int SWIG_arg = 0;
lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ;
- lldb::SBError *arg2 = 0 ;
- void *arg3 = (void *) 0 ;
- size_t arg4 ;
- size_t arg5 ;
- lldb::tid_t arg6 ;
- size_t result;
+ lldb::SBStructuredData *arg2 = 0 ;
+ lldb::SBError result;
- SWIG_check_num_args("lldb::SBTrace::GetMetaData",6,6)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTrace::GetMetaData",1,"lldb::SBTrace *");
- if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBTrace::GetMetaData",2,"lldb::SBError &");
- if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("lldb::SBTrace::GetMetaData",3,"void *");
- if(!lua_isinteger(L,4)) SWIG_fail_arg("lldb::SBTrace::GetMetaData",4,"size_t");
- if(!lua_isinteger(L,5)) SWIG_fail_arg("lldb::SBTrace::GetMetaData",5,"size_t");
- if(!lua_isinteger(L,6)) SWIG_fail_arg("lldb::SBTrace::GetMetaData",6,"lldb::tid_t");
+ SWIG_check_num_args("lldb::SBTrace::Start",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTrace::Start",1,"lldb::SBTrace *");
+ if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBTrace::Start",2,"lldb::SBStructuredData const &");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTrace,0))){
- SWIG_fail_ptr("SBTrace_GetMetaData",1,SWIGTYPE_p_lldb__SBTrace);
+ SWIG_fail_ptr("SBTrace_Start",1,SWIGTYPE_p_lldb__SBTrace);
}
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_lldb__SBError,0))){
- SWIG_fail_ptr("SBTrace_GetMetaData",2,SWIGTYPE_p_lldb__SBError);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_lldb__SBStructuredData,0))){
+ SWIG_fail_ptr("SBTrace_Start",2,SWIGTYPE_p_lldb__SBStructuredData);
}
- arg3=(void *)SWIG_MustGetPtr(L,3,0,0,3,"SBTrace_GetMetaData");
- arg4 = (unsigned long)lua_tointeger(L, 4);
- arg5 = (unsigned long)lua_tointeger(L, 5);
- arg6 = (unsigned long long)lua_tointeger(L, 6);
- result = (arg1)->GetMetaData(*arg2,arg3,arg4,arg5,arg6);
- lua_pushinteger(L, (lua_Integer) result); SWIG_arg++;
+ result = (arg1)->Start((lldb::SBStructuredData const &)*arg2);
+ {
+ lldb::SBError * resultptr = new lldb::SBError((const lldb::SBError &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_lldb__SBError,1); SWIG_arg++;
+ }
return SWIG_arg;
if(0) SWIG_fail;
@@ -56911,29 +57389,37 @@ fail:
}
-static int _wrap_SBTrace_StopTrace(lua_State* L) {
+static int _wrap_SBTrace_Start__SWIG_1(lua_State* L) {
int SWIG_arg = 0;
lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ;
- lldb::SBError *arg2 = 0 ;
- lldb::tid_t arg3 ;
+ lldb::SBThread *arg2 = 0 ;
+ lldb::SBStructuredData *arg3 = 0 ;
+ lldb::SBError result;
- SWIG_check_num_args("lldb::SBTrace::StopTrace",3,3)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTrace::StopTrace",1,"lldb::SBTrace *");
- if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBTrace::StopTrace",2,"lldb::SBError &");
- if(!lua_isinteger(L,3)) SWIG_fail_arg("lldb::SBTrace::StopTrace",3,"lldb::tid_t");
+ SWIG_check_num_args("lldb::SBTrace::Start",3,3)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTrace::Start",1,"lldb::SBTrace *");
+ if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBTrace::Start",2,"lldb::SBThread const &");
+ if(!lua_isuserdata(L,3)) SWIG_fail_arg("lldb::SBTrace::Start",3,"lldb::SBStructuredData const &");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTrace,0))){
- SWIG_fail_ptr("SBTrace_StopTrace",1,SWIGTYPE_p_lldb__SBTrace);
+ SWIG_fail_ptr("SBTrace_Start",1,SWIGTYPE_p_lldb__SBTrace);
}
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_lldb__SBError,0))){
- SWIG_fail_ptr("SBTrace_StopTrace",2,SWIGTYPE_p_lldb__SBError);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_lldb__SBThread,0))){
+ SWIG_fail_ptr("SBTrace_Start",2,SWIGTYPE_p_lldb__SBThread);
}
- arg3 = (unsigned long long)lua_tointeger(L, 3);
- (arg1)->StopTrace(*arg2,arg3);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_lldb__SBStructuredData,0))){
+ SWIG_fail_ptr("SBTrace_Start",3,SWIGTYPE_p_lldb__SBStructuredData);
+ }
+
+ result = (arg1)->Start((lldb::SBThread const &)*arg2,(lldb::SBStructuredData const &)*arg3);
+ {
+ lldb::SBError * resultptr = new lldb::SBError((const lldb::SBError &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_lldb__SBError,1); SWIG_arg++;
+ }
return SWIG_arg;
if(0) SWIG_fail;
@@ -56944,33 +57430,97 @@ fail:
}
-static int _wrap_SBTrace_GetTraceConfig(lua_State* L) {
+static int _wrap_SBTrace_Start(lua_State* L) {
+ int argc;
+ int argv[4]={
+ 1,2,3,4
+ };
+
+ argc = lua_gettop(L);
+ if (argc == 2) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_lldb__SBTrace, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ {
+ void *ptr;
+ if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_lldb__SBStructuredData, SWIG_POINTER_NO_NULL)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ return _wrap_SBTrace_Start__SWIG_0(L);
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_lldb__SBTrace, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ {
+ void *ptr;
+ if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_lldb__SBThread, SWIG_POINTER_NO_NULL)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ {
+ void *ptr;
+ if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_lldb__SBStructuredData, SWIG_POINTER_NO_NULL)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ return _wrap_SBTrace_Start__SWIG_1(L);
+ }
+ }
+ }
+ }
+
+ SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'SBTrace_Start'\n"
+ " Possible C/C++ prototypes are:\n"
+ " lldb::SBTrace::Start(lldb::SBStructuredData const &)\n"
+ " lldb::SBTrace::Start(lldb::SBThread const &,lldb::SBStructuredData const &)\n");
+ lua_error(L);return 0;
+}
+
+
+static int _wrap_SBTrace_Stop__SWIG_0(lua_State* L) {
int SWIG_arg = 0;
lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ;
- lldb::SBTraceOptions *arg2 = 0 ;
- lldb::SBError *arg3 = 0 ;
+ lldb::SBError result;
- SWIG_check_num_args("lldb::SBTrace::GetTraceConfig",3,3)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTrace::GetTraceConfig",1,"lldb::SBTrace *");
- if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBTrace::GetTraceConfig",2,"lldb::SBTraceOptions &");
- if(!lua_isuserdata(L,3)) SWIG_fail_arg("lldb::SBTrace::GetTraceConfig",3,"lldb::SBError &");
+ SWIG_check_num_args("lldb::SBTrace::Stop",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTrace::Stop",1,"lldb::SBTrace *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTrace,0))){
- SWIG_fail_ptr("SBTrace_GetTraceConfig",1,SWIGTYPE_p_lldb__SBTrace);
- }
-
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBTrace_GetTraceConfig",2,SWIGTYPE_p_lldb__SBTraceOptions);
+ SWIG_fail_ptr("SBTrace_Stop",1,SWIGTYPE_p_lldb__SBTrace);
}
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_lldb__SBError,0))){
- SWIG_fail_ptr("SBTrace_GetTraceConfig",3,SWIGTYPE_p_lldb__SBError);
+ result = (arg1)->Stop();
+ {
+ lldb::SBError * resultptr = new lldb::SBError((const lldb::SBError &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_lldb__SBError,1); SWIG_arg++;
}
-
- (arg1)->GetTraceConfig(*arg2,*arg3);
-
return SWIG_arg;
if(0) SWIG_fail;
@@ -56981,20 +57531,30 @@ fail:
}
-static int _wrap_SBTrace_GetTraceUID(lua_State* L) {
+static int _wrap_SBTrace_Stop__SWIG_1(lua_State* L) {
int SWIG_arg = 0;
lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ;
- lldb::user_id_t result;
+ lldb::SBThread *arg2 = 0 ;
+ lldb::SBError result;
- SWIG_check_num_args("lldb::SBTrace::GetTraceUID",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTrace::GetTraceUID",1,"lldb::SBTrace *");
+ SWIG_check_num_args("lldb::SBTrace::Stop",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTrace::Stop",1,"lldb::SBTrace *");
+ if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBTrace::Stop",2,"lldb::SBThread const &");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTrace,0))){
- SWIG_fail_ptr("SBTrace_GetTraceUID",1,SWIGTYPE_p_lldb__SBTrace);
+ SWIG_fail_ptr("SBTrace_Stop",1,SWIGTYPE_p_lldb__SBTrace);
}
- result = (lldb::user_id_t)(arg1)->GetTraceUID();
- lua_pushinteger(L, (lua_Integer) result); SWIG_arg++;
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_lldb__SBThread,0))){
+ SWIG_fail_ptr("SBTrace_Stop",2,SWIGTYPE_p_lldb__SBThread);
+ }
+
+ result = (arg1)->Stop((lldb::SBThread const &)*arg2);
+ {
+ lldb::SBError * resultptr = new lldb::SBError((const lldb::SBError &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_lldb__SBError,1); SWIG_arg++;
+ }
return SWIG_arg;
if(0) SWIG_fail;
@@ -57005,6 +57565,60 @@ fail:
}
+static int _wrap_SBTrace_Stop(lua_State* L) {
+ int argc;
+ int argv[3]={
+ 1,2,3
+ };
+
+ argc = lua_gettop(L);
+ if (argc == 1) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_lldb__SBTrace, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ return _wrap_SBTrace_Stop__SWIG_0(L);
+ }
+ }
+ if (argc == 2) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_lldb__SBTrace, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ {
+ void *ptr;
+ if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_lldb__SBThread, SWIG_POINTER_NO_NULL)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ return _wrap_SBTrace_Stop__SWIG_1(L);
+ }
+ }
+ }
+
+ SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'SBTrace_Stop'\n"
+ " Possible C/C++ prototypes are:\n"
+ " lldb::SBTrace::Stop()\n"
+ " lldb::SBTrace::Stop(lldb::SBThread const &)\n");
+ lua_error(L);return 0;
+}
+
+
static int _wrap_SBTrace_IsValid(lua_State* L) {
int SWIG_arg = 0;
lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ;
@@ -57045,11 +57659,9 @@ static swig_lua_attribute swig_SBTrace_attributes[] = {
{0,0,0}
};
static swig_lua_method swig_SBTrace_methods[]= {
- { "GetTraceData", _wrap_SBTrace_GetTraceData},
- { "GetMetaData", _wrap_SBTrace_GetMetaData},
- { "StopTrace", _wrap_SBTrace_StopTrace},
- { "GetTraceConfig", _wrap_SBTrace_GetTraceConfig},
- { "GetTraceUID", _wrap_SBTrace_GetTraceUID},
+ { "GetStartConfigurationHelp", _wrap_SBTrace_GetStartConfigurationHelp},
+ { "Start", _wrap_SBTrace_Start},
+ { "Stop", _wrap_SBTrace_Stop},
{ "IsValid", _wrap_SBTrace_IsValid},
{0,0}
};
@@ -57082,369 +57694,6 @@ static swig_lua_class *swig_SBTrace_bases[] = {0};
static const char *swig_SBTrace_base_names[] = {0};
static swig_lua_class _wrap_class_SBTrace = { "SBTrace", "SBTrace", &SWIGTYPE_p_lldb__SBTrace,_proxy__wrap_new_SBTrace, swig_delete_SBTrace, swig_SBTrace_methods, swig_SBTrace_attributes, &swig_SBTrace_Sf_SwigStatic, swig_SBTrace_meta, swig_SBTrace_bases, swig_SBTrace_base_names };
-static int _wrap_new_SBTraceOptions(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBTraceOptions *result = 0 ;
-
- SWIG_check_num_args("lldb::SBTraceOptions::SBTraceOptions",0,0)
- result = (lldb::SBTraceOptions *)new lldb::SBTraceOptions();
- SWIG_NewPointerObj(L,result,SWIGTYPE_p_lldb__SBTraceOptions,1); SWIG_arg++;
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
-static int _wrap_SBTraceOptions_getType(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ;
- lldb::TraceType result;
-
- SWIG_check_num_args("lldb::SBTraceOptions::getType",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTraceOptions::getType",1,"lldb::SBTraceOptions const *");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBTraceOptions_getType",1,SWIGTYPE_p_lldb__SBTraceOptions);
- }
-
- result = (lldb::TraceType)((lldb::SBTraceOptions const *)arg1)->getType();
- lua_pushnumber(L, (lua_Number)(int)(result)); SWIG_arg++;
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
-static int _wrap_SBTraceOptions_getTraceBufferSize(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ;
- uint64_t result;
-
- SWIG_check_num_args("lldb::SBTraceOptions::getTraceBufferSize",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTraceOptions::getTraceBufferSize",1,"lldb::SBTraceOptions const *");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBTraceOptions_getTraceBufferSize",1,SWIGTYPE_p_lldb__SBTraceOptions);
- }
-
- result = (uint64_t)((lldb::SBTraceOptions const *)arg1)->getTraceBufferSize();
- lua_pushinteger(L, (lua_Integer) result); SWIG_arg++;
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
-static int _wrap_SBTraceOptions_getTraceParams(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ;
- lldb::SBError *arg2 = 0 ;
- lldb::SBStructuredData result;
-
- SWIG_check_num_args("lldb::SBTraceOptions::getTraceParams",2,2)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTraceOptions::getTraceParams",1,"lldb::SBTraceOptions *");
- if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBTraceOptions::getTraceParams",2,"lldb::SBError &");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBTraceOptions_getTraceParams",1,SWIGTYPE_p_lldb__SBTraceOptions);
- }
-
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_lldb__SBError,0))){
- SWIG_fail_ptr("SBTraceOptions_getTraceParams",2,SWIGTYPE_p_lldb__SBError);
- }
-
- result = (arg1)->getTraceParams(*arg2);
- {
- lldb::SBStructuredData * resultptr = new lldb::SBStructuredData((const lldb::SBStructuredData &) result);
- SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_lldb__SBStructuredData,1); SWIG_arg++;
- }
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
-static int _wrap_SBTraceOptions_getMetaDataBufferSize(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ;
- uint64_t result;
-
- SWIG_check_num_args("lldb::SBTraceOptions::getMetaDataBufferSize",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTraceOptions::getMetaDataBufferSize",1,"lldb::SBTraceOptions const *");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBTraceOptions_getMetaDataBufferSize",1,SWIGTYPE_p_lldb__SBTraceOptions);
- }
-
- result = (uint64_t)((lldb::SBTraceOptions const *)arg1)->getMetaDataBufferSize();
- lua_pushinteger(L, (lua_Integer) result); SWIG_arg++;
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
-static int _wrap_SBTraceOptions_setTraceParams(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ;
- lldb::SBStructuredData *arg2 = 0 ;
-
- SWIG_check_num_args("lldb::SBTraceOptions::setTraceParams",2,2)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTraceOptions::setTraceParams",1,"lldb::SBTraceOptions *");
- if(!lua_isuserdata(L,2)) SWIG_fail_arg("lldb::SBTraceOptions::setTraceParams",2,"lldb::SBStructuredData &");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBTraceOptions_setTraceParams",1,SWIGTYPE_p_lldb__SBTraceOptions);
- }
-
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_lldb__SBStructuredData,0))){
- SWIG_fail_ptr("SBTraceOptions_setTraceParams",2,SWIGTYPE_p_lldb__SBStructuredData);
- }
-
- (arg1)->setTraceParams(*arg2);
-
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
-static int _wrap_SBTraceOptions_setType(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ;
- lldb::TraceType arg2 ;
-
- SWIG_check_num_args("lldb::SBTraceOptions::setType",2,2)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTraceOptions::setType",1,"lldb::SBTraceOptions *");
- if(!lua_isnumber(L,2)) SWIG_fail_arg("lldb::SBTraceOptions::setType",2,"lldb::TraceType");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBTraceOptions_setType",1,SWIGTYPE_p_lldb__SBTraceOptions);
- }
-
- arg2 = (lldb::TraceType)(int)lua_tonumber(L, 2);
- (arg1)->setType(arg2);
-
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
-static int _wrap_SBTraceOptions_setTraceBufferSize(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ;
- uint64_t arg2 ;
-
- SWIG_check_num_args("lldb::SBTraceOptions::setTraceBufferSize",2,2)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTraceOptions::setTraceBufferSize",1,"lldb::SBTraceOptions *");
- if(!lua_isinteger(L,2)) SWIG_fail_arg("lldb::SBTraceOptions::setTraceBufferSize",2,"uint64_t");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBTraceOptions_setTraceBufferSize",1,SWIGTYPE_p_lldb__SBTraceOptions);
- }
-
- arg2 = (unsigned long long)lua_tointeger(L, 2);
- (arg1)->setTraceBufferSize(arg2);
-
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
-static int _wrap_SBTraceOptions_setMetaDataBufferSize(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ;
- uint64_t arg2 ;
-
- SWIG_check_num_args("lldb::SBTraceOptions::setMetaDataBufferSize",2,2)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTraceOptions::setMetaDataBufferSize",1,"lldb::SBTraceOptions *");
- if(!lua_isinteger(L,2)) SWIG_fail_arg("lldb::SBTraceOptions::setMetaDataBufferSize",2,"uint64_t");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBTraceOptions_setMetaDataBufferSize",1,SWIGTYPE_p_lldb__SBTraceOptions);
- }
-
- arg2 = (unsigned long long)lua_tointeger(L, 2);
- (arg1)->setMetaDataBufferSize(arg2);
-
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
-static int _wrap_SBTraceOptions_setThreadID(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ;
- lldb::tid_t arg2 ;
-
- SWIG_check_num_args("lldb::SBTraceOptions::setThreadID",2,2)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTraceOptions::setThreadID",1,"lldb::SBTraceOptions *");
- if(!lua_isinteger(L,2)) SWIG_fail_arg("lldb::SBTraceOptions::setThreadID",2,"lldb::tid_t");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBTraceOptions_setThreadID",1,SWIGTYPE_p_lldb__SBTraceOptions);
- }
-
- arg2 = (unsigned long long)lua_tointeger(L, 2);
- (arg1)->setThreadID(arg2);
-
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
-static int _wrap_SBTraceOptions_getThreadID(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ;
- lldb::tid_t result;
-
- SWIG_check_num_args("lldb::SBTraceOptions::getThreadID",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTraceOptions::getThreadID",1,"lldb::SBTraceOptions *");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBTraceOptions_getThreadID",1,SWIGTYPE_p_lldb__SBTraceOptions);
- }
-
- result = (lldb::tid_t)(arg1)->getThreadID();
- lua_pushinteger(L, (lua_Integer) result); SWIG_arg++;
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
-static int _wrap_SBTraceOptions_IsValid(lua_State* L) {
- int SWIG_arg = 0;
- lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) 0 ;
- bool result;
-
- SWIG_check_num_args("lldb::SBTraceOptions::IsValid",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("lldb::SBTraceOptions::IsValid",1,"lldb::SBTraceOptions *");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_lldb__SBTraceOptions,0))){
- SWIG_fail_ptr("SBTraceOptions_IsValid",1,SWIGTYPE_p_lldb__SBTraceOptions);
- }
-
- result = (bool)(arg1)->IsValid();
- lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
-static void swig_delete_SBTraceOptions(void *obj) {
-lldb::SBTraceOptions *arg1 = (lldb::SBTraceOptions *) obj;
-delete arg1;
-}
-static int _proxy__wrap_new_SBTraceOptions(lua_State *L) {
- assert(lua_istable(L,1));
- lua_pushcfunction(L,_wrap_new_SBTraceOptions);
- assert(!lua_isnil(L,-1));
- lua_replace(L,1); /* replace our table with real constructor */
- lua_call(L,lua_gettop(L)-1,1);
- return 1;
-}
-static swig_lua_attribute swig_SBTraceOptions_attributes[] = {
- {0,0,0}
-};
-static swig_lua_method swig_SBTraceOptions_methods[]= {
- { "getType", _wrap_SBTraceOptions_getType},
- { "getTraceBufferSize", _wrap_SBTraceOptions_getTraceBufferSize},
- { "getTraceParams", _wrap_SBTraceOptions_getTraceParams},
- { "getMetaDataBufferSize", _wrap_SBTraceOptions_getMetaDataBufferSize},
- { "setTraceParams", _wrap_SBTraceOptions_setTraceParams},
- { "setType", _wrap_SBTraceOptions_setType},
- { "setTraceBufferSize", _wrap_SBTraceOptions_setTraceBufferSize},
- { "setMetaDataBufferSize", _wrap_SBTraceOptions_setMetaDataBufferSize},
- { "setThreadID", _wrap_SBTraceOptions_setThreadID},
- { "getThreadID", _wrap_SBTraceOptions_getThreadID},
- { "IsValid", _wrap_SBTraceOptions_IsValid},
- {0,0}
-};
-static swig_lua_method swig_SBTraceOptions_meta[] = {
- {0,0}
-};
-
-static swig_lua_attribute swig_SBTraceOptions_Sf_SwigStatic_attributes[] = {
- {0,0,0}
-};
-static swig_lua_const_info swig_SBTraceOptions_Sf_SwigStatic_constants[]= {
- {0,0,0,0,0,0}
-};
-static swig_lua_method swig_SBTraceOptions_Sf_SwigStatic_methods[]= {
- {0,0}
-};
-static swig_lua_class* swig_SBTraceOptions_Sf_SwigStatic_classes[]= {
- 0
-};
-
-static swig_lua_namespace swig_SBTraceOptions_Sf_SwigStatic = {
- "SBTraceOptions",
- swig_SBTraceOptions_Sf_SwigStatic_methods,
- swig_SBTraceOptions_Sf_SwigStatic_attributes,
- swig_SBTraceOptions_Sf_SwigStatic_constants,
- swig_SBTraceOptions_Sf_SwigStatic_classes,
- 0
-};
-static swig_lua_class *swig_SBTraceOptions_bases[] = {0};
-static const char *swig_SBTraceOptions_base_names[] = {0};
-static swig_lua_class _wrap_class_SBTraceOptions = { "SBTraceOptions", "SBTraceOptions", &SWIGTYPE_p_lldb__SBTraceOptions,_proxy__wrap_new_SBTraceOptions, swig_delete_SBTraceOptions, swig_SBTraceOptions_methods, swig_SBTraceOptions_attributes, &swig_SBTraceOptions_Sf_SwigStatic, swig_SBTraceOptions_meta, swig_SBTraceOptions_bases, swig_SBTraceOptions_base_names };
-
static int _wrap_new_SBTypeMember__SWIG_0(lua_State* L) {
int SWIG_arg = 0;
lldb::SBTypeMember *result = 0 ;
@@ -70205,6 +70454,41 @@ LLDBSwigLuaBreakpointCallbackFunction
return stop;
}
+// This function is called from Lua::CallWatchpointCallback
+SWIGEXPORT llvm::Expected<bool>
+LLDBSwigLuaWatchpointCallbackFunction
+(
+ lua_State *L,
+ lldb::StackFrameSP stop_frame_sp,
+ lldb::WatchpointSP wp_sp
+)
+{
+ lldb::SBFrame sb_frame(stop_frame_sp);
+ lldb::SBWatchpoint sb_wp(wp_sp);
+ int nargs = 2;
+
+ // Push the Lua wrappers
+ PushSBClass(L, &sb_frame);
+ PushSBClass(L, &sb_wp);
+
+ // Call into the Lua callback passing 'sb_frame' and 'sb_wp'.
+ // Expects a boolean return.
+ if (lua_pcall(L, nargs, 1, 0) != LUA_OK) {
+ llvm::Error E = llvm::make_error<llvm::StringError>(
+ llvm::formatv("{0}\n", lua_tostring(L, -1)),
+ llvm::inconvertibleErrorCode());
+ // Pop error message from the stack.
+ lua_pop(L, 1);
+ return std::move(E);
+ }
+
+ // Boolean return from the callback
+ bool stop = lua_toboolean(L, -1);
+ lua_pop(L, 1);
+
+ return stop;
+}
+
static swig_lua_attribute swig_SwigModule_attributes[] = {
@@ -70233,6 +70517,7 @@ static swig_lua_const_info swig_SwigModule_constants[]= {
{SWIG_LUA_CONSTTAB_INT("LLDB_REGNUM_GENERIC_ARG6", 10)},
{SWIG_LUA_CONSTTAB_INT("LLDB_REGNUM_GENERIC_ARG7", 11)},
{SWIG_LUA_CONSTTAB_INT("LLDB_REGNUM_GENERIC_ARG8", 12)},
+ {SWIG_LUA_CONSTTAB_INT("LLDB_INVALID_STOP_ID", 0)},
{SWIG_LUA_CONSTTAB_STRING("LLDB_INVALID_ADDRESS", "18446744073709551615ULL")},
{SWIG_LUA_CONSTTAB_INT("LLDB_INVALID_INDEX32", 4294967295U)},
{SWIG_LUA_CONSTTAB_INT("LLDB_INVALID_IVAR_OFFSET", 4294967295U)},
@@ -70375,6 +70660,10 @@ static swig_lua_const_info swig_SwigModule_constants[]= {
{SWIG_LUA_CONSTTAB_INT("eStopReasonPlanComplete", lldb::eStopReasonPlanComplete)},
{SWIG_LUA_CONSTTAB_INT("eStopReasonThreadExiting", lldb::eStopReasonThreadExiting)},
{SWIG_LUA_CONSTTAB_INT("eStopReasonInstrumentation", lldb::eStopReasonInstrumentation)},
+ {SWIG_LUA_CONSTTAB_INT("eStopReasonProcessorTrace", lldb::eStopReasonProcessorTrace)},
+ {SWIG_LUA_CONSTTAB_INT("eStopReasonFork", lldb::eStopReasonFork)},
+ {SWIG_LUA_CONSTTAB_INT("eStopReasonVFork", lldb::eStopReasonVFork)},
+ {SWIG_LUA_CONSTTAB_INT("eStopReasonVForkDone", lldb::eStopReasonVForkDone)},
{SWIG_LUA_CONSTTAB_INT("eReturnStatusInvalid", lldb::eReturnStatusInvalid)},
{SWIG_LUA_CONSTTAB_INT("eReturnStatusSuccessFinishNoResult", lldb::eReturnStatusSuccessFinishNoResult)},
{SWIG_LUA_CONSTTAB_INT("eReturnStatusSuccessFinishResult", lldb::eReturnStatusSuccessFinishResult)},
@@ -70616,6 +70905,7 @@ static swig_lua_const_info swig_SwigModule_constants[]= {
{SWIG_LUA_CONSTTAB_INT("eArgTypeCommand", lldb::eArgTypeCommand)},
{SWIG_LUA_CONSTTAB_INT("eArgTypeColumnNum", lldb::eArgTypeColumnNum)},
{SWIG_LUA_CONSTTAB_INT("eArgTypeModuleUUID", lldb::eArgTypeModuleUUID)},
+ {SWIG_LUA_CONSTTAB_INT("eArgTypeSaveCoreStyle", lldb::eArgTypeSaveCoreStyle)},
{SWIG_LUA_CONSTTAB_INT("eArgTypeLastArg", lldb::eArgTypeLastArg)},
{SWIG_LUA_CONSTTAB_INT("eSymbolTypeAny", lldb::eSymbolTypeAny)},
{SWIG_LUA_CONSTTAB_INT("eSymbolTypeInvalid", lldb::eSymbolTypeInvalid)},
@@ -70844,6 +71134,11 @@ static swig_lua_const_info swig_SwigModule_constants[]= {
{SWIG_LUA_CONSTTAB_INT("eExpressionEvaluationIRGen", lldb::eExpressionEvaluationIRGen)},
{SWIG_LUA_CONSTTAB_INT("eExpressionEvaluationExecution", lldb::eExpressionEvaluationExecution)},
{SWIG_LUA_CONSTTAB_INT("eExpressionEvaluationComplete", lldb::eExpressionEvaluationComplete)},
+ {SWIG_LUA_CONSTTAB_INT("eTraceInstructionControlFlowTypeInstruction", lldb::eTraceInstructionControlFlowTypeInstruction)},
+ {SWIG_LUA_CONSTTAB_INT("eTraceInstructionControlFlowTypeBranch", lldb::eTraceInstructionControlFlowTypeBranch)},
+ {SWIG_LUA_CONSTTAB_INT("eTraceInstructionControlFlowTypeTakenBranch", lldb::eTraceInstructionControlFlowTypeTakenBranch)},
+ {SWIG_LUA_CONSTTAB_INT("eTraceInstructionControlFlowTypeCall", lldb::eTraceInstructionControlFlowTypeCall)},
+ {SWIG_LUA_CONSTTAB_INT("eTraceInstructionControlFlowTypeReturn", lldb::eTraceInstructionControlFlowTypeReturn)},
{SWIG_LUA_CONSTTAB_INT("eWatchpointKindWrite", lldb::eWatchpointKindWrite)},
{SWIG_LUA_CONSTTAB_INT("eWatchpointKindRead", lldb::eWatchpointKindRead)},
{SWIG_LUA_CONSTTAB_INT("eGdbSignalBadAccess", lldb::eGdbSignalBadAccess)},
@@ -70907,6 +71202,9 @@ static swig_lua_const_info swig_SwigModule_constants[]= {
{SWIG_LUA_CONSTTAB_INT("eCommandInterpreterResultInferiorCrash", lldb::eCommandInterpreterResultInferiorCrash)},
{SWIG_LUA_CONSTTAB_INT("eCommandInterpreterResultCommandError", lldb::eCommandInterpreterResultCommandError)},
{SWIG_LUA_CONSTTAB_INT("eCommandInterpreterResultQuitRequested", lldb::eCommandInterpreterResultQuitRequested)},
+ {SWIG_LUA_CONSTTAB_INT("eSaveCoreUnspecified", lldb::eSaveCoreUnspecified)},
+ {SWIG_LUA_CONSTTAB_INT("eSaveCoreFull", lldb::eSaveCoreFull)},
+ {SWIG_LUA_CONSTTAB_INT("eSaveCoreDirtyOnly", lldb::eSaveCoreDirtyOnly)},
{SWIG_LUA_CONSTTAB_INT("SBCommandInterpreter_eBroadcastBitThreadShouldExit", lldb::SBCommandInterpreter::eBroadcastBitThreadShouldExit)},
{SWIG_LUA_CONSTTAB_INT("SBCommandInterpreter_eBroadcastBitResetPrompt", lldb::SBCommandInterpreter::eBroadcastBitResetPrompt)},
{SWIG_LUA_CONSTTAB_INT("SBCommandInterpreter_eBroadcastBitQuitCommandReceived", lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived)},
@@ -71083,7 +71381,6 @@ static swig_lua_class* swig_SwigModule_classes[]= {
&_wrap_class_SBThreadCollection,
&_wrap_class_SBThreadPlan,
&_wrap_class_SBTrace,
-&_wrap_class_SBTraceOptions,
&_wrap_class_SBTypeMember,
&_wrap_class_SBTypeMemberFunction,
&_wrap_class_SBType,
@@ -71188,7 +71485,6 @@ static swig_type_info _swigt__p_lldb__SBThread = {"_p_lldb__SBThread", "lldb::SB
static swig_type_info _swigt__p_lldb__SBThreadCollection = {"_p_lldb__SBThreadCollection", "lldb::SBThreadCollection *", 0, 0, (void*)&_wrap_class_SBThreadCollection, 0};
static swig_type_info _swigt__p_lldb__SBThreadPlan = {"_p_lldb__SBThreadPlan", "lldb::SBThreadPlan *", 0, 0, (void*)&_wrap_class_SBThreadPlan, 0};
static swig_type_info _swigt__p_lldb__SBTrace = {"_p_lldb__SBTrace", "lldb::SBTrace *", 0, 0, (void*)&_wrap_class_SBTrace, 0};
-static swig_type_info _swigt__p_lldb__SBTraceOptions = {"_p_lldb__SBTraceOptions", "lldb::SBTraceOptions *", 0, 0, (void*)&_wrap_class_SBTraceOptions, 0};
static swig_type_info _swigt__p_lldb__SBType = {"_p_lldb__SBType", "lldb::SBType *", 0, 0, (void*)&_wrap_class_SBType, 0};
static swig_type_info _swigt__p_lldb__SBTypeCategory = {"_p_lldb__SBTypeCategory", "lldb::SBTypeCategory *", 0, 0, (void*)&_wrap_class_SBTypeCategory, 0};
static swig_type_info _swigt__p_lldb__SBTypeEnumMember = {"_p_lldb__SBTypeEnumMember", "lldb::SBTypeEnumMember *", 0, 0, (void*)&_wrap_class_SBTypeEnumMember, 0};
@@ -71255,6 +71551,7 @@ static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__LanguageRuntime_t
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__LineTable_t = {"_p_std__shared_ptrT_lldb_private__LineTable_t", "lldb::LineTableSP *|std::shared_ptr< lldb_private::LineTable > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__Listener_t = {"_p_std__shared_ptrT_lldb_private__Listener_t", "std::shared_ptr< lldb_private::Listener > *|lldb::ListenerSP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__MemoryHistory_t = {"_p_std__shared_ptrT_lldb_private__MemoryHistory_t", "lldb::MemoryHistorySP *|std::shared_ptr< lldb_private::MemoryHistory > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__MemoryRegionInfo_t = {"_p_std__shared_ptrT_lldb_private__MemoryRegionInfo_t", "std::shared_ptr< lldb_private::MemoryRegionInfo > *|lldb::MemoryRegionInfoSP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__Module_t = {"_p_std__shared_ptrT_lldb_private__Module_t", "lldb::ModuleSP *|std::shared_ptr< lldb_private::Module > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__ObjectFileJITDelegate_t = {"_p_std__shared_ptrT_lldb_private__ObjectFileJITDelegate_t", "lldb::ObjectFileJITDelegateSP *|std::shared_ptr< lldb_private::ObjectFileJITDelegate > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__ObjectFile_t = {"_p_std__shared_ptrT_lldb_private__ObjectFile_t", "lldb::ObjectFileSP *|std::shared_ptr< lldb_private::ObjectFile > *", 0, 0, (void*)0, 0};
@@ -71312,8 +71609,8 @@ static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__Target_t = {"_p_s
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__ThreadCollection_t = {"_p_std__shared_ptrT_lldb_private__ThreadCollection_t", "std::shared_ptr< lldb_private::ThreadCollection > *|lldb::ThreadCollectionSP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__ThreadPlanTracer_t = {"_p_std__shared_ptrT_lldb_private__ThreadPlanTracer_t", "std::shared_ptr< lldb_private::ThreadPlanTracer > *|lldb::ThreadPlanTracerSP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__ThreadPlan_t = {"_p_std__shared_ptrT_lldb_private__ThreadPlan_t", "lldb::ThreadPlanSP *|std::shared_ptr< lldb_private::ThreadPlan > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__ThreadPostMortemTrace_t = {"_p_std__shared_ptrT_lldb_private__ThreadPostMortemTrace_t", "std::shared_ptr< lldb_private::ThreadPostMortemTrace > *|lldb::ThreadPostMortemTraceSP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__Thread_t = {"_p_std__shared_ptrT_lldb_private__Thread_t", "std::shared_ptr< lldb_private::Thread > *|lldb::ThreadSP *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__TraceOptions_t = {"_p_std__shared_ptrT_lldb_private__TraceOptions_t", "std::shared_ptr< lldb_private::TraceOptions > *|lldb::TraceOptionsSP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__Trace_t = {"_p_std__shared_ptrT_lldb_private__Trace_t", "std::shared_ptr< lldb_private::Trace > *|lldb::TraceSP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__TypeCategoryImpl_t = {"_p_std__shared_ptrT_lldb_private__TypeCategoryImpl_t", "std::shared_ptr< lldb_private::TypeCategoryImpl > *|lldb::TypeCategoryImplSP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__shared_ptrT_lldb_private__TypeEnumMemberImpl_t = {"_p_std__shared_ptrT_lldb_private__TypeEnumMemberImpl_t", "lldb::TypeEnumMemberImplSP *|std::shared_ptr< lldb_private::TypeEnumMemberImpl > *", 0, 0, (void*)0, 0};
@@ -71346,6 +71643,7 @@ static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__JITLoaderList_t =
static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__MemoryRegionInfo_t = {"_p_std__unique_ptrT_lldb_private__MemoryRegionInfo_t", "std::unique_ptr< lldb_private::MemoryRegionInfo > *|lldb::MemoryRegionInfoUP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__OperatingSystem_t = {"_p_std__unique_ptrT_lldb_private__OperatingSystem_t", "lldb::OperatingSystemUP *|std::unique_ptr< lldb_private::OperatingSystem > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__ScriptInterpreter_t = {"_p_std__unique_ptrT_lldb_private__ScriptInterpreter_t", "std::unique_ptr< lldb_private::ScriptInterpreter > *|lldb::ScriptInterpreterUP *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__ScriptedProcessInterface_t = {"_p_std__unique_ptrT_lldb_private__ScriptedProcessInterface_t", "std::unique_ptr< lldb_private::ScriptedProcessInterface > *|lldb::ScriptedProcessInterfaceUP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__SectionList_t = {"_p_std__unique_ptrT_lldb_private__SectionList_t", "lldb::SectionListUP *|std::unique_ptr< lldb_private::SectionList > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__SourceManager_t = {"_p_std__unique_ptrT_lldb_private__SourceManager_t", "std::unique_ptr< lldb_private::SourceManager > *|lldb::SourceManagerUP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__StackFrameRecognizerManager_t = {"_p_std__unique_ptrT_lldb_private__StackFrameRecognizerManager_t", "std::unique_ptr< lldb_private::StackFrameRecognizerManager > *|lldb::StackFrameRecognizerManagerUP *", 0, 0, (void*)0, 0};
@@ -71353,6 +71651,8 @@ static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__StackFrame_t = {"
static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__StructuredDataImpl_t = {"_p_std__unique_ptrT_lldb_private__StructuredDataImpl_t", "std::unique_ptr< lldb_private::StructuredDataImpl > *|lldb::StructuredDataImplUP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__SymbolVendor_t = {"_p_std__unique_ptrT_lldb_private__SymbolVendor_t", "std::unique_ptr< lldb_private::SymbolVendor > *|lldb::SymbolVendorUP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__SystemRuntime_t = {"_p_std__unique_ptrT_lldb_private__SystemRuntime_t", "std::unique_ptr< lldb_private::SystemRuntime > *|lldb::SystemRuntimeUP *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__TraceCursor_t = {"_p_std__unique_ptrT_lldb_private__TraceCursor_t", "std::unique_ptr< lldb_private::TraceCursor > *|lldb::TraceCursorUP *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__unique_ptrT_lldb_private__TraceExporter_t = {"_p_std__unique_ptrT_lldb_private__TraceExporter_t", "lldb::TraceExporterUP *|std::unique_ptr< lldb_private::TraceExporter > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__weak_ptrT_lldb_private__BreakpointLocation_t = {"_p_std__weak_ptrT_lldb_private__BreakpointLocation_t", "std::weak_ptr< lldb_private::BreakpointLocation > *|lldb::BreakpointLocationWP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__weak_ptrT_lldb_private__BreakpointSite_t = {"_p_std__weak_ptrT_lldb_private__BreakpointSite_t", "std::weak_ptr< lldb_private::BreakpointSite > *|lldb::BreakpointSiteWP *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__weak_ptrT_lldb_private__Breakpoint_t = {"_p_std__weak_ptrT_lldb_private__Breakpoint_t", "std::weak_ptr< lldb_private::Breakpoint > *|lldb::BreakpointWP *", 0, 0, (void*)0, 0};
@@ -71448,7 +71748,6 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_lldb__SBThreadCollection,
&_swigt__p_lldb__SBThreadPlan,
&_swigt__p_lldb__SBTrace,
- &_swigt__p_lldb__SBTraceOptions,
&_swigt__p_lldb__SBType,
&_swigt__p_lldb__SBTypeCategory,
&_swigt__p_lldb__SBTypeEnumMember,
@@ -71515,6 +71814,7 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_std__shared_ptrT_lldb_private__LineTable_t,
&_swigt__p_std__shared_ptrT_lldb_private__Listener_t,
&_swigt__p_std__shared_ptrT_lldb_private__MemoryHistory_t,
+ &_swigt__p_std__shared_ptrT_lldb_private__MemoryRegionInfo_t,
&_swigt__p_std__shared_ptrT_lldb_private__Module_t,
&_swigt__p_std__shared_ptrT_lldb_private__ObjectFileJITDelegate_t,
&_swigt__p_std__shared_ptrT_lldb_private__ObjectFile_t,
@@ -71572,8 +71872,8 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_std__shared_ptrT_lldb_private__ThreadCollection_t,
&_swigt__p_std__shared_ptrT_lldb_private__ThreadPlanTracer_t,
&_swigt__p_std__shared_ptrT_lldb_private__ThreadPlan_t,
+ &_swigt__p_std__shared_ptrT_lldb_private__ThreadPostMortemTrace_t,
&_swigt__p_std__shared_ptrT_lldb_private__Thread_t,
- &_swigt__p_std__shared_ptrT_lldb_private__TraceOptions_t,
&_swigt__p_std__shared_ptrT_lldb_private__Trace_t,
&_swigt__p_std__shared_ptrT_lldb_private__TypeCategoryImpl_t,
&_swigt__p_std__shared_ptrT_lldb_private__TypeEnumMemberImpl_t,
@@ -71606,6 +71906,7 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_std__unique_ptrT_lldb_private__MemoryRegionInfo_t,
&_swigt__p_std__unique_ptrT_lldb_private__OperatingSystem_t,
&_swigt__p_std__unique_ptrT_lldb_private__ScriptInterpreter_t,
+ &_swigt__p_std__unique_ptrT_lldb_private__ScriptedProcessInterface_t,
&_swigt__p_std__unique_ptrT_lldb_private__SectionList_t,
&_swigt__p_std__unique_ptrT_lldb_private__SourceManager_t,
&_swigt__p_std__unique_ptrT_lldb_private__StackFrameRecognizerManager_t,
@@ -71613,6 +71914,8 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_std__unique_ptrT_lldb_private__StructuredDataImpl_t,
&_swigt__p_std__unique_ptrT_lldb_private__SymbolVendor_t,
&_swigt__p_std__unique_ptrT_lldb_private__SystemRuntime_t,
+ &_swigt__p_std__unique_ptrT_lldb_private__TraceCursor_t,
+ &_swigt__p_std__unique_ptrT_lldb_private__TraceExporter_t,
&_swigt__p_std__weak_ptrT_lldb_private__BreakpointLocation_t,
&_swigt__p_std__weak_ptrT_lldb_private__BreakpointSite_t,
&_swigt__p_std__weak_ptrT_lldb_private__Breakpoint_t,
@@ -71708,7 +72011,6 @@ static swig_cast_info _swigc__p_lldb__SBThread[] = { {&_swigt__p_lldb__SBThread
static swig_cast_info _swigc__p_lldb__SBThreadCollection[] = { {&_swigt__p_lldb__SBThreadCollection, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_lldb__SBThreadPlan[] = { {&_swigt__p_lldb__SBThreadPlan, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_lldb__SBTrace[] = { {&_swigt__p_lldb__SBTrace, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_lldb__SBTraceOptions[] = { {&_swigt__p_lldb__SBTraceOptions, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_lldb__SBType[] = { {&_swigt__p_lldb__SBType, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_lldb__SBTypeCategory[] = { {&_swigt__p_lldb__SBTypeCategory, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_lldb__SBTypeEnumMember[] = { {&_swigt__p_lldb__SBTypeEnumMember, 0, 0, 0},{0, 0, 0, 0}};
@@ -71775,6 +72077,7 @@ static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__LanguageRuntime_t
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__LineTable_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__LineTable_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__Listener_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__Listener_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__MemoryHistory_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__MemoryHistory_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__MemoryRegionInfo_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__MemoryRegionInfo_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__Module_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__Module_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__ObjectFileJITDelegate_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__ObjectFileJITDelegate_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__ObjectFile_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__ObjectFile_t, 0, 0, 0},{0, 0, 0, 0}};
@@ -71832,8 +72135,8 @@ static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__Target_t[] = { {
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__ThreadCollection_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__ThreadCollection_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__ThreadPlanTracer_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__ThreadPlanTracer_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__ThreadPlan_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__ThreadPlan_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__ThreadPostMortemTrace_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__ThreadPostMortemTrace_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__Thread_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__Thread_t, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__TraceOptions_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__TraceOptions_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__Trace_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__Trace_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__TypeCategoryImpl_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__TypeCategoryImpl_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__shared_ptrT_lldb_private__TypeEnumMemberImpl_t[] = { {&_swigt__p_std__shared_ptrT_lldb_private__TypeEnumMemberImpl_t, 0, 0, 0},{0, 0, 0, 0}};
@@ -71866,6 +72169,7 @@ static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__JITLoaderList_t[]
static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__MemoryRegionInfo_t[] = { {&_swigt__p_std__unique_ptrT_lldb_private__MemoryRegionInfo_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__OperatingSystem_t[] = { {&_swigt__p_std__unique_ptrT_lldb_private__OperatingSystem_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__ScriptInterpreter_t[] = { {&_swigt__p_std__unique_ptrT_lldb_private__ScriptInterpreter_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__ScriptedProcessInterface_t[] = { {&_swigt__p_std__unique_ptrT_lldb_private__ScriptedProcessInterface_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__SectionList_t[] = { {&_swigt__p_std__unique_ptrT_lldb_private__SectionList_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__SourceManager_t[] = { {&_swigt__p_std__unique_ptrT_lldb_private__SourceManager_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__StackFrameRecognizerManager_t[] = { {&_swigt__p_std__unique_ptrT_lldb_private__StackFrameRecognizerManager_t, 0, 0, 0},{0, 0, 0, 0}};
@@ -71873,6 +72177,8 @@ static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__StackFrame_t[] =
static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__StructuredDataImpl_t[] = { {&_swigt__p_std__unique_ptrT_lldb_private__StructuredDataImpl_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__SymbolVendor_t[] = { {&_swigt__p_std__unique_ptrT_lldb_private__SymbolVendor_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__SystemRuntime_t[] = { {&_swigt__p_std__unique_ptrT_lldb_private__SystemRuntime_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__TraceCursor_t[] = { {&_swigt__p_std__unique_ptrT_lldb_private__TraceCursor_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__unique_ptrT_lldb_private__TraceExporter_t[] = { {&_swigt__p_std__unique_ptrT_lldb_private__TraceExporter_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__weak_ptrT_lldb_private__BreakpointLocation_t[] = { {&_swigt__p_std__weak_ptrT_lldb_private__BreakpointLocation_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__weak_ptrT_lldb_private__BreakpointSite_t[] = { {&_swigt__p_std__weak_ptrT_lldb_private__BreakpointSite_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__weak_ptrT_lldb_private__Breakpoint_t[] = { {&_swigt__p_std__weak_ptrT_lldb_private__Breakpoint_t, 0, 0, 0},{0, 0, 0, 0}};
@@ -71968,7 +72274,6 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_lldb__SBThreadCollection,
_swigc__p_lldb__SBThreadPlan,
_swigc__p_lldb__SBTrace,
- _swigc__p_lldb__SBTraceOptions,
_swigc__p_lldb__SBType,
_swigc__p_lldb__SBTypeCategory,
_swigc__p_lldb__SBTypeEnumMember,
@@ -72035,6 +72340,7 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_std__shared_ptrT_lldb_private__LineTable_t,
_swigc__p_std__shared_ptrT_lldb_private__Listener_t,
_swigc__p_std__shared_ptrT_lldb_private__MemoryHistory_t,
+ _swigc__p_std__shared_ptrT_lldb_private__MemoryRegionInfo_t,
_swigc__p_std__shared_ptrT_lldb_private__Module_t,
_swigc__p_std__shared_ptrT_lldb_private__ObjectFileJITDelegate_t,
_swigc__p_std__shared_ptrT_lldb_private__ObjectFile_t,
@@ -72092,8 +72398,8 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_std__shared_ptrT_lldb_private__ThreadCollection_t,
_swigc__p_std__shared_ptrT_lldb_private__ThreadPlanTracer_t,
_swigc__p_std__shared_ptrT_lldb_private__ThreadPlan_t,
+ _swigc__p_std__shared_ptrT_lldb_private__ThreadPostMortemTrace_t,
_swigc__p_std__shared_ptrT_lldb_private__Thread_t,
- _swigc__p_std__shared_ptrT_lldb_private__TraceOptions_t,
_swigc__p_std__shared_ptrT_lldb_private__Trace_t,
_swigc__p_std__shared_ptrT_lldb_private__TypeCategoryImpl_t,
_swigc__p_std__shared_ptrT_lldb_private__TypeEnumMemberImpl_t,
@@ -72126,6 +72432,7 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_std__unique_ptrT_lldb_private__MemoryRegionInfo_t,
_swigc__p_std__unique_ptrT_lldb_private__OperatingSystem_t,
_swigc__p_std__unique_ptrT_lldb_private__ScriptInterpreter_t,
+ _swigc__p_std__unique_ptrT_lldb_private__ScriptedProcessInterface_t,
_swigc__p_std__unique_ptrT_lldb_private__SectionList_t,
_swigc__p_std__unique_ptrT_lldb_private__SourceManager_t,
_swigc__p_std__unique_ptrT_lldb_private__StackFrameRecognizerManager_t,
@@ -72133,6 +72440,8 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_std__unique_ptrT_lldb_private__StructuredDataImpl_t,
_swigc__p_std__unique_ptrT_lldb_private__SymbolVendor_t,
_swigc__p_std__unique_ptrT_lldb_private__SystemRuntime_t,
+ _swigc__p_std__unique_ptrT_lldb_private__TraceCursor_t,
+ _swigc__p_std__unique_ptrT_lldb_private__TraceExporter_t,
_swigc__p_std__weak_ptrT_lldb_private__BreakpointLocation_t,
_swigc__p_std__weak_ptrT_lldb_private__BreakpointSite_t,
_swigc__p_std__weak_ptrT_lldb_private__Breakpoint_t,
diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile
index fee0d508463d..5672464a9213 100644
--- a/lib/clang/liblldb/Makefile
+++ b/lib/clang/liblldb/Makefile
@@ -72,7 +72,6 @@ SRCS+= API/SBThread.cpp
SRCS+= API/SBThreadCollection.cpp
SRCS+= API/SBThreadPlan.cpp
SRCS+= API/SBTrace.cpp
-SRCS+= API/SBTraceOptions.cpp
SRCS+= API/SBType.cpp
SRCS+= API/SBTypeCategory.cpp
SRCS+= API/SBTypeEnumMember.cpp
@@ -123,6 +122,7 @@ SRCS+= Commands/CommandObjectHelp.cpp
SRCS+= Commands/CommandObjectLanguage.cpp
SRCS+= Commands/CommandObjectLog.cpp
SRCS+= Commands/CommandObjectMemory.cpp
+SRCS+= Commands/CommandObjectMemoryTag.cpp
SRCS+= Commands/CommandObjectMultiword.cpp
SRCS+= Commands/CommandObjectPlatform.cpp
SRCS+= Commands/CommandObjectPlugin.cpp
@@ -149,9 +149,9 @@ SRCS+= Core/Address.cpp
SRCS+= Core/AddressRange.cpp
SRCS+= Core/AddressResolver.cpp
SRCS+= Core/AddressResolverFileLine.cpp
-SRCS+= Core/AddressResolverName.cpp
SRCS+= Core/Communication.cpp
SRCS+= Core/Debugger.cpp
+SRCS+= Core/Declaration.cpp
SRCS+= Core/Disassembler.cpp
SRCS+= Core/DumpDataExtractor.cpp
SRCS+= Core/DumpRegisterValue.cpp
@@ -169,9 +169,11 @@ SRCS+= Core/ModuleChild.cpp
SRCS+= Core/ModuleList.cpp
SRCS+= Core/Opcode.cpp
SRCS+= Core/PluginManager.cpp
+SRCS+= Core/Progress.cpp
SRCS+= Core/RichManglingContext.cpp
SRCS+= Core/SearchFilter.cpp
SRCS+= Core/Section.cpp
+SRCS+= Core/SourceLocationSpec.cpp
SRCS+= Core/SourceManager.cpp
SRCS+= Core/StreamAsynchronousIO.cpp
SRCS+= Core/StreamFile.cpp
@@ -189,6 +191,7 @@ SRCS+= Core/ValueObjectList.cpp
SRCS+= Core/ValueObjectMemory.cpp
SRCS+= Core/ValueObjectRegister.cpp
SRCS+= Core/ValueObjectSyntheticFilter.cpp
+SRCS+= Core/ValueObjectUpdater.cpp
SRCS+= Core/ValueObjectVariable.cpp
SRCS+= DataFormatters/CXXFunctionPointer.cpp
SRCS+= DataFormatters/DataVisualization.cpp
@@ -286,6 +289,7 @@ SRCS+= Interpreter/OptionGroupVariable.cpp
SRCS+= Interpreter/OptionGroupWatchpoint.cpp
SRCS+= Interpreter/OptionValue.cpp
SRCS+= Interpreter/OptionValueArch.cpp
+SRCS+= Interpreter/OptionValueArgs.cpp
SRCS+= Interpreter/OptionValueArray.cpp
SRCS+= Interpreter/OptionValueBoolean.cpp
SRCS+= Interpreter/OptionValueChar.cpp
@@ -321,6 +325,7 @@ SRCS+= Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
SRCS+= Plugins/ABI/X86/ABISysV_i386.cpp
SRCS+= Plugins/ABI/X86/ABISysV_x86_64.cpp
SRCS+= Plugins/ABI/X86/ABIX86.cpp
+SRCS+= Plugins/Architecture/AArch64/ArchitectureAArch64.cpp
SRCS+= Plugins/Architecture/Arm/ArchitectureArm.cpp
SRCS+= Plugins/Architecture/Mips/ArchitectureMips.cpp
SRCS+= Plugins/Architecture/PPC64/ArchitecturePPC64.cpp
@@ -433,6 +438,7 @@ SRCS+= Plugins/Process/Utility/HistoryUnwind.cpp
SRCS+= Plugins/Process/Utility/InferiorCallPOSIX.cpp
SRCS+= Plugins/Process/Utility/LinuxSignals.cpp
SRCS+= Plugins/Process/Utility/MipsLinuxSignals.cpp
+SRCS+= Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp
SRCS+= Plugins/Process/Utility/NativeProcessSoftwareSingleStep.cpp
SRCS+= Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.cpp
SRCS+= Plugins/Process/Utility/NativeRegisterContextDBReg_x86.cpp
@@ -447,8 +453,6 @@ SRCS+= Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp
SRCS+= Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
SRCS+= Plugins/Process/Utility/RegisterContextHistory.cpp
SRCS+= Plugins/Process/Utility/RegisterContextLinux_i386.cpp
-SRCS+= Plugins/Process/Utility/RegisterContextLinux_mips.cpp
-SRCS+= Plugins/Process/Utility/RegisterContextLinux_mips64.cpp
SRCS+= Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
SRCS+= Plugins/Process/Utility/RegisterContextMemory.cpp
SRCS+= Plugins/Process/Utility/RegisterContextNetBSD_i386.cpp
@@ -490,6 +494,7 @@ SRCS+= Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
SRCS+= Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
SRCS+= Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
SRCS+= Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
+SRCS+= Plugins/Process/scripted/ScriptedProcess.cpp
SRCS+= Plugins/ScriptInterpreter/Lua/Lua.cpp
SRCS+= Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
SRCS+= Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
@@ -542,7 +547,6 @@ SRCS+= Symbol/CompilerType.cpp
SRCS+= Symbol/DWARFCallFrameInfo.cpp
SRCS+= Symbol/DebugMacros.cpp
SRCS+= Symbol/DeclVendor.cpp
-SRCS+= Symbol/Declaration.cpp
SRCS+= Symbol/FuncUnwinders.cpp
SRCS+= Symbol/Function.cpp
SRCS+= Symbol/LineEntry.cpp
@@ -621,6 +625,8 @@ SRCS+= Target/ThreadPlanStepUntil.cpp
SRCS+= Target/ThreadPlanTracer.cpp
SRCS+= Target/ThreadSpec.cpp
SRCS+= Target/Trace.cpp
+SRCS+= Target/TraceCursor.cpp
+SRCS+= Target/TraceInstructionDumper.cpp
SRCS+= Target/UnixSignals.cpp
SRCS+= Target/UnwindAssembly.cpp
SRCS+= Target/UnwindLLDB.cpp
@@ -664,8 +670,8 @@ SRCS+= Utility/StringLexer.cpp
SRCS+= Utility/StringList.cpp
SRCS+= Utility/StructuredData.cpp
SRCS+= Utility/TildeExpressionResolver.cpp
+SRCS+= Utility/TraceGDBRemotePackets.cpp
SRCS+= Utility/Timer.cpp
-SRCS+= Utility/TraceOptions.cpp
SRCS+= Utility/UUID.cpp
SRCS+= Utility/UnimplementedError.cpp
SRCS+= Utility/UriParser.cpp
diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile
index bd0aee918ef3..6df32d8b452a 100644
--- a/lib/clang/libllvm/Makefile
+++ b/lib/clang/libllvm/Makefile
@@ -117,6 +117,7 @@ SRCS_MIN+= Analysis/ObjCARCAliasAnalysis.cpp
SRCS_MIN+= Analysis/ObjCARCAnalysisUtils.cpp
SRCS_MIN+= Analysis/ObjCARCInstKind.cpp
SRCS_MIN+= Analysis/OptimizationRemarkEmitter.cpp
+SRCS_MIN+= Analysis/OverflowInstAnalysis.cpp
SRCS_MIN+= Analysis/PHITransAddr.cpp
SRCS_MIN+= Analysis/PhiValues.cpp
SRCS_MIN+= Analysis/PostDominators.cpp
@@ -203,7 +204,6 @@ SRCS_MIN+= CodeGen/BasicTargetTransformInfo.cpp
SRCS_MIN+= CodeGen/BranchFolding.cpp
SRCS_MIN+= CodeGen/BranchRelaxation.cpp
SRCS_MIN+= CodeGen/BreakFalseDeps.cpp
-SRCS_EXT+= CodeGen/BuiltinGCs.cpp
SRCS_MIN+= CodeGen/CFGuardLongjmp.cpp
SRCS_MIN+= CodeGen/CFIInstrInserter.cpp
SRCS_MIN+= CodeGen/CalcSpillWeights.cpp
@@ -216,12 +216,14 @@ SRCS_MIN+= CodeGen/DFAPacketizer.cpp
SRCS_MIN+= CodeGen/DeadMachineInstructionElim.cpp
SRCS_MIN+= CodeGen/DetectDeadLanes.cpp
SRCS_MIN+= CodeGen/DwarfEHPrepare.cpp
+SRCS_MIN+= CodeGen/EHContGuardCatchret.cpp
SRCS_MIN+= CodeGen/EarlyIfConversion.cpp
SRCS_MIN+= CodeGen/EdgeBundles.cpp
SRCS_MIN+= CodeGen/ExecutionDomainFix.cpp
SRCS_MIN+= CodeGen/ExpandMemCmp.cpp
SRCS_MIN+= CodeGen/ExpandPostRAPseudos.cpp
SRCS_MIN+= CodeGen/ExpandReductions.cpp
+SRCS_MIN+= CodeGen/ExpandVectorPredication.cpp
SRCS_MIN+= CodeGen/FEntryInserter.cpp
SRCS_MIN+= CodeGen/FaultMaps.cpp
SRCS_MIN+= CodeGen/FinalizeISel.cpp
@@ -230,7 +232,6 @@ SRCS_MIN+= CodeGen/FuncletLayout.cpp
SRCS_MIN+= CodeGen/GCMetadata.cpp
SRCS_MIN+= CodeGen/GCMetadataPrinter.cpp
SRCS_MIN+= CodeGen/GCRootLowering.cpp
-SRCS_MIN+= CodeGen/GCStrategy.cpp
SRCS_MIN+= CodeGen/GlobalISel/CSEInfo.cpp
SRCS_MIN+= CodeGen/GlobalISel/CSEMIRBuilder.cpp
SRCS_MIN+= CodeGen/GlobalISel/Combiner.cpp
@@ -243,6 +244,7 @@ SRCS_MIN+= CodeGen/GlobalISel/IRTranslator.cpp
SRCS_MIN+= CodeGen/GlobalISel/InlineAsmLowering.cpp
SRCS_MIN+= CodeGen/GlobalISel/InstructionSelect.cpp
SRCS_MIN+= CodeGen/GlobalISel/InstructionSelector.cpp
+SRCS_MIN+= CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
SRCS_MIN+= CodeGen/GlobalISel/LegalityPredicates.cpp
SRCS_MIN+= CodeGen/GlobalISel/LegalizeMutations.cpp
SRCS_MIN+= CodeGen/GlobalISel/Legalizer.cpp
@@ -291,6 +293,7 @@ SRCS_MIN+= CodeGen/LowLevelType.cpp
SRCS_MIN+= CodeGen/LowerEmuTLS.cpp
SRCS_MIN+= CodeGen/MBFIWrapper.cpp
SRCS_MIN+= CodeGen/MIRCanonicalizerPass.cpp
+SRCS_MIN+= CodeGen/MIRFSDiscriminator.cpp
SRCS_MIN+= CodeGen/MIRNamerPass.cpp
SRCS_EXT+= CodeGen/MIRParser/MILexer.cpp
SRCS_EXT+= CodeGen/MIRParser/MIParser.cpp
@@ -321,6 +324,7 @@ SRCS_MIN+= CodeGen/MachineLoopInfo.cpp
SRCS_MIN+= CodeGen/MachineLoopUtils.cpp
SRCS_MIN+= CodeGen/MachineModuleInfo.cpp
SRCS_MIN+= CodeGen/MachineModuleInfoImpls.cpp
+SRCS_MIN+= CodeGen/MachineModuleSlotTracker.cpp
SRCS_MIN+= CodeGen/MachineOperand.cpp
SRCS_MIN+= CodeGen/MachineOptimizationRemarkEmitter.cpp
SRCS_MIN+= CodeGen/MachineOutliner.cpp
@@ -353,6 +357,7 @@ SRCS_MIN+= CodeGen/PrologEpilogInserter.cpp
SRCS_MIN+= CodeGen/PseudoProbeInserter.cpp
SRCS_MIN+= CodeGen/PseudoSourceValue.cpp
SRCS_MIN+= CodeGen/ReachingDefAnalysis.cpp
+SRCS_MIN+= CodeGen/ReplaceWithVeclib.cpp
SRCS_MIN+= CodeGen/RDFGraph.cpp
SRCS_MIN+= CodeGen/RDFLiveness.cpp
SRCS_MIN+= CodeGen/RDFRegisters.cpp
@@ -368,6 +373,7 @@ SRCS_MIN+= CodeGen/RegisterCoalescer.cpp
SRCS_MIN+= CodeGen/RegisterPressure.cpp
SRCS_MIN+= CodeGen/RegisterScavenging.cpp
SRCS_MIN+= CodeGen/RegisterUsageInfo.cpp
+SRCS_MIN+= CodeGen/RemoveRedundantDebugValues.cpp
SRCS_MIN+= CodeGen/RenameIndependentSubregs.cpp
SRCS_MIN+= CodeGen/ResetMachineFunctionPass.cpp
SRCS_MIN+= CodeGen/SafeStack.cpp
@@ -433,6 +439,8 @@ SRCS_MIN+= CodeGen/VirtRegMap.cpp
SRCS_MIN+= CodeGen/WasmEHPrepare.cpp
SRCS_MIN+= CodeGen/WinEHPrepare.cpp
SRCS_MIN+= CodeGen/XRayInstrumentation.cpp
+SRCS_EXT+= DWP/DWP.cpp
+SRCS_EXT+= DWP/DWPError.cpp
SRCS_EXT+= DebugInfo/CodeView/AppendingTypeTableBuilder.cpp
SRCS_MIN+= DebugInfo/CodeView/CVSymbolVisitor.cpp
SRCS_MIN+= DebugInfo/CodeView/CVTypeVisitor.cpp
@@ -600,6 +608,7 @@ SRCS_MIW+= Demangle/Demangle.cpp
SRCS_MIN+= Demangle/ItaniumDemangle.cpp
SRCS_MIW+= Demangle/MicrosoftDemangle.cpp
SRCS_MIW+= Demangle/MicrosoftDemangleNodes.cpp
+SRCS_MIW+= Demangle/RustDemangle.cpp
SRCS_XDB+= ExecutionEngine/ExecutionEngine.cpp
SRCS_XDB+= ExecutionEngine/ExecutionEngineBindings.cpp
SRCS_XDB+= ExecutionEngine/GDBRegistrationListener.cpp
@@ -608,7 +617,9 @@ SRCS_XDB+= ExecutionEngine/Interpreter/ExternalFunctions.cpp
SRCS_XDB+= ExecutionEngine/Interpreter/Interpreter.cpp
SRCS_EXT+= ExecutionEngine/JITLink/EHFrameSupport.cpp
SRCS_EXT+= ExecutionEngine/JITLink/ELF.cpp
+SRCS_EXT+= ExecutionEngine/JITLink/ELF_riscv.cpp
SRCS_EXT+= ExecutionEngine/JITLink/ELF_x86_64.cpp
+SRCS_EXT+= ExecutionEngine/JITLink/ELFLinkGraphBuilder.cpp
SRCS_EXT+= ExecutionEngine/JITLink/JITLink.cpp
SRCS_EXT+= ExecutionEngine/JITLink/JITLinkGeneric.cpp
SRCS_EXT+= ExecutionEngine/JITLink/JITLinkMemoryManager.cpp
@@ -616,12 +627,18 @@ SRCS_EXT+= ExecutionEngine/JITLink/MachO.cpp
SRCS_EXT+= ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
SRCS_EXT+= ExecutionEngine/JITLink/MachO_arm64.cpp
SRCS_EXT+= ExecutionEngine/JITLink/MachO_x86_64.cpp
+SRCS_EXT+= ExecutionEngine/JITLink/riscv.cpp
+SRCS_EXT+= ExecutionEngine/JITLink/x86_64.cpp
SRCS_XDB+= ExecutionEngine/MCJIT/MCJIT.cpp
SRCS_EXT+= ExecutionEngine/Orc/CompileOnDemandLayer.cpp
SRCS_EXT+= ExecutionEngine/Orc/CompileUtils.cpp
SRCS_EXT+= ExecutionEngine/Orc/Core.cpp
+SRCS_EXT+= ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp
SRCS_EXT+= ExecutionEngine/Orc/DebugUtils.cpp
+SRCS_EXT+= ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp
+SRCS_EXT+= ExecutionEngine/Orc/EPCEHFrameRegistrar.cpp
SRCS_EXT+= ExecutionEngine/Orc/ExecutionUtils.cpp
+SRCS_EXT+= ExecutionEngine/Orc/ExecutorProcessControl.cpp
SRCS_EXT+= ExecutionEngine/Orc/IRCompileLayer.cpp
SRCS_EXT+= ExecutionEngine/Orc/IRTransformLayer.cpp
SRCS_EXT+= ExecutionEngine/Orc/IndirectionUtils.cpp
@@ -638,9 +655,9 @@ SRCS_EXT+= ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
SRCS_EXT+= ExecutionEngine/Orc/Shared/OrcError.cpp
SRCS_EXT+= ExecutionEngine/Orc/Shared/RPCError.cpp
SRCS_EXT+= ExecutionEngine/Orc/Speculation.cpp
+SRCS_XDB+= ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
SRCS_EXT+= ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp
SRCS_EXT+= ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.cpp
-SRCS_EXT+= ExecutionEngine/Orc/TargetProcessControl.cpp
SRCS_EXT+= ExecutionEngine/Orc/ThreadSafeModule.cpp
SRCS_XDB+= ExecutionEngine/RuntimeDyld/JITSymbol.cpp
SRCS_XDB+= ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
@@ -652,6 +669,7 @@ SRCS_XDB+= ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
SRCS_XDB+= ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldELFMips.cpp
SRCS_XDB+= ExecutionEngine/SectionMemoryManager.cpp
SRCS_XDB+= ExecutionEngine/TargetSelect.cpp
+SRCS_MIN+= Frontend/OpenMP/OMP.cpp
SRCS_MIN+= Frontend/OpenMP/OMPContext.cpp
SRCS_MIN+= Frontend/OpenMP/OMPIRBuilder.cpp
SRCS_MIN+= IR/AbstractCallSite.cpp
@@ -660,6 +678,7 @@ SRCS_MIN+= IR/Assumptions.cpp
SRCS_MIN+= IR/Attributes.cpp
SRCS_MIN+= IR/AutoUpgrade.cpp
SRCS_MIN+= IR/BasicBlock.cpp
+SRCS_EXT+= IR/BuiltinGCs.cpp
SRCS_MIN+= IR/Comdat.cpp
SRCS_MIN+= IR/ConstantFold.cpp
SRCS_MIN+= IR/ConstantRange.cpp
@@ -676,6 +695,7 @@ SRCS_MIN+= IR/DiagnosticPrinter.cpp
SRCS_MIN+= IR/Dominators.cpp
SRCS_MIN+= IR/FPEnv.cpp
SRCS_MIN+= IR/Function.cpp
+SRCS_MIN+= IR/GCStrategy.cpp
SRCS_MIN+= IR/GVMaterializer.cpp
SRCS_MIN+= IR/Globals.cpp
SRCS_MIN+= IR/IRBuilder.cpp
@@ -772,6 +792,7 @@ SRCS_MIN+= MC/MCParser/MCAsmParser.cpp
SRCS_MIN+= MC/MCParser/MCAsmParserExtension.cpp
SRCS_MIN+= MC/MCParser/MCTargetAsmParser.cpp
SRCS_MIN+= MC/MCParser/WasmAsmParser.cpp
+SRCS_MIN+= MC/MCParser/XCOFFAsmParser.cpp
SRCS_MIN+= MC/MCPseudoProbe.cpp
SRCS_MIN+= MC/MCRegisterInfo.cpp
SRCS_MIN+= MC/MCSchedule.cpp
@@ -803,6 +824,7 @@ SRCS_MIN+= MC/WinCOFFObjectWriter.cpp
SRCS_MIN+= MC/XCOFFObjectWriter.cpp
SRCS_EXT+= MCA/CodeEmitter.cpp
SRCS_EXT+= MCA/Context.cpp
+SRCS_EXT+= MCA/CustomBehaviour.cpp
SRCS_EXT+= MCA/HWEventListener.cpp
SRCS_EXT+= MCA/HardwareUnits/HardwareUnit.cpp
SRCS_EXT+= MCA/HardwareUnits/LSUnit.cpp
@@ -816,6 +838,7 @@ SRCS_EXT+= MCA/Pipeline.cpp
SRCS_EXT+= MCA/Stages/DispatchStage.cpp
SRCS_EXT+= MCA/Stages/EntryStage.cpp
SRCS_EXT+= MCA/Stages/ExecuteStage.cpp
+SRCS_EXT+= MCA/Stages/InOrderIssueStage.cpp
SRCS_EXT+= MCA/Stages/InstructionTables.cpp
SRCS_EXT+= MCA/Stages/MicroOpQueueStage.cpp
SRCS_EXT+= MCA/Stages/RetireStage.cpp
@@ -831,6 +854,7 @@ SRCS_MIN+= Object/Decompressor.cpp
SRCS_MIN+= Object/ELF.cpp
SRCS_MIN+= Object/ELFObjectFile.cpp
SRCS_MIN+= Object/Error.cpp
+SRCS_MIW+= Object/FaultMapParser.cpp
SRCS_MIN+= Object/IRObjectFile.cpp
SRCS_MIN+= Object/IRSymtab.cpp
SRCS_MIN+= Object/MachOObjectFile.cpp
@@ -925,6 +949,7 @@ SRCS_MIN+= Support/ELFAttributes.cpp
SRCS_MIN+= Support/Errno.cpp
SRCS_MIN+= Support/Error.cpp
SRCS_MIN+= Support/ErrorHandling.cpp
+SRCS_MIN+= Support/ExtensibleRTTI.cpp
SRCS_MIN+= Support/FileCollector.cpp
SRCS_MIW+= Support/FileOutputBuffer.cpp
SRCS_MIN+= Support/FileUtilities.cpp
@@ -997,6 +1022,7 @@ SRCS_MIN+= Support/ToolOutputFile.cpp
SRCS_MIN+= Support/TrigramIndex.cpp
SRCS_MIN+= Support/Triple.cpp
SRCS_MIN+= Support/Twine.cpp
+SRCS_MIN+= Support/TypeSize.cpp
SRCS_MIN+= Support/Unicode.cpp
SRCS_MIN+= Support/UnicodeCaseFold.cpp
SRCS_MIN+= Support/Valgrind.cpp
@@ -1050,6 +1076,7 @@ SRCS_MIN+= Target/AArch64/AArch64ISelDAGToDAG.cpp
SRCS_MIN+= Target/AArch64/AArch64ISelLowering.cpp
SRCS_MIN+= Target/AArch64/AArch64InstrInfo.cpp
SRCS_MIN+= Target/AArch64/AArch64LoadStoreOptimizer.cpp
+SRCS_MIN+= Target/AArch64/AArch64LowerHomogeneousPrologEpilog.cpp
SRCS_MIN+= Target/AArch64/AArch64MCInstLower.cpp
SRCS_MIN+= Target/AArch64/AArch64MachineFunctionInfo.cpp
SRCS_MIN+= Target/AArch64/AArch64MacroFusion.cpp
@@ -1072,8 +1099,10 @@ SRCS_MIN+= Target/AArch64/AsmParser/AArch64AsmParser.cpp
SRCS_XDW+= Target/AArch64/Disassembler/AArch64Disassembler.cpp
SRCS_XDW+= Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
SRCS_MIN+= Target/AArch64/GISel/AArch64CallLowering.cpp
+SRCS_MIN+= Target/AArch64/GISel/AArch64GlobalISelUtils.cpp
SRCS_MIN+= Target/AArch64/GISel/AArch64InstructionSelector.cpp
SRCS_MIN+= Target/AArch64/GISel/AArch64LegalizerInfo.cpp
+SRCS_MIN+= Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp
SRCS_MIN+= Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
SRCS_MIN+= Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
SRCS_MIN+= Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
@@ -1148,9 +1177,10 @@ SRCS_MIN+= Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp
SRCS_MIN+= Target/ARM/MCTargetDesc/ARMWinCOFFStreamer.cpp
SRCS_MIN+= Target/ARM/MLxExpansionPass.cpp
SRCS_MIN+= Target/ARM/MVEGatherScatterLowering.cpp
+SRCS_MIN+= Target/ARM/MVELaneInterleavingPass.cpp
+SRCS_MIN+= Target/ARM/MVETPAndVPTOptimisationsPass.cpp
SRCS_MIN+= Target/ARM/MVETailPredication.cpp
SRCS_MIN+= Target/ARM/MVEVPTBlockPass.cpp
-SRCS_MIN+= Target/ARM/MVEVPTOptimisationsPass.cpp
SRCS_MIN+= Target/ARM/TargetInfo/ARMTargetInfo.cpp
SRCS_MIN+= Target/ARM/Thumb1FrameLowering.cpp
SRCS_MIN+= Target/ARM/Thumb1InstrInfo.cpp
@@ -1163,7 +1193,9 @@ SRCS_MIN+= Target/ARM/Utils/ARMBaseInfo.cpp
.if ${MK_LLVM_TARGET_BPF} != "no"
SRCS_MIN+= Target/BPF/AsmParser/BPFAsmParser.cpp
SRCS_MIN+= Target/BPF/BPFAbstractMemberAccess.cpp
+SRCS_MIN+= Target/BPF/BPFAdjustOpt.cpp
SRCS_MIN+= Target/BPF/BPFAsmPrinter.cpp
+SRCS_MIN+= Target/BPF/BPFCheckAndAdjustIR.cpp
SRCS_MIN+= Target/BPF/BPFFrameLowering.cpp
SRCS_MIN+= Target/BPF/BPFISelDAGToDAG.cpp
SRCS_MIN+= Target/BPF/BPFISelLowering.cpp
@@ -1260,6 +1292,7 @@ SRCS_MIN+= Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp
SRCS_MIN+= Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
SRCS_MIN+= Target/PowerPC/MCTargetDesc/PPCPredicates.cpp
SRCS_MIN+= Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp
+SRCS_MIN+= Target/PowerPC/MCTargetDesc/PPCXCOFFStreamer.cpp
SRCS_MIN+= Target/PowerPC/PPCAsmPrinter.cpp
SRCS_MIN+= Target/PowerPC/PPCBoolRetToInt.cpp
SRCS_MIN+= Target/PowerPC/PPCBranchCoalescing.cpp
@@ -1268,6 +1301,7 @@ SRCS_MIN+= Target/PowerPC/PPCCCState.cpp
SRCS_MIN+= Target/PowerPC/PPCCTRLoops.cpp
SRCS_MIN+= Target/PowerPC/PPCCallingConv.cpp
SRCS_MIN+= Target/PowerPC/PPCEarlyReturn.cpp
+SRCS_MIN+= Target/PowerPC/PPCExpandAtomicPseudoInsts.cpp
SRCS_MIN+= Target/PowerPC/PPCExpandISEL.cpp
SRCS_MIN+= Target/PowerPC/PPCFastISel.cpp
SRCS_MIN+= Target/PowerPC/PPCFrameLowering.cpp
@@ -1312,10 +1346,10 @@ SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.cpp
SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp
SRCS_MIN+= Target/RISCV/RISCVAsmPrinter.cpp
SRCS_MIN+= Target/RISCV/RISCVCallLowering.cpp
-SRCS_MIN+= Target/RISCV/RISCVCleanupVSETVLI.cpp
SRCS_MIN+= Target/RISCV/RISCVExpandAtomicPseudoInsts.cpp
SRCS_MIN+= Target/RISCV/RISCVExpandPseudoInsts.cpp
SRCS_MIN+= Target/RISCV/RISCVFrameLowering.cpp
+SRCS_MIN+= Target/RISCV/RISCVInsertVSETVLI.cpp
SRCS_MIN+= Target/RISCV/RISCVInstrInfo.cpp
SRCS_MIN+= Target/RISCV/RISCVInstructionSelector.cpp
SRCS_MIN+= Target/RISCV/RISCVISelDAGToDAG.cpp
@@ -1365,6 +1399,7 @@ SRCS_MIN+= Target/X86/X86DomainReassignment.cpp
SRCS_MIN+= Target/X86/X86EvexToVex.cpp
SRCS_MIN+= Target/X86/X86ExpandPseudo.cpp
SRCS_MIN+= Target/X86/X86FastISel.cpp
+SRCS_MIN+= Target/X86/X86FastTileConfig.cpp
SRCS_MIN+= Target/X86/X86FixupBWInsts.cpp
SRCS_MIN+= Target/X86/X86FixupLEAs.cpp
SRCS_MIN+= Target/X86/X86FixupSetCC.cpp
@@ -1386,13 +1421,16 @@ SRCS_MIN+= Target/X86/X86InterleavedAccess.cpp
SRCS_MIN+= Target/X86/X86LegalizerInfo.cpp
SRCS_MIN+= Target/X86/X86LoadValueInjectionLoadHardening.cpp
SRCS_MIN+= Target/X86/X86LoadValueInjectionRetHardening.cpp
+SRCS_MIN+= Target/X86/X86LowerAMXIntrinsics.cpp
SRCS_MIN+= Target/X86/X86LowerAMXType.cpp
+SRCS_MIN+= Target/X86/X86LowerTileCopy.cpp
SRCS_MIN+= Target/X86/X86MCInstLower.cpp
SRCS_MIN+= Target/X86/X86MachineFunctionInfo.cpp
SRCS_MIN+= Target/X86/X86MacroFusion.cpp
SRCS_MIN+= Target/X86/X86OptimizeLEAs.cpp
SRCS_MIN+= Target/X86/X86PadShortFunction.cpp
SRCS_MIN+= Target/X86/X86PartialReduction.cpp
+SRCS_MIN+= Target/X86/X86PreAMXConfig.cpp
SRCS_MIN+= Target/X86/X86PreTileConfig.cpp
SRCS_MIN+= Target/X86/X86RegisterBankInfo.cpp
SRCS_MIN+= Target/X86/X86RegisterInfo.cpp
@@ -1409,14 +1447,14 @@ SRCS_MIN+= Target/X86/X86VZeroUpper.cpp
SRCS_MIN+= Target/X86/X86WinAllocaExpander.cpp
SRCS_MIN+= Target/X86/X86WinEHState.cpp
.endif # MK_LLVM_TARGET_X86
-SRCS_MIW+= TextAPI/MachO/Architecture.cpp
-SRCS_MIW+= TextAPI/MachO/ArchitectureSet.cpp
-SRCS_MIW+= TextAPI/MachO/InterfaceFile.cpp
-SRCS_MIW+= TextAPI/MachO/PackedVersion.cpp
-SRCS_MIW+= TextAPI/MachO/Platform.cpp
-SRCS_MIW+= TextAPI/MachO/Target.cpp
-SRCS_MIW+= TextAPI/MachO/TextStub.cpp
-SRCS_MIW+= TextAPI/MachO/TextStubCommon.cpp
+SRCS_MIW+= TextAPI/Architecture.cpp
+SRCS_MIW+= TextAPI/ArchitectureSet.cpp
+SRCS_MIW+= TextAPI/InterfaceFile.cpp
+SRCS_MIW+= TextAPI/PackedVersion.cpp
+SRCS_MIW+= TextAPI/Platform.cpp
+SRCS_MIW+= TextAPI/Target.cpp
+SRCS_MIW+= TextAPI/TextStub.cpp
+SRCS_MIW+= TextAPI/TextStubCommon.cpp
SRCS_MIN+= ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
SRCS_MIW+= ToolDrivers/llvm-lib/LibDriver.cpp
SRCS_MIN+= Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
@@ -1428,7 +1466,6 @@ SRCS_MIN+= Transforms/Coroutines/CoroElide.cpp
SRCS_MIN+= Transforms/Coroutines/CoroFrame.cpp
SRCS_MIN+= Transforms/Coroutines/CoroSplit.cpp
SRCS_MIN+= Transforms/Coroutines/Coroutines.cpp
-SRCS_MIN+= Transforms/HelloNew/HelloWorld.cpp
SRCS_MIN+= Transforms/IPO/AlwaysInliner.cpp
SRCS_MIN+= Transforms/IPO/Annotation2Metadata.cpp
SRCS_MIN+= Transforms/IPO/ArgumentPromotion.cpp
@@ -1445,6 +1482,7 @@ SRCS_MIN+= Transforms/IPO/ExtractGV.cpp
SRCS_MIN+= Transforms/IPO/ForceFunctionAttrs.cpp
SRCS_MIN+= Transforms/IPO/FunctionAttrs.cpp
SRCS_MIN+= Transforms/IPO/FunctionImport.cpp
+SRCS_MIN+= Transforms/IPO/FunctionSpecialization.cpp
SRCS_MIN+= Transforms/IPO/GlobalDCE.cpp
SRCS_MIN+= Transforms/IPO/GlobalOpt.cpp
SRCS_MIN+= Transforms/IPO/GlobalSplit.cpp
@@ -1506,7 +1544,7 @@ SRCS_MIN+= Transforms/Instrumentation/SanitizerCoverage.cpp
SRCS_MIN+= Transforms/Instrumentation/ThreadSanitizer.cpp
SRCS_MIN+= Transforms/Instrumentation/ValueProfileCollector.cpp
SRCS_MIN+= Transforms/ObjCARC/DependencyAnalysis.cpp
-SRCS_EXT+= Transforms/ObjCARC/ObjCARC.cpp
+SRCS_MIN+= Transforms/ObjCARC/ObjCARC.cpp
SRCS_MIN+= Transforms/ObjCARC/ObjCARCAPElim.cpp
SRCS_MIN+= Transforms/ObjCARC/ObjCARCContract.cpp
SRCS_MIN+= Transforms/ObjCARC/ObjCARCExpand.cpp
@@ -1523,6 +1561,7 @@ SRCS_MIN+= Transforms/Scalar/ConstantHoisting.cpp
SRCS_MIN+= Transforms/Scalar/ConstraintElimination.cpp
SRCS_MIN+= Transforms/Scalar/CorrelatedValuePropagation.cpp
SRCS_MIN+= Transforms/Scalar/DCE.cpp
+SRCS_MIN+= Transforms/Scalar/DFAJumpThreading.cpp
SRCS_MIN+= Transforms/Scalar/DeadStoreElimination.cpp
SRCS_MIN+= Transforms/Scalar/DivRemPairs.cpp
SRCS_MIN+= Transforms/Scalar/EarlyCSE.cpp
@@ -1540,6 +1579,7 @@ SRCS_MIN+= Transforms/Scalar/InstSimplifyPass.cpp
SRCS_MIN+= Transforms/Scalar/JumpThreading.cpp
SRCS_MIN+= Transforms/Scalar/LICM.cpp
SRCS_MIN+= Transforms/Scalar/LoopAccessAnalysisPrinter.cpp
+SRCS_MIN+= Transforms/Scalar/LoopBoundSplit.cpp
SRCS_MIN+= Transforms/Scalar/LoopDataPrefetch.cpp
SRCS_MIN+= Transforms/Scalar/LoopDeletion.cpp
SRCS_MIN+= Transforms/Scalar/LoopDistribute.cpp
@@ -1586,7 +1626,6 @@ SRCS_MIN+= Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
SRCS_MIN+= Transforms/Scalar/SimpleLoopUnswitch.cpp
SRCS_MIN+= Transforms/Scalar/SimplifyCFGPass.cpp
SRCS_MIN+= Transforms/Scalar/Sink.cpp
-SRCS_MIN+= Transforms/Scalar/SpeculateAroundPHIs.cpp
SRCS_MIN+= Transforms/Scalar/SpeculativeExecution.cpp
SRCS_MIN+= Transforms/Scalar/StraightLineStrengthReduce.cpp
SRCS_MIN+= Transforms/Scalar/StructurizeCFG.cpp
@@ -1620,6 +1659,7 @@ SRCS_MIN+= Transforms/Utils/FunctionComparator.cpp
SRCS_MIN+= Transforms/Utils/FunctionImportUtils.cpp
SRCS_MIN+= Transforms/Utils/GlobalStatus.cpp
SRCS_MIN+= Transforms/Utils/GuardUtils.cpp
+SRCS_MIN+= Transforms/Utils/HelloWorld.cpp
SRCS_MIN+= Transforms/Utils/InjectTLIMappings.cpp
SRCS_MIN+= Transforms/Utils/InlineFunction.cpp
SRCS_MIN+= Transforms/Utils/InstructionNamer.cpp
@@ -1640,13 +1680,18 @@ SRCS_MIN+= Transforms/Utils/LowerSwitch.cpp
SRCS_MIN+= Transforms/Utils/MatrixUtils.cpp
SRCS_MIN+= Transforms/Utils/Mem2Reg.cpp
SRCS_MIN+= Transforms/Utils/MetaRenamer.cpp
+SRCS_MIN+= Transforms/Utils/MemoryOpRemark.cpp
SRCS_MIN+= Transforms/Utils/ModuleUtils.cpp
SRCS_MIN+= Transforms/Utils/NameAnonGlobals.cpp
SRCS_MIN+= Transforms/Utils/PredicateInfo.cpp
SRCS_MIN+= Transforms/Utils/PromoteMemoryToRegister.cpp
+SRCS_MIN+= Transforms/Utils/RelLookupTableConverter.cpp
+SRCS_MIN+= Transforms/Utils/SCCPSolver.cpp
SRCS_MIN+= Transforms/Utils/SSAUpdater.cpp
+SRCS_MIN+= Transforms/Utils/SSAUpdaterBulk.cpp
SRCS_MIN+= Transforms/Utils/SanitizerStats.cpp
SRCS_MIN+= Transforms/Utils/ScalarEvolutionExpander.cpp
+SRCS_MIN+= Transforms/Utils/SampleProfileLoaderBaseUtil.cpp
SRCS_MIN+= Transforms/Utils/SimplifyCFG.cpp
SRCS_MIN+= Transforms/Utils/SimplifyIndVar.cpp
SRCS_MIN+= Transforms/Utils/SimplifyLibCalls.cpp
@@ -1657,7 +1702,6 @@ SRCS_MIN+= Transforms/Utils/StripNonLineTableDebugInfo.cpp
SRCS_MIN+= Transforms/Utils/SymbolRewriter.cpp
SRCS_MIN+= Transforms/Utils/UnifyFunctionExitNodes.cpp
SRCS_MIN+= Transforms/Utils/UnifyLoopExits.cpp
-SRCS_MIN+= Transforms/Utils/UniqueInternalLinkageNames.cpp
SRCS_EXT+= Transforms/Utils/Utils.cpp
SRCS_MIN+= Transforms/Utils/VNCoercion.cpp
SRCS_MIN+= Transforms/Utils/ValueMapper.cpp
@@ -1721,7 +1765,7 @@ llvm/Frontend/OpenMP/OMP.h.inc: ${LLVM_SRCS}/include/llvm/Frontend/OpenMP/OMP.td
TGHDRS+= llvm/Frontend/OpenMP/OMP.h.inc
llvm/Frontend/OpenMP/OMP.inc: ${LLVM_SRCS}/include/llvm/Frontend/OpenMP/OMP.td
- ${LLVM_TBLGEN} --gen-directive-gen \
+ ${LLVM_TBLGEN} --gen-directive-impl \
-I ${LLVM_SRCS}/include -d ${.TARGET}.d -o ${.TARGET} \
${LLVM_SRCS}/include/llvm/Frontend/OpenMP/OMP.td
TGHDRS+= llvm/Frontend/OpenMP/OMP.inc
@@ -1804,6 +1848,7 @@ beforebuild:
InstrInfo/-gen-instr-info \
MCCodeEmitter/-gen-emitter \
MCPseudoLowering/-gen-pseudo-lowering \
+ O0PreLegalizeGICombiner/-gen-global-isel-combiner,-combiners=${arch:H}O0PreLegalizerCombinerHelper \
PostLegalizeGICombiner/-gen-global-isel-combiner,-combiners=${arch:H}PostLegalizerCombinerHelper \
PostLegalizeGILowering/-gen-global-isel-combiner,-combiners=${arch:H}PostLegalizerLoweringHelper \
PreLegalizeGICombiner/-gen-global-isel-combiner,-combiners=${arch:H}PreLegalizerCombinerHelper \
@@ -1832,6 +1877,7 @@ TGHDRS+= AArch64GenGlobalISel.inc
TGHDRS+= AArch64GenInstrInfo.inc
TGHDRS+= AArch64GenMCCodeEmitter.inc
TGHDRS+= AArch64GenMCPseudoLowering.inc
+TGHDRS+= AArch64GenO0PreLegalizeGICombiner.inc
TGHDRS+= AArch64GenPostLegalizeGICombiner.inc
TGHDRS+= AArch64GenPostLegalizeGILowering.inc
TGHDRS+= AArch64GenPreLegalizeGICombiner.inc
diff --git a/lib/clang/libllvmminimal/Makefile b/lib/clang/libllvmminimal/Makefile
index c84f5036cb15..e4f2d19bbb69 100644
--- a/lib/clang/libllvmminimal/Makefile
+++ b/lib/clang/libllvmminimal/Makefile
@@ -18,12 +18,14 @@ SRCS+= Support/ConvertUTF.cpp
SRCS+= Support/ConvertUTFWrapper.cpp
SRCS+= Support/CrashRecoveryContext.cpp
SRCS+= Support/Debug.cpp
+SRCS+= Support/DebugCounter.cpp
SRCS+= Support/Errno.cpp
SRCS+= Support/Error.cpp
SRCS+= Support/ErrorHandling.cpp
SRCS+= Support/FoldingSet.cpp
SRCS+= Support/FormatVariadic.cpp
SRCS+= Support/FormattedStream.cpp
+SRCS+= Support/GraphWriter.cpp
SRCS+= Support/Hashing.cpp
SRCS+= Support/Host.cpp
SRCS+= Support/InitLLVM.cpp
@@ -40,6 +42,7 @@ SRCS+= Support/Path.cpp
SRCS+= Support/PrettyStackTrace.cpp
SRCS+= Support/Process.cpp
SRCS+= Support/Program.cpp
+SRCS+= Support/RandomNumberGenerator.cpp
SRCS+= Support/Regex.cpp
SRCS+= Support/Signals.cpp
SRCS+= Support/Signposts.cpp
@@ -57,6 +60,7 @@ SRCS+= Support/Timer.cpp
SRCS+= Support/ToolOutputFile.cpp
SRCS+= Support/Triple.cpp
SRCS+= Support/Twine.cpp
+SRCS+= Support/TypeSize.cpp
SRCS+= Support/Unicode.cpp
SRCS+= Support/VirtualFileSystem.cpp
SRCS+= Support/Watchdog.cpp
diff --git a/lib/csu/Makefile.inc b/lib/csu/Makefile.inc
index 31c1bcbd7278..1633fa3dc3ea 100644
--- a/lib/csu/Makefile.inc
+++ b/lib/csu/Makefile.inc
@@ -19,6 +19,7 @@ CRT1OBJS+= crtbrand.o feature_note.o ignore_init_note.o
ACFLAGS+= -DLOCORE
+CFLAGS+= -DSTRIP_FBSDID
CFLAGS+= -fno-asynchronous-unwind-tables
CFLAGS+= -fno-omit-frame-pointer
CFLAGS+= -I${.CURDIR:H}/common \
diff --git a/lib/csu/mips/Makefile b/lib/csu/mips/Makefile
deleted file mode 100644
index 372f98d5b18e..000000000000
--- a/lib/csu/mips/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-# $FreeBSD$
-
-.PATH: ${.CURDIR:H}/common
-
-.include <src.opts.mk>
-
-CFLAGS+= -DCRT_IRELOC_SUPPRESS
-
-.if ${MACHINE_ARCH:Mmips64}
-ELFCLASS= 64
-.else
-ELFCLASS= 32
-.endif
-.if ${MACHINE_ARCH:Mmips*el}
-ENDIAN= l
-.else
-ENDIAN= b
-.endif
-.if ${MACHINE_ARCH:Mmipsn32*}
-SUFFIX= n32
-.else
-SUFFIX=
-.endif
-
-# binutils requires an explicit emulation for ld -r
-LDFLAGS.bfd+= -Wl,-m -Wl,elf${ELFCLASS}${ENDIAN}tsmip${SUFFIX}_fbsd
-
-.include <bsd.lib.mk>
diff --git a/lib/csu/mips/Makefile.depend b/lib/csu/mips/Makefile.depend
deleted file mode 100644
index 79506ce16b79..000000000000
--- a/lib/csu/mips/Makefile.depend
+++ /dev/null
@@ -1,12 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- include \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/lib/csu/mips/crt1_c.c b/lib/csu/mips/crt1_c.c
deleted file mode 100644
index b753f7b707bd..000000000000
--- a/lib/csu/mips/crt1_c.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-4-Clause
- *
- * Copyright 1996-1998 John D. Polstra.
- * All rights reserved.
- * Copyright (c) 1995 Christopher G. Demetriou
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Christopher G. Demetriou
- * for the NetBSD Project.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stdlib.h>
-#include "libc_private.h"
-#include "ignore_init.c"
-
-struct Struct_Obj_Entry;
-struct ps_strings;
-
-#ifdef GCRT
-extern void _mcleanup(void);
-extern void monstartup(void *, void *);
-extern int eprol;
-extern int etext;
-#endif
-
-void __start(char **, void (*)(void), struct Struct_Obj_Entry *, struct ps_strings *);
-
-/* The entry function. */
-void
-__start(char **ap,
- void (*cleanup)(void), /* from shared loader */
- struct Struct_Obj_Entry *obj __unused, /* from shared loader */
- struct ps_strings *ps_strings __unused)
-{
- int argc;
- char **argv;
- char **env;
-
- argc = * (long *) ap;
- argv = ap + 1;
- env = ap + 2 + argc;
- handle_argv(argc, argv, env);
-
- if (&_DYNAMIC != NULL)
- atexit(cleanup);
- else
- _init_tls();
-
-#ifdef GCRT
- atexit(_mcleanup);
- monstartup(&eprol, &etext);
-#endif
-
- handle_static_init(argc, argv, env);
- exit(main(argc, argv, env));
-}
-
-#ifdef GCRT
-__asm__(".text");
-__asm__("eprol:");
-__asm__(".previous");
-#endif
diff --git a/lib/csu/mips/crti.S b/lib/csu/mips/crti.S
deleted file mode 100644
index 7289f0a91f47..000000000000
--- a/lib/csu/mips/crti.S
+++ /dev/null
@@ -1,53 +0,0 @@
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#ifndef __clang__
- .gnu_attribute 4, 0
-#endif
- .section .init,"ax",%progbits
- .align 4
- .globl _init
- .type _init,%function
-_init:
- .set noreorder
-#if defined(__ABICALLS__) && (defined(__mips_o32) || defined(__mips_o64))
- SETUP_GP
-#endif
- PTR_ADDU sp, sp, -CALLFRAME_SIZ
- REG_S ra, CALLFRAME_RA(sp)
-#if defined(__ABICALLS__)
-#if defined(__mips_o32) || defined(__mips_o64)
- SAVE_GP(CALLFRAME_GP)
-#else
- SETUP_GP64(CALLFRAME_GP, _init)
-#endif
-#else /* __ABICALLS__ */
-#if defined(__mips_n32) || defined(__mips_n64)
- REG_S gp, CALLFRAME_GP(sp)
-#endif
-#endif
- .set reorder
-
- .section .fini,"ax",%progbits
- .align 4
- .globl _fini
- .type _fini,%function
-_fini:
- .set noreorder
-#if defined(__ABICALLS__) && (defined(__mips_o32) || defined(__mips_o64))
- SETUP_GP
-#endif
- PTR_ADDU sp, sp, -CALLFRAME_SIZ
- REG_S ra, CALLFRAME_RA(sp)
-#if defined(__ABICALLS__)
-#if defined(__mips_o32) || defined(__mips_o64)
- SAVE_GP(CALLFRAME_GP)
-#else
- SETUP_GP64(CALLFRAME_GP, _fini)
-#endif
-#else /* __ABICALLS__ */
-#if defined(__mips_n32) || defined(__mips_n64)
- REG_S gp, CALLFRAME_GP(sp)
-#endif
-#endif
- .set reorder
diff --git a/lib/csu/mips/crtn.S b/lib/csu/mips/crtn.S
deleted file mode 100644
index db03f6c65d20..000000000000
--- a/lib/csu/mips/crtn.S
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#ifndef __clang__
- .gnu_attribute 4, 0
-#endif
- .section .init,"ax",%progbits
- .set noreorder
-#if defined(__ABICALLS__) && (defined(__mips_n32) || defined(__mips_n64))
- REG_L gp, CALLFRAME_GP(sp)
-#endif
- REG_L ra, CALLFRAME_RA(sp)
- jr ra
- PTR_ADDU sp, sp, CALLFRAME_SIZ
- .set reorder
-
- .section .fini,"ax",%progbits
- .set noreorder
-#if defined(__ABICALLS__) && (defined(__mips_n32) || defined(__mips_n64))
- REG_L gp, CALLFRAME_GP(sp)
-#endif
- REG_L ra, CALLFRAME_RA(sp)
- jr ra
- PTR_ADDU sp, sp, CALLFRAME_SIZ
- .set reorder
diff --git a/lib/geom/multipath/gmultipath.8 b/lib/geom/multipath/gmultipath.8
index f6e286a43c72..53761455080d 100644
--- a/lib/geom/multipath/gmultipath.8
+++ b/lib/geom/multipath/gmultipath.8
@@ -230,7 +230,7 @@ criteria across multiple underlying transport types that can
identity, but in all respects such identity can rarely be considered
.Ar definitive .
.Pp
-For example, if you use the World Word Port Name of a Fibre Channel
+For example, if you use the World Wide Port Name of a Fibre Channel
disk object you might believe that two disks that have the same WWPN
on different paths (or even disjoint fabrics) might be considered
the same disk.
diff --git a/lib/geom/part/gpart.8 b/lib/geom/part/gpart.8
index d27844f709e9..e71ba0e928a6 100644
--- a/lib/geom/part/gpart.8
+++ b/lib/geom/part/gpart.8
@@ -605,6 +605,10 @@ Requires the
.Cm GEOM_PART_VTOC8
kernel option.
.El
+.Pp
+See
+.Xr glabel 8
+for additional information on labelization of devices and partitions.
.Sh PARTITION TYPES
Partition types are identified on disk by particular strings or magic
values.
@@ -1507,6 +1511,7 @@ and
.Xr geom 4 ,
.Xr boot0cfg 8 ,
.Xr geom 8 ,
+.Xr glabel 8 ,
.Xr gptboot 8
.Sh HISTORY
The
diff --git a/lib/libbe/Makefile b/lib/libbe/Makefile
index 50a8f8f56fb2..3c66ea9f1cf0 100644
--- a/lib/libbe/Makefile
+++ b/lib/libbe/Makefile
@@ -63,7 +63,10 @@ CFLAGS+= -I${SRCTOP}/sys
CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
CFLAGS+= -DHAVE_ISSETUGID
-
+CFLAGS.be.c= -Wno-cast-qual
+CFLAGS.be_access.c= -Wno-cast-qual
+CFLAGS.be_error.c= -Wno-cast-qual
+CFLAGS.be_info.c= -Wno-cast-qual
HAS_TESTS= YES
SUBDIR.${MK_TESTS}+= tests
diff --git a/lib/libbsddialog/Makefile b/lib/libbsddialog/Makefile
new file mode 100644
index 000000000000..95f8fad115a4
--- /dev/null
+++ b/lib/libbsddialog/Makefile
@@ -0,0 +1,28 @@
+BSDDIALOG= ${SRCTOP}/contrib/bsddialog
+
+.PATH: ${BSDDIALOG}/lib
+
+LIB= bsddialog
+PRIVATELIB= yes
+SHLIB_MAJOR= 0
+SRCS= barbox.c \
+ formbox.c \
+ infobox.c \
+ lib_util.c \
+ lib_util.h \
+ libbsddialog.c \
+ menubox.c \
+ messagebox.c \
+ textbox.c \
+ theme.c \
+ timebox.c
+INCS= bsddialog.h \
+ bsddialog_theme.h \
+ bsddialog_progressview.h
+MAN= bsddialog.3
+
+LIBADD= ncursesw tinfow formw
+
+WARNS= 2
+
+.include <bsd.lib.mk>
diff --git a/lib/libc++/Makefile b/lib/libc++/Makefile
index f47e7b594241..dda8bc1772c9 100644
--- a/lib/libc++/Makefile
+++ b/lib/libc++/Makefile
@@ -1,5 +1,7 @@
# $FreeBSD$
+SHLIBDIR?= /lib
+
.include <src.opts.mk>
PACKAGE= clibs
@@ -28,6 +30,7 @@ SRCS+= exception.cpp
SRCS+= filesystem/directory_iterator.cpp
SRCS+= filesystem/int128_builtins.cpp
SRCS+= filesystem/operations.cpp
+SRCS+= format.cpp
SRCS+= functional.cpp
SRCS+= future.cpp
SRCS+= hash.cpp
@@ -73,6 +76,7 @@ cxxrt_${_S}: ${_LIBCXXRTDIR}/${_S} .NOMETA
.endfor
WARNS?= 0
+CFLAGS+= -isystem ${.CURDIR}
CFLAGS+= -isystem ${HDRDIR}
CFLAGS+= -isystem ${_LIBCXXRTDIR}
CFLAGS+= -nostdinc++
@@ -84,18 +88,19 @@ CFLAGS+= -fdata-sections
CXXSTD?= c++14
LIBADD+= cxxrt
-INCSGROUPS= STD MEM EXP EXT
+INCSGROUPS+= STD
+STDDIR= ${CXXINCLUDEDIR}
STD_HEADERS+= __availability
STD_HEADERS+= __bit_reference
STD_HEADERS+= __bits
STD_HEADERS+= __bsd_locale_defaults.h
STD_HEADERS+= __bsd_locale_fallbacks.h
+STD_HEADERS+= __config
STD_HEADERS+= __debug
STD_HEADERS+= __errc
-STD_HEADERS+= __functional_03
+STD_HEADERS+= __function_like.h
STD_HEADERS+= __functional_base
-STD_HEADERS+= __functional_base_03
STD_HEADERS+= __hash_table
STD_HEADERS+= __libcpp_version
STD_HEADERS+= __locale
@@ -103,7 +108,6 @@ STD_HEADERS+= __mutex_base
STD_HEADERS+= __node_handle
STD_HEADERS+= __nullptr
STD_HEADERS+= __split_buffer
-STD_HEADERS+= __sso_allocator
STD_HEADERS+= __std_stream
STD_HEADERS+= __string
STD_HEADERS+= __threading_support
@@ -157,6 +161,7 @@ STD_HEADERS+= execution
STD_HEADERS+= fenv.h
STD_HEADERS+= filesystem
STD_HEADERS+= float.h
+STD_HEADERS+= format
STD_HEADERS+= forward_list
STD_HEADERS+= fstream
STD_HEADERS+= functional
@@ -178,6 +183,7 @@ STD_HEADERS+= locale.h
STD_HEADERS+= map
STD_HEADERS+= math.h
STD_HEADERS+= memory
+STD_HEADERS+= module.modulemap
STD_HEADERS+= mutex
STD_HEADERS+= new
STD_HEADERS+= numbers
@@ -186,6 +192,7 @@ STD_HEADERS+= optional
STD_HEADERS+= ostream
STD_HEADERS+= queue
STD_HEADERS+= random
+STD_HEADERS+= ranges
STD_HEADERS+= ratio
STD_HEADERS+= regex
STD_HEADERS+= scoped_allocator
@@ -223,41 +230,279 @@ STD_HEADERS+= vector
STD_HEADERS+= version
STD_HEADERS+= wchar.h
STD_HEADERS+= wctype.h
+.for hdr in ${STD_HEADERS}
+STD+= ${HDRDIR}/${hdr}
+.endfor
+
+# Special case for __config_site, which as of libc++ 12.0.0 is generated by
+# CMake, and as of 13.0.0 installed side-by-side with__config.
+STD+= ${.CURDIR}/__config_site
RT_HEADERS+= cxxabi.h
RT_HEADERS+= unwind-arm.h
RT_HEADERS+= unwind-itanium.h
RT_HEADERS+= unwind.h
-
-.for hdr in ${STD_HEADERS}
-STD+= ${HDRDIR}/${hdr}
-INCSLINKS+= ../${hdr} ${CXXINCLUDEDIR}/tr1/${hdr}
-.endfor
.for hdr in ${RT_HEADERS}
STD+= ${_LIBCXXRTDIR}/${hdr}
.endfor
-STDDIR= ${CXXINCLUDEDIR}
-# Special case for __config, which as of libc++ 12.0.0 is produced by
-# concatenating the locally generated __config_site and the upstream __config
-# files.
-CONFIG_HEADER= __config
+INCSGROUPS+= ALG
+ALGDIR= ${CXXINCLUDEDIR}/__algorithm
+ALG_HEADERS+= adjacent_find.h
+ALG_HEADERS+= all_of.h
+ALG_HEADERS+= any_of.h
+ALG_HEADERS+= binary_search.h
+ALG_HEADERS+= clamp.h
+ALG_HEADERS+= comp.h
+ALG_HEADERS+= comp_ref_type.h
+ALG_HEADERS+= copy.h
+ALG_HEADERS+= copy_backward.h
+ALG_HEADERS+= copy_if.h
+ALG_HEADERS+= copy_n.h
+ALG_HEADERS+= count.h
+ALG_HEADERS+= count_if.h
+ALG_HEADERS+= equal.h
+ALG_HEADERS+= equal_range.h
+ALG_HEADERS+= fill.h
+ALG_HEADERS+= fill_n.h
+ALG_HEADERS+= find.h
+ALG_HEADERS+= find_end.h
+ALG_HEADERS+= find_first_of.h
+ALG_HEADERS+= find_if.h
+ALG_HEADERS+= find_if_not.h
+ALG_HEADERS+= for_each.h
+ALG_HEADERS+= for_each_n.h
+ALG_HEADERS+= generate.h
+ALG_HEADERS+= generate_n.h
+ALG_HEADERS+= half_positive.h
+ALG_HEADERS+= includes.h
+ALG_HEADERS+= inplace_merge.h
+ALG_HEADERS+= is_heap.h
+ALG_HEADERS+= is_heap_until.h
+ALG_HEADERS+= is_partitioned.h
+ALG_HEADERS+= is_permutation.h
+ALG_HEADERS+= is_sorted.h
+ALG_HEADERS+= is_sorted_until.h
+ALG_HEADERS+= iter_swap.h
+ALG_HEADERS+= lexicographical_compare.h
+ALG_HEADERS+= lower_bound.h
+ALG_HEADERS+= make_heap.h
+ALG_HEADERS+= max.h
+ALG_HEADERS+= max_element.h
+ALG_HEADERS+= merge.h
+ALG_HEADERS+= min.h
+ALG_HEADERS+= min_element.h
+ALG_HEADERS+= minmax.h
+ALG_HEADERS+= minmax_element.h
+ALG_HEADERS+= mismatch.h
+ALG_HEADERS+= move.h
+ALG_HEADERS+= move_backward.h
+ALG_HEADERS+= next_permutation.h
+ALG_HEADERS+= none_of.h
+ALG_HEADERS+= nth_element.h
+ALG_HEADERS+= partial_sort.h
+ALG_HEADERS+= partial_sort_copy.h
+ALG_HEADERS+= partition.h
+ALG_HEADERS+= partition_copy.h
+ALG_HEADERS+= partition_point.h
+ALG_HEADERS+= pop_heap.h
+ALG_HEADERS+= prev_permutation.h
+ALG_HEADERS+= push_heap.h
+ALG_HEADERS+= remove.h
+ALG_HEADERS+= remove_copy.h
+ALG_HEADERS+= remove_copy_if.h
+ALG_HEADERS+= remove_if.h
+ALG_HEADERS+= replace.h
+ALG_HEADERS+= replace_copy.h
+ALG_HEADERS+= replace_copy_if.h
+ALG_HEADERS+= replace_if.h
+ALG_HEADERS+= reverse.h
+ALG_HEADERS+= reverse_copy.h
+ALG_HEADERS+= rotate.h
+ALG_HEADERS+= rotate_copy.h
+ALG_HEADERS+= sample.h
+ALG_HEADERS+= search.h
+ALG_HEADERS+= search_n.h
+ALG_HEADERS+= set_difference.h
+ALG_HEADERS+= set_intersection.h
+ALG_HEADERS+= set_symmetric_difference.h
+ALG_HEADERS+= set_union.h
+ALG_HEADERS+= shift_left.h
+ALG_HEADERS+= shift_right.h
+ALG_HEADERS+= shuffle.h
+ALG_HEADERS+= sift_down.h
+ALG_HEADERS+= sort.h
+ALG_HEADERS+= sort_heap.h
+ALG_HEADERS+= stable_partition.h
+ALG_HEADERS+= stable_sort.h
+ALG_HEADERS+= swap_ranges.h
+ALG_HEADERS+= transform.h
+ALG_HEADERS+= unique.h
+ALG_HEADERS+= unique_copy.h
+ALG_HEADERS+= unwrap_iter.h
+ALG_HEADERS+= upper_bound.h
+.for hdr in ${ALG_HEADERS}
+ALG+= ${HDRDIR}/__algorithm/${hdr}
+.endfor
+
+INCSGROUPS+= FMT
+FMTDIR= ${CXXINCLUDEDIR}/__format
+FMT_HEADERS+= format_error.h
+FMT_HEADERS+= format_parse_context.h
+.for hdr in ${FMT_HEADERS}
+FMT+= ${HDRDIR}/__format/${hdr}
+.endfor
+
+INCSGROUPS+= FUN
+FUNDIR= ${CXXINCLUDEDIR}/__functional
+FUN_HEADERS+= binary_function.h
+FUN_HEADERS+= binary_negate.h
+FUN_HEADERS+= bind.h
+FUN_HEADERS+= bind_front.h
+FUN_HEADERS+= binder1st.h
+FUN_HEADERS+= binder2nd.h
+FUN_HEADERS+= default_searcher.h
+FUN_HEADERS+= function.h
+FUN_HEADERS+= hash.h
+FUN_HEADERS+= identity.h
+FUN_HEADERS+= invoke.h
+FUN_HEADERS+= is_transparent.h
+FUN_HEADERS+= mem_fn.h
+FUN_HEADERS+= mem_fun_ref.h
+FUN_HEADERS+= not_fn.h
+FUN_HEADERS+= operations.h
+FUN_HEADERS+= perfect_forward.h
+FUN_HEADERS+= pointer_to_binary_function.h
+FUN_HEADERS+= pointer_to_unary_function.h
+FUN_HEADERS+= ranges_operations.h
+FUN_HEADERS+= reference_wrapper.h
+FUN_HEADERS+= unary_function.h
+FUN_HEADERS+= unary_negate.h
+FUN_HEADERS+= unwrap_ref.h
+FUN_HEADERS+= weak_result_type.h
+.for hdr in ${FUN_HEADERS}
+FUN+= ${HDRDIR}/__functional/${hdr}
+.endfor
-${CONFIG_HEADER}: ${.CURDIR}/__config_site ${HDRDIR}/__config
- cat ${.ALLSRC} > ${.TARGET}
-STD+= ${CONFIG_HEADER}
-CLEANFILES+= ${CONFIG_HEADER}
+INCSGROUPS+= IT
+ITDIR= ${CXXINCLUDEDIR}/__iterator
+IT_HEADERS+= access.h
+IT_HEADERS+= advance.h
+IT_HEADERS+= back_insert_iterator.h
+IT_HEADERS+= common_iterator.h
+IT_HEADERS+= concepts.h
+IT_HEADERS+= counted_iterator.h
+IT_HEADERS+= data.h
+IT_HEADERS+= default_sentinel.h
+IT_HEADERS+= distance.h
+IT_HEADERS+= empty.h
+IT_HEADERS+= erase_if_container.h
+IT_HEADERS+= front_insert_iterator.h
+IT_HEADERS+= incrementable_traits.h
+IT_HEADERS+= insert_iterator.h
+IT_HEADERS+= istream_iterator.h
+IT_HEADERS+= istreambuf_iterator.h
+IT_HEADERS+= iter_move.h
+IT_HEADERS+= iter_swap.h
+IT_HEADERS+= iterator.h
+IT_HEADERS+= iterator_traits.h
+IT_HEADERS+= move_iterator.h
+IT_HEADERS+= next.h
+IT_HEADERS+= ostream_iterator.h
+IT_HEADERS+= ostreambuf_iterator.h
+IT_HEADERS+= prev.h
+IT_HEADERS+= projected.h
+IT_HEADERS+= readable_traits.h
+IT_HEADERS+= reverse_access.h
+IT_HEADERS+= reverse_iterator.h
+IT_HEADERS+= size.h
+IT_HEADERS+= wrap_iter.h
+.for hdr in ${IT_HEADERS}
+IT+= ${HDRDIR}/__iterator/${hdr}
+.endfor
+INCSGROUPS+= MEM
+MEMDIR= ${CXXINCLUDEDIR}/__memory
+MEM_HEADERS+= addressof.h
+MEM_HEADERS+= allocation_guard.h
+MEM_HEADERS+= allocator.h
+MEM_HEADERS+= allocator_arg_t.h
MEM_HEADERS+= allocator_traits.h
-MEM_HEADERS+= base.h
+MEM_HEADERS+= auto_ptr.h
+MEM_HEADERS+= compressed_pair.h
+MEM_HEADERS+= construct_at.h
+MEM_HEADERS+= pointer_safety.h
MEM_HEADERS+= pointer_traits.h
-MEM_HEADERS+= utilities.h
-
+MEM_HEADERS+= raw_storage_iterator.h
+MEM_HEADERS+= shared_ptr.h
+MEM_HEADERS+= temporary_buffer.h
+MEM_HEADERS+= uninitialized_algorithms.h
+MEM_HEADERS+= unique_ptr.h
+MEM_HEADERS+= uses_allocator.h
.for hdr in ${MEM_HEADERS}
MEM+= ${HDRDIR}/__memory/${hdr}
.endfor
-MEMDIR= ${CXXINCLUDEDIR}/__memory
+INCSGROUPS+= RND
+RNDDIR= ${CXXINCLUDEDIR}/__random
+RND_HEADERS+= uniform_int_distribution.h
+.for hdr in ${RND_HEADERS}
+RND+= ${HDRDIR}/__random/${hdr}
+.endfor
+
+INCSGROUPS+= RNG
+RNGDIR= ${CXXINCLUDEDIR}/__ranges
+RNG_HEADERS+= access.h
+RNG_HEADERS+= all.h
+RNG_HEADERS+= common_view.h
+RNG_HEADERS+= concepts.h
+RNG_HEADERS+= copyable_box.h
+RNG_HEADERS+= dangling.h
+RNG_HEADERS+= data.h
+RNG_HEADERS+= drop_view.h
+RNG_HEADERS+= empty.h
+RNG_HEADERS+= empty_view.h
+RNG_HEADERS+= enable_borrowed_range.h
+RNG_HEADERS+= enable_view.h
+RNG_HEADERS+= non_propagating_cache.h
+RNG_HEADERS+= ref_view.h
+RNG_HEADERS+= size.h
+RNG_HEADERS+= subrange.h
+RNG_HEADERS+= transform_view.h
+RNG_HEADERS+= view_interface.h
+.for hdr in ${RNG_HEADERS}
+RNG+= ${HDRDIR}/__ranges/${hdr}
+.endfor
+
+INCSGROUPS+= UTL
+UTLDIR= ${CXXINCLUDEDIR}/__utility
+UTL_HEADERS+= __decay_copy.h
+UTL_HEADERS+= as_const.h
+UTL_HEADERS+= cmp.h
+UTL_HEADERS+= declval.h
+UTL_HEADERS+= exchange.h
+UTL_HEADERS+= forward.h
+UTL_HEADERS+= in_place.h
+UTL_HEADERS+= integer_sequence.h
+UTL_HEADERS+= move.h
+UTL_HEADERS+= pair.h
+UTL_HEADERS+= piecewise_construct.h
+UTL_HEADERS+= rel_ops.h
+UTL_HEADERS+= swap.h
+UTL_HEADERS+= to_underlying.h
+.for hdr in ${UTL_HEADERS}
+UTL+= ${HDRDIR}/__utility/${hdr}
+.endfor
+
+INCSGROUPS+= VAR
+VAR_HEADERS+= monostate.h
+VARDIR= ${CXXINCLUDEDIR}/__variant
+.for hdr in ${VAR_HEADERS}
+VAR+= ${HDRDIR}/__variant/${hdr}
+.endfor
+
+INCSGROUPS+= EXP
+EXPDIR= ${CXXINCLUDEDIR}/experimental
EXP_HEADERS+= __config
EXP_HEADERS+= __memory
EXP_HEADERS+= algorithm
@@ -280,19 +525,17 @@ EXP_HEADERS+= unordered_map
EXP_HEADERS+= unordered_set
EXP_HEADERS+= utility
EXP_HEADERS+= vector
-
.for hdr in ${EXP_HEADERS}
EXP+= ${HDRDIR}/experimental/${hdr}
.endfor
-EXPDIR= ${CXXINCLUDEDIR}/experimental
+INCSGROUPS+= EXT
+EXTDIR= ${CXXINCLUDEDIR}/ext
EXT_HEADERS+= __hash
EXT_HEADERS+= hash_map
EXT_HEADERS+= hash_set
-
.for hdr in ${EXT_HEADERS}
EXT+= ${HDRDIR}/ext/${hdr}
.endfor
-EXTDIR= ${CXXINCLUDEDIR}/ext
.include <bsd.lib.mk>
diff --git a/lib/libc++/__config_site b/lib/libc++/__config_site
index 0030c2aed2d6..cb195721d10e 100644
--- a/lib/libc++/__config_site
+++ b/lib/libc++/__config_site
@@ -34,6 +34,8 @@
/* #undef _LIBCPP_HAS_PARALLEL_ALGORITHMS */
/* #undef _LIBCPP_HAS_NO_RANDOM_DEVICE */
/* #undef _LIBCPP_HAS_NO_LOCALIZATION */
+/* #undef _LIBCPP_HAS_NO_INCOMPLETE_FORMAT */
+/* #undef _LIBCPP_HAS_NO_INCOMPLETE_RANGES */
diff --git a/lib/libc++experimental/Makefile b/lib/libc++experimental/Makefile
index f3b17c5cff9a..5861c78f6122 100644
--- a/lib/libc++experimental/Makefile
+++ b/lib/libc++experimental/Makefile
@@ -15,6 +15,7 @@ SRCS+= memory_resource.cpp
WARNS?= 0
CXXFLAGS+= ${PICFLAG}
+CFLAGS+= -isystem ${.CURDIR}/../libc++
CXXFLAGS+= -isystem ${SRCDIR}/include
CXXFLAGS+= -nostdinc++
CXXFLAGS+= -nostdlib
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index fdf6aa49932b..b6e4dd1787b4 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -111,9 +111,7 @@ NOASM=
.if ${LIBC_ARCH} != "aarch64" && \
${LIBC_ARCH} != "amd64" && \
${LIBC_ARCH} != "powerpc64" && \
- ${LIBC_ARCH} != "riscv" && \
- ${MACHINE_ARCH:Mmipsn32*} == "" && \
- ${MACHINE_ARCH:Mmips64*} == ""
+ ${LIBC_ARCH} != "riscv"
.include "${LIBC_SRCTOP}/quad/Makefile.inc"
.endif
.include "${LIBC_SRCTOP}/regex/Makefile.inc"
@@ -130,7 +128,6 @@ NOASM=
.include "${LIBC_SRCTOP}/xdr/Makefile.inc"
.if (${LIBC_ARCH} == "arm" && \
(${MACHINE_ARCH:Marmv[67]*} == "" || (defined(CPUTYPE) && ${CPUTYPE:M*soft*}))) || \
- (${LIBC_ARCH} == "mips" && ${MACHINE_ARCH:Mmips*hf} == "") || \
(${LIBC_ARCH} == "riscv" && ${MACHINE_ARCH:Mriscv*sf} != "")
.include "${LIBC_SRCTOP}/softfloat/Makefile.inc"
.endif
diff --git a/lib/libc/aarch64/Symbol.map b/lib/libc/aarch64/Symbol.map
index d9121798140c..4214db12ed5f 100644
--- a/lib/libc/aarch64/Symbol.map
+++ b/lib/libc/aarch64/Symbol.map
@@ -32,6 +32,5 @@ FBSD_1.0 {
};
FBSDprivate_1.0 {
- _set_tp;
__makecontext;
};
diff --git a/lib/libc/aarch64/gen/Makefile.inc b/lib/libc/aarch64/gen/Makefile.inc
index 7c530b93b4e4..138ffe03f5e9 100644
--- a/lib/libc/aarch64/gen/Makefile.inc
+++ b/lib/libc/aarch64/gen/Makefile.inc
@@ -7,12 +7,10 @@ SRCS+= _ctx_start.S \
flt_rounds.c \
fpgetmask.c \
fpsetmask.c \
- _get_tp.c \
infinity.c \
ldexp.c \
makecontext.c \
_setjmp.S \
- _set_tp.c \
setjmp.S \
sigsetjmp.S \
trivial-getcontextx.c
diff --git a/lib/libc/aarch64/gen/_set_tp.c b/lib/libc/aarch64/gen/_set_tp.c
deleted file mode 100644
index 871acb3001a3..000000000000
--- a/lib/libc/aarch64/gen/_set_tp.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*-
- * Copyright (c) 2014 Andrew Turner
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <string.h>
-#include <sys/types.h>
-
-#include <machine/sysarch.h>
-
-#include <stdlib.h>
-#include "libc_private.h"
-
-void
-_set_tp(void *tp)
-{
-
- asm volatile("msr tpidr_el0, %0" : : "r"(tp));
-}
diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc
index 5ce355f8b0c1..0e1f0f4b84e2 100644
--- a/lib/libc/aarch64/string/Makefile.inc
+++ b/lib/libc/aarch64/string/Makefile.inc
@@ -1,20 +1,41 @@
# $FreeBSD$
#
-# String handling from the Cortex Strings library
-# https://git.linaro.org/toolchain/cortex-strings.git
+# String handling from the Arm Optimized Routines
+# https://github.com/ARM-software/optimized-routines
#
-.PATH: ${SRCTOP}/contrib/cortex-strings/src/aarch64
+AARCH64_STRING_FUNCS= \
+ memchr \
+ memcmp \
+ memcpy \
+ memmove \
+ memrchr \
+ memset \
+ stpcpy \
+ strchr \
+ strchrnul \
+ strcmp \
+ strcpy \
+ strlen \
+ strncmp \
+ strnlen \
+ strrchr
-MDSRCS+= \
- memchr.S \
- memcmp.S \
- memcpy.S \
- memmove.S \
- memset.S \
- strchr.S \
- strcmp.S \
- strcpy.S \
- strlen.S \
- strncmp.S \
- strnlen.S
+#
+# Add the above functions. Generate an asm file that includes the needed
+# Arm Optimized Routines file defining the function name to the libc name.
+# Some file need multiple macros defined or a weak symbol added we can
+# override the generated file in these cases.
+#
+.for FUNC in ${AARCH64_STRING_FUNCS}
+.if !exists(${FUNC}.S)
+${FUNC}.S:
+ printf '/* %sgenerated by libc/aarch64/string/Makefile.inc */\n' @ > ${.TARGET}
+ printf '#define __%s_aarch64 %s\n' ${FUNC} ${FUNC} >> ${.TARGET}
+ printf '#include "aarch64/%s.S"\n' ${FUNC} >> ${.TARGET}
+CLEANFILES+= ${FUNC}.S
+.endif
+
+MDSRCS+= ${FUNC}.S
+CFLAGS.${FUNC}.S+=-I${SRCTOP}/contrib/arm-optimized-routines/string
+.endfor
diff --git a/lib/libc/aarch64/string/memcpy.S b/lib/libc/aarch64/string/memcpy.S
new file mode 100644
index 000000000000..ac4fbe8d6175
--- /dev/null
+++ b/lib/libc/aarch64/string/memcpy.S
@@ -0,0 +1,6 @@
+#define __memcpy_aarch64 memcpy
+#define __memmove_aarch64 memmove
+#include "aarch64/memcpy.S"
+
+.weak index
+.equ index, strchr
diff --git a/lib/libc/aarch64/string/memmove.S b/lib/libc/aarch64/string/memmove.S
new file mode 100644
index 000000000000..e2f99790e0da
--- /dev/null
+++ b/lib/libc/aarch64/string/memmove.S
@@ -0,0 +1,5 @@
+/*
+ * memmove is implemented in memcpy.S. Having this file simplifies the build
+ * as it stops MISRCS from picking up the C implementation and rtld expects
+ * to copy the memmove object file into its object directory.
+ */
diff --git a/lib/libc/aarch64/string/strchr.S b/lib/libc/aarch64/string/strchr.S
new file mode 100644
index 000000000000..e241b35004bb
--- /dev/null
+++ b/lib/libc/aarch64/string/strchr.S
@@ -0,0 +1,5 @@
+#define __strchr_aarch64 strchr
+#include "aarch64/strchr.S"
+
+.weak index
+.equ index, strchr
diff --git a/lib/libc/aarch64/string/strrchr.S b/lib/libc/aarch64/string/strrchr.S
new file mode 100644
index 000000000000..46e966e3188a
--- /dev/null
+++ b/lib/libc/aarch64/string/strrchr.S
@@ -0,0 +1,5 @@
+#define __strrchr_aarch64 strrchr
+#include "aarch64/strrchr.S"
+
+.weak rindex
+.equ rindex, strrchr
diff --git a/lib/libc/aarch64/sys/Makefile.inc b/lib/libc/aarch64/sys/Makefile.inc
index 623a06b7faf8..97aff8ba92fe 100644
--- a/lib/libc/aarch64/sys/Makefile.inc
+++ b/lib/libc/aarch64/sys/Makefile.inc
@@ -2,7 +2,8 @@
MIASM:= ${MIASM:Nfreebsd[467]_*}
-SRCS+= __vdso_gettc.c
+SRCS+= __vdso_gettc.c \
+ sched_getcpu_gen.c
MDASM= cerror.S \
syscall.S \
diff --git a/lib/libc/amd64/Symbol.map b/lib/libc/amd64/Symbol.map
index 0655bd5eeb36..297792eb0e82 100644
--- a/lib/libc/amd64/Symbol.map
+++ b/lib/libc/amd64/Symbol.map
@@ -60,7 +60,6 @@ FBSDprivate_1.0 {
/* PSEUDO syscalls */
_getlogin;
- _set_tp;
___longjmp;
__makecontext;
__longjmp;
diff --git a/lib/libc/amd64/gen/Makefile.inc b/lib/libc/amd64/gen/Makefile.inc
index 4df3c044493e..f904e1e71eb0 100644
--- a/lib/libc/amd64/gen/Makefile.inc
+++ b/lib/libc/amd64/gen/Makefile.inc
@@ -1,7 +1,7 @@
# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
# $FreeBSD$
-SRCS+= _setjmp.S _get_tp.c _set_tp.c rfork_thread.S setjmp.S sigsetjmp.S \
+SRCS+= _setjmp.S rfork_thread.S setjmp.S sigsetjmp.S \
fabs.S \
infinity.c ldexp.c makecontext.c signalcontext.c \
flt_rounds.c fpgetmask.c fpsetmask.c fpgetprec.c fpsetprec.c \
diff --git a/lib/libc/amd64/gen/_set_tp.c b/lib/libc/amd64/gen/_set_tp.c
deleted file mode 100644
index 6e3a4c07499b..000000000000
--- a/lib/libc/amd64/gen/_set_tp.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2004 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <string.h>
-#include <stdint.h>
-#include <machine/sysarch.h>
-#include "libc_private.h"
-
-void
-_set_tp(void *tp)
-{
-
- amd64_set_fsbase(tp);
-}
diff --git a/lib/libc/arm/Symbol.map b/lib/libc/arm/Symbol.map
index 530c19798d60..61c7ccc070f2 100644
--- a/lib/libc/arm/Symbol.map
+++ b/lib/libc/arm/Symbol.map
@@ -50,7 +50,6 @@ FBSDprivate_1.0 {
/* PSEUDO syscalls */
_getlogin;
- _set_tp;
__aeabi_read_tp;
___longjmp;
__makecontext;
diff --git a/lib/libc/arm/gen/Makefile.inc b/lib/libc/arm/gen/Makefile.inc
index 35aa465e4904..77c995f70cbc 100644
--- a/lib/libc/arm/gen/Makefile.inc
+++ b/lib/libc/arm/gen/Makefile.inc
@@ -4,8 +4,6 @@
SRCS+= \
__aeabi_read_tp.S \
_ctx_start.S \
- _get_tp.c \
- _set_tp.c \
_setjmp.S \
alloca.S \
arm_initfini.c \
diff --git a/lib/libc/arm/sys/Makefile.inc b/lib/libc/arm/sys/Makefile.inc
index be6a58f8aaf5..c6e854e7954a 100644
--- a/lib/libc/arm/sys/Makefile.inc
+++ b/lib/libc/arm/sys/Makefile.inc
@@ -1,6 +1,7 @@
# $FreeBSD$
-SRCS+= __vdso_gettc.c
+SRCS+= __vdso_gettc.c \
+ sched_getcpu_gen.c
MDASM= Ovfork.S cerror.S syscall.S
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index aa9a4c0cbf67..fd8a0feeb748 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -30,6 +30,8 @@ SRCS+= __getosreldate.c \
clock_getcpuclockid.c \
closedir.c \
confstr.c \
+ cpuset_alloc.c \
+ cpuset_free.c \
crypt.c \
ctermid.c \
daemon.c \
@@ -123,6 +125,8 @@ SRCS+= __getosreldate.c \
scandir.c \
scandir_b.c \
scandir-compat11.c \
+ sched_getaffinity.c \
+ sched_setaffinity.c \
seed48.c \
seekdir.c \
semctl.c \
@@ -461,7 +465,10 @@ MLINKS+=modf.3 modff.3 \
MLINKS+=popen.3 pclose.3
MLINKS+=posix_spawn.3 posix_spawnp.3 \
posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addclose.3 \
+ posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addclosefrom_np.3 \
posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_adddup2.3 \
+ posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addchdir_np.3 \
+ posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addfchdir_np.3 \
posix_spawn_file_actions_init.3 posix_spawn_file_actions_destroy.3 \
posix_spawnattr_getflags.3 posix_spawnattr_setflags.3 \
posix_spawnattr_getpgroup.3 posix_spawnattr_setpgroup.3 \
diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map
index c89eb63caada..012c9ff11f04 100644
--- a/lib/libc/gen/Symbol.map
+++ b/lib/libc/gen/Symbol.map
@@ -435,6 +435,17 @@ FBSD_1.6 {
tcsetwinsize;
};
+FBSD_1.7 {
+ posix_spawn_file_actions_addchdir_np;
+ posix_spawn_file_actions_addclosefrom_np;
+ posix_spawn_file_actions_addfchdir_np;
+ sched_getaffinity;
+ sched_setaffinity;
+ sched_getcpu;
+ __cpuset_alloc;
+ __cpuset_free;
+};
+
FBSDprivate_1.0 {
/* needed by thread libraries */
__thr_jtable;
diff --git a/lib/libc/i386/gen/_set_tp.c b/lib/libc/gen/cpuset_alloc.c
index 2da48988eb37..ac307f07f263 100644
--- a/lib/libc/i386/gen/_set_tp.c
+++ b/lib/libc/gen/cpuset_alloc.c
@@ -1,8 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2004 Doug Rabson
- * All rights reserved.
+ * Copyright (c) 2021 Stefan Esser <se@FreeBSD.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,19 +21,13 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
-#include <string.h>
-#include <stdint.h>
-#include <machine/sysarch.h>
+#include <stdlib.h>
+#include <sched.h>
-#include "libc_private.h"
-
-void
-_set_tp(void *tp)
+cpuset_t *
+__cpuset_alloc(size_t ncpus)
{
-
- i386_set_gsbase(tp);
+ return (malloc(CPU_ALLOC_SIZE(ncpus)));
}
diff --git a/lib/libc/powerpc/gen/_set_tp.c b/lib/libc/gen/cpuset_free.c
index 61986f21c697..4cd993853241 100644
--- a/lib/libc/powerpc/gen/_set_tp.c
+++ b/lib/libc/gen/cpuset_free.c
@@ -1,8 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2004 Doug Rabson
- * All rights reserved.
+ * Copyright (c) 2021 Stefan Esser <se@FreeBSD.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,14 +21,13 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
-#include "libc_private.h"
+
+#include <stdlib.h>
+#include <sched.h>
void
-_set_tp(void *tpval)
+__cpuset_free(cpuset_t *ptr)
{
-
- __asm __volatile("mr 2,%0" :: "r"((char*)tpval + 0x7008));
+ free(ptr);
}
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index 5832cb8c6799..3743518c8f58 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -210,12 +210,11 @@ static int
grp_marshal_func(char *buffer, size_t *buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
- char *name;
- gid_t gid;
+ char *name __unused;
+ gid_t gid __unused;
struct group *grp;
- char *orig_buf;
- size_t orig_buf_size;
-
+ char *orig_buf __unused;
+ size_t orig_buf_size __unused;
struct group new_grp;
size_t desired_size, size, mem_size;
char *p, **mem;
@@ -305,8 +304,8 @@ static int
grp_unmarshal_func(char *buffer, size_t buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
- char *name;
- gid_t gid;
+ char *name __unused;
+ gid_t gid __unused;
struct group *grp;
char *orig_buf;
size_t orig_buf_size;
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index bc1d341fd3ad..634fc4fc8229 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -257,11 +257,11 @@ static int
pwd_marshal_func(char *buffer, size_t *buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
- char *name;
- uid_t uid;
+ char *name __unused;
+ uid_t uid __unused;
struct passwd *pwd;
- char *orig_buf;
- size_t orig_buf_size;
+ char *orig_buf __unused;
+ size_t orig_buf_size __unused;
struct passwd new_pwd;
size_t desired_size, size;
@@ -361,8 +361,8 @@ static int
pwd_unmarshal_func(char *buffer, size_t buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
- char *name;
- uid_t uid;
+ char *name __unused;
+ uid_t uid __unused;
struct passwd *pwd;
char *orig_buf;
size_t orig_buf_size;
diff --git a/lib/libc/gen/posix_spawn.3 b/lib/libc/gen/posix_spawn.3
index 596dac318673..f7d54903dcb6 100644
--- a/lib/libc/gen/posix_spawn.3
+++ b/lib/libc/gen/posix_spawn.3
@@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 5, 2016
+.Dd November 28, 2021
.Dt POSIX_SPAWN 3
.Os
.Sh NAME
@@ -46,9 +46,23 @@
.Sh SYNOPSIS
.In spawn.h
.Ft int
-.Fn posix_spawn "pid_t *restrict pid" "const char *restrict path" "const posix_spawn_file_actions_t *file_actions" "const posix_spawnattr_t *restrict attrp" "char *const argv[restrict]" "char *const envp[restrict]"
+.Fo posix_spawn
+.Fa "pid_t *restrict pid"
+.Fa "const char *restrict path"
+.Fa "const posix_spawn_file_actions_t *file_actions"
+.Fa "const posix_spawnattr_t *restrict attrp"
+.Fa "char *const argv[restrict]"
+.Fa "char *const envp[restrict]"
+.Fc
.Ft int
-.Fn posix_spawnp "pid_t *restrict pid" "const char *restrict file" "const posix_spawn_file_actions_t *file_actions" "const posix_spawnattr_t *restrict attrp" "char *const argv[restrict]" "char *const envp[restrict]"
+.Fo posix_spawnp
+.Fa "pid_t *restrict pid"
+.Fa "const char *restrict file"
+.Fa "const posix_spawn_file_actions_t *file_actions"
+.Fa "const posix_spawnattr_t *restrict attrp"
+.Fa "char *const argv[restrict]"
+.Fa "char *const envp[restrict]"
+.Fc
.Sh DESCRIPTION
The
.Fn posix_spawn
@@ -408,6 +422,11 @@ in addition to those described by
This implementation ignores any errors from
.Fn close ,
including trying to close a descriptor that is not open.
+The ignore extends to any errors from individual file descriptors
+.Fn close
+executed as part of the
+.Fn closefrom
+action.
.El
.Sh SEE ALSO
.Xr close 2 ,
@@ -420,8 +439,11 @@ including trying to close a descriptor that is not open.
.Xr setpgid 2 ,
.Xr vfork 2 ,
.Xr posix_spawn_file_actions_addclose 3 ,
+.Xr posix_spawn_file_actions_addclosefrom_np 3 ,
.Xr posix_spawn_file_actions_adddup2 3 ,
.Xr posix_spawn_file_actions_addopen 3 ,
+.Xr posix_spawn_file_actions_addchdir_np 3 ,
+.Xr posix_spawn_file_actions_addfchdir_np 3 ,
.Xr posix_spawn_file_actions_destroy 3 ,
.Xr posix_spawn_file_actions_init 3 ,
.Xr posix_spawnattr_destroy 3 ,
diff --git a/lib/libc/gen/posix_spawn.c b/lib/libc/gen/posix_spawn.c
index 0bca52811e30..909db9a60a02 100644
--- a/lib/libc/gen/posix_spawn.c
+++ b/lib/libc/gen/posix_spawn.c
@@ -62,7 +62,14 @@ struct __posix_spawn_file_actions {
typedef struct __posix_spawn_file_actions_entry {
STAILQ_ENTRY(__posix_spawn_file_actions_entry) fae_list;
- enum { FAE_OPEN, FAE_DUP2, FAE_CLOSE } fae_action;
+ enum {
+ FAE_OPEN,
+ FAE_DUP2,
+ FAE_CLOSE,
+ FAE_CHDIR,
+ FAE_FCHDIR,
+ FAE_CLOSEFROM,
+ } fae_action;
int fae_fildes;
union {
@@ -176,6 +183,17 @@ process_file_actions_entry(posix_spawn_file_actions_entry_t *fae)
/* Perform a close(), do not fail if already closed */
(void)_close(fae->fae_fildes);
break;
+ case FAE_CHDIR:
+ if (chdir(fae->fae_path) != 0)
+ return (errno);
+ break;
+ case FAE_FCHDIR:
+ if (fchdir(fae->fae_fildes) != 0)
+ return (errno);
+ break;
+ case FAE_CLOSEFROM:
+ closefrom(fae->fae_fildes);
+ break;
}
return (0);
}
@@ -349,7 +367,7 @@ posix_spawn(pid_t *pid, const char *path,
const posix_spawnattr_t *sa,
char * const argv[], char * const envp[])
{
- return do_posix_spawn(pid, path, fa, sa, argv, envp, 0);
+ return (do_posix_spawn(pid, path, fa, sa, argv, envp, 0));
}
int
@@ -358,7 +376,7 @@ posix_spawnp(pid_t *pid, const char *path,
const posix_spawnattr_t *sa,
char * const argv[], char * const envp[])
{
- return do_posix_spawn(pid, path, fa, sa, argv, envp, 1);
+ return (do_posix_spawn(pid, path, fa, sa, argv, envp, 1));
}
/*
@@ -389,7 +407,8 @@ posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *fa)
STAILQ_REMOVE_HEAD(&(*fa)->fa_list, fae_list);
/* Deallocate file action entry */
- if (fae->fae_action == FAE_OPEN)
+ if (fae->fae_action == FAE_OPEN ||
+ fae->fae_action == FAE_CHDIR)
free(fae->fae_path);
free(fae);
}
@@ -474,6 +493,71 @@ posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *fa,
return (0);
}
+int
+posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t *
+ __restrict fa, const char *__restrict path)
+{
+ posix_spawn_file_actions_entry_t *fae;
+ int error;
+
+ fae = malloc(sizeof(posix_spawn_file_actions_entry_t));
+ if (fae == NULL)
+ return (errno);
+
+ fae->fae_action = FAE_CHDIR;
+ fae->fae_path = strdup(path);
+ if (fae->fae_path == NULL) {
+ error = errno;
+ free(fae);
+ return (error);
+ }
+
+ STAILQ_INSERT_TAIL(&(*fa)->fa_list, fae, fae_list);
+ return (0);
+}
+
+int
+posix_spawn_file_actions_addfchdir_np(posix_spawn_file_actions_t *__restrict fa,
+ int fildes)
+{
+ posix_spawn_file_actions_entry_t *fae;
+
+ if (fildes < 0)
+ return (EBADF);
+
+ /* Allocate object */
+ fae = malloc(sizeof(posix_spawn_file_actions_entry_t));
+ if (fae == NULL)
+ return (errno);
+
+ fae->fae_action = FAE_FCHDIR;
+ fae->fae_fildes = fildes;
+
+ STAILQ_INSERT_TAIL(&(*fa)->fa_list, fae, fae_list);
+ return (0);
+}
+
+int
+posix_spawn_file_actions_addclosefrom_np (posix_spawn_file_actions_t *
+ __restrict fa, int from)
+{
+ posix_spawn_file_actions_entry_t *fae;
+
+ if (from < 0)
+ return (EBADF);
+
+ /* Allocate object */
+ fae = malloc(sizeof(posix_spawn_file_actions_entry_t));
+ if (fae == NULL)
+ return (errno);
+
+ fae->fae_action = FAE_CLOSEFROM;
+ fae->fae_fildes = from;
+
+ STAILQ_INSERT_TAIL(&(*fa)->fa_list, fae, fae_list);
+ return (0);
+}
+
/*
* Spawn attributes
*/
diff --git a/lib/libc/gen/posix_spawn_file_actions_addopen.3 b/lib/libc/gen/posix_spawn_file_actions_addopen.3
index 0b57999bf4be..0782e15b3126 100644
--- a/lib/libc/gen/posix_spawn_file_actions_addopen.3
+++ b/lib/libc/gen/posix_spawn_file_actions_addopen.3
@@ -40,18 +40,49 @@
.Sh NAME
.Nm posix_spawn_file_actions_addopen ,
.Nm posix_spawn_file_actions_adddup2 ,
-.Nm posix_spawn_file_actions_addclose
-.Nd "add open, dup2 or close action to spawn file actions object"
+.Nm posix_spawn_file_actions_addclose ,
+.Nm posix_spawn_file_actions_addclosefrom_np ,
+.Nm posix_spawn_file_actions_addchdir_np ,
+.Nm posix_spawn_file_actions_addfchdir_np
+.Nd "add open, dup2, close, closefrom, or chdir/fchdir actions to spawn file actions object"
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In spawn.h
.Ft int
-.Fn posix_spawn_file_actions_addopen "posix_spawn_file_actions_t * file_actions" "int fildes" "const char *restrict path" "int oflag" "mode_t mode"
+.Fo posix_spawn_file_actions_addopen
+.Fa "posix_spawn_file_actions_t * file_actions"
+.Fa "int fildes"
+.Fa "const char *restrict path"
+.Fa "int oflag"
+.Fa "mode_t mode"
+.Fc
.Ft int
-.Fn posix_spawn_file_actions_adddup2 "posix_spawn_file_actions_t * file_actions" "int fildes" "int newfildes"
+.Fo posix_spawn_file_actions_adddup2
+.Fa "posix_spawn_file_actions_t * file_actions"
+.Fa "int fildes"
+.Fa "int newfildes"
+.Fc
.Ft int
-.Fn posix_spawn_file_actions_addclose "posix_spawn_file_actions_t * file_actions" "int fildes"
+.Fo posix_spawn_file_actions_addclose
+.Fa "posix_spawn_file_actions_t * file_actions"
+.Fa "int fildes"
+.Fc
+.Ft int
+.Fo posix_spawn_file_actions_addclosefrom_np
+.Fa "posix_spawn_file_actions_t * file_actions"
+.Fa "int from"
+.Fc
+.Ft int
+.Fo posix_spawn_file_actions_addchdir_np
+.Fa "posix_spawn_file_actions_t *restrict file_actions"
+.Fa "const char *restrict path"
+.Fc
+.Ft int
+.Fo posix_spawn_file_actions_addfchdir_np
+.Fa "posix_spawn_file_actions_t * file_actions"
+.Fa "int fildes"
+.Fc
.Sh DESCRIPTION
These functions add an open, dup2 or close action to a spawn
file actions object.
@@ -150,6 +181,34 @@ close(fildes)
.Pp
had been called) when a new process is spawned using this file actions
object.
+.Pp
+The
+.Fn posix_spawn_file_actions_addclosefrom_np
+function adds a close action to close all file descriptors numerically
+equal or greater then the argument
+.Fa from .
+For each open file descriptor, logically the close action is performed,
+and any possible errors encountered are ignored.
+.Pp
+The
+.Fn posix_spawn_file_actions_addchdir_np
+and
+.Fn posix_spawn_file_actions_addfchdir_np
+functions add a change current directory action to the object
+referenced by
+.Fa file_actions
+that affects actions (opens with relative path) performed after the operation,
+in the order of insertion into the
+.Fa file_actions
+object.
+It also sets the working directory for the spawned program.
+The
+.Fn posix_spawn_file_actions_addchdir_np
+function takes the
+.Fa path
+to set as the working directory, while
+.Fn posix_spawn_file_actions_addfchdir_np
+takes the directory file descriptor.
.Sh RETURN VALUES
Upon successful completion, these functions return zero;
otherwise, an error number is returned to indicate the error.
@@ -191,6 +250,14 @@ is equal to
(clearing
.Dv FD_CLOEXEC ) .
A future update of the Standard is expected to require this behavior.
+.Pp
+The
+.Fn posix_spawn_file_actions_addchdir_np ,
+.Fn posix_spawn_file_actions_addfchdir_np ,
+and
+.Fn posix_spawn_file_actions_addclosefrom_np
+functions are non-standard functions implemented after the similar
+functionality provided by glibc.
.Sh HISTORY
The
.Fn posix_spawn_file_actions_addopen ,
@@ -199,5 +266,12 @@ and
.Fn posix_spawn_file_actions_addclose
functions first appeared in
.Fx 8.0 .
+The
+.Fn posix_spawn_file_actions_addchdir_np ,
+.Fn posix_spawn_file_actions_addfchdir_np ,
+and
+.Fn posix_spawn_file_actions_addclosefrom_np
+functions first appeared in
+.Fx 14.0 .
.Sh AUTHORS
.An \&Ed Schouten Aq Mt ed@FreeBSD.org
diff --git a/lib/libc/gen/posix_spawn_file_actions_init.3 b/lib/libc/gen/posix_spawn_file_actions_init.3
index 380eed769003..1215a04f6386 100644
--- a/lib/libc/gen/posix_spawn_file_actions_init.3
+++ b/lib/libc/gen/posix_spawn_file_actions_init.3
@@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 24, 2008
+.Dd November 28, 2021
.Dt POSIX_SPAWN_FILE_ACTIONS_INIT 3
.Os
.Sh NAME
@@ -83,6 +83,7 @@ Insufficient memory exists to initialize the spawn file actions object.
.Sh SEE ALSO
.Xr posix_spawn 3 ,
.Xr posix_spawn_file_actions_addclose 3 ,
+.Xr posix_spawn_file_actions_addclosefrom_np 3 ,
.Xr posix_spawn_file_actions_adddup2 3 ,
.Xr posix_spawn_file_actions_addopen 3 ,
.Xr posix_spawnp 3
diff --git a/lib/libc/aarch64/gen/_get_tp.c b/lib/libc/gen/sched_getaffinity.c
index ce51b400b542..7d345eb82a3b 100644
--- a/lib/libc/aarch64/gen/_get_tp.c
+++ b/lib/libc/gen/sched_getaffinity.c
@@ -1,9 +1,7 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
* Copyright (c) 2021 The FreeBSD Foundation
*
- * This software were developed by Konstantin Belousov
+ * This software were developed by Konstantin Belousov <kib@FreeBSD.org>
* under sponsorship from the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
@@ -28,18 +26,31 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
+#include <errno.h>
+#include <sched.h>
#include <string.h>
-#include <stdint.h>
-#include "libc_private.h"
-void *
-_get_tp(void)
+int
+sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset)
{
- void *res;
+ /*
+ * Be more Linux-compatible:
+ * - return EINVAL in passed size is less than size of cpuset_t
+ * in advance, instead of ERANGE from the syscall
+ * - if passed size is larger than the size of cpuset_t, be
+ * permissive by claming it back to sizeof(cpuset_t) and
+ * zeroing the rest.
+ */
+ if (cpusetsz < sizeof(cpuset_t)) {
+ errno = EINVAL;
+ return (-1);
+ }
+ if (cpusetsz > sizeof(cpuset_t)) {
+ memset((char *)cpuset + sizeof(cpuset_t), 0,
+ cpusetsz - sizeof(cpuset_t));
+ cpusetsz = sizeof(cpuset_t);
+ }
- __asm __volatile("mrs %0, tpidr_el0" : "=r" (res));
- return (res);
+ return (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID,
+ pid == 0 ? -1 : pid, cpusetsz, cpuset));
}
diff --git a/lib/libc/powerpc64/gen/_set_tp.c b/lib/libc/gen/sched_getcpu_gen.c
index 541ad2d0d8a4..ef1bebc2915a 100644
--- a/lib/libc/powerpc64/gen/_set_tp.c
+++ b/lib/libc/gen/sched_getcpu_gen.c
@@ -1,8 +1,8 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * Copyright (c) 2021 The FreeBSD Foundation
*
- * Copyright (c) 2004 Doug Rabson
- * All rights reserved.
+ * This software were developed by Konstantin Belousov <kib@FreeBSD.org>
+ * under sponsorship from the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,14 +24,13 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
+
+#include <sched.h>
#include "libc_private.h"
-void
-_set_tp(void *tpval)
+int
+sched_getcpu(void)
{
-
- __asm __volatile("mr 13,%0" :: "r"((char*)tpval + 0x7010));
+ return (__sys_sched_getcpu());
}
diff --git a/lib/libc/arm/gen/_get_tp.c b/lib/libc/gen/sched_setaffinity.c
index 495fa982dd6f..91ab2a401bda 100644
--- a/lib/libc/arm/gen/_get_tp.c
+++ b/lib/libc/gen/sched_setaffinity.c
@@ -1,9 +1,7 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
* Copyright (c) 2021 The FreeBSD Foundation
*
- * This software were developed by Konstantin Belousov
+ * This software were developed by Konstantin Belousov <kib@FreeBSD.org>
* under sponsorship from the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
@@ -28,19 +26,22 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
+#include <errno.h>
+#include <sched.h>
#include <string.h>
-#include <stdint.h>
-#include "libc_private.h"
-void *
-_get_tp(void)
+int
+sched_setaffinity(pid_t pid, size_t cpusetsz, const cpuset_t *cpuset)
{
- void *res;
+ cpuset_t c;
- __asm __volatile("mrc p15, 0, %0, c13, c0, 3" : "=r" (res));
- return (res);
+ if (cpusetsz > sizeof(cpuset_t)) {
+ errno = EINVAL;
+ return (-1);
+ } else {
+ memset(&c, 0, sizeof(c));
+ memcpy(&c, cpuset, cpusetsz);
+ }
+ return (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID,
+ pid == 0 ? -1 : pid, sizeof(cpuset_t), &c));
}
diff --git a/lib/libc/gen/setproctitle.c b/lib/libc/gen/setproctitle.c
index 3f858952255c..08612e99d9bb 100644
--- a/lib/libc/gen/setproctitle.c
+++ b/lib/libc/gen/setproctitle.c
@@ -62,7 +62,7 @@ setproctitle_internal(const char *fmt, va_list ap)
static struct ps_strings *ps_strings;
static char *buf = NULL;
static char *obuf = NULL;
- static char **oargv, *kbuf;
+ static char **oargv;
static int oargc = -1;
static char *nargv[2] = { NULL, NULL };
char **nargvp;
@@ -103,12 +103,10 @@ setproctitle_internal(const char *fmt, va_list ap)
nargvp = nargv;
nargc = 1;
- kbuf = buf;
} else if (*obuf != '\0') {
/* Idea from NetBSD - reset the title on fmt == NULL */
nargvp = oargv;
nargc = oargc;
- kbuf = obuf;
} else
/* Nothing to restore */
return (NULL);
diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c
index d90aac028b88..5ceaf439d839 100644
--- a/lib/libc/gen/tls.c
+++ b/lib/libc/gen/tls.c
@@ -72,15 +72,6 @@ void _rtld_free_tls(void *tls, size_t tcbsize, size_t tcbalign);
void *__libc_allocate_tls(void *oldtls, size_t tcbsize, size_t tcbalign);
void __libc_free_tls(void *tls, size_t tcbsize, size_t tcbalign);
-#if defined(__amd64__)
-#define TLS_TCB_ALIGN 16
-#elif defined(__aarch64__) || defined(__arm__) || defined(__i386__) || \
- defined(__mips__) || defined(__powerpc__) || defined(__riscv)
-#define TLS_TCB_ALIGN sizeof(void *)
-#else
-#error TLS_TCB_ALIGN undefined for target architecture
-#endif
-
#ifndef PIC
static size_t libc_tls_static_space;
@@ -92,11 +83,10 @@ static void *libc_tls_init;
void *
__libc_tls_get_addr(void *vti)
{
- Elf_Addr **dtvp, *dtv;
+ uintptr_t *dtv;
tls_index *ti;
- dtvp = _get_tp();
- dtv = *dtvp;
+ dtv = _tcb_get()->tcb_dtv;
ti = vti;
return ((char *)(dtv[ti->ti_module + 1] + ti->ti_offset) +
TLS_DTV_OFFSET);
@@ -158,11 +148,11 @@ libc_free_aligned(void *ptr)
* Note: for Local Exec TLS Model, the offsets from TP (TCB in this case) to
* TLS variables are computed by linker, so we cannot overalign TLS section.
*
- * - MIPS, PowerPC and RISC-V use modified version of variant I,
- * described in [3] where TP points (with bias) to TLS and TCB immediately
- * precedes TLS without any alignment gap[4]. Only TLS should be aligned.
- * The TCB[0] points to DTV vector and DTV values are biased by constant
- * value (0x8000) from real addresses[5].
+ * - PowerPC and RISC-V use modified version of variant I, described in [3]
+ * where TP points (with bias) to TLS and TCB immediately precedes TLS without
+ * any alignment gap[4]. Only TLS should be aligned. The TCB[0] points to DTV
+ * vector and DTV values are biased by constant value (TLS_DTV_OFFSET) from
+ * real addresses[5].
*
* [1] Ulrich Drepper: ELF Handling for Thread-Local Storage
* www.akkadia.org/drepper/tls.pdf
@@ -175,7 +165,7 @@ libc_free_aligned(void *ptr)
* https://members.openpowerfoundation.org/document/dl/576
*
* [4] Its unclear if "without any alignment gap" is hard ABI requirement,
- * but we must follow this rule due to suboptimal _set_tp()
+ * but we must follow this rule due to suboptimal _tcb_set()
* (aka <ARCH>_SET_TP) implementation. This function doesn't expect TP but
* TCB as argument.
*
@@ -307,8 +297,6 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign)
#ifdef TLS_VARIANT_II
-#define TLS_TCB_SIZE (3 * sizeof(Elf_Addr))
-
/*
* Free Static TLS using the Variant II method.
*/
@@ -462,6 +450,6 @@ _init_tls(void)
}
tls = _rtld_allocate_tls(NULL, TLS_TCB_SIZE, TLS_TCB_ALIGN);
- _set_tp(tls);
+ _tcb_set(tls);
#endif
}
diff --git a/lib/libc/i386/Symbol.map b/lib/libc/i386/Symbol.map
index 96ec93bfba6c..b169c3229879 100644
--- a/lib/libc/i386/Symbol.map
+++ b/lib/libc/i386/Symbol.map
@@ -57,7 +57,6 @@ FBSDprivate_1.0 {
/* PSEUDO syscalls */
_getlogin;
- _set_tp;
___longjmp;
__makecontext;
__longjmp;
diff --git a/lib/libc/i386/gen/Makefile.inc b/lib/libc/i386/gen/Makefile.inc
index bad73852f6eb..e1a95e8bf53e 100644
--- a/lib/libc/i386/gen/Makefile.inc
+++ b/lib/libc/i386/gen/Makefile.inc
@@ -1,6 +1,6 @@
# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
# $FreeBSD$
-SRCS+= _ctx_start.S _setjmp.S _set_tp.c _get_tp.c fabs.S \
+SRCS+= _ctx_start.S _setjmp.S fabs.S \
flt_rounds.c infinity.c ldexp.c makecontext.c \
rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S
diff --git a/lib/libc/i386/gen/_get_tp.c b/lib/libc/i386/gen/_get_tp.c
deleted file mode 100644
index f96695247928..000000000000
--- a/lib/libc/i386/gen/_get_tp.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2021 The FreeBSD Foundation
- *
- * This software were developed by Konstantin Belousov
- * under sponsorship from the FreeBSD Foundation.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <string.h>
-#include <stdint.h>
-#include "libc_private.h"
-
-void *
-_get_tp(void)
-{
- void **res;
-
- __asm __volatile("movl %%gs:0, %0" : "=r" (res));
- return (&res[1]);
-}
diff --git a/lib/libc/iconv/citrus_bcs.c b/lib/libc/iconv/citrus_bcs.c
index b8484a0d793e..cd88ea7fe2fd 100644
--- a/lib/libc/iconv/citrus_bcs.c
+++ b/lib/libc/iconv/citrus_bcs.c
@@ -109,7 +109,7 @@ const char *
_citrus_bcs_skip_ws_len(const char * __restrict p, size_t * __restrict len)
{
- while (*p && *len > 0 && _bcs_isspace(*p)) {
+ while (*len > 0 && *p && _bcs_isspace(*p)) {
p++;
(*len)--;
}
@@ -124,7 +124,7 @@ const char *
_citrus_bcs_skip_nonws_len(const char * __restrict p, size_t * __restrict len)
{
- while (*p && *len > 0 && !_bcs_isspace(*p)) {
+ while (*len > 0 && *p && !_bcs_isspace(*p)) {
p++;
(*len)--;
}
diff --git a/lib/libc/iconv/citrus_prop.c b/lib/libc/iconv/citrus_prop.c
index 7ac39bbee6e5..0b627f362c22 100644
--- a/lib/libc/iconv/citrus_prop.c
+++ b/lib/libc/iconv/citrus_prop.c
@@ -79,7 +79,7 @@ static const char *xdigit = "0123456789ABCDEF";
#define _CITRUS_PROP_READ_UINT_COMMON(_func_, _type_, _max_) \
static int \
_citrus_prop_read_##_func_##_common(struct _memstream * __restrict ms, \
- _type_ * __restrict result, int base) \
+ _type_ * __restrict result, int base, int neg) \
{ \
_type_ acc, cutoff; \
int ch, cutlim, n; \
@@ -99,7 +99,7 @@ _citrus_prop_read_##_func_##_common(struct _memstream * __restrict ms, \
acc += n; \
} \
_memstream_ungetc(ms, ch); \
- *result = acc; \
+ *result = neg ? -acc : acc; \
return (0); \
}
_CITRUS_PROP_READ_UINT_COMMON(chr, int, UCHAR_MAX)
@@ -139,7 +139,7 @@ _citrus_prop_read_##_func_(struct _memstream * __restrict ms, \
return (EINVAL); \
_memstream_ungetc(ms, ch); \
return (_citrus_prop_read_##_func_##_common \
- (ms, &obj->u._func_, base)); \
+ (ms, &obj->u._func_, base, neg)); \
}
_CITRUS_PROP_READ_INT(chr, int)
_CITRUS_PROP_READ_INT(num, uint64_t)
@@ -185,7 +185,8 @@ _citrus_prop_read_character_common(struct _memstream * __restrict ms,
base -= 8;
/*FALLTHROUGH*/
case 'x':
- return (_citrus_prop_read_chr_common(ms, result, base));
+ return (_citrus_prop_read_chr_common(ms, result,
+ base, 0));
/*NOTREACHED*/
default:
/* unknown escape */
diff --git a/lib/libc/include/compat.h b/lib/libc/include/compat.h
index ccb92c0fd930..e6bc2e7a6612 100644
--- a/lib/libc/include/compat.h
+++ b/lib/libc/include/compat.h
@@ -69,6 +69,8 @@ __sym_compat(mknodat, freebsd11_mknodat, FBSD_1.1);
__sym_compat(kevent, freebsd11_kevent, FBSD_1.0);
+__sym_compat(swapoff, freebsd13_swapoff, FBSD_1.0);
+
#undef __sym_compat
#define __weak_reference(sym,alias) \
diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h
index 5a524c0211d1..641b9272c7fc 100644
--- a/lib/libc/include/libc_private.h
+++ b/lib/libc/include/libc_private.h
@@ -261,12 +261,6 @@ void _init_tls(void);
int _once(pthread_once_t *, void (*)(void));
/*
- * Get/set the TLS thread pointer
- */
-void *_get_tp(void);
-void _set_tp(void *tp);
-
-/*
* This is a pointer in the C run-time startup code. It is used
* by getprogname() and setprogname().
*/
@@ -371,6 +365,7 @@ __ssize_t __sys_recv(int, void *, __size_t, int);
__ssize_t __sys_recvfrom(int, void *, __size_t, int, struct sockaddr *,
__socklen_t *);
__ssize_t __sys_recvmsg(int, struct msghdr *, int);
+int __sys_sched_getcpu(void);
int __sys_select(int, struct fd_set *, struct fd_set *,
struct fd_set *, struct timeval *);
__ssize_t __sys_sendmsg(int, const struct msghdr *, int);
diff --git a/lib/libc/mips/Makefile.inc b/lib/libc/mips/Makefile.inc
deleted file mode 100644
index f340477ad22a..000000000000
--- a/lib/libc/mips/Makefile.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-# $NetBSD: Makefile.inc,v 1.7 2005/09/17 11:49:39 tsutsui Exp $
-# $FreeBSD$
-
-SRCS+= machdep_ldisd.c
-SYM_MAPS+= ${LIBC_SRCTOP}/mips/Symbol.map
diff --git a/lib/libc/mips/SYS.h b/lib/libc/mips/SYS.h
deleted file mode 100644
index c4767a5cd96b..000000000000
--- a/lib/libc/mips/SYS.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* $NetBSD: SYS.h,v 1.19 2009/12/14 01:07:41 matt Exp $ */
-/* $FreeBSD$ */
-
-/*-
- * SPDX-License-Identifier: (BSD-4-Clause AND BSD-3-Clause)
- *
- * Copyright (c) 1996 Jonathan Stone
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jonathan Stone for
- * the NetBSD Project.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)SYS.h 8.1 (Berkeley) 6/4/93
- */
-
-#include <sys/syscall.h>
-
-#include <machine/asm.h>
-
-/*
- * If compiling for shared libs, Emit sysV ABI PIC segment pseudo-ops.
- *
- * i) Emit .abicalls before .LEAF entrypoint, and .cpload/.cprestore after.
- * ii) Do interprocedure jumps indirectly via t9, with the side-effect of
- * preserving the callee's entry address in t9.
- */
-#ifdef __ABICALLS__
- .abicalls
-# if defined(__mips_o32) || defined(__mips_o64)
-# define PIC_PROLOGUE(x) SETUP_GP
-# define PIC_TAILCALL(l) PTR_LA t9, _C_LABEL(l); jr t9
-# define PIC_RETURN() j ra
-# else
-# define PIC_PROLOGUE(x) SETUP_GP64(t3, x)
-# define PIC_TAILCALL(l) PTR_LA t9, _C_LABEL(l); RESTORE_GP64; jr t9
-# define PIC_RETURN() RESTORE_GP64; j ra
-# endif
-#else
-# define PIC_PROLOGUE(x)
-# define PIC_TAILCALL(l) j _C_LABEL(l)
-# define PIC_RETURN() j ra
-#endif /* __ABICALLS__ */
-
-# define SYSTRAP(x) li v0,SYS_ ## x; syscall;
-
-/*
- * Do a syscall that cannot fail (sync, get{p,u,g,eu,eg)id)
- */
-#define RSYSCALL_NOERROR(x) \
-LEAF(__sys_ ## x); \
- .weak _C_LABEL(x); \
- _C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \
- .weak _C_LABEL(__CONCAT(_,x)); \
- _C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \
- SYSTRAP(x); \
- j ra; \
-END(__sys_ ## x)
-
-/*
- * Do a normal syscall.
- */
-#define RSYSCALL(x) \
-LEAF(__sys_ ## x); \
- .weak _C_LABEL(x); \
- _C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \
- .weak _C_LABEL(__CONCAT(_,x)); \
- _C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \
- PIC_PROLOGUE(__sys_ ## x); \
- SYSTRAP(x); \
- bne a3,zero,err; \
- PIC_RETURN(); \
-err: \
- PIC_TAILCALL(__cerror); \
-END(__sys_ ## x)
-
-/*
- * Do a renamed or pseudo syscall (e.g., _exit()), where the entrypoint
- * and syscall name are not the same.
- */
-#define PSEUDO_NOERROR(x) \
-LEAF(__sys_ ## x); \
- .weak _C_LABEL(__CONCAT(_,x)); \
- _C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \
- SYSTRAP(x); \
- j ra; \
-END(__sys_ ## x)
-
-#define PSEUDO(x) \
-LEAF(__sys_ ## x); \
- .weak _C_LABEL(__CONCAT(_,x)); \
- _C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \
- PIC_PROLOGUE(__sys_ ## x); \
- SYSTRAP(x); \
- bne a3,zero,err; \
- PIC_RETURN(); \
-err: \
- PIC_TAILCALL(__cerror); \
-END(__sys_ ## x)
diff --git a/lib/libc/mips/Symbol.map b/lib/libc/mips/Symbol.map
deleted file mode 100644
index b66a26cd91dc..000000000000
--- a/lib/libc/mips/Symbol.map
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * $FreeBSD$
- */
-
-/*
- * This only needs to contain symbols that are not listed in
- * symbol maps from other parts of libc (i.e., not found in
- * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...).
- */
-FBSD_1.0 {
- /* PSEUDO syscalls */
- _exit;
-
- _mcount;
- _setjmp;
- _longjmp;
- alloca;
- fabs;
- __infinity;
- __nan;
- makecontext;
- setjmp;
- longjmp;
- sigsetjmp;
- siglongjmp;
- htonl;
- htons;
- ntohl;
- ntohs;
- vfork;
- brk;
- sbrk;
-};
-
-FBSD_1.3 {
- __flt_rounds;
-};
-
-FBSDprivate_1.0 {
- /* PSEUDO syscalls */
- _getlogin;
-
- _set_tp;
- ___longjmp;
- __makecontext;
- __longjmp;
- signalcontext;
- _signalcontext;
- __siglongjmp;
- _vfork;
- _brk;
- _sbrk;
-};
diff --git a/lib/libc/mips/_fpmath.h b/lib/libc/mips/_fpmath.h
deleted file mode 100644
index cece2fa81cb6..000000000000
--- a/lib/libc/mips/_fpmath.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-union IEEEl2bits {
- long double e;
- struct {
-#ifndef __MIPSEB__
- unsigned int manl :32;
- unsigned int manh :20;
- unsigned int exp :11;
- unsigned int sign :1;
-#else
- unsigned int sign :1;
- unsigned int exp :11;
- unsigned int manh :20;
- unsigned int manl :32;
-#endif
- } bits;
-};
-
-#define LDBL_NBIT 0
-#define mask_nbit_l(u) ((void)0)
-#define LDBL_IMPLICIT_NBIT
-
-#define LDBL_MANH_SIZE 20
-#define LDBL_MANL_SIZE 32
-
-#define LDBL_TO_ARRAY32(u, a) do { \
- (a)[0] = (uint32_t)(u).bits.manl; \
- (a)[1] = (uint32_t)(u).bits.manh; \
-} while(0)
diff --git a/lib/libc/mips/arith.h b/lib/libc/mips/arith.h
deleted file mode 100644
index 61f3930f4a89..000000000000
--- a/lib/libc/mips/arith.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * MD header for contrib/gdtoa
- *
- * $FreeBSD$
- */
-
-/*
- * NOTE: The definitions in this file must be correct or strtod(3) and
- * floating point formats in printf(3) will break! The file can be
- * generated by running contrib/gdtoa/arithchk.c on the target
- * architecture. See contrib/gdtoa/gdtoaimp.h for details.
- */
-#include <machine/endian.h>
-
-#if BYTE_ORDER == BIG_ENDIAN
-#define IEEE_MC68k
-#define Arith_Kind_ASL 2
-#define Double_Align
-#else
-/* TODO: Generate these values on a LE machine */
-#define IEEE_8087
-#define Arith_Kind_ASL 1
-#define Long int
-#define Intcast (int)(long)
-#define Double_Align
-#endif
diff --git a/lib/libc/mips/gd_qnan.h b/lib/libc/mips/gd_qnan.h
deleted file mode 100644
index 69eeaf988fa0..000000000000
--- a/lib/libc/mips/gd_qnan.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * MD header for contrib/gdtoa
- *
- * This file can be generated by compiling and running contrib/gdtoa/qnan.c
- * on the target architecture after arith.h has been generated.
- *
- * $FreeBSD$
- */
-
-
-#include <machine/endian.h>
-
-#if BYTE_ORDER == BIG_ENDIAN
-/* These values were gained on a running
- * Octeon in Big Endian order. They were gotten
- * by running ./qnan after arithchk was ran and
- * got us the proper values for arith.h.
- */
-#define f_QNAN 0x7f900000
-#define d_QNAN0 0x7ff80000
-#define d_QNAN1 0x0
-#define ld_QNAN0 0x7ff80000
-#define ld_QNAN1 0x0
-#define ld_QNAN2 0x0
-#define ld_QNAN3 0x0
-#define ldus_QNAN0 0x7ff8
-#define ldus_QNAN1 0x0
-#define ldus_QNAN2 0x0
-#define ldus_QNAN3 0x0
-#define ldus_QNAN4 0x0
-#else
-/* FIX FIX, need to run this on a Little Endian
- * machine and get the proper values, these here
- * were stolen fromn i386/gd_qnan.h
- */
-#define f_QNAN 0x7fc00000
-#define d_QNAN0 0x0
-#define d_QNAN1 0x7ff80000
-#define ld_QNAN0 0x0
-#define ld_QNAN1 0xc0000000
-#define ld_QNAN2 0x7fff
-#define ld_QNAN3 0x0
-#define ldus_QNAN0 0x0
-#define ldus_QNAN1 0x0
-#define ldus_QNAN2 0x0
-#define ldus_QNAN3 0xc000
-#define ldus_QNAN4 0x7fff
-#endif
diff --git a/lib/libc/mips/gen/Makefile.inc b/lib/libc/mips/gen/Makefile.inc
deleted file mode 100644
index d2dc9b5f4bdb..000000000000
--- a/lib/libc/mips/gen/Makefile.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-# $NetBSD: Makefile.inc,v 1.27 2005/10/07 17:16:40 tsutsui Exp $
-# $FreeBSD$
-
-SRCS+= infinity.c fabs.c ldexp.c flt_rounds.c
-
-# SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
-# fpsetround.c fpsetsticky.c
-
-SRCS+= _ctx_start.S _get_tp.c _set_tp.c _setjmp.S makecontext.c \
- setjmp.S signalcontext.c sigsetjmp.S \
- trivial-getcontextx.c
diff --git a/lib/libc/mips/gen/_ctx_start.S b/lib/libc/mips/gen/_ctx_start.S
deleted file mode 100644
index f1f5cdc32641..000000000000
--- a/lib/libc/mips/gen/_ctx_start.S
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * Copyright (c) 2010 Juli Mallett.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-/*
- * This requires makecontext() to setup a valid GP for locating
- * _ctx_done rather than deriving GP from T9 on entry. Currently this
- * uses the GP inherited from getcontext() assuming that getcontext()
- * is in the same shared object as _ctx_done(). For N32 and N64, GP
- * is caller-save so will be preserved across the call to the callback
- * function. For O32, GP is callee-save, so save it in a different
- * caller-save register (S1) while invoking the callback. This is
- * done instead of the usual SETUP_GP/SAVE_GP to avoid disturbing the
- * stack frame setup by makecontext() for the callback function.
- */
-ENTRY(_ctx_start)
-#ifdef __mips_o32
- move s1, gp
-#endif
- jalr t9
-
-#ifdef __mips_o32
- move gp, s1
-#endif
- move a0, s0
- PTR_LA t9, _ctx_done
- jalr t9
-
- break 0
-END(_ctx_start)
diff --git a/lib/libc/mips/gen/_get_tp.c b/lib/libc/mips/gen/_get_tp.c
deleted file mode 100644
index 45c5f8f35d42..000000000000
--- a/lib/libc/mips/gen/_get_tp.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2021 The FreeBSD Foundation
- *
- * This software were developed by Konstantin Belousov
- * under sponsorship from the FreeBSD Foundation.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <string.h>
-#include <stdint.h>
-#include <machine/sysarch.h>
-#include <machine/tls.h>
-
-#include "libc_private.h"
-
-#ifdef __mips_n64
-static void *
-_mips_get_tls(void)
-{
- uint64_t _rv;
-
- __asm__ __volatile__ (
- ".set\tpush\n\t"
- ".set\tmips64r2\n\t"
- "rdhwr\t%0, $29\n\t"
- ".set\tpop"
- : "=r" (_rv));
- /*
- * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317'
- *
- * Remove the offset since this really a request to get the TLS
- * pointer via sysarch() (in theory). Of course, this may go away
- * once the TLS code is rewritten.
- */
- _rv = _rv - TLS_TP_OFFSET - TLS_TCB_SIZE;
-
- return (void *)_rv;
-}
-
-#else /* mips 32 */
-
-static void *
-_mips_get_tls(void)
-{
- uint32_t _rv;
-
- __asm__ __volatile__ (
- ".set\tpush\n\t"
- ".set\tmips32r2\n\t"
- "rdhwr\t%0, $29\n\t"
- ".set\tpop"
- : "=r" (_rv));
- /*
- * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317'
- *
- * Remove the offset since this really a request to get the TLS
- * pointer via sysarch() (in theory). Of course, this may go away
- * once the TLS code is rewritten.
- */
- _rv = _rv - TLS_TP_OFFSET - TLS_TCB_SIZE;
-
- return (void *)_rv;
-}
-#endif /* ! __mips_n64 */
-
-void *
-_get_tp(void)
-{
- void *res;
-
-#ifdef TLS_USE_SYSARCH
- sysarch(MIPS_GET_TLS, &res);
-#else
- res = _mips_get_tls();
-#endif
- return (res);
-}
diff --git a/lib/libc/mips/gen/_setjmp.S b/lib/libc/mips/gen/_setjmp.S
deleted file mode 100644
index 10c4cda5e0c1..000000000000
--- a/lib/libc/mips/gen/_setjmp.S
+++ /dev/null
@@ -1,200 +0,0 @@
-/* $NetBSD: _setjmp.S,v 1.20.34.5 2010/02/03 23:46:47 matt Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#include "SYS.h"
-
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
- RCSID("from: @(#)_setjmp.s 8.1 (Berkeley) 6/4/93")
-#else
- RCSID("$NetBSD: _setjmp.S,v 1.20.34.5 2010/02/03 23:46:47 matt Exp $")
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * C library -- _setjmp, _longjmp
- *
- * _longjmp(a,v)
- * will generate a "return(v)" from
- * the last call to
- * _setjmp(a)
- * by restoring registers from the stack,
- * The previous signal state is NOT restored.
- */
-
- .set noreorder
-
-LEAF(_setjmp)
- REG_PROLOGUE
- REG_LI v0, _JB_MAGIC__SETJMP # sigcontext magic number
- REG_S v0, (_JB_MAGIC * SZREG)(a0)
- REG_S ra, (_JB_REG_RA * SZREG)(a0)
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * Registers s0..s7 are callee-saved.
- * The sp register is callee-saved.
- * The fp (or s8) register is callee-saved.
- * The gp register is callee-saved (for n32/n64).
- */
- REG_S s0, (_JB_REG_S0 * SZREG)(a0)
- REG_S s1, (_JB_REG_S1 * SZREG)(a0)
- REG_S s2, (_JB_REG_S2 * SZREG)(a0)
- REG_S s3, (_JB_REG_S3 * SZREG)(a0)
- REG_S s4, (_JB_REG_S4 * SZREG)(a0)
- REG_S s5, (_JB_REG_S5 * SZREG)(a0)
- REG_S s6, (_JB_REG_S6 * SZREG)(a0)
- REG_S s7, (_JB_REG_S7 * SZREG)(a0)
- REG_S sp, (_JB_REG_SP * SZREG)(a0)
- REG_S s8, (_JB_REG_S8 * SZREG)(a0)
-#if defined(__mips_n32) || defined(__mips_n64)
- REG_S gp, (_JB_REG_GP * SZREG)(a0) # newabi gp is callee-saved
-#endif
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
- * In N64, FP registers F24 .. F31 are callee-saved.
- * In O32, FP registers F20 .. F23 are callee-saved.
- */
-#ifndef __mips_soft_float
- cfc1 v0, $31 # too bad can't check if FP used
-#if defined(__mips_n64) || defined(__mips_n32)
- FP_S $f30, (_JB_FPREG_F30 * SZREG)(a0)
- FP_S $f28, (_JB_FPREG_F28 * SZREG)(a0)
- FP_S $f26, (_JB_FPREG_F26 * SZREG)(a0)
- FP_S $f24, (_JB_FPREG_F24 * SZREG)(a0)
-#endif
-#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
- FP_S $f22, (_JB_FPREG_F22 * SZREG)(a0)
- FP_S $f20, (_JB_FPREG_F20 * SZREG)(a0)
-#endif
-#if defined(__mips_o32) || defined(__mips_o64)
- FP_S $f21, (_JB_FPREG_F21 * SZREG)(a0)
- FP_S $f23, (_JB_FPREG_F23 * SZREG)(a0)
-#endif
-#if defined(__mips_n64)
- FP_S $f25, (_JB_FPREG_F25 * SZREG)(a0)
- FP_S $f27, (_JB_FPREG_F27 * SZREG)(a0)
- FP_S $f29, (_JB_FPREG_F29 * SZREG)(a0)
- FP_S $f31, (_JB_FPREG_F31 * SZREG)(a0)
-#endif
- INT_S v0, (_JB_FPREG_FCSR * SZREG)(a0)
-#endif /* ! __mips_soft_float */
- REG_EPILOGUE
-
- j ra
- move v0, zero
-END(_setjmp)
-
-LEAF(_longjmp)
- PIC_PROLOGUE(_longjmp)
- PTR_SUBU sp, sp, CALLFRAME_SIZ
- SAVE_GP(CALLFRAME_GP)
-
- REG_PROLOGUE
- REG_L v0, (_JB_MAGIC * SZREG)(a0) # get magic number
- REG_L ra, (_JB_REG_RA * SZREG)(a0)
- REG_LI t0, _JB_MAGIC__SETJMP
- bne v0, t0, botch # jump if error
- PTR_ADDU sp, sp, CALLFRAME_SIZ # does not matter, sanity
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * Registers s0..s7 are callee-saved.
- * The sp register is callee-saved.
- * The fp (or s8) register is callee-saved.
- * The gp register is callee-saved (for n32/n64).
- */
- REG_L s0, (_JB_REG_S0 * SZREG)(a0)
- REG_L s1, (_JB_REG_S1 * SZREG)(a0)
- REG_L s2, (_JB_REG_S2 * SZREG)(a0)
- REG_L s3, (_JB_REG_S3 * SZREG)(a0)
- REG_L s4, (_JB_REG_S4 * SZREG)(a0)
- REG_L s5, (_JB_REG_S5 * SZREG)(a0)
- REG_L s6, (_JB_REG_S6 * SZREG)(a0)
- REG_L s7, (_JB_REG_S7 * SZREG)(a0)
- REG_L sp, (_JB_REG_SP * SZREG)(a0)
- REG_L s8, (_JB_REG_S8 * SZREG)(a0)
-#if defined(__mips_n32) || defined(__mips_n64)
- REG_L gp, (_JB_REG_GP * SZREG)(a0)
-#endif
-#ifndef __mips_soft_float
- # get fpu status
- INT_L v0, (_JB_FPREG_FCSR * SZREG)(a0)
- ctc1 v0, $31
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
- * In N64, FP registers F24 .. F31 are callee-saved.
- * In O32, FP registers F20 .. F23 are callee-saved.
- */
-#if defined(__mips_n64) || defined(__mips_n32)
- FP_L $f30, (_JB_FPREG_F30 * SZREG)(a0)
- FP_L $f28, (_JB_FPREG_F28 * SZREG)(a0)
- FP_L $f26, (_JB_FPREG_F26 * SZREG)(a0)
- FP_L $f24, (_JB_FPREG_F24 * SZREG)(a0)
-#endif
-#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
- FP_L $f22, (_JB_FPREG_F22 * SZREG)(a0)
- FP_L $f20, (_JB_FPREG_F20 * SZREG)(a0)
-#endif
-#if defined(__mips_o32) || defined(__mips_o64)
- FP_L $f21, (_JB_FPREG_F21 * SZREG)(a0)
- FP_L $f23, (_JB_FPREG_F23 * SZREG)(a0)
-#endif
-#if defined(__mips_n64)
- FP_L $f25, (_JB_FPREG_F25 * SZREG)(a0)
- FP_L $f27, (_JB_FPREG_F27 * SZREG)(a0)
- FP_L $f29, (_JB_FPREG_F29 * SZREG)(a0)
- FP_L $f31, (_JB_FPREG_F31 * SZREG)(a0)
-#endif
-#endif /* ! __mips_soft_float */
-
- REG_EPILOGUE
- move v0, a1 # get return value in 1st arg
- j ra
- nop
-
-botch:
- /*
- * We know we aren't returning so we don't care about restoring
- * our caller's GP.
- */
- PTR_LA t9, _C_LABEL(longjmperror)
- jalr t9
- nop
-
- PIC_TAILCALL(abort)
-END(_longjmp)
diff --git a/lib/libc/mips/gen/fabs.S b/lib/libc/mips/gen/fabs.S
deleted file mode 100644
index 3b79249864d1..000000000000
--- a/lib/libc/mips/gen/fabs.S
+++ /dev/null
@@ -1,58 +0,0 @@
-/* $NetBSD: fabs.S,v 1.7 2003/08/07 16:42:15 agc Exp $ */
-
-/*-
- * Copyright (c) 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)fabs.s 8.1 (Berkeley) 2/16/94")
- ASMSTR("$NetBSD: fabs.S,v 1.7 2003/08/07 16:42:15 agc Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-
-#ifdef __ABICALLS__
- .abicalls
-#endif
- .set noreorder
-
-/*
- * fabs(x)
- * double x;
- *
- * Return absolute value of x.
- */
-LEAF(fabs)
- j ra
- abs.d $f0, $f12 # compute absolute value of x
-END(fabs)
diff --git a/lib/libc/mips/gen/fabs.c b/lib/libc/mips/gen/fabs.c
deleted file mode 100644
index 9c51f43ff4e7..000000000000
--- a/lib/libc/mips/gen/fabs.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $NetBSD: fabs.c,v 1.2 2002/05/26 11:48:01 wiz Exp $ */
-
-/*-
- * SPDX-License-Identifier: BSD-4-Clause
- *
- * Copyright (c) 1996 Mark Brinicombe
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * fabs(x) returns the absolute value of x.
- */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-double
-fabs(double x)
-{
-
- return (__builtin_fabs(x));
-}
diff --git a/lib/libc/mips/gen/flt_rounds.c b/lib/libc/mips/gen/flt_rounds.c
deleted file mode 100644
index 27d8bf35315f..000000000000
--- a/lib/libc/mips/gen/flt_rounds.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* $NetBSD: flt_rounds.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
-
-/*
- * Written by J.T. Conklin, Apr 11, 1995
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: flt_rounds.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include <fenv.h>
-#include <float.h>
-
-#ifdef __mips_soft_float
-#include "softfloat-for-gcc.h"
-#include "milieu.h"
-#include "softfloat.h"
-#endif
-
-static const int map[] = {
- 1, /* round to nearest */
- 0, /* round to zero */
- 2, /* round to positive infinity */
- 3 /* round to negative infinity */
-};
-
-int
-__flt_rounds()
-{
- int mode;
-
-#ifdef __mips_soft_float
- mode = __softfloat_float_rounding_mode;
-#else
- __asm __volatile("cfc1 %0,$31" : "=r" (mode));
-#endif
-
- return map[mode & 0x03];
-}
diff --git a/lib/libc/mips/gen/hardfloat/fpgetmask.c b/lib/libc/mips/gen/hardfloat/fpgetmask.c
deleted file mode 100644
index 505a74c68466..000000000000
--- a/lib/libc/mips/gen/hardfloat/fpgetmask.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* $NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
-
-/*
- * Written by J.T. Conklin, Apr 11, 1995
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
-
-#include <ieeefp.h>
-
-#ifdef __weak_alias
-__weak_alias(fpgetmask,_fpgetmask)
-#endif
-
-fp_except_t
-fpgetmask()
-{
- int x;
-
- __asm("cfc1 %0,$31" : "=r" (x));
- return (x >> 7) & 0x1f;
-}
diff --git a/lib/libc/mips/gen/hardfloat/fpgetround.c b/lib/libc/mips/gen/hardfloat/fpgetround.c
deleted file mode 100644
index 6d0f11a5cb6e..000000000000
--- a/lib/libc/mips/gen/hardfloat/fpgetround.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* $NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
-
-/*
- * Written by J.T. Conklin, Apr 11, 1995
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
-
-#include <ieeefp.h>
-
-#ifdef __weak_alias
-__weak_alias(fpgetround,_fpgetround)
-#endif
-
-fp_rnd_t
-fpgetround()
-{
- int x;
-
- __asm("cfc1 %0,$31" : "=r" (x));
- return x & 0x03;
-}
diff --git a/lib/libc/mips/gen/hardfloat/fpgetsticky.c b/lib/libc/mips/gen/hardfloat/fpgetsticky.c
deleted file mode 100644
index 8028261c2c81..000000000000
--- a/lib/libc/mips/gen/hardfloat/fpgetsticky.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* $NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
-
-/*
- * Written by J.T. Conklin, Apr 11, 1995
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
-
-#include <ieeefp.h>
-
-#ifdef __weak_alias
-__weak_alias(fpgetsticky,_fpgetsticky)
-#endif
-
-fp_except_t
-fpgetsticky()
-{
- int x;
-
- __asm("cfc1 %0,$31" : "=r" (x));
- return (x >> 2) & 0x1f;
-}
diff --git a/lib/libc/mips/gen/hardfloat/fpsetmask.c b/lib/libc/mips/gen/hardfloat/fpsetmask.c
deleted file mode 100644
index 7abb3fd05f92..000000000000
--- a/lib/libc/mips/gen/hardfloat/fpsetmask.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* $NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
-
-/*
- * Written by J.T. Conklin, Apr 11, 1995
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
-
-#include <ieeefp.h>
-
-#ifdef __weak_alias
-__weak_alias(fpsetmask,_fpsetmask)
-#endif
-
-fp_except_t
-fpsetmask(mask)
- fp_except_t mask;
-{
- fp_except_t old;
- fp_except_t new;
-
- __asm("cfc1 %0,$31" : "=r" (old));
-
- new = old;
- new &= ~(0x1f << 7);
- new |= ((mask & 0x1f) << 7);
-
- __asm("ctc1 %0,$31" : : "r" (new));
-
- return (old >> 7) & 0x1f;
-}
diff --git a/lib/libc/mips/gen/hardfloat/fpsetround.c b/lib/libc/mips/gen/hardfloat/fpsetround.c
deleted file mode 100644
index 020516180033..000000000000
--- a/lib/libc/mips/gen/hardfloat/fpsetround.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* $NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
-
-/*
- * Written by J.T. Conklin, Apr 11, 1995
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
-
-#include <ieeefp.h>
-
-#ifdef __weak_alias
-__weak_alias(fpsetround,_fpsetround)
-#endif
-
-fp_rnd_t
-fpsetround(fp_rnd_t rnd_dir)
-{
- fp_rnd_t old;
- fp_rnd_t new;
-
- __asm("cfc1 %0,$31" : "=r" (old));
-
- new = old;
- new &= ~0x03;
- new |= (rnd_dir & 0x03);
-
- __asm("ctc1 %0,$31" : : "r" (new));
-
- return old & 0x03;
-}
diff --git a/lib/libc/mips/gen/hardfloat/fpsetsticky.c b/lib/libc/mips/gen/hardfloat/fpsetsticky.c
deleted file mode 100644
index e43367117792..000000000000
--- a/lib/libc/mips/gen/hardfloat/fpsetsticky.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* $NetBSD: fpsetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */
-
-/*
- * Written by J.T. Conklin, Apr 11, 1995
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
-
-#include <ieeefp.h>
-
-#ifdef __weak_alias
-__weak_alias(fpsetsticky,_fpsetsticky)
-#endif
-
-fp_except
-fpsetsticky(sticky)
- fp_except sticky;
-{
- fp_except old;
- fp_except new;
-
- __asm("cfc1 %0,$31" : "=r" (old));
-
- new = old;
- new &= ~(0x1f << 2);
- new |= ((sticky & 0x1f) << 2);
-
- __asm("ctc1 %0,$31" : : "r" (new));
-
- return (old >> 2) & 0x1f;
-}
diff --git a/lib/libc/mips/gen/infinity.c b/lib/libc/mips/gen/infinity.c
deleted file mode 100644
index 55cf25f8e9d7..000000000000
--- a/lib/libc/mips/gen/infinity.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * infinity.c
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <math.h>
-
-/* bytes for +Infinity on a 387 */
-const union __infinity_un __infinity = {
-#if BYTE_ORDER == BIG_ENDIAN
- { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
-#else
- { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
-#endif
-};
-
-/* bytes for NaN */
-const union __nan_un __nan = {
-#if BYTE_ORDER == BIG_ENDIAN
- {0x7f, 0xa0, 0, 0}
-#else
- { 0, 0, 0xa0, 0x7f }
-#endif
-};
diff --git a/lib/libc/mips/gen/ldexp.S b/lib/libc/mips/gen/ldexp.S
deleted file mode 100644
index caee70380707..000000000000
--- a/lib/libc/mips/gen/ldexp.S
+++ /dev/null
@@ -1,219 +0,0 @@
-/* $NetBSD: ldexp.S,v 1.8 2003/08/07 16:42:15 agc Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)ldexp.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: ldexp.S,v 1.8 2003/08/07 16:42:15 agc Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-#ifdef __ABICALLS__
- .abicalls
-#endif
-
-#define DEXP_INF 0x7ff
-#define DEXP_BIAS 1023
-#define DEXP_MIN -1022
-#define DEXP_MAX 1023
-#define DFRAC_BITS 52
-#define DIMPL_ONE 0x00100000
-#define DLEAD_ZEROS 31 - 20
-#define STICKYBIT 1
-#define GUARDBIT 0x80000000
-#define DSIGNAL_NAN 0x00040000
-#define DQUIET_NAN0 0x0007ffff
-#define DQUIET_NAN1 0xffffffff
-
-/*
- * double ldexp(x, N)
- * double x; int N;
- *
- * Return x * (2**N), for integer values N.
- */
-LEAF(ldexp)
- mfc1 v1, $f13 # get MSW of x
- mfc1 t3, $f12 # get LSW of x
- sll t1, v1, 1 # get x exponent
- srl t1, t1, 32 - 11
- beq t1, DEXP_INF, 9f # is it a NAN or infinity?
- beq t1, zero, 1f # zero or denormalized number?
- addu t1, t1, a2 # scale exponent
- sll v0, a2, 20 # position N for addition
- bge t1, DEXP_INF, 8f # overflow?
- addu v0, v0, v1 # multiply by (2**N)
- ble t1, zero, 4f # underflow?
- mtc1 v0, $f1 # save MSW of result
- mtc1 t3, $f0 # save LSW of result
- j ra
-1:
- sll t2, v1, 32 - 20 # get x fraction
- srl t2, t2, 32 - 20
- srl t0, v1, 31 # get x sign
- bne t2, zero, 1f
- beq t3, zero, 9f # result is zero
-1:
-/*
- * Find out how many leading zero bits are in t2,t3 and put in t9.
- */
- move v0, t2
- move t9, zero
- bne t2, zero, 1f
- move v0, t3
- addu t9, 32
-1:
- srl ta0, v0, 16
- bne ta0, zero, 1f
- addu t9, 16
- sll v0, 16
-1:
- srl ta0, v0, 24
- bne ta0, zero, 1f
- addu t9, 8
- sll v0, 8
-1:
- srl ta0, v0, 28
- bne ta0, zero, 1f
- addu t9, 4
- sll v0, 4
-1:
- srl ta0, v0, 30
- bne ta0, zero, 1f
- addu t9, 2
- sll v0, 2
-1:
- srl ta0, v0, 31
- bne ta0, zero, 1f
- addu t9, 1
-/*
- * Now shift t2,t3 the correct number of bits.
- */
-1:
- subu t9, t9, DLEAD_ZEROS # dont count normal leading zeros
- li t1, DEXP_MIN + DEXP_BIAS
- subu t1, t1, t9 # adjust exponent
- addu t1, t1, a2 # scale exponent
- li v0, 32
- blt t9, v0, 1f
- subu t9, t9, v0 # shift fraction left >= 32 bits
- sll t2, t3, t9
- move t3, zero
- b 2f
-1:
- subu v0, v0, t9 # shift fraction left < 32 bits
- sll t2, t2, t9
- srl ta0, t3, v0
- or t2, t2, ta0
- sll t3, t3, t9
-2:
- bge t1, DEXP_INF, 8f # overflow?
- ble t1, zero, 4f # underflow?
- sll t2, t2, 32 - 20 # clear implied one bit
- srl t2, t2, 32 - 20
-3:
- sll t1, t1, 31 - 11 # reposition exponent
- sll t0, t0, 31 # reposition sign
- or t0, t0, t1 # put result back together
- or t0, t0, t2
- mtc1 t0, $f1 # save MSW of result
- mtc1 t3, $f0 # save LSW of result
- j ra
-4:
- li v0, 0x80000000
- ble t1, -52, 7f # is result too small for denorm?
- sll t2, v1, 31 - 20 # clear exponent, extract fraction
- or t2, t2, v0 # set implied one bit
- blt t1, -30, 2f # will all bits in t3 be shifted out?
- srl t2, t2, 31 - 20 # shift fraction back to normal position
- subu t1, t1, 1
- sll ta0, t2, t1 # shift right t2,t3 based on exponent
- srl t8, t3, t1 # save bits shifted out
- negu t1
- srl t3, t3, t1
- or t3, t3, ta0
- srl t2, t2, t1
- bge t8, zero, 1f # does result need to be rounded?
- addu t3, t3, 1 # round result
- sltu ta0, t3, 1
- sll t8, t8, 1
- addu t2, t2, ta0
- bne t8, zero, 1f # round result to nearest
- and t3, t3, ~1
-1:
- mtc1 t3, $f0 # save denormalized result (LSW)
- mtc1 t2, $f1 # save denormalized result (MSW)
- bge v1, zero, 1f # should result be negative?
- neg.d $f0, $f0 # negate result
-1:
- j ra
-2:
- mtc1 zero, $f1 # exponent and upper fraction
- addu t1, t1, 20 # compute amount to shift right by
- sll t8, t2, t1 # save bits shifted out
- negu t1
- srl t3, t2, t1
- bge t8, zero, 1f # does result need to be rounded?
- addu t3, t3, 1 # round result
- sltu ta0, t3, 1
- sll t8, t8, 1
- mtc1 ta0, $f1 # exponent and upper fraction
- bne t8, zero, 1f # round result to nearest
- and t3, t3, ~1
-1:
- mtc1 t3, $f0
- bge v1, zero, 1f # is result negative?
- neg.d $f0, $f0 # negate result
-1:
- j ra
-7:
- mtc1 zero, $f0 # result is zero
- mtc1 zero, $f1
- beq t0, zero, 1f # is result positive?
- neg.d $f0, $f0 # negate result
-1:
- j ra
-8:
- li t1, 0x7ff00000 # result is infinity (MSW)
- mtc1 t1, $f1
- mtc1 zero, $f0 # result is infinity (LSW)
- bge v1, zero, 1f # should result be negative infinity?
- neg.d $f0, $f0 # result is negative infinity
-1:
- add.d $f0, $f0 # cause overflow faults if enabled
- j ra
-9:
- mov.d $f0, $f12 # yes, result is just x
- j ra
-END(ldexp)
diff --git a/lib/libc/mips/gen/makecontext.c b/lib/libc/mips/gen/makecontext.c
deleted file mode 100644
index 7d3e647b4d09..000000000000
--- a/lib/libc/mips/gen/makecontext.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* $NetBSD: makecontext.c,v 1.5 2009/12/14 01:07:42 matt Exp $ */
-
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-NetBSD
- *
- * Copyright (c) 2001 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Klaus Klein.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: makecontext.c,v 1.5 2009/12/14 01:07:42 matt Exp $");
-#endif
-
-#include <sys/param.h>
-#include <machine/abi.h>
-#define _WANT_MIPS_REGNUM
-#include <machine/regnum.h>
-
-#include <stdarg.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <ucontext.h>
-
-__weak_reference(__makecontext, makecontext);
-
-void _ctx_done(ucontext_t *);
-void _ctx_start(void);
-
-void
-__makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
-{
- mcontext_t *mc;
- register_t *sp;
- int i;
- va_list ap;
-
- /*
- * XXX/juli
- * We need an mc_len or mc_flags like other architectures
- * so that we can mark a context as invalid. Store it in
- * mc->mc_regs[ZERO] perhaps?
- */
- if (argc < 0 || ucp == NULL ||
- ucp->uc_stack.ss_sp == NULL ||
- ucp->uc_stack.ss_size < MINSIGSTKSZ)
- return;
- mc = &ucp->uc_mcontext;
-
- sp = (register_t *)
- ((uintptr_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
-#if defined(__mips_o32) || defined(__mips_o64)
- sp -= (argc >= 4 ? argc : 4); /* Make room for >=4 arguments. */
-#elif defined(__mips_n32) || defined(__mips_n64)
- sp -= (argc > 8 ? argc - 8 : 0); /* Make room for > 8 arguments. */
-#endif
- sp = (register_t *)((uintptr_t)sp & ~(STACK_ALIGN - 1));
-
- mc->mc_regs[SP] = (intptr_t)sp;
- mc->mc_regs[S0] = (intptr_t)ucp;
- mc->mc_regs[T9] = (intptr_t)func;
- mc->mc_pc = (intptr_t)_ctx_start;
-
- /* Construct argument list. */
- va_start(ap, argc);
-#if defined(__mips_o32) || defined(__mips_o64)
- /* Up to the first four arguments are passed in $a0-3. */
- for (i = 0; i < argc && i < 4; i++)
- /* LINTED register_t is safe */
- mc->mc_regs[A0 + i] = va_arg(ap, register_t);
- /* Skip over the $a0-3 gap. */
- sp += 4;
-#endif
-#if defined(__mips_n32) || defined(__mips_n64)
- /* Up to the first 8 arguments are passed in $a0-7. */
- for (i = 0; i < argc && i < 8; i++)
- /* LINTED register_t is safe */
- mc->mc_regs[A0 + i] = va_arg(ap, register_t);
-#endif
- /* Pass remaining arguments on the stack. */
- for (; i < argc; i++)
- /* LINTED register_t is safe */
- *sp++ = va_arg(ap, register_t);
- va_end(ap);
-}
-
-void
-_ctx_done(ucontext_t *ucp)
-{
-
- if (ucp->uc_link == NULL)
- exit(0);
- else {
- setcontext((const ucontext_t *)ucp->uc_link);
- abort();
- }
-}
diff --git a/lib/libc/mips/gen/setjmp.S b/lib/libc/mips/gen/setjmp.S
deleted file mode 100644
index 3ef6878bb608..000000000000
--- a/lib/libc/mips/gen/setjmp.S
+++ /dev/null
@@ -1,237 +0,0 @@
-/* $NetBSD: setjmp.S,v 1.17 2005/09/17 11:49:39 tsutsui Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: setjmp.S,v 1.17 2005/09/17 11:49:39 tsutsui Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-#include "SYS.h"
-
-#ifdef __ABICALLS__
- .abicalls
-#endif
-
-/*
- * C library -- setjmp, longjmp
- *
- * longjmp(a,v)
- * will generate a "return(v)" from
- * the last call to
- * setjmp(a)
- * by restoring registers from the stack,
- * and a struct sigcontext, see <signal.h>
- */
-
-#define SETJMP_FRAME_SIZE (CALLFRAME_SIZ + (SZREG * 2))
-
-
-NESTED(setjmp, SETJMP_FRAME_SIZE, ra)
- .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
- SETUP_GP
- PTR_SUBU sp, sp, SETJMP_FRAME_SIZE # allocate stack frame
- SAVE_GP(CALLFRAME_GP)
- SETUP_GP64(CALLFRAME_GP, setjmp)
-
- REG_S ra, CALLFRAME_RA(sp) # save RA
- REG_S a0, CALLFRAME_SIZ(sp) # store env
-
- /* Get the signal mask. */
- PTR_ADDU a2, a0, _JB_SIGMASK * SZREG # &oenv
- li a0, 1 # SIG_SETBLOCK
- move a1, zero # &env == 0
- PTR_LA t9, _C_LABEL(sigprocmask) # get current signal mask
- jalr t9
-
- RESTORE_GP64
- REG_L a0, CALLFRAME_SIZ(sp) # restore env pointer
- REG_L ra, CALLFRAME_RA(sp) # restore RA
- PTR_ADDU sp, sp, SETJMP_FRAME_SIZE # pop stack frame
-
- REG_LI v0, _JB_MAGIC_SETJMP
- REG_S v0, (_JB_MAGIC * SZREG)(a0)
- REG_S ra, (_JB_REG_RA * SZREG)(a0)
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * Registers s0..s7 are callee-saved.
- * The sp register is callee-saved.
- * The fp (or s8) register is callee-saved.
- * The gp register is callee-saved (for n32/n64).
- */
- REG_S s0, (_JB_REG_S0 * SZREG)(a0)
- REG_S s1, (_JB_REG_S1 * SZREG)(a0)
- REG_S s2, (_JB_REG_S2 * SZREG)(a0)
- REG_S s3, (_JB_REG_S3 * SZREG)(a0)
- REG_S s4, (_JB_REG_S4 * SZREG)(a0)
- REG_S s5, (_JB_REG_S5 * SZREG)(a0)
- REG_S s6, (_JB_REG_S6 * SZREG)(a0)
- REG_S s7, (_JB_REG_S7 * SZREG)(a0)
- REG_S sp, (_JB_REG_SP * SZREG)(a0)
- REG_S s8, (_JB_REG_S8 * SZREG)(a0)
-#if defined(__mips_n32) || defined(__mips_n64)
- REG_S gp, (_JB_REG_GP * SZREG)(a0)
-#endif
-#ifndef __mips_soft_float
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
- * In N64, FP registers F24 .. F31 are callee-saved.
- * In O32, FP registers F20 .. F23 are callee-saved.
- */
- cfc1 v0, $31
- INT_S v0, (_JB_FPREG_FCSR * SZREG)(a0)
-#if defined(__mips_o32) || defined(__mips_o64) || defined(__mips_n32)
- FP_S $f20, (_JB_FPREG_F20 * SZREG)(a0)
- FP_S $f22, (_JB_FPREG_F22 * SZREG)(a0)
-#endif
-#if defined(__mips_o32) || defined(__mips_o64)
- FP_S $f21, (_JB_FPREG_F21 * SZREG)(a0)
- FP_S $f23, (_JB_FPREG_F23 * SZREG)(a0)
-#endif
-#if defined(__mips_n32) || defined(__mips_n64)
- FP_S $f24, (_JB_FPREG_F24 * SZREG)(a0)
- FP_S $f26, (_JB_FPREG_F26 * SZREG)(a0)
- FP_S $f28, (_JB_FPREG_F28 * SZREG)(a0)
- FP_S $f30, (_JB_FPREG_F30 * SZREG)(a0)
-#endif
-#if defined(__mips_n64)
- FP_S $f25, (_JB_FPREG_F25 * SZREG)(a0)
- FP_S $f27, (_JB_FPREG_F27 * SZREG)(a0)
- FP_S $f29, (_JB_FPREG_F29 * SZREG)(a0)
- FP_S $f31, (_JB_FPREG_F31 * SZREG)(a0)
-#endif
-#endif /* ! __mips_soft_float */
-
- move v0, zero
- jr ra
-END(setjmp)
-
-#define LONGJMP_FRAME_SIZE (CALLFRAME_SIZ + (SZREG * 2))
-
-NESTED(longjmp, LONGJMP_FRAME_SIZE, ra)
- .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
- PIC_PROLOGUE(longjmp)
- PTR_SUBU sp, sp, LONGJMP_FRAME_SIZE # allocate stack frame
- SAVE_GP(CALLFRAME_GP)
-
- REG_S ra, CALLFRAME_RA(sp) # save RA
- REG_L v0, (_JB_MAGIC * SZREG)(a0)
- REG_LI t0, _JB_MAGIC_SETJMP
- bne v0, t0, botch # jump if error
- nop
-
- REG_S a0, CALLFRAME_SIZ(sp) # save env
- REG_S a1, (CALLFRAME_SIZ + SZREG)(sp) # save return value
-
- # set sigmask
- PTR_ADDU a1, a0, _JB_SIGMASK * SZREG # &set
- move a2, zero # &oset == NULL
- li a0, 3 # SIG_SETMASK
- PTR_LA t9,_C_LABEL(sigprocmask) # set current signal mask
- jal t9
- nop
-
- REG_L a0, CALLFRAME_SIZ(sp) # restore env
- REG_L a1, (CALLFRAME_SIZ + SZREG)(sp) # restore return value
-
- REG_L ra, (_JB_REG_RA * SZREG)(a0)
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * Registers s0..s7 are callee-saved.
- * The sp register is callee-saved.
- * The fp (or s8) register is callee-saved.
- * The gp register is callee-saved (for n32/n64).
- */
- REG_L s0, (_JB_REG_S0 * SZREG)(a0)
- REG_L s1, (_JB_REG_S1 * SZREG)(a0)
- REG_L s2, (_JB_REG_S2 * SZREG)(a0)
- REG_L s3, (_JB_REG_S3 * SZREG)(a0)
- REG_L s4, (_JB_REG_S4 * SZREG)(a0)
- REG_L s5, (_JB_REG_S5 * SZREG)(a0)
- REG_L s6, (_JB_REG_S6 * SZREG)(a0)
- REG_L s7, (_JB_REG_S7 * SZREG)(a0)
- REG_L sp, (_JB_REG_SP * SZREG)(a0)
- REG_L s8, (_JB_REG_S8 * SZREG)(a0)
-#if defined(__mips_n32) || defined(__mips_n64)
- REG_L gp, (_JB_REG_GP * SZREG)(a0)
-#endif
-#ifndef __mips_soft_float
- /*
- * From "MIPSpro N32 ABI Handbook", Table 2-1:
- * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
- * In N64, FP registers F23 .. F31 are callee-saved.
- * In O32, FP registers F20 .. F23 are callee-saved.
- */
- INT_L v0, (_JB_FPREG_FCSR * SZREG)(a0)
- ctc1 v0, $31
-#if defined(__mips_n64) || defined(__mips_n32)
- FP_L $f30, (_JB_FPREG_F30 * SZREG)(a0)
- FP_L $f28, (_JB_FPREG_F28 * SZREG)(a0)
- FP_L $f26, (_JB_FPREG_F26 * SZREG)(a0)
- FP_L $f24, (_JB_FPREG_F24 * SZREG)(a0)
-#endif
-#if defined(__mips_n32) || defined(__mips_o32) || defined(__mips_o64)
- FP_L $f22, (_JB_FPREG_F22 * SZREG)(a0)
- FP_L $f20, (_JB_FPREG_F20 * SZREG)(a0)
-#endif
-#if defined(__mips_o32) || defined(__mips_o64)
- FP_L $f21, (_JB_FPREG_F21 * SZREG)(a0)
- FP_L $f23, (_JB_FPREG_F23 * SZREG)(a0)
-#endif
-#if defined(__mips_n64)
- FP_L $f25, (_JB_FPREG_F25 * SZREG)(a0)
- FP_L $f27, (_JB_FPREG_F27 * SZREG)(a0)
- FP_L $f29, (_JB_FPREG_F29 * SZREG)(a0)
- FP_L $f31, (_JB_FPREG_F31 * SZREG)(a0)
-#endif
-#endif /* ! __mips_soft_float */
-
- move v0, a1
- j ra
- nop
-
-botch:
- /*
- * We know we aren't returning so we don't care about restoring
- * our caller's GP.
- */
- PTR_LA t9, _C_LABEL(longjmperror)
- jalr t9
- nop
-
- PIC_TAILCALL(abort)
-END(longjmp)
diff --git a/lib/libc/mips/gen/signalcontext.c b/lib/libc/mips/gen/signalcontext.c
deleted file mode 100644
index 7870a1efede8..000000000000
--- a/lib/libc/mips/gen/signalcontext.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2004 Olivier Houchard
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/signal.h>
-#include <sys/ucontext.h>
-
-#include <machine/frame.h>
-#include <machine/sigframe.h>
-
-#include <errno.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <strings.h>
-#include <signal.h>
-
-__weak_reference(__signalcontext, signalcontext);
-
-extern void _ctx_start(void);
-
-int
-__signalcontext(ucontext_t *ucp, int sig, __sighandler_t *func)
-{
- /* XXXMIPS: Implement me */
- return (0);
-}
diff --git a/lib/libc/mips/gen/sigsetjmp.S b/lib/libc/mips/gen/sigsetjmp.S
deleted file mode 100644
index a36b2803a10b..000000000000
--- a/lib/libc/mips/gen/sigsetjmp.S
+++ /dev/null
@@ -1,76 +0,0 @@
-/* $NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993, 1995,
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Havard Eidnes.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-#include "SYS.h"
-
-#ifdef __ABICALLS__
- .abicalls
-#endif
-
-/*
- * C library -- sigsetjmp, siglongjmp
- *
- * siglongjmp(a,v)
- * will generate a "return(v)" from
- * the last call to
- * sigsetjmp(a, savemask)
- * by restoring registers from the stack,
- * and dependent on savemask restores the
- * signal mask.
- */
-
-LEAF(sigsetjmp)
- PIC_PROLOGUE(sigsetjmp)
-
- bne a1, zero, 1f # do saving of signal mask?
- PIC_TAILCALL(_setjmp)
-
-1: PIC_TAILCALL(setjmp)
-END(sigsetjmp)
-
-LEAF(siglongjmp)
- PIC_PROLOGUE(siglongjmp)
- REG_L t0, (_JB_MAGIC * SZREG)(a0)
- REG_LI t1, _JB_MAGIC__SETJMP
- bne t0, t1, 1f # setjmp or _setjmp magic?
- PIC_TAILCALL(_longjmp)
-1: PIC_TAILCALL(longjmp)
-END(siglongjmp)
diff --git a/lib/libc/mips/net/Makefile.inc b/lib/libc/mips/net/Makefile.inc
deleted file mode 100644
index 304d5cac1a3e..000000000000
--- a/lib/libc/mips/net/Makefile.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-# $NetBSD: Makefile.inc,v 1.3 2003/08/01 17:03:51 lukem Exp $
-# $FreeBSD$
-
-SRCS+= htonl.S ntohl.S htons.S ntohs.S
diff --git a/lib/libc/mips/net/htonl.S b/lib/libc/mips/net/htonl.S
deleted file mode 100644
index 66c4f90fd65f..000000000000
--- a/lib/libc/mips/net/htonl.S
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $NetBSD: byte_swap_4.S,v 1.2 2006/02/08 21:52:36 simonb Exp $ */
-
-/*-
- * Copyright (c) 1997 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Neil A. Carson
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-
-__FBSDID("$FreeBSD$");
-
-LEAF(htonl) # a0 = 0x11223344, return 0x44332211
-#ifdef __MIPSEB__
- move v0, a0
-#else
- srl v1, a0, 24 # v1 = 0x00000011
- sll v0, a0, 24 # v0 = 0x44000000
- or v0, v0, v1
- and v1, a0, 0xff00
- sll v1, v1, 8 # v1 = 0x00330000
- or v0, v0, v1
- srl v1, a0, 8
- and v1, v1, 0xff00 # v1 = 0x00002200
- or v0, v0, v1
-#endif
- j ra
-END(htonl)
diff --git a/lib/libc/mips/net/htons.S b/lib/libc/mips/net/htons.S
deleted file mode 100644
index 0449c4d82e5c..000000000000
--- a/lib/libc/mips/net/htons.S
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $NetBSD: byte_swap_2.S,v 1.2 2006/02/08 21:52:36 simonb Exp $ */
-
-/*-
- * Copyright (c) 1999 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Charles M. Hannum.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-
-__FBSDID("$FreeBSD$");
-
-LEAF(htons)
-#ifdef __MIPSEB__
- move v0, a0
-#else
- srl v0, a0, 8
- and v0, v0, 0xff
- sll v1, a0, 8
- and v1, v1, 0xff00
- or v0, v0, v1
-#endif
- j ra
-END(htons)
diff --git a/lib/libc/mips/net/ntohl.S b/lib/libc/mips/net/ntohl.S
deleted file mode 100644
index 39001aa86bbe..000000000000
--- a/lib/libc/mips/net/ntohl.S
+++ /dev/null
@@ -1,51 +0,0 @@
-/* $NetBSD: byte_swap_4.S,v 1.2 2006/02/08 21:52:36 simonb Exp $ */
-
-/*-
- * Copyright (c) 1997 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Neil A. Carson
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-
-__FBSDID("$FreeBSD$");
-
-LEAF(ntohl) # a0 = 0x11223344, return 0x44332211
-#ifdef __MIPSEB__
- move v0, a0
-#else
- srl v1, a0, 24 # v1 = 0x00000011
- sll v0, a0, 24 # v0 = 0x44000000
- or v0, v0, v1
- and v1, a0, 0xff00
- sll v1, v1, 8 # v1 = 0x00330000
- or v0, v0, v1
- srl v1, a0, 8
- and v1, v1, 0xff00 # v1 = 0x00002200
- or v0, v0, v1
-#endif
- j ra
-END(ntohl)
diff --git a/lib/libc/mips/net/ntohs.S b/lib/libc/mips/net/ntohs.S
deleted file mode 100644
index 4761371be1af..000000000000
--- a/lib/libc/mips/net/ntohs.S
+++ /dev/null
@@ -1,46 +0,0 @@
-/* $NetBSD: byte_swap_2.S,v 1.2 2006/02/08 21:52:36 simonb Exp $ */
-
-/*-
- * Copyright (c) 1999 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Charles M. Hannum.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-LEAF(ntohs)
-#ifdef __MIPSEB__
- move v0, a0
-#else
- srl v0, a0, 8
- and v0, v0, 0xff
- sll v1, a0, 8
- and v1, v1, 0xff00
- or v0, v0, v1
-#endif
- j ra
-END(ntohs)
diff --git a/lib/libc/mips/softfloat/milieu.h b/lib/libc/mips/softfloat/milieu.h
deleted file mode 100644
index e04b26692113..000000000000
--- a/lib/libc/mips/softfloat/milieu.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $FreeBSD$ */
-
-/*
-===============================================================================
-
-This C header file is part of the SoftFloat IEC/IEEE Floating-point
-Arithmetic Package, Release 2a.
-
-Written by John R. Hauser. This work was made possible in part by the
-International Computer Science Institute, located at Suite 600, 1947 Center
-Street, Berkeley, California 94704. Funding was partially provided by the
-National Science Foundation under grant MIP-9311980. The original version
-of this code was written as part of a project to build a fixed-point vector
-processor in collaboration with the University of California at Berkeley,
-overseen by Profs. Nelson Morgan and John Wawrzynek. More information
-is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
-arithmetic/SoftFloat.html'.
-
-THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
-has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
-TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
-PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
-AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
-
-Derivative works are acceptable, even for commercial purposes, so long as
-(1) they include prominent notice that the work is derivative, and (2) they
-include prominent notice akin to these four paragraphs for those parts of
-this code that are retained.
-
-===============================================================================
-*/
-
-/*
--------------------------------------------------------------------------------
-Include common integer types and flags.
--------------------------------------------------------------------------------
-*/
-#include "mips-gcc.h"
-
-/*
--------------------------------------------------------------------------------
-Symbolic Boolean literals.
--------------------------------------------------------------------------------
-*/
-enum {
- FALSE = 0,
- TRUE = 1
-};
diff --git a/lib/libc/mips/softfloat/mips-gcc.h b/lib/libc/mips/softfloat/mips-gcc.h
deleted file mode 100644
index c8ec07c839c8..000000000000
--- a/lib/libc/mips/softfloat/mips-gcc.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* $NetBSD: arm-gcc.h,v 1.2 2001/02/21 18:09:25 bjh21 Exp $ */
-/* $FreeBSD$ */
-
-/*
--------------------------------------------------------------------------------
-One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
--------------------------------------------------------------------------------
-*/
-#ifdef __MIPSEB__
-#define BIGENDIAN
-#else
-#define LITTLEENDIAN
-#endif
-
-/*
--------------------------------------------------------------------------------
-The macro `BITS64' can be defined to indicate that 64-bit integer types are
-supported by the compiler.
--------------------------------------------------------------------------------
-*/
-#define BITS64
-
-/*
--------------------------------------------------------------------------------
-Each of the following `typedef's defines the most convenient type that holds
-integers of at least as many bits as specified. For example, `uint8' should
-be the most convenient type that can hold unsigned integers of as many as
-8 bits. The `flag' type must be able to hold either a 0 or 1. For most
-implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
-to the same as `int'.
--------------------------------------------------------------------------------
-*/
-typedef int flag;
-typedef int uint8;
-typedef int int8;
-typedef int uint16;
-typedef int int16;
-typedef unsigned int uint32;
-typedef signed int int32;
-#ifdef BITS64
-typedef unsigned long long int uint64;
-typedef signed long long int int64;
-#endif
-
-/*
--------------------------------------------------------------------------------
-Each of the following `typedef's defines a type that holds integers
-of _exactly_ the number of bits specified. For instance, for most
-implementation of C, `bits16' and `sbits16' should be `typedef'ed to
-`unsigned short int' and `signed short int' (or `short int'), respectively.
--------------------------------------------------------------------------------
-*/
-typedef unsigned char bits8;
-typedef signed char sbits8;
-typedef unsigned short int bits16;
-typedef signed short int sbits16;
-typedef unsigned int bits32;
-typedef signed int sbits32;
-#ifdef BITS64
-typedef unsigned long long int bits64;
-typedef signed long long int sbits64;
-#endif
-
-#ifdef BITS64
-/*
--------------------------------------------------------------------------------
-The `LIT64' macro takes as its argument a textual integer literal and
-if necessary ``marks'' the literal as having a 64-bit integer type.
-For example, the GNU C Compiler (`gcc') requires that 64-bit literals be
-appended with the letters `LL' standing for `long long', which is `gcc's
-name for the 64-bit integer type. Some compilers may allow `LIT64' to be
-defined as the identity macro: `#define LIT64( a ) a'.
--------------------------------------------------------------------------------
-*/
-#define LIT64( a ) a##LL
-#endif
-
-/*
--------------------------------------------------------------------------------
-The macro `INLINE' can be used before functions that should be inlined. If
-a compiler does not support explicit inlining, this macro should be defined
-to be `static'.
--------------------------------------------------------------------------------
-*/
-#define INLINE static __inline
-
-#if defined(SOFTFLOAT_FOR_GCC)
-/* XXXMIPS: check this one */
-#define FLOAT64_DEMANGLE(a) (a)
-#define FLOAT64_MANGLE(a) (a)
-#endif
diff --git a/lib/libc/mips/softfloat/softfloat.h b/lib/libc/mips/softfloat/softfloat.h
deleted file mode 100644
index 6aef49975a38..000000000000
--- a/lib/libc/mips/softfloat/softfloat.h
+++ /dev/null
@@ -1,315 +0,0 @@
-/* $NetBSD: softfloat.h,v 1.6 2002/05/12 13:12:46 bjh21 Exp $ */
-/* $FreeBSD$ */
-
-/* This is a derivative work. */
-
-/*
-===============================================================================
-
-This C header file is part of the SoftFloat IEC/IEEE Floating-point
-Arithmetic Package, Release 2a.
-
-Written by John R. Hauser. This work was made possible in part by the
-International Computer Science Institute, located at Suite 600, 1947 Center
-Street, Berkeley, California 94704. Funding was partially provided by the
-National Science Foundation under grant MIP-9311980. The original version
-of this code was written as part of a project to build a fixed-point vector
-processor in collaboration with the University of California at Berkeley,
-overseen by Profs. Nelson Morgan and John Wawrzynek. More information
-is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/
-arithmetic/SoftFloat.html'.
-
-THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort
-has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT
-TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO
-PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY
-AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.
-
-Derivative works are acceptable, even for commercial purposes, so long as
-(1) they include prominent notice that the work is derivative, and (2) they
-include prominent notice akin to these four paragraphs for those parts of
-this code that are retained.
-
-===============================================================================
-*/
-
-/*
--------------------------------------------------------------------------------
-The macro `FLOATX80' must be defined to enable the extended double-precision
-floating-point format `floatx80'. If this macro is not defined, the
-`floatx80' type will not be defined, and none of the functions that either
-input or output the `floatx80' type will be defined. The same applies to
-the `FLOAT128' macro and the quadruple-precision format `float128'.
--------------------------------------------------------------------------------
-*/
-/* #define FLOATX80 */
-/* #define FLOAT128 */
-
-#include <fenv.h>
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE floating-point types.
--------------------------------------------------------------------------------
-*/
-typedef unsigned int float32;
-typedef unsigned long long float64;
-#ifdef FLOATX80
-typedef struct {
- unsigned short high;
- unsigned long long low;
-} floatx80;
-#endif
-#ifdef FLOAT128
-typedef struct {
- unsigned long long high, low;
-} float128;
-#endif
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE floating-point underflow tininess-detection mode.
--------------------------------------------------------------------------------
-*/
-#ifndef SOFTFLOAT_FOR_GCC
-extern int float_detect_tininess;
-#endif
-enum {
- float_tininess_after_rounding = 0,
- float_tininess_before_rounding = 1
-};
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE floating-point rounding mode.
--------------------------------------------------------------------------------
-*/
-extern int float_rounding_mode;
-enum {
- float_round_nearest_even = FE_TONEAREST,
- float_round_to_zero = FE_TOWARDZERO,
- float_round_down = FE_DOWNWARD,
- float_round_up = FE_UPWARD
-};
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE floating-point exception flags.
--------------------------------------------------------------------------------
-*/
-extern int float_exception_flags;
-extern int float_exception_mask;
-enum {
- float_flag_inexact = FE_INEXACT,
- float_flag_underflow = FE_UNDERFLOW,
- float_flag_overflow = FE_OVERFLOW,
- float_flag_divbyzero = FE_DIVBYZERO,
- float_flag_invalid = FE_INVALID
-};
-
-/*
--------------------------------------------------------------------------------
-Routine to raise any or all of the software IEC/IEEE floating-point
-exception flags.
--------------------------------------------------------------------------------
-*/
-void float_raise( int );
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE integer-to-floating-point conversion routines.
--------------------------------------------------------------------------------
-*/
-float32 int32_to_float32( int );
-float64 int32_to_float64( int );
-#ifdef FLOATX80
-floatx80 int32_to_floatx80( int );
-#endif
-#ifdef FLOAT128
-float128 int32_to_float128( int );
-#endif
-#ifndef SOFTFLOAT_FOR_GCC /* __floatdi?f is in libgcc2.c */
-float32 int64_to_float32( long long );
-float64 int64_to_float64( long long );
-#ifdef FLOATX80
-floatx80 int64_to_floatx80( long long );
-#endif
-#ifdef FLOAT128
-float128 int64_to_float128( long long );
-#endif
-#endif
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE single-precision conversion routines.
--------------------------------------------------------------------------------
-*/
-int float32_to_int32( float32 );
-int float32_to_int32_round_to_zero( float32 );
-#if defined(SOFTFLOAT_FOR_GCC) && defined(SOFTFLOAT_NEED_FIXUNS)
-unsigned int float32_to_uint32_round_to_zero( float32 );
-#endif
-#ifndef SOFTFLOAT_FOR_GCC /* __fix?fdi provided by libgcc2.c */
-long long float32_to_int64( float32 );
-long long float32_to_int64_round_to_zero( float32 );
-#endif
-float64 float32_to_float64( float32 );
-#ifdef FLOATX80
-floatx80 float32_to_floatx80( float32 );
-#endif
-#ifdef FLOAT128
-float128 float32_to_float128( float32 );
-#endif
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE single-precision operations.
--------------------------------------------------------------------------------
-*/
-float32 float32_round_to_int( float32 );
-float32 float32_add( float32, float32 );
-float32 float32_sub( float32, float32 );
-float32 float32_mul( float32, float32 );
-float32 float32_div( float32, float32 );
-float32 float32_rem( float32, float32 );
-float32 float32_sqrt( float32 );
-int float32_eq( float32, float32 );
-int float32_le( float32, float32 );
-int float32_lt( float32, float32 );
-int float32_eq_signaling( float32, float32 );
-int float32_le_quiet( float32, float32 );
-int float32_lt_quiet( float32, float32 );
-#ifndef SOFTFLOAT_FOR_GCC
-int float32_is_signaling_nan( float32 );
-#endif
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE double-precision conversion routines.
--------------------------------------------------------------------------------
-*/
-int float64_to_int32( float64 );
-int float64_to_int32_round_to_zero( float64 );
-#if defined(SOFTFLOAT_FOR_GCC) && defined(SOFTFLOAT_NEED_FIXUNS)
-unsigned int float64_to_uint32_round_to_zero( float64 );
-#endif
-#ifndef SOFTFLOAT_FOR_GCC /* __fix?fdi provided by libgcc2.c */
-long long float64_to_int64( float64 );
-long long float64_to_int64_round_to_zero( float64 );
-#endif
-float32 float64_to_float32( float64 );
-#ifdef FLOATX80
-floatx80 float64_to_floatx80( float64 );
-#endif
-#ifdef FLOAT128
-float128 float64_to_float128( float64 );
-#endif
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE double-precision operations.
--------------------------------------------------------------------------------
-*/
-float64 float64_round_to_int( float64 );
-float64 float64_add( float64, float64 );
-float64 float64_sub( float64, float64 );
-float64 float64_mul( float64, float64 );
-float64 float64_div( float64, float64 );
-float64 float64_rem( float64, float64 );
-float64 float64_sqrt( float64 );
-int float64_eq( float64, float64 );
-int float64_le( float64, float64 );
-int float64_lt( float64, float64 );
-int float64_eq_signaling( float64, float64 );
-int float64_le_quiet( float64, float64 );
-int float64_lt_quiet( float64, float64 );
-#ifndef SOFTFLOAT_FOR_GCC
-int float64_is_signaling_nan( float64 );
-#endif
-
-#ifdef FLOATX80
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE extended double-precision conversion routines.
--------------------------------------------------------------------------------
-*/
-int floatx80_to_int32( floatx80 );
-int floatx80_to_int32_round_to_zero( floatx80 );
-long long floatx80_to_int64( floatx80 );
-long long floatx80_to_int64_round_to_zero( floatx80 );
-float32 floatx80_to_float32( floatx80 );
-float64 floatx80_to_float64( floatx80 );
-#ifdef FLOAT128
-float128 floatx80_to_float128( floatx80 );
-#endif
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE extended double-precision rounding precision. Valid
-values are 32, 64, and 80.
--------------------------------------------------------------------------------
-*/
-extern int floatx80_rounding_precision;
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE extended double-precision operations.
--------------------------------------------------------------------------------
-*/
-floatx80 floatx80_round_to_int( floatx80 );
-floatx80 floatx80_add( floatx80, floatx80 );
-floatx80 floatx80_sub( floatx80, floatx80 );
-floatx80 floatx80_mul( floatx80, floatx80 );
-floatx80 floatx80_div( floatx80, floatx80 );
-floatx80 floatx80_rem( floatx80, floatx80 );
-floatx80 floatx80_sqrt( floatx80 );
-int floatx80_eq( floatx80, floatx80 );
-int floatx80_le( floatx80, floatx80 );
-int floatx80_lt( floatx80, floatx80 );
-int floatx80_eq_signaling( floatx80, floatx80 );
-int floatx80_le_quiet( floatx80, floatx80 );
-int floatx80_lt_quiet( floatx80, floatx80 );
-int floatx80_is_signaling_nan( floatx80 );
-
-#endif
-
-#ifdef FLOAT128
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE quadruple-precision conversion routines.
--------------------------------------------------------------------------------
-*/
-int float128_to_int32( float128 );
-int float128_to_int32_round_to_zero( float128 );
-long long float128_to_int64( float128 );
-long long float128_to_int64_round_to_zero( float128 );
-float32 float128_to_float32( float128 );
-float64 float128_to_float64( float128 );
-#ifdef FLOATX80
-floatx80 float128_to_floatx80( float128 );
-#endif
-
-/*
--------------------------------------------------------------------------------
-Software IEC/IEEE quadruple-precision operations.
--------------------------------------------------------------------------------
-*/
-float128 float128_round_to_int( float128 );
-float128 float128_add( float128, float128 );
-float128 float128_sub( float128, float128 );
-float128 float128_mul( float128, float128 );
-float128 float128_div( float128, float128 );
-float128 float128_rem( float128, float128 );
-float128 float128_sqrt( float128 );
-int float128_eq( float128, float128 );
-int float128_le( float128, float128 );
-int float128_lt( float128, float128 );
-int float128_eq_signaling( float128, float128 );
-int float128_le_quiet( float128, float128 );
-int float128_lt_quiet( float128, float128 );
-int float128_is_signaling_nan( float128 );
-
-#endif
-
diff --git a/lib/libc/mips/static_tls.h b/lib/libc/mips/static_tls.h
deleted file mode 100644
index 67ee8afe14c6..000000000000
--- a/lib/libc/mips/static_tls.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2019 The FreeBSD Foundation
- *
- * This software was developed by Konstantin Belousov <kib@FreeBSD.org>
- * under sponsorship from the FreeBSD Foundation.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _LIBC_MIPS_STATIC_TLS_H
-#define _LIBC_MIPS_STATIC_TLS_H
-
-#include <machine/tls.h>
-
-static __inline uintptr_t
-_libc_get_static_tls_base(size_t offset)
-{
- uintptr_t tlsbase;
-
-#if defined(__mips_n64)
- __asm__ __volatile__ (
- ".set\tpush\n\t"
- ".set\tmips64r2\n\t"
- "rdhwr\t%0, $29\n\t"
- ".set\tpop"
- : "=r" (tlsbase));
- tlsbase -= TLS_TP_OFFSET + TLS_TCB_SIZE;
-#else /* mips 32 */
- __asm__ __volatile__ (
- ".set\tpush\n\t"
- ".set\tmips32r2\n\t"
- "rdhwr\t%0, $29\n\t"
- ".set\tpop"
- : "=r" (tlsbase));
- tlsbase -= TLS_TP_OFFSET + TLS_TCB_SIZE;
-#endif /* ! __mips_n64 */
- tlsbase += offset;
- return (tlsbase);
-}
-
-#endif
diff --git a/lib/libc/mips/string/Makefile.inc b/lib/libc/mips/string/Makefile.inc
deleted file mode 100644
index 266446c9d132..000000000000
--- a/lib/libc/mips/string/Makefile.inc
+++ /dev/null
@@ -1,13 +0,0 @@
-# $FreeBSD$
-
-MDSRCS+= \
- bcmp.S \
- bcopy.S \
- bzero.S \
- ffs.S \
- memcpy.S \
- memmove.S \
- strchr.S \
- strcmp.S \
- strlen.S \
- strrchr.S
diff --git a/lib/libc/mips/string/bcmp.S b/lib/libc/mips/string/bcmp.S
deleted file mode 100644
index ffcaeeb1a3fa..000000000000
--- a/lib/libc/mips/string/bcmp.S
+++ /dev/null
@@ -1,130 +0,0 @@
-/* $NetBSD: bcmp.S,v 1.9 2009/12/14 01:07:42 matt Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#define _LOCORE /* XXX not really, just assembly-code source */
-#include <machine/endian.h> /* LWLO/LWHI, SWLO/SWHI */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
- ASMSTR("from: @(#)bcmp.s 8.1 (Berkeley) 6/4/93")
-#else
- ASMSTR("$NetBSD: bcmp.S,v 1.9 2009/12/14 01:07:42 matt Exp $")
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#ifdef __ABICALLS__
- .abicalls
-#endif
-
-/* bcmp(s1, s2, n) */
-
-
-LEAF(bcmp)
- .set noreorder
- blt a2, 16, small # is it worth any trouble?
- xor v0, a0, a1 # compare low two bits of addresses
- and v0, v0, 3
- PTR_SUBU a3, zero, a1 # compute # bytes to word align address
- bne v0, zero, unaligned # not possible to align addresses
- and a3, a3, 3
-
- beq a3, zero, 1f
- PTR_SUBU a2, a2, a3 # subtract from remaining count
- move v0, v1 # init v0,v1 so unmodified bytes match
- LWHI v0, 0(a0) # read 1, 2, or 3 bytes
- LWHI v1, 0(a1)
- PTR_ADDU a1, a1, a3
- bne v0, v1, nomatch
- PTR_ADDU a0, a0, a3
-1:
- and a3, a2, ~3 # compute number of whole words left
- PTR_SUBU a2, a2, a3 # which has to be >= (16-3) & ~3
- PTR_ADDU a3, a3, a0 # compute ending address
-2:
- lw v0, 0(a0) # compare words
- lw v1, 0(a1)
- PTR_ADDU a0, a0, 4
- bne v0, v1, nomatch
- PTR_ADDU a1, a1, 4
- bne a0, a3, 2b
- nop
- b small # finish remainder
- nop
-unaligned:
- beq a3, zero, 2f
- PTR_SUBU a2, a2, a3 # subtract from remaining count
- PTR_ADDU a3, a3, a0 # compute ending address
-1:
- lbu v0, 0(a0) # compare bytes until a1 word aligned
- lbu v1, 0(a1)
- PTR_ADDU a0, a0, 1
- bne v0, v1, nomatch
- PTR_ADDU a1, a1, 1
- bne a0, a3, 1b
- nop
-2:
- and a3, a2, ~3 # compute number of whole words left
- PTR_SUBU a2, a2, a3 # which has to be >= (16-3) & ~3
- PTR_ADDU a3, a3, a0 # compute ending address
-3:
- LWHI v0, 0(a0) # compare words a0 unaligned, a1 aligned
- LWLO v0, 3(a0)
- lw v1, 0(a1)
- PTR_ADDU a0, a0, 4
- bne v0, v1, nomatch
- PTR_ADDU a1, a1, 4
- bne a0, a3, 3b
- nop
-small:
- ble a2, zero, match
- PTR_ADDU a3, a2, a0 # compute ending address
-1:
- lbu v0, 0(a0)
- lbu v1, 0(a1)
- PTR_ADDU a0, a0, 1
- bne v0, v1, nomatch
- PTR_ADDU a1, a1, 1
- bne a0, a3, 1b
- nop
-match:
- j ra
- move v0, zero
-nomatch:
- j ra
- li v0, 1
- .set reorder
-END(bcmp)
diff --git a/lib/libc/mips/string/bcopy.S b/lib/libc/mips/string/bcopy.S
deleted file mode 100644
index bc227e07d662..000000000000
--- a/lib/libc/mips/string/bcopy.S
+++ /dev/null
@@ -1,297 +0,0 @@
-/* $NetBSD: bcopy.S,v 1.3 2009/12/14 00:39:00 matt Exp $ */
-
-/*
- * Mach Operating System
- * Copyright (c) 1993 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-
-/*
- * File: mips_bcopy.s
- * Author: Chris Maeda
- * Date: June 1993
- *
- * Fast copy routine. Derived from aligned_block_copy.
- */
-
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#define _LOCORE /* XXX not really, just assembly-code source */
-#include <machine/endian.h>
-
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
- ASMSTR("from: @(#)mips_bcopy.s 2.2 CMU 18/06/93")
-#else
- ASMSTR("$NetBSD: bcopy.S,v 1.3 2009/12/14 00:39:00 matt Exp $")
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#ifdef __ABICALLS__
- .abicalls
-#endif
-
-/*
- * bcopy(caddr_t src, caddr_t dst, unsigned int len)
- *
- * a0 src address
- * a1 dst address
- * a2 length
- */
-
-#if defined(MEMCOPY) || defined(MEMMOVE)
-#ifdef MEMCOPY
-#define FUNCTION memcpy
-#else
-#define FUNCTION memmove
-#endif
-#define SRCREG a1
-#define DSTREG a0
-#else
-#define FUNCTION bcopy
-#define SRCREG a0
-#define DSTREG a1
-#endif
-
-#define SIZEREG a2
-
-LEAF(FUNCTION)
- .set noat
- .set noreorder
-
-#if defined(MEMCOPY) || defined(MEMMOVE)
- /* set up return value, while we still can */
- move v0,DSTREG
-#endif
- /*
- * Make sure we can copy forwards.
- */
- sltu t0,SRCREG,DSTREG # t0 == SRCREG < DSTREG
- bne t0,zero,6f # copy backwards
-
- /*
- * There are four alignment cases (with frequency)
- * (Based on measurements taken with a DECstation 5000/200
- * inside a Mach kernel.)
- *
- * aligned -> aligned (mostly)
- * unaligned -> aligned (sometimes)
- * aligned,unaligned -> unaligned (almost never)
- *
- * Note that we could add another case that checks if
- * the destination and source are unaligned but the
- * copy is alignable. eg if src and dest are both
- * on a halfword boundary.
- */
- andi t1,DSTREG,(SZREG-1) # get last bits of dest
- bne t1,zero,3f # dest unaligned
- andi t0,SRCREG,(SZREG-1) # get last bits of src
- bne t0,zero,5f
-
- /*
- * Forward aligned->aligned copy, 8 words at a time.
- */
-98:
- li AT,-(SZREG*8)
- and t0,SIZEREG,AT # count truncated to multiples
- PTR_ADDU a3,SRCREG,t0 # run fast loop up to this addr
- sltu AT,SRCREG,a3 # any work to do?
- beq AT,zero,2f
- PTR_SUBU SIZEREG,t0
-
- /*
- * loop body
- */
-1: # cp
- REG_L t3,(0*SZREG)(SRCREG)
- REG_L v1,(1*SZREG)(SRCREG)
- REG_L t0,(2*SZREG)(SRCREG)
- REG_L t1,(3*SZREG)(SRCREG)
- PTR_ADDU SRCREG,SZREG*8
- REG_S t3,(0*SZREG)(DSTREG)
- REG_S v1,(1*SZREG)(DSTREG)
- REG_S t0,(2*SZREG)(DSTREG)
- REG_S t1,(3*SZREG)(DSTREG)
- REG_L t1,(-1*SZREG)(SRCREG)
- REG_L t0,(-2*SZREG)(SRCREG)
- REG_L v1,(-3*SZREG)(SRCREG)
- REG_L t3,(-4*SZREG)(SRCREG)
- PTR_ADDU DSTREG,SZREG*8
- REG_S t1,(-1*SZREG)(DSTREG)
- REG_S t0,(-2*SZREG)(DSTREG)
- REG_S v1,(-3*SZREG)(DSTREG)
- bne SRCREG,a3,1b
- REG_S t3,(-4*SZREG)(DSTREG)
-
- /*
- * Copy a word at a time, no loop unrolling.
- */
-2: # wordcopy
- andi t2,SIZEREG,(SZREG-1) # get byte count / SZREG
- PTR_SUBU t2,SIZEREG,t2 # t2 = words to copy * SZREG
- beq t2,zero,3f
- PTR_ADDU t0,SRCREG,t2 # stop at t0
- PTR_SUBU SIZEREG,SIZEREG,t2
-1:
- REG_L t3,0(SRCREG)
- PTR_ADDU SRCREG,SZREG
- REG_S t3,0(DSTREG)
- bne SRCREG,t0,1b
- PTR_ADDU DSTREG,SZREG
-
-3: # bytecopy
- beq SIZEREG,zero,4f # nothing left to do?
- nop
-1:
- lb t3,0(SRCREG)
- PTR_ADDU SRCREG,1
- sb t3,0(DSTREG)
- PTR_SUBU SIZEREG,1
- bgtz SIZEREG,1b
- PTR_ADDU DSTREG,1
-
-4: # copydone
- j ra
- nop
-
- /*
- * Copy from unaligned source to aligned dest.
- */
-5: # destaligned
- andi t0,SIZEREG,(SZREG-1) # t0 = bytecount mod SZREG
- PTR_SUBU a3,SIZEREG,t0 # number of words to transfer
- beq a3,zero,3b
- nop
- move SIZEREG,t0 # this many to do after we are done
- PTR_ADDU a3,SRCREG,a3 # stop point
-
-1:
- REG_LHI t3,0(SRCREG)
- REG_LLO t3,SZREG-1(SRCREG)
- PTR_ADDI SRCREG,SZREG
- REG_S t3,0(DSTREG)
- bne SRCREG,a3,1b
- PTR_ADDI DSTREG,SZREG
-
- b 3b
- nop
-
-6: # backcopy -- based on above
- PTR_ADDU SRCREG,SIZEREG
- PTR_ADDU DSTREG,SIZEREG
- andi t1,DSTREG,SZREG-1 # get last 3 bits of dest
- bne t1,zero,3f
- andi t0,SRCREG,SZREG-1 # get last 3 bits of src
- bne t0,zero,5f
-
- /*
- * Forward aligned->aligned copy, 8*4 bytes at a time.
- */
- li AT,(-8*SZREG)
- and t0,SIZEREG,AT # count truncated to multiple of 32
- beq t0,zero,2f # any work to do?
- PTR_SUBU SIZEREG,t0
- PTR_SUBU a3,SRCREG,t0
-
- /*
- * loop body
- */
-1: # cp
- REG_L t3,(-4*SZREG)(SRCREG)
- REG_L v1,(-3*SZREG)(SRCREG)
- REG_L t0,(-2*SZREG)(SRCREG)
- REG_L t1,(-1*SZREG)(SRCREG)
- PTR_SUBU SRCREG,8*SZREG
- REG_S t3,(-4*SZREG)(DSTREG)
- REG_S v1,(-3*SZREG)(DSTREG)
- REG_S t0,(-2*SZREG)(DSTREG)
- REG_S t1,(-1*SZREG)(DSTREG)
- REG_L t1,(3*SZREG)(SRCREG)
- REG_L t0,(2*SZREG)(SRCREG)
- REG_L v1,(1*SZREG)(SRCREG)
- REG_L t3,(0*SZREG)(SRCREG)
- PTR_SUBU DSTREG,8*SZREG
- REG_S t1,(3*SZREG)(DSTREG)
- REG_S t0,(2*SZREG)(DSTREG)
- REG_S v1,(1*SZREG)(DSTREG)
- bne SRCREG,a3,1b
- REG_S t3,(0*SZREG)(DSTREG)
-
- /*
- * Copy a word at a time, no loop unrolling.
- */
-2: # wordcopy
- andi t2,SIZEREG,SZREG-1 # get byte count / 4
- PTR_SUBU t2,SIZEREG,t2 # t2 = number of words to copy
- beq t2,zero,3f
- PTR_SUBU t0,SRCREG,t2 # stop at t0
- PTR_SUBU SIZEREG,SIZEREG,t2
-1:
- REG_L t3,-SZREG(SRCREG)
- PTR_SUBU SRCREG,SZREG
- REG_S t3,-SZREG(DSTREG)
- bne SRCREG,t0,1b
- PTR_SUBU DSTREG,SZREG
-
-3: # bytecopy
- beq SIZEREG,zero,4f # nothing left to do?
- nop
-1:
- lb t3,-1(SRCREG)
- PTR_SUBU SRCREG,1
- sb t3,-1(DSTREG)
- PTR_SUBU SIZEREG,1
- bgtz SIZEREG,1b
- PTR_SUBU DSTREG,1
-
-4: # copydone
- j ra
- nop
-
- /*
- * Copy from unaligned source to aligned dest.
- */
-5: # destaligned
- andi t0,SIZEREG,SZREG-1 # t0 = bytecount mod 4
- PTR_SUBU a3,SIZEREG,t0 # number of words to transfer
- beq a3,zero,3b
- nop
- move SIZEREG,t0 # this many to do after we are done
- PTR_SUBU a3,SRCREG,a3 # stop point
-
-1:
- REG_LHI t3,-SZREG(SRCREG)
- REG_LLO t3,-1(SRCREG)
- PTR_SUBU SRCREG,SZREG
- REG_S t3,-SZREG(DSTREG)
- bne SRCREG,a3,1b
- PTR_SUBU DSTREG,SZREG
-
- b 3b
- nop
-
- .set reorder
- .set at
- END(FUNCTION)
diff --git a/lib/libc/mips/string/bzero.S b/lib/libc/mips/string/bzero.S
deleted file mode 100644
index 83e54ba4baea..000000000000
--- a/lib/libc/mips/string/bzero.S
+++ /dev/null
@@ -1,83 +0,0 @@
-/* $NetBSD: bzero.S,v 1.10 2009/12/14 02:53:52 matt Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
- ASMSTR("from: @(#)bzero.s 8.1 (Berkeley) 6/4/93")
-#else
- ASMSTR("$NetBSD: bzero.S,v 1.10 2009/12/14 02:53:52 matt Exp $")
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#define _LOCORE /* XXX not really, just assembly-code source */
-#include <machine/endian.h>
-
-#ifdef __ABICALLS__
- .abicalls
-#endif
-
-/* bzero(s1, n) */
-
-LEAF(bzero)
- .set noreorder
- blt a1, 3*SZREG, smallclr # small amount to clear?
- PTR_SUBU a3, zero, a0 # compute # bytes to word align address
- and a3, a3, SZREG-1
- beq a3, zero, 1f # skip if word aligned
- PTR_SUBU a1, a1, a3 # subtract from remaining count
- REG_SHI zero, 0(a0) # clear 1, 2, or 3 bytes to align
- PTR_ADDU a0, a0, a3
-1:
- and v0, a1, SZREG-1 # compute number of words left
- PTR_SUBU a3, a1, v0
- move a1, v0
- PTR_ADDU a3, a3, a0 # compute ending address
-2:
- PTR_ADDU a0, a0, SZREG # clear words
- bne a0, a3, 2b # unrolling loop doesnt help
- REG_S zero, -SZREG(a0) # since we are limited by memory speed
-smallclr:
- ble a1, zero, 2f
- PTR_ADDU a3, a1, a0 # compute ending address
-1:
- PTR_ADDU a0, a0, 1 # clear bytes
- bne a0, a3, 1b
- sb zero, -1(a0)
-2:
- j ra
- nop
-END(bzero)
diff --git a/lib/libc/mips/string/ffs.S b/lib/libc/mips/string/ffs.S
deleted file mode 100644
index 17e509c24637..000000000000
--- a/lib/libc/mips/string/ffs.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* $NetBSD: ffs.S,v 1.2 2009/12/14 00:39:00 matt Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)ffs.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: ffs.S,v 1.2 2009/12/14 00:39:00 matt Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-#ifdef __ABICALLS__
- .abicalls
-#endif
-
-/* bit = ffs(value) */
-
-LEAF(ffs)
- move v0, zero
- beq a0, zero, done
-1:
- and v1, a0, 1 # bit set?
- addu v0, v0, 1
- srl a0, a0, 1
- beq v1, zero, 1b # no, continue
-done:
- j ra
-END(ffs)
diff --git a/lib/libc/mips/string/memcpy.S b/lib/libc/mips/string/memcpy.S
deleted file mode 100644
index 8d3c0dbfcf2c..000000000000
--- a/lib/libc/mips/string/memcpy.S
+++ /dev/null
@@ -1,7 +0,0 @@
-/* $NetBSD: memcpy.S,v 1.1 2005/12/20 19:28:50 christos Exp $ */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#define MEMCOPY
-#include "bcopy.S"
diff --git a/lib/libc/mips/string/memmove.S b/lib/libc/mips/string/memmove.S
deleted file mode 100644
index 29d9e707ee46..000000000000
--- a/lib/libc/mips/string/memmove.S
+++ /dev/null
@@ -1,7 +0,0 @@
-/* $NetBSD: memmove.S,v 1.1 2005/12/20 19:28:50 christos Exp $ */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#define MEMMOVE
-#include "bcopy.S"
diff --git a/lib/libc/mips/string/strchr.S b/lib/libc/mips/string/strchr.S
deleted file mode 100644
index 19dae58415e2..000000000000
--- a/lib/libc/mips/string/strchr.S
+++ /dev/null
@@ -1,66 +0,0 @@
-/* $NetBSD: index.S,v 1.8 2005/04/22 06:59:00 simonb Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)index.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: index.S,v 1.8 2005/04/22 06:59:00 simonb Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-#ifdef __ABICALLS__
- .abicalls
-#endif
-
-/*
- * char *
- * strchr(const char *s, int c);
- */
-LEAF(strchr)
- and a1, a1, 0xff
-1:
- lbu a2, 0(a0) # get a byte
- PTR_ADDU a0, a0, 1
- beq a2, a1, fnd
- bne a2, zero, 1b
-notfnd:
- move v0, zero
- j ra
-fnd:
- PTR_SUBU v0, a0, 1
- j ra
-END(strchr)
-
-WEAK_ALIAS(index, strchr)
diff --git a/lib/libc/mips/string/strcmp.S b/lib/libc/mips/string/strcmp.S
deleted file mode 100644
index 8a9905630ce8..000000000000
--- a/lib/libc/mips/string/strcmp.S
+++ /dev/null
@@ -1,68 +0,0 @@
-/* $NetBSD: strcmp.S,v 1.2 2009/12/14 00:39:00 matt Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)strcmp.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: strcmp.S,v 1.2 2009/12/14 00:39:00 matt Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-#ifdef __ABICALLS__
- .abicalls
-#endif
-
-/*
- * NOTE: this version assumes unsigned chars in order to be "8 bit clean".
- */
-LEAF(strcmp)
-1:
- lbu t0, 0(a0) # get two bytes and compare them
- lbu t1, 0(a1)
- beq t0, zero, LessOrEq # end of first string?
- bne t0, t1, NotEq
- lbu t0, 1(a0) # unroll loop
- lbu t1, 1(a1)
- PTR_ADD a0, a0, 2
- beq t0, zero, LessOrEq # end of first string?
- PTR_ADD a1, a1, 2
- beq t0, t1, 1b
-NotEq:
- subu v0, t0, t1
- j ra
-LessOrEq:
- subu v0, zero, t1
- j ra
-END(strcmp)
diff --git a/lib/libc/mips/string/strlen.S b/lib/libc/mips/string/strlen.S
deleted file mode 100644
index 3b46ccceb54b..000000000000
--- a/lib/libc/mips/string/strlen.S
+++ /dev/null
@@ -1,55 +0,0 @@
-/* $NetBSD: strlen.S,v 1.2 2009/12/14 00:39:00 matt Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)strlen.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: strlen.S,v 1.2 2009/12/14 00:39:00 matt Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-#ifdef __ABICALLS__
- .abicalls
-#endif
-
-LEAF(strlen)
- PTR_ADDU v1, a0, 1
-1:
- lb v0, 0(a0) # get byte from string
- PTR_ADDU a0, a0, 1 # increment pointer
- bne v0, zero, 1b # continue if not end
- PTR_SUBU v0, a0, v1 # compute length - 1 for '\0' char
- j ra
-END(strlen)
diff --git a/lib/libc/mips/string/strrchr.S b/lib/libc/mips/string/strrchr.S
deleted file mode 100644
index c0dcef049d6e..000000000000
--- a/lib/libc/mips/string/strrchr.S
+++ /dev/null
@@ -1,64 +0,0 @@
-/* $NetBSD: rindex.S,v 1.7 2003/08/07 16:42:16 agc Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)rindex.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: rindex.S,v 1.7 2003/08/07 16:42:16 agc Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-#ifdef __ABICALLS__
- .abicalls
-#endif
-
-/*
- * char *
- * strrchr(const char *s, int c);
- */
-LEAF(strrchr)
- move v0, zero # default if not found
- and a1, a1, 0xff
-1:
- lbu a3, 0(a0) # get a byte
- PTR_ADDU a0, a0, 1
- bne a3, a1, 2f
- PTR_SUBU v0, a0, 1 # save address of last match
-2:
- bne a3, zero, 1b # continue if not end
- j ra
-END(strrchr)
-
-WEAK_ALIAS(rindex, strrchr)
diff --git a/lib/libc/mips/sys/Makefile.inc b/lib/libc/mips/sys/Makefile.inc
deleted file mode 100644
index d7cc70d01b07..000000000000
--- a/lib/libc/mips/sys/Makefile.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-# $FreeBSD$
-
-SRCS+= trivial-vdso_tc.c
-
-MDASM= Ovfork.S cerror.S syscall.S
-
-# Don't generate default code for these syscalls:
-NOASM+= sbrk.o vfork.o
diff --git a/lib/libc/mips/sys/Ovfork.S b/lib/libc/mips/sys/Ovfork.S
deleted file mode 100644
index 9df93ea59e9d..000000000000
--- a/lib/libc/mips/sys/Ovfork.S
+++ /dev/null
@@ -1,64 +0,0 @@
-/* $NetBSD: compat_Ovfork.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-#include "SYS.h"
-
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)Ovfork.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: compat_Ovfork.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * pid = vfork();
- *
- * v1 == 0 in parent process, v1 == 1 in child process.
- * v0 == pid of child in parent, v0 == pid of parent in child.
- */
-
-LEAF(__sys_vfork)
- WEAK_ALIAS(vfork, __sys_vfork)
- WEAK_ALIAS(_vfork, __sys_vfork)
- PIC_PROLOGUE(__sys_vfork)
- li v0, SYS_vfork # system call number for vfork
- syscall
- beq a3, zero, 1f # jump if no errors
- PIC_TAILCALL(__cerror)
-1:
- beq v1, zero, 2f # parent process ?
- move v0, zero # return zero in child
-2:
- PIC_RETURN()
-END(__sys_vfork)
diff --git a/lib/libc/mips/sys/cerror.S b/lib/libc/mips/sys/cerror.S
deleted file mode 100644
index c504d73afa3f..000000000000
--- a/lib/libc/mips/sys/cerror.S
+++ /dev/null
@@ -1,72 +0,0 @@
-/* $NetBSD: cerror.S,v 1.14 2009/12/14 01:07:42 matt Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-#include "SYS.h"
-
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
- RCSID("from: @(#)cerror.s 8.1 (Berkeley) 6/16/93")
-#else
- RCSID("$NetBSD: cerror.S,v 1.14 2009/12/14 01:07:42 matt Exp $")
-#endif
-#endif /* LIBC_SCCS and not lint */
-
- .globl _C_LABEL(__error)
-NESTED_NOPROFILE(__cerror, CALLFRAME_SIZ, ra)
- .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
- SETUP_GP
- PTR_SUBU sp, sp, CALLFRAME_SIZ
- SETUP_GP64(CALLFRAME_GP, __cerror)
- SAVE_GP(CALLFRAME_GP)
-
- PTR_S ra, CALLFRAME_RA(sp)
- REG_S v0, CALLFRAME_S0(sp) # save errno value
-
- PTR_LA t9, _C_LABEL(__error) # locate address of errno
- jalr t9
-
- REG_L t0, CALLFRAME_S0(sp)
- PTR_L ra, CALLFRAME_RA(sp)
- INT_S t0, 0(v0) # update errno value
-
- RESTORE_GP64
- PTR_ADDU sp, sp, CALLFRAME_SIZ
-
- li v0, -1
- li v1, -1
-
- j ra
-END(__cerror)
diff --git a/lib/libc/mips/sys/syscall.S b/lib/libc/mips/sys/syscall.S
deleted file mode 100644
index b3c6708b5da5..000000000000
--- a/lib/libc/mips/sys/syscall.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $NetBSD: syscall.S,v 1.5 2003/08/07 16:42:18 agc Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-#include "SYS.h"
-
-#if defined(LIBC_SCCS) && !defined(lint)
- ASMSTR("from: @(#)syscall.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$NetBSD: syscall.S,v 1.5 2003/08/07 16:42:18 agc Exp $")
-#endif /* LIBC_SCCS and not lint */
-
-RSYSCALL(syscall)
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c
index 718a64defab9..2da8024c47f4 100644
--- a/lib/libc/net/gethostnamadr.c
+++ b/lib/libc/net/gethostnamadr.c
@@ -258,10 +258,10 @@ static int
host_marshal_func(char *buffer, size_t *buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
- char *str;
- void *addr;
- socklen_t len;
- int type;
+ char *str __unused;
+ void *addr __unused;
+ socklen_t len __unused;
+ int type __unused;
struct hostent *ht;
struct hostent new_ht;
@@ -364,10 +364,10 @@ static int
host_unmarshal_func(char *buffer, size_t buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
- char *str;
- void *addr;
- socklen_t len;
- int type;
+ char *str __unused;
+ void *addr __unused;
+ socklen_t len __unused;
+ int type __unused;
struct hostent *ht;
char *p;
diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c
index ad54920aa793..b72734e56ed3 100644
--- a/lib/libc/net/getnameinfo.c
+++ b/lib/libc/net/getnameinfo.c
@@ -467,7 +467,7 @@ getnameinfo_link(const struct afd *afd,
* The following have zero-length addresses.
* IFT_GIF (net/if_gif.c)
* IFT_LOOP (net/if_loop.c)
- * IFT_PPP (net/if_ppp.c, net/if_spppsubr.c)
+ * IFT_PPP (net/if_tuntap.c)
* IFT_SLIP (net/if_sl.c, net/if_strip.c)
* IFT_STF (net/if_stf.c)
* IFT_L2VLAN (net/if_vlan.c)
diff --git a/lib/libc/net/getnetnamadr.c b/lib/libc/net/getnetnamadr.c
index 2d9776685cf9..82ff089c1f1b 100644
--- a/lib/libc/net/getnetnamadr.c
+++ b/lib/libc/net/getnetnamadr.c
@@ -121,12 +121,12 @@ static int
net_marshal_func(char *buffer, size_t *buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
- char *name;
- uint32_t net;
- int type;
+ char *name __unused;
+ uint32_t net __unused;
+ int type __unused;
struct netent *ne;
- char *orig_buf;
- size_t orig_buf_size;
+ char *orig_buf __unused;
+ size_t orig_buf_size __unused;
struct netent new_ne;
size_t desired_size, size, aliases_size;
@@ -210,9 +210,9 @@ static int
net_unmarshal_func(char *buffer, size_t buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
- char *name;
- uint32_t net;
- int type;
+ char *name __unused;
+ uint32_t net __unused;
+ int type __unused;
struct netent *ne;
char *orig_buf;
size_t orig_buf_size;
diff --git a/lib/libc/net/getprotoent.c b/lib/libc/net/getprotoent.c
index 73b069250499..b3bb52195dfc 100644
--- a/lib/libc/net/getprotoent.c
+++ b/lib/libc/net/getprotoent.c
@@ -144,11 +144,11 @@ int
__proto_marshal_func(char *buffer, size_t *buffer_size, void *retval,
va_list ap, void *cache_mdata)
{
- char *name;
- int num;
+ char *name __unused;
+ int num __unused;
struct protoent *proto;
- char *orig_buf;
- size_t orig_buf_size;
+ char *orig_buf __unused;
+ size_t orig_buf_size __unused;
struct protoent new_proto;
size_t desired_size, size, aliases_size;
@@ -231,8 +231,8 @@ int
__proto_unmarshal_func(char *buffer, size_t buffer_size, void *retval,
va_list ap, void *cache_mdata)
{
- char *name;
- int num;
+ char *name __unused;
+ int num __unused;
struct protoent *proto;
char *orig_buf;
size_t orig_buf_size;
diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c
index 76db40d96cf5..bcb9f8ff8b84 100644
--- a/lib/libc/net/getservent.c
+++ b/lib/libc/net/getservent.c
@@ -947,12 +947,12 @@ int
serv_marshal_func(char *buffer, size_t *buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
- char *name;
- char *proto;
- int port;
+ char *name __unused;
+ char *proto __unused;
+ int port __unused;
struct servent *serv;
- char *orig_buf;
- size_t orig_buf_size;
+ char *orig_buf __unused;
+ size_t orig_buf_size __unused;
struct servent new_serv;
size_t desired_size;
@@ -1048,9 +1048,9 @@ int
serv_unmarshal_func(char *buffer, size_t buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
- char *name;
- char *proto;
- int port;
+ char *name __unused;
+ char *proto __unused;
+ int port __unused;
struct servent *serv;
char *orig_buf;
char *p;
diff --git a/lib/libc/net/inet.3 b/lib/libc/net/inet.3
index a36cb313f7d3..cb44394d0a0c 100644
--- a/lib/libc/net/inet.3
+++ b/lib/libc/net/inet.3
@@ -28,7 +28,7 @@
.\" From: @(#)inet.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 14, 2007
+.Dd November 9, 2021
.Dt INET 3
.Os
.Sh NAME
@@ -157,18 +157,20 @@ The routine
.Fn inet_ntoa_r
is the reentrant version of
.Fn inet_ntoa .
-The routine
+The deprecated routine
.Fn inet_makeaddr
takes an Internet network number and a local
-network address and constructs an Internet address
+host address on that network, and constructs an Internet address
from it.
-The routines
+It should only be assumed to work for historical class A/B/C networks.
+The deprecated routines
.Fn inet_netof
and
.Fn inet_lnaof
break apart Internet host addresses, returning
-the network number and local network address part,
-respectively.
+the network number and local host address part,
+respectively,
+assuming the historical class A/B/C network masks.
.Pp
All Internet addresses are returned in network
order (bytes ordered from left to right).
@@ -203,17 +205,11 @@ ordered from right to left.
.Pp
When a three part address is specified, the last
part is interpreted as a 16-bit quantity and placed
-in the right-most two bytes of the network address.
-This makes the three part address format convenient
-for specifying Class B network addresses as
-.Dq Li 128.net.host .
+in the least significant two bytes of the network address.
.Pp
When a two part address is supplied, the last part
is interpreted as a 24-bit quantity and placed in
-the right most three bytes of the network address.
-This makes the two part address format convenient
-for specifying Class A network addresses as
-.Dq Li net.host .
+the least significant three bytes of the network address.
.Pp
When only one part is given, the value is stored
directly in the network address without any byte
diff --git a/lib/libc/net/inet_net.3 b/lib/libc/net/inet_net.3
index f0721729ff05..4028984bd09b 100644
--- a/lib/libc/net/inet_net.3
+++ b/lib/libc/net/inet_net.3
@@ -32,7 +32,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 18, 2016
+.Dd November 9, 2021
.Dt INET_NET 3
.Os
.Sh NAME
@@ -120,17 +120,11 @@ That is, little-endian bytes are ordered from right to left.
.Pp
When a three part number is specified, the last
part is interpreted as a 16-bit quantity and placed
-in the rightmost two bytes of the Internet network number.
-This makes the three part number format convenient
-for specifying Class B network numbers as
-.Dq Li 128.net.host .
+in the least significant two bytes of the Internet network number.
.Pp
When a two part number is supplied, the last part
is interpreted as a 24-bit quantity and placed in
-the rightmost three bytes of the Internet network number.
-This makes the two part number format convenient
-for specifying Class A network numbers as
-.Dq Li net.host .
+the least significant three bytes of the Internet network number.
.Pp
When only one part is given, the value is stored
directly in the Internet network number without any byte
diff --git a/lib/libc/net/nscachedcli.c b/lib/libc/net/nscachedcli.c
index 53f69dda7fbb..2acc12af2d1e 100644
--- a/lib/libc/net/nscachedcli.c
+++ b/lib/libc/net/nscachedcli.c
@@ -153,7 +153,6 @@ send_credentials(struct cached_connection_ *connection, int type)
struct kevent eventlist;
int nevents;
ssize_t result;
- int res;
memset(&cmsg, 0, sizeof(cmsg));
cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(struct cmsgcred));
@@ -171,7 +170,7 @@ send_credentials(struct cached_connection_ *connection, int type)
EV_SET(&eventlist, connection->sockfd, EVFILT_WRITE, EV_ADD,
NOTE_LOWAT, sizeof(int), NULL);
- res = _kevent(connection->write_queue, &eventlist, 1, NULL, 0, NULL);
+ (void)_kevent(connection->write_queue, &eventlist, 1, NULL, 0, NULL);
nevents = _kevent(connection->write_queue, NULL, 0, &eventlist, 1,
NULL);
@@ -474,10 +473,9 @@ int
__close_cached_mp_write_session(struct cached_connection_ *ws)
{
int notification;
- int result;
notification = CET_MP_WRITE_SESSION_CLOSE_NOTIFICATION;
- result = safe_write(ws, &notification, sizeof(int));
+ (void)safe_write(ws, &notification, sizeof(int));
__close_cached_connection(ws);
return (0);
}
diff --git a/lib/libc/net/nsdispatch.c b/lib/libc/net/nsdispatch.c
index b0f80d079b0b..ada7ac606e15 100644
--- a/lib/libc/net/nsdispatch.c
+++ b/lib/libc/net/nsdispatch.c
@@ -335,7 +335,9 @@ static int
nss_configure(void)
{
static time_t confmod;
+#ifndef NS_REREAD_CONF
static int already_initialized = 0;
+#endif
struct stat statbuf;
int result, isthreaded;
const char *path;
diff --git a/lib/libc/net/sctp_sys_calls.c b/lib/libc/net/sctp_sys_calls.c
index 66a0f6adac3a..7c3652ff5d3c 100644
--- a/lib/libc/net/sctp_sys_calls.c
+++ b/lib/libc/net/sctp_sys_calls.c
@@ -391,23 +391,27 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs)
{
struct sctp_getaddresses *addrs;
struct sockaddr *sa;
- sctp_assoc_t asoc;
caddr_t lim;
socklen_t opt_len;
+ uint32_t size_of_addresses;
int cnt;
if (raddrs == NULL) {
errno = EFAULT;
return (-1);
}
- asoc = id;
- opt_len = (socklen_t)sizeof(sctp_assoc_t);
+ /* When calling getsockopt(), the value contains the assoc_id. */
+ size_of_addresses = (uint32_t)id;
+ opt_len = (socklen_t)sizeof(uint32_t);
if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_REMOTE_ADDR_SIZE,
- &asoc, &opt_len) != 0) {
- return (-1);
+ &size_of_addresses, &opt_len) != 0) {
+ if (errno == ENOENT) {
+ return (0);
+ } else {
+ return (-1);
+ }
}
- /* size required is returned in 'asoc' */
- opt_len = (socklen_t)((size_t)asoc + sizeof(struct sctp_getaddresses));
+ opt_len = (socklen_t)((size_t)size_of_addresses + sizeof(struct sctp_getaddresses));
addrs = calloc(1, (size_t)opt_len);
if (addrs == NULL) {
errno = ENOMEM;
@@ -446,10 +450,10 @@ int
sctp_getladdrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs)
{
struct sctp_getaddresses *addrs;
- caddr_t lim;
struct sockaddr *sa;
- size_t size_of_addresses;
+ caddr_t lim;
socklen_t opt_len;
+ uint32_t size_of_addresses;
int cnt;
if (raddrs == NULL) {
@@ -457,17 +461,12 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs)
return (-1);
}
size_of_addresses = 0;
- opt_len = (socklen_t)sizeof(int);
+ opt_len = (socklen_t)sizeof(uint32_t);
if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDR_SIZE,
&size_of_addresses, &opt_len) != 0) {
- errno = ENOMEM;
return (-1);
}
- if (size_of_addresses == 0) {
- errno = ENOTCONN;
- return (-1);
- }
- opt_len = (socklen_t)(size_of_addresses + sizeof(struct sctp_getaddresses));
+ opt_len = (socklen_t)((size_t)size_of_addresses + sizeof(struct sctp_getaddresses));
addrs = calloc(1, (size_t)opt_len);
if (addrs == NULL) {
errno = ENOMEM;
@@ -478,9 +477,12 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs)
if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDRESSES, addrs,
&opt_len) != 0) {
free(addrs);
- errno = ENOMEM;
return (-1);
}
+ if (size_of_addresses == 0) {
+ free(addrs);
+ return (0);
+ }
*raddrs = &addrs->addr[0].sa;
cnt = 0;
sa = &addrs->addr[0].sa;
diff --git a/lib/libc/posix1e/acl_delete_entry.c b/lib/libc/posix1e/acl_delete_entry.c
index 59462c8ae6ab..189669ad7530 100644
--- a/lib/libc/posix1e/acl_delete_entry.c
+++ b/lib/libc/posix1e/acl_delete_entry.c
@@ -76,7 +76,6 @@ _entry_matches(const acl_entry_t a, const acl_entry_t b)
int
acl_delete_entry(acl_t acl, acl_entry_t entry_d)
{
- struct acl *acl_int;
struct acl_entry entry_int;
int i, j, found = 0;
@@ -85,8 +84,6 @@ acl_delete_entry(acl_t acl, acl_entry_t entry_d)
return (-1);
}
- acl_int = &acl->ats_acl;
-
if (_entry_brand(entry_d) != _acl_brand(acl)) {
errno = EINVAL;
return (-1);
diff --git a/lib/libc/powerpc/Symbol.map b/lib/libc/powerpc/Symbol.map
index be6daf5d908e..8b4418b8eaae 100644
--- a/lib/libc/powerpc/Symbol.map
+++ b/lib/libc/powerpc/Symbol.map
@@ -45,7 +45,6 @@ FBSDprivate_1.0 {
/* PSEUDO syscalls */
_getlogin;
- _set_tp;
_fpgetsticky;
__makecontext;
__longjmp;
diff --git a/lib/libc/powerpc/gen/Makefile.common b/lib/libc/powerpc/gen/Makefile.common
index b2f898c9faae..64498ea0391c 100644
--- a/lib/libc/powerpc/gen/Makefile.common
+++ b/lib/libc/powerpc/gen/Makefile.common
@@ -3,6 +3,4 @@
.PATH: ${LIBC_SRCTOP}/powerpc/gen
SRCS += _ctx_start.S eabi.S infinity.c ldexp.c makecontext.c \
- signalcontext.c syncicache.c _get_tp.c _set_tp.c trivial-getcontextx.c
-
-CFLAGS._get_tp.c+= ${RTLD_HDRS}
+ signalcontext.c syncicache.c trivial-getcontextx.c
diff --git a/lib/libc/powerpc/gen/_get_tp.c b/lib/libc/powerpc/gen/_get_tp.c
deleted file mode 100644
index 0d08b707ff1a..000000000000
--- a/lib/libc/powerpc/gen/_get_tp.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2021 The FreeBSD Foundation
- *
- * This software were developed by Konstantin Belousov
- * under sponsorship from the FreeBSD Foundation.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <string.h>
-#include <stdint.h>
-#include "libc_private.h"
-#include "rtld.h"
-
-void *
-_get_tp(void)
-{
- Elf_Addr tp;
-
- __asm __volatile("mr %0,2" : "=r" (tp));
- return ((void *)(tp - TLS_TP_OFFSET - TLS_TCB_SIZE));
-}
diff --git a/lib/libc/powerpc/sys/Makefile.inc b/lib/libc/powerpc/sys/Makefile.inc
index 99a141b5cb1e..6f07795b8870 100644
--- a/lib/libc/powerpc/sys/Makefile.inc
+++ b/lib/libc/powerpc/sys/Makefile.inc
@@ -1,4 +1,6 @@
# $FreeBSD$
-SRCS+= __vdso_gettc.c
+SRCS+= __vdso_gettc.c \
+ sched_getcpu_gen.c
+
MDASM+= cerror.S
diff --git a/lib/libc/powerpc64/Symbol.map b/lib/libc/powerpc64/Symbol.map
index 29bd6a544a61..57b20a5984c0 100644
--- a/lib/libc/powerpc64/Symbol.map
+++ b/lib/libc/powerpc64/Symbol.map
@@ -41,7 +41,6 @@ FBSDprivate_1.0 {
/* PSEUDO syscalls */
_getlogin;
- _set_tp;
_fpgetsticky;
__makecontext;
__longjmp;
diff --git a/lib/libc/powerpc64/gen/Makefile.inc b/lib/libc/powerpc64/gen/Makefile.inc
index 0e40aee2d11f..4cb174fe8603 100644
--- a/lib/libc/powerpc64/gen/Makefile.inc
+++ b/lib/libc/powerpc64/gen/Makefile.inc
@@ -1,11 +1,8 @@
# $FreeBSD$
SRCS += _ctx_start.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \
- fpgetsticky.c fpsetmask.c fpsetround.c _get_tp.c \
+ fpgetsticky.c fpsetmask.c fpsetround.c \
infinity.c ldexp.c makecontext.c _setjmp.S \
setjmp.S sigsetjmp.S signalcontext.c syncicache.c \
- _set_tp.c \
trivial-getcontextx.c
-CFLAGS._get_tp.c+= ${RTLD_HDRS}
-
diff --git a/lib/libc/powerpc64/gen/_get_tp.c b/lib/libc/powerpc64/gen/_get_tp.c
deleted file mode 100644
index 16f5c952276e..000000000000
--- a/lib/libc/powerpc64/gen/_get_tp.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2021 The FreeBSD Foundation
- *
- * This software were developed by Konstantin Belousov
- * under sponsorship from the FreeBSD Foundation.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <string.h>
-#include <stdint.h>
-#include "libc_private.h"
-#include "rtld.h"
-
-void *
-_get_tp(void)
-{
- Elf_Addr tp;
-
- __asm __volatile("mr %0,13" : "=r" (tp));
- return ((void *)(tp - TLS_TP_OFFSET - TLS_TCB_SIZE));
-}
diff --git a/lib/libc/powerpc64/sys/Makefile.inc b/lib/libc/powerpc64/sys/Makefile.inc
index 99a141b5cb1e..6f07795b8870 100644
--- a/lib/libc/powerpc64/sys/Makefile.inc
+++ b/lib/libc/powerpc64/sys/Makefile.inc
@@ -1,4 +1,6 @@
# $FreeBSD$
-SRCS+= __vdso_gettc.c
+SRCS+= __vdso_gettc.c \
+ sched_getcpu_gen.c
+
MDASM+= cerror.S
diff --git a/lib/libc/regex/regexec.c b/lib/libc/regex/regexec.c
index bf27d05f86c6..d7aa46f45b2b 100644
--- a/lib/libc/regex/regexec.c
+++ b/lib/libc/regex/regexec.c
@@ -97,8 +97,8 @@ xmbrtowc_dummy(wint_t *wi,
}
/* macros for manipulating states, small version */
-#define states long
-#define states1 states /* for later use in regexec() decision */
+#define states1 long /* for later use in regexec() decision */
+#define states states1
#define CLEAR(v) ((v) = 0)
#define SET0(v, n) ((v) &= ~((unsigned long)1 << (n)))
#define SET1(v, n) ((v) |= (unsigned long)1 << (n))
diff --git a/lib/libc/resolv/res_init.c b/lib/libc/resolv/res_init.c
index 515c86c2378d..274ffbf999d6 100644
--- a/lib/libc/resolv/res_init.c
+++ b/lib/libc/resolv/res_init.c
@@ -202,11 +202,7 @@ __res_vinit(res_state statp, int preinit) {
statp->id = res_nrandomid(statp);
memset(u, 0, sizeof(u));
-#ifdef USELOOPBACK
- u[nserv].sin.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
-#else
u[nserv].sin.sin_addr.s_addr = INADDR_ANY;
-#endif
u[nserv].sin.sin_family = AF_INET;
u[nserv].sin.sin_port = htons(NAMESERVER_PORT);
#ifdef HAVE_SA_LEN
@@ -214,11 +210,7 @@ __res_vinit(res_state statp, int preinit) {
#endif
nserv++;
#ifdef HAS_INET6_STRUCTS
-#ifdef USELOOPBACK
- u[nserv].sin6.sin6_addr = in6addr_loopback;
-#else
u[nserv].sin6.sin6_addr = in6addr_any;
-#endif
u[nserv].sin6.sin6_family = AF_INET6;
u[nserv].sin6.sin6_port = htons(NAMESERVER_PORT);
#ifdef HAVE_SA_LEN
diff --git a/lib/libc/riscv/Symbol.map b/lib/libc/riscv/Symbol.map
index d9121798140c..4214db12ed5f 100644
--- a/lib/libc/riscv/Symbol.map
+++ b/lib/libc/riscv/Symbol.map
@@ -32,6 +32,5 @@ FBSD_1.0 {
};
FBSDprivate_1.0 {
- _set_tp;
__makecontext;
};
diff --git a/lib/libc/riscv/gen/Makefile.inc b/lib/libc/riscv/gen/Makefile.inc
index 1c1a90bda730..f5914e630694 100644
--- a/lib/libc/riscv/gen/Makefile.inc
+++ b/lib/libc/riscv/gen/Makefile.inc
@@ -5,14 +5,10 @@ SRCS+= _ctx_start.S \
flt_rounds.c \
fpgetmask.c \
fpsetmask.c \
- _get_tp.c \
infinity.c \
ldexp.c \
makecontext.c \
_setjmp.S \
- _set_tp.c \
setjmp.S \
sigsetjmp.S \
trivial-getcontextx.c
-
-CFLAGS._get_tp.c+= ${RTLD_HDRS}
diff --git a/lib/libc/riscv/gen/_get_tp.c b/lib/libc/riscv/gen/_get_tp.c
deleted file mode 100644
index 0477e3ab8ca9..000000000000
--- a/lib/libc/riscv/gen/_get_tp.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2021 The FreeBSD Foundation
- *
- * This software were developed by Konstantin Belousov
- * under sponsorship from the FreeBSD Foundation.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <string.h>
-#include <stdint.h>
-#include "libc_private.h"
-#include "rtld.h"
-
-void *
-_get_tp(void)
-{
- Elf_Addr tp;
-
- __asm __volatile("mv %0, tp" : "=r" (tp));
- return ((void *)(tp - TLS_TP_OFFSET - TLS_TCB_SIZE));
-}
diff --git a/lib/libc/riscv/gen/_set_tp.c b/lib/libc/riscv/gen/_set_tp.c
deleted file mode 100644
index 49295e26857c..000000000000
--- a/lib/libc/riscv/gen/_set_tp.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com>
- * All rights reserved.
- *
- * Portions of this software were developed by SRI International and the
- * University of Cambridge Computer Laboratory under DARPA/AFRL contract
- * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme.
- *
- * Portions of this software were developed by the University of Cambridge
- * Computer Laboratory as part of the CTSRD Project, with support from the
- * UK Higher Education Innovation Fund (HEIF).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <string.h>
-#include <sys/types.h>
-
-#include <stdlib.h>
-
-/* NB: size of 'struct tcb'. */
-#define TP_OFFSET (sizeof(void *) * 2)
-
-void
-_set_tp(void *tp)
-{
-
- __asm __volatile("addi tp, %0, %1" :: "r" (tp), "I" (TP_OFFSET));
-}
diff --git a/lib/libc/riscv/sys/Makefile.inc b/lib/libc/riscv/sys/Makefile.inc
index b322cece382c..2eb12bf11cad 100644
--- a/lib/libc/riscv/sys/Makefile.inc
+++ b/lib/libc/riscv/sys/Makefile.inc
@@ -1,6 +1,7 @@
# $FreeBSD$
-SRCS+= __vdso_gettc.c
+SRCS+= __vdso_gettc.c \
+ sched_getcpu_gen.c
MDASM= cerror.S \
syscall.S \
diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c
index 4f3df270de0c..e4770e4e88c5 100644
--- a/lib/libc/rpc/getrpcent.c
+++ b/lib/libc/rpc/getrpcent.c
@@ -657,11 +657,11 @@ static int
rpc_marshal_func(char *buffer, size_t *buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
- char *name;
- int num;
+ char *name __unused;
+ int num __unused;
struct rpcent *rpc;
- char *orig_buf;
- size_t orig_buf_size;
+ char *orig_buf __unused;
+ size_t orig_buf_size __unused;
struct rpcent new_rpc;
size_t desired_size, size, aliases_size;
@@ -744,8 +744,8 @@ static int
rpc_unmarshal_func(char *buffer, size_t buffer_size, void *retval, va_list ap,
void *cache_mdata)
{
- char *name;
- int num;
+ char *name __unused;
+ int num __unused;
struct rpcent *rpc;
char *orig_buf;
size_t orig_buf_size;
diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c
index 1e5cd86d7ed4..ae23442e9a16 100644
--- a/lib/libc/rpc/rpc_soc.c
+++ b/lib/libc/rpc/rpc_soc.c
@@ -120,11 +120,11 @@ clnt_com_create(struct sockaddr_in *raddr, rpcprog_t prog, rpcvers_t vers, int *
proto = strcmp(tp, "udp") == 0 ? IPPROTO_UDP : IPPROTO_TCP;
sport = pmap_getport(raddr, (u_long)prog, (u_long)vers,
proto);
+ mutex_lock(&rpcsoc_lock); /* pmap_getport is recursive */
if (sport == 0) {
goto err;
}
raddr->sin_port = htons(sport);
- mutex_lock(&rpcsoc_lock); /* pmap_getport is recursive */
}
/* Transform sockaddr_in to netbuf */
diff --git a/lib/libc/stdio/fflush.c b/lib/libc/stdio/fflush.c
index f7d2fbdc28e5..decc974907f4 100644
--- a/lib/libc/stdio/fflush.c
+++ b/lib/libc/stdio/fflush.c
@@ -105,8 +105,8 @@ __weak_reference(__fflush, fflush_unlocked);
int
__sflush(FILE *fp)
{
- unsigned char *p;
- int n, t;
+ unsigned char *p, *old_p;
+ int n, t, old_w;
t = fp->_flags;
if ((t & __SWR) == 0)
@@ -121,7 +121,9 @@ __sflush(FILE *fp)
* Set these immediately to avoid problems with longjmp and to allow
* exchange buffering (via setvbuf) in user write function.
*/
+ old_p = fp->_p;
fp->_p = p;
+ old_w = fp->_w;
fp->_w = t & (__SLBF|__SNBF) ? 0 : fp->_bf._size;
for (; n > 0; n -= t, p += t) {
@@ -134,6 +136,9 @@ __sflush(FILE *fp)
fp->_p += n;
if ((fp->_flags & (__SLBF | __SNBF)) == 0)
fp->_w -= n;
+ } else if (p == fp->_p) { /* cond. to handle setvbuf */
+ fp->_p = old_p;
+ fp->_w = old_w;
}
fp->_flags |= __SERR;
return (EOF);
diff --git a/lib/libc/stdio/fread.c b/lib/libc/stdio/fread.c
index 11f8d13f0caf..cafe86fe7961 100644
--- a/lib/libc/stdio/fread.c
+++ b/lib/libc/stdio/fread.c
@@ -129,11 +129,13 @@ __fread(void * __restrict buf, size_t size, size_t count, FILE * __restrict fp)
}
while (resid > (r = fp->_r)) {
- (void)memcpy((void *)p, (void *)fp->_p, (size_t)r);
- fp->_p += r;
- /* fp->_r = 0 ... done in __srefill */
- p += r;
- resid -= r;
+ if (r != 0) {
+ (void)memcpy((void *)p, (void *)fp->_p, (size_t)r);
+ fp->_p += r;
+ /* fp->_r = 0 ... done in __srefill */
+ p += r;
+ resid -= r;
+ }
if (__srefill(fp)) {
/* no more input: return partial result */
return ((total - resid) / size);
diff --git a/lib/libc/stdio/vfwscanf.c b/lib/libc/stdio/vfwscanf.c
index fbd3a8ad747a..34488912171a 100644
--- a/lib/libc/stdio/vfwscanf.c
+++ b/lib/libc/stdio/vfwscanf.c
@@ -268,7 +268,6 @@ convert_string(FILE *fp, char * mbp, int width, locale_t locale)
static __inline int
convert_wstring(FILE *fp, wchar_t *wcp, int width, locale_t locale)
{
- wchar_t *wcp0;
wint_t wi;
int nread;
@@ -280,7 +279,6 @@ convert_wstring(FILE *fp, wchar_t *wcp, int width, locale_t locale)
if (wi != WEOF)
__ungetwc(wi, fp, locale);
} else {
- wcp0 = wcp;
while ((wi = __fgetwc(fp, locale)) != WEOF &&
width-- != 0 && !iswspace(wi)) {
*wcp++ = (wchar_t)wi;
diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc
index 361761e73fdd..a658fd78e862 100644
--- a/lib/libc/stdlib/Makefile.inc
+++ b/lib/libc/stdlib/Makefile.inc
@@ -46,7 +46,8 @@ MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 \
MLINKS+=a64l.3 l64a.3 a64l.3 l64a_r.3
MLINKS+=atol.3 atoll.3
MLINKS+=exit.3 _Exit.3
-MLINKS+=getenv.3 putenv.3 getenv.3 setenv.3 getenv.3 unsetenv.3
+MLINKS+=getenv.3 clearenv.3 getenv.3 putenv.3 getenv.3 setenv.3 \
+ getenv.3 unsetenv.3
MLINKS+=getopt_long.3 getopt_long_only.3
MLINKS+=hcreate.3 hdestroy.3 hcreate.3 hsearch.3
MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 hsearch_r.3
diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map
index 2be23390e333..6524c6097b96 100644
--- a/lib/libc/stdlib/Symbol.map
+++ b/lib/libc/stdlib/Symbol.map
@@ -128,6 +128,10 @@ FBSD_1.6 {
srand;
};
+FBSD_1.7 {
+ clearenv;
+};
+
FBSDprivate_1.0 {
__system;
_system;
diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3
index e662b86d214b..5566d7b01dcd 100644
--- a/lib/libc/stdlib/getenv.3
+++ b/lib/libc/stdlib/getenv.3
@@ -32,10 +32,11 @@
.\" @(#)getenv.3 8.2 (Berkeley) 12/11/93
.\" $FreeBSD$
.\"
-.Dd June 20, 2007
+.Dd November 7, 2021
.Dt GETENV 3
.Os
.Sh NAME
+.Nm clearenv ,
.Nm getenv ,
.Nm putenv ,
.Nm setenv ,
@@ -45,6 +46,8 @@
.Lb libc
.Sh SYNOPSIS
.In stdlib.h
+.Ft int
+.Fn clearenv "void"
.Ft char *
.Fn getenv "const char *name"
.Ft int
@@ -59,6 +62,14 @@ host
.Em environment list .
.Pp
The
+.Fn clearenv
+function clears all environment variables.
+New variables can be added using
+.Fn setenv
+and
+.Fn putenv .
+.Pp
+The
.Fn getenv
function obtains the current value of the environment variable,
.Fa name .
@@ -128,7 +139,7 @@ is not in the current environment,
.Dv NULL
is returned.
.Pp
-.Rv -std setenv putenv unsetenv
+.Rv -std clearenv setenv putenv unsetenv
.Sh ERRORS
.Bl -tag -width Er
.It Bq Er EINVAL
@@ -211,6 +222,11 @@ This was changed to use
as the memory location of the ``name=value'' pair to follow the
.Tn POSIX
specification.
+.Pp
+The
+.Fn clearenv
+was added in
+.Fx 14 .
.Sh BUGS
Successive calls to
.Fn setenv
diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c
index 5d445e18d93b..bf79cb6b0d79 100644
--- a/lib/libc/stdlib/getenv.c
+++ b/lib/libc/stdlib/getenv.c
@@ -691,3 +691,28 @@ unsetenv(const char *name)
return (0);
}
+
+/*
+ * Unset all variable by flagging them as inactive. No variable is
+ * ever freed.
+ */
+int
+clearenv(void)
+{
+ int ndx;
+
+ /* Initialize environment. */
+ if (__merge_environ() == -1 || (envVars == NULL && __build_env() == -1))
+ return (-1);
+
+ /* Remove from the end to not shuffle memory too much. */
+ for (ndx = envVarsTotal - 1; ndx >= 0; ndx--) {
+ envVars[ndx].active = false;
+ if (envVars[ndx].putenv)
+ __remove_putenv(ndx);
+ }
+
+ __rebuild_environ(0);
+
+ return (0);
+}
diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c
index 5016fff7895f..0b99c04507d3 100644
--- a/lib/libc/stdlib/qsort.c
+++ b/lib/libc/stdlib/qsort.c
@@ -108,6 +108,8 @@ local_qsort(void *a, size_t n, size_t es, cmp_t *cmp, void *thunk)
int cmp_result;
int swap_cnt;
+ if (__predict_false(n == 0))
+ return;
loop:
swap_cnt = 0;
if (n < 7) {
diff --git a/lib/libc/string/strstr.c b/lib/libc/string/strstr.c
index 72f8abb9e200..2ca0d4fd03c1 100644
--- a/lib/libc/string/strstr.c
+++ b/lib/libc/string/strstr.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-3-Clause
+ * SPDX-License-Identifier: MIT
*
* Copyright (c) 2005-2014 Rich Felker, et al.
*
@@ -149,7 +149,7 @@ twoway_strstr(const unsigned char *h, const unsigned char *n)
for (;;) {
/* Update incremental end-of-haystack pointer */
if (z - h < l) {
- /* Fast estimate for MIN(l,63) */
+ /* Fast estimate for MAX(l,63) */
size_t grow = l | 63;
const unsigned char *z2 = memchr(z, 0, grow);
if (z2) {
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 58ba333080b7..5e2c3da198b0 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -36,6 +36,9 @@ SRCS+= \
SRCS+= getdents.c lstat.c mknod.c stat.c
+NOASM+= sched_getcpu.o
+PSEUDO+= _sched_getcpu.o
+
SRCS+= fstat.c fstatat.c fstatfs.c getfsstat.c statfs.c
NOASM+= fstat.o fstatat.o fstatfs.o getfsstat.o statfs.o
PSEUDO+= _fstat.o _fstatat.o _fstatfs.o _getfsstat.o _statfs.o
@@ -69,6 +72,7 @@ INTERPOSED = \
nanosleep \
open \
openat \
+ pdfork \
poll \
ppoll \
pselect \
@@ -285,14 +289,12 @@ MAN+= abort2.2 \
revoke.2 \
rfork.2 \
rmdir.2 \
- rtprio.2
-.if !defined(NO_P1003_1B)
-MAN+= sched_get_priority_max.2 \
+ rtprio.2 \
+ sched_get_priority_max.2 \
sched_setparam.2 \
sched_setscheduler.2 \
- sched_yield.2
-.endif
-MAN+= sctp_generic_recvmsg.2 \
+ sched_yield.2 \
+ sctp_generic_recvmsg.2 \
sctp_generic_sendmsg.2 \
sctp_peeloff.2 \
select.2 \
@@ -461,12 +463,10 @@ MLINKS+=recv.2 recvfrom.2 \
recv.2 recvmsg.2
MLINKS+=rename.2 renameat.2
MLINKS+=rtprio.2 rtprio_thread.2
-.if !defined(NO_P1003_1B)
MLINKS+=sched_get_priority_max.2 sched_get_priority_min.2 \
sched_get_priority_max.2 sched_rr_get_interval.2
MLINKS+=sched_setparam.2 sched_getparam.2
MLINKS+=sched_setscheduler.2 sched_getscheduler.2
-.endif
MLINKS+=select.2 FD_CLR.3 \
select.2 FD_ISSET.3 \
select.2 FD_SET.3 \
diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map
index a70d14b51f7c..7984f54da697 100644
--- a/lib/libc/sys/Symbol.map
+++ b/lib/libc/sys/Symbol.map
@@ -260,7 +260,6 @@ FBSD_1.0 {
sigwaitinfo;
socket;
socketpair;
- swapoff;
swapon;
symlink;
sync;
@@ -420,6 +419,7 @@ FBSD_1.6 {
FBSD_1.7 {
_Fork;
fspacectl;
+ swapoff;
};
FBSDprivate_1.0 {
diff --git a/lib/libc/sys/fcntl.2 b/lib/libc/sys/fcntl.2
index 33ad7a5673e1..d6d48f7a4797 100644
--- a/lib/libc/sys/fcntl.2
+++ b/lib/libc/sys/fcntl.2
@@ -28,7 +28,7 @@
.\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94
.\" $FreeBSD$
.\"
-.Dd January 6, 2021
+.Dd December 7, 2021
.Dt FCNTL 2
.Os
.Sh NAME
@@ -53,7 +53,11 @@ Depending on the value of
.Fa cmd ,
.Fn fcntl
can take an additional third argument
-.Fa "int arg" .
+.Fa arg .
+Unless otherwise noted below for a specific operation,
+.Fa arg
+has type
+.Vt int .
.Bl -tag -width F_DUP2FD_CLOEXEC
.It Dv F_DUPFD
Return a new descriptor as follows:
@@ -190,6 +194,19 @@ Check if the vnode is part of a union stack (either the "union" flag from
.Xr mount 2
or unionfs).
This is a hack not intended to be used outside of libc.
+.It Dv F_KINFO
+Fills a
+.Vt struct kinfo_file
+for the file referenced by the specified file descriptor.
+The
+.Fa arg
+argument should point to the storage for
+.Vt struct kinfo_file .
+The
+.Va kf_structsize
+member of the passed structure must be initialized with the sizeof of
+.Vt struct kinfo_file ,
+to allow for the interface versioning and evolution.
.El
.Pp
The flags for the
@@ -273,7 +290,7 @@ and
will fail and return
.Dv EINVAL .
.Pp
-Several commands are available for doing advisory file locking;
+Several operations are available for doing advisory file locking;
they all operate on the following structure:
.Bd -literal
struct flock {
@@ -285,6 +302,10 @@ struct flock {
int l_sysid; /* remote system id or zero for local */
};
.Ed
+These advisory file locking operations take a pointer to
+.Vt struct flock
+as the third argument
+.Fa arg .
The commands available for advisory record locking are as follows:
.Bl -tag -width F_SETLKWX
.It Dv F_GETLK
diff --git a/lib/libc/sys/getfh.2 b/lib/libc/sys/getfh.2
index cd3d54f54d7f..e042839a00c4 100644
--- a/lib/libc/sys/getfh.2
+++ b/lib/libc/sys/getfh.2
@@ -29,7 +29,7 @@
.\" @(#)getfh.2 8.1 (Berkeley) 6/9/93
.\" $FreeBSD$
.\"
-.Dd February 23, 2021
+.Dd December 23, 2021
.Dt GETFH 2
.Os
.Sh NAME
@@ -130,6 +130,7 @@ is called with an absolute
it ignores the
.Fa fd
argument.
+.Pp
These system calls are restricted to the superuser.
.Sh RETURN VALUES
.Rv -std
@@ -141,6 +142,8 @@ and
system calls
fail if one or more of the following are true:
.Bl -tag -width Er
+.It Bq Er EPERM
+The caller does not have appropriate privilege to perform the operation.
.It Bq Er ENOTDIR
A component of the path prefix of
.Fa path
diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2
index 7ae16728c4a9..925c56eaab52 100644
--- a/lib/libc/sys/intro.2
+++ b/lib/libc/sys/intro.2
@@ -474,7 +474,7 @@ The state protected by a robust mutex is not recoverable.
The owner of a robust mutex terminated while holding the mutex lock.
.It Er 97 EINTEGRITY Em "Integrity check failed" .
An integrity check such as a check-hash or a cross-correlation failed.
-The integrity error falls between
+The integrity error falls in the kernel I/O stack between
.Er EINVAL
that identifies errors in parameters to a system call and
.Er EIO
diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2
index 68929e973dc0..8ba1779c5551 100644
--- a/lib/libc/sys/kqueue.2
+++ b/lib/libc/sys/kqueue.2
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 12, 2021
+.Dd January 20, 2022
.Dt KQUEUE 2
.Os
.Sh NAME
@@ -390,8 +390,8 @@ For eventfds,
will contain the maximum value that can be added to the counter
without blocking.
.Pp
-For BPF devices, the filter always indicates that it is possible to
-write and
+For BPF devices, when the descriptor is attached to an interface the filter
+always indicates that it is possible to write and
.Va data
will contain the MTU size of the underlying interface.
.It Dv EVFILT_EMPTY
@@ -479,7 +479,9 @@ The events to monitor are:
.It Dv NOTE_EXIT
The process has exited.
The exit status will be stored in
-.Va data .
+.Va data
+in the same format as the status returned by
+.Xr wait 2 .
.It Dv NOTE_FORK
The process has called
.Fn fork .
diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2
index da42c238a151..f6b061079ddf 100644
--- a/lib/libc/sys/open.2
+++ b/lib/libc/sys/open.2
@@ -334,9 +334,6 @@ but advisory locking is not allowed
.It Xr close 2
.It Xr fstat 2
.It Xr fexecve 2
-requires that
-.Dv O_EXEC
-was also specified at open time
.It Dv SCM_RIGHTS
can be passed over a
.Xr unix 4
diff --git a/lib/libc/sys/pdfork.c b/lib/libc/sys/pdfork.c
index 003262d1237d..d98f9b2f7d26 100644
--- a/lib/libc/sys/pdfork.c
+++ b/lib/libc/sys/pdfork.c
@@ -34,7 +34,7 @@
__FBSDID("$FreeBSD$");
#include <sys/types.h>
-#include <unistd.h>
+#include <sys/procdesc.h>
#include "libc_private.h"
#pragma weak pdfork
diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2
index 504891597dab..a0ca0ddee75f 100644
--- a/lib/libc/sys/ptrace.2
+++ b/lib/libc/sys/ptrace.2
@@ -2,7 +2,7 @@
.\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
.\"
.\" This file is in the public domain.
-.Dd May 20, 2021
+.Dd January 22, 2022
.Dt PTRACE 2
.Os
.Sh NAME
@@ -122,6 +122,55 @@ Kernel drops any
signals queued to the traced children, which could be either generated by
not yet consumed debug events, or sent by other means, the later should
not be done anyway.
+.Sh DISABLING PTRACE
+The
+.Nm
+subsystem provides rich facilities to manipulate other processes state.
+Sometimes it may be desirable to disallow it either completely, or limit
+its scope.
+The following controls are provided for this:
+.Bl -tag -width security.bsd.unprivileged_proc_debug
+.It Dv security.bsd.allow_ptrace
+Setting this sysctl to zero value makes
+.Xr ptrace 2
+return
+.Er ENOSYS
+always as if the syscall is not implemented by the kernel.
+.It Dv security.bsd.unprivileged_proc_debug
+Setting this sysctl to zero disallows use of
+.Fn ptrace
+by unprivileged processes.
+.It Dv security.bsd.see_other_uids
+Setting this sysctl to zero value disallows
+.Fn ptrace
+requests from targeting processes with the real user identifier different
+from the real user identifier of the caller.
+The requests return
+.Er ESRCH
+if policy is not met.
+.It Dv security.bsd.see_other_gids
+Setting this sysctl to zero value disallows
+.Fn ptrace
+requests from process belonging to a group that is not also one of
+the group of the target process.
+The requests return
+.Er ESRCH
+if policy is not met.
+.It Dv securelevel and init
+The
+.Xr init 1
+process can only be traced with
+.Nm
+if securelevel is zero.
+.It Dv procctl(2) PROC_TRACE_CTL
+Process can deny attempts to trace itself with
+.Xr procctl 2
+.Dv PROC_TRACE_CTL
+request.
+In this case requests return
+.Xr EPERM
+error.
+.El
.Sh TRACING EVENTS
.Pp
Each traced process has a tracing event mask.
diff --git a/lib/libc/sys/rtprio.2 b/lib/libc/sys/rtprio.2
index 3c11d25d94bb..650e841b1075 100644
--- a/lib/libc/sys/rtprio.2
+++ b/lib/libc/sys/rtprio.2
@@ -53,7 +53,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 27, 2011
+.Dd December 8, 2021
.Dt RTPRIO 2
.Os
.Sh NAME
@@ -167,15 +167,19 @@ The specified
.Fa prio
was out of range.
.It Bq Er EPERM
-The calling thread is not allowed to set the realtime priority.
+The calling thread is not allowed to set the priority.
Only
-root is allowed to change the realtime priority of any thread, and non-root
-may only change the idle priority of threads the user owns,
-when the
+root is allowed to change the realtime or idle priority of any thread.
+Exceptional privileges can be granted through the
+.Xr mac_priority 4
+policy and the realtime and idletime user groups.
+The
.Xr sysctl 8
variable
.Va security.bsd.unprivileged_idprio
-is set to non-zero.
+is deprecated.
+If set to non-zero, it lets any user change the idle priority of threads
+they own.
.It Bq Er ESRCH
The specified process or thread was not found or visible.
.El
@@ -185,6 +189,7 @@ The specified process or thread was not found or visible.
.Xr rtprio 1 ,
.Xr setpriority 2 ,
.Xr nice 3 ,
+.Xr mac_priority 4 ,
.Xr renice 8 ,
.Xr p_cansee 9
.Sh AUTHORS
diff --git a/lib/libc/sys/swapon.2 b/lib/libc/sys/swapon.2
index 47acbc2dc178..c369e8b7ba51 100644
--- a/lib/libc/sys/swapon.2
+++ b/lib/libc/sys/swapon.2
@@ -28,7 +28,7 @@
.\" @(#)swapon.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd March 30, 2020
+.Dd December 8, 2021
.Dt SWAPON 2
.Os
.Sh NAME
@@ -37,11 +37,13 @@
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
+.It vm/vm_param.h
+.It vm/swap_pager.h
.In unistd.h
.Ft int
.Fn swapon "const char *special"
.Ft int
-.Fn swapoff "const char *special"
+.Fn swapoff "const char *special" "u_int flags"
.Sh DESCRIPTION
The
.Fn swapon
@@ -63,6 +65,20 @@ The
system call disables paging and swapping on the given device.
All associated swap metadata are deallocated, and the device
is made available for other purposes.
+.Pp
+The
+.Fa special
+argument points to the name of the device or file used for swapping.
+.The
+.Va flags
+argument takes the following flags:
+.Bl -tag -width SWAPOFF_FORCE
+.It Dv SWAPOFF_FORCE
+Overrides a very conservative check that prevents swapoff
+if the total amount of free memory and remaining swap
+devices space might be unsufficient for the system to continue
+operating.
+.El
.Sh RETURN VALUES
If an error has occurred, a value of -1 is returned and
.Va errno
diff --git a/lib/libc/tests/net/getaddrinfo/Makefile b/lib/libc/tests/net/getaddrinfo/Makefile
index 96b60d2a9792..edf335cd222f 100644
--- a/lib/libc/tests/net/getaddrinfo/Makefile
+++ b/lib/libc/tests/net/getaddrinfo/Makefile
@@ -8,7 +8,7 @@ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libc/net/${.CURDIR:T}
BINDIR= ${TESTSDIR}
-.error "This testcase needs to be ported to FreeBSD (the output from getaddrinfo_test differs from NetBSD)"
+.error This testcase needs to be ported to FreeBSD (the output from getaddrinfo_test differs from NetBSD)
NETBSD_ATF_TESTS_SH= getaddrinfo_test
diff --git a/lib/libc/tests/ssp/Makefile b/lib/libc/tests/ssp/Makefile
index 452c57246e39..936ada01a760 100644
--- a/lib/libc/tests/ssp/Makefile
+++ b/lib/libc/tests/ssp/Makefile
@@ -38,7 +38,7 @@ PROGS+= h_raw
LDADD.h_raw+= ${SANITIZER_LDFLAGS}
.else
.if make(all)
-.info "Could not find runtime library ${_libclang_rt_ubsan}, skipping h_raw"
+.info Could not find runtime library ${_libclang_rt_ubsan}, skipping h_raw
.endif
.endif
.endif
diff --git a/lib/libc/tests/stdlib/Makefile b/lib/libc/tests/stdlib/Makefile
index bd85efcb1b95..ffba83443a9e 100644
--- a/lib/libc/tests/stdlib/Makefile
+++ b/lib/libc/tests/stdlib/Makefile
@@ -2,6 +2,7 @@
.include <src.opts.mk>
+ATF_TESTS_C+= clearenv_test
ATF_TESTS_C+= dynthr_test
ATF_TESTS_C+= heapsort_test
ATF_TESTS_C+= mergesort_test
diff --git a/lib/libc/tests/stdlib/clearenv_test.c b/lib/libc/tests/stdlib/clearenv_test.c
new file mode 100644
index 000000000000..40bd7f2ba0f5
--- /dev/null
+++ b/lib/libc/tests/stdlib/clearenv_test.c
@@ -0,0 +1,176 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (C) 2021 Mariusz Zaborski <oshogbo@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Test for clearenv(3) routine.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <atf-c.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define TEST_VARIABLE "TEST_VAR"
+#define TEST_SYSTEM_VARIABLE "PWD"
+
+extern char **environ;
+
+void
+create_multiple_variables(int num)
+{
+ char name[64];
+ char value[64];
+ int i;
+
+ for (i = 0; i < num; i++) {
+ snprintf(name, sizeof(name), "%s_%d", TEST_VARIABLE, i);
+ snprintf(value, sizeof(value), "%d", i);
+ ATF_CHECK(getenv(name) == NULL);
+ ATF_CHECK(setenv(name, value, 0) != -1);
+ ATF_CHECK_STREQ(getenv(name), value);
+ }
+}
+
+void
+check_if_nulled_variables(int num)
+{
+ char name[64];
+ int i;
+
+ for (i = 0; i < num; i++) {
+ snprintf(name, sizeof(name), "%s_%d", TEST_VARIABLE, i);
+ ATF_CHECK(getenv(name) == NULL);
+ }
+}
+
+ATF_TC_WITHOUT_HEAD(clearenv__single_var_test);
+ATF_TC_BODY(clearenv__single_var_test, tc)
+{
+
+ ATF_CHECK(setenv(TEST_VARIABLE, "true", 0) != -1);
+ ATF_CHECK_STREQ(getenv(TEST_VARIABLE), "true");
+ ATF_CHECK(clearenv() == 0);
+ ATF_CHECK(getenv(TEST_VARIABLE) == NULL);
+}
+
+ATF_TC_WITHOUT_HEAD(clearenv__multiple_vars_test);
+ATF_TC_BODY(clearenv__multiple_vars_test, tc)
+{
+
+ create_multiple_variables(10);
+ ATF_CHECK(clearenv() == 0);
+ check_if_nulled_variables(10);
+}
+
+ATF_TC_WITHOUT_HEAD(clearenv__recreated_vars_test);
+ATF_TC_BODY(clearenv__recreated_vars_test, tc)
+{
+
+ create_multiple_variables(10);
+ ATF_CHECK(clearenv() == 0);
+ check_if_nulled_variables(10);
+ create_multiple_variables(10);
+}
+
+ATF_TC_WITHOUT_HEAD(clearenv__system_var_test);
+ATF_TC_BODY(clearenv__system_var_test, tc)
+{
+
+ ATF_CHECK(getenv(TEST_SYSTEM_VARIABLE) != NULL);
+ ATF_CHECK(clearenv() == 0);
+ ATF_CHECK(getenv(TEST_SYSTEM_VARIABLE) == NULL);
+}
+
+ATF_TC_WITHOUT_HEAD(clearenv__recreated_system_var_test);
+ATF_TC_BODY(clearenv__recreated_system_var_test, tc)
+{
+
+ ATF_CHECK(getenv(TEST_SYSTEM_VARIABLE) != NULL);
+ ATF_CHECK(clearenv() == 0);
+ ATF_CHECK(getenv(TEST_SYSTEM_VARIABLE) == NULL);
+ ATF_CHECK(setenv(TEST_SYSTEM_VARIABLE, "test", 0) != -1);
+ ATF_CHECK_STREQ(getenv(TEST_SYSTEM_VARIABLE), "test");
+}
+
+ATF_TC_WITHOUT_HEAD(clearenv__double_clear_vars);
+ATF_TC_BODY(clearenv__double_clear_vars, tc)
+{
+
+ create_multiple_variables(10);
+ ATF_CHECK(clearenv() == 0);
+ check_if_nulled_variables(10);
+ ATF_CHECK(clearenv() == 0);
+ check_if_nulled_variables(10);
+ create_multiple_variables(10);
+}
+
+ATF_TC_WITHOUT_HEAD(clearenv__environ_null);
+ATF_TC_BODY(clearenv__environ_null, tc)
+{
+
+ ATF_CHECK(clearenv() == 0);
+ ATF_CHECK(environ != NULL);
+}
+
+ATF_TC_WITHOUT_HEAD(clearenv__putenv_vars);
+ATF_TC_BODY(clearenv__putenv_vars, tc)
+{
+ char buf[64], ref[64];
+
+ snprintf(buf, sizeof(buf), "%s=1", TEST_VARIABLE);
+ strcpy(ref, buf);
+
+ ATF_CHECK(getenv(TEST_VARIABLE) == NULL);
+ ATF_CHECK(putenv(buf) != -1);
+ ATF_CHECK(strcmp(getenv(TEST_VARIABLE), "1") == 0);
+
+ ATF_CHECK(clearenv() == 0);
+
+ ATF_CHECK(getenv(TEST_VARIABLE) == NULL);
+ ATF_CHECK(strcmp(buf, ref) == 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, clearenv__single_var_test);
+ ATF_TP_ADD_TC(tp, clearenv__multiple_vars_test);
+ ATF_TP_ADD_TC(tp, clearenv__recreated_vars_test);
+
+ ATF_TP_ADD_TC(tp, clearenv__system_var_test);
+ ATF_TP_ADD_TC(tp, clearenv__recreated_system_var_test);
+
+ ATF_TP_ADD_TC(tp, clearenv__double_clear_vars);
+ ATF_TP_ADD_TC(tp, clearenv__environ_null);
+
+ ATF_TP_ADD_TC(tp, clearenv__putenv_vars);
+
+ return (atf_no_error());
+}
diff --git a/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c b/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c
index 4f5622f47a81..c19a1a54a8b6 100644
--- a/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c
+++ b/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c
@@ -51,6 +51,7 @@ mod_thread(void *ptr __unused)
char *volatile dummy;
dummy = malloc(500);
+ *dummy = 'a';
return (NULL);
}
diff --git a/lib/libc/uuid/uuid.3 b/lib/libc/uuid/uuid.3
index 4fa41dec98bd..108ee34f213c 100644
--- a/lib/libc/uuid/uuid.3
+++ b/lib/libc/uuid/uuid.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 1, 2012
+.Dd November 19, 2021
.Dt UUID 3
.Os
.Sh NAME
@@ -68,20 +68,12 @@ The
and
.Fn uuid_create_nil
functions create UUIDs.
-The
-.Fn uuid_compare ,
-.Fn uuid_equal
-and
-.Fn uuid_is_nil
-functions can be used to test UUIDs.
To convert from the binary representation to the string representation or
vice versa, use
.Fn uuid_to_string
or
.Fn uuid_from_string
respectively.
-A 16-bit hash value can be obtained by calling
-.Fn uuid_hash .
.Pp
The
.Fn uuid_to_string
@@ -111,6 +103,49 @@ functions decode a UUID from an octet stream in little-endian and
big-endian byte-order, respectively.
These routines are not part of the DCE RPC API.
They are provided for convenience.
+.Pp
+The
+.Fn uuid_compare
+and
+.Fn uuid_equal
+functions compare two UUIDs for equality.
+UUIDs are equal if pointers
+.Fa a
+and
+.Fa b
+are equal or both
+.Dv NULL ,
+or if the structures
+.Fa a
+and
+.Fa b
+point to are equal.
+.Fn uuid_compare
+returns 0 if the UUIDs are equal, -1 if
+.Fa a
+is less than
+.Fa b ,
+and 1 if
+.Fa a
+is greater than
+.Fa b .
+.Fn uuid_equal
+returns 1 if the UUIDs are equal, 0 if they are
+not equal.
+.Pp
+The
+.Fn uuid_is_nil
+function compares a UUID to
+.Dv NULL .
+The function returns 1 if
+.Fa u
+is
+.Dv NULL
+or if the UUID consists of all zeros, and zero otherwise.
+.Pp
+The
+.Fn uuid_hash
+function returns a 16-bit hash value for the specified UUID.
.Sh RETURN VALUES
The successful or unsuccessful completion of the function is returned in
the
@@ -127,6 +162,16 @@ The string representation of an UUID is not valid.
.It Dv uuid_s_no_memory
The function can not allocate memory to store an UUID representation.
.El
+.Pp
+.Fn uuid_compare ,
+.Fn uuid_equal ,
+.Fn uuid_is_nil ,
+and
+.Fn uuid_hash
+always set
+.Fa status
+to
+.Dv uuid_s_ok .
.Sh SEE ALSO
.Xr uuidgen 1 ,
.Xr uuidgen 2
diff --git a/lib/libc/x86/sys/Makefile.inc b/lib/libc/x86/sys/Makefile.inc
index eff3a1085ec6..382b52dd9065 100644
--- a/lib/libc/x86/sys/Makefile.inc
+++ b/lib/libc/x86/sys/Makefile.inc
@@ -4,7 +4,8 @@
SRCS+= \
__vdso_gettc.c \
- pkru.c
+ pkru.c \
+ sched_getcpu_x86.c
MAN+= \
pkru.3
diff --git a/lib/libc/x86/sys/__vdso_gettc.c b/lib/libc/x86/sys/__vdso_gettc.c
index 5cc847e31c0e..b3f3de9f4203 100644
--- a/lib/libc/x86/sys/__vdso_gettc.c
+++ b/lib/libc/x86/sys/__vdso_gettc.c
@@ -147,7 +147,7 @@ static const struct tsc_selector_tag tsc_selector[] = {
static int
tsc_selector_idx(u_int cpu_feature)
{
- u_int amd_feature, cpu_exthigh, cpu_id, p[4], v[3];
+ u_int amd_feature, cpu_exthigh, p[4], v[3];
static const char amd_id[] = "AuthenticAMD";
static const char hygon_id[] = "HygonGenuine";
bool amd_cpu;
@@ -162,9 +162,6 @@ tsc_selector_idx(u_int cpu_feature)
amd_cpu = memcmp(v, amd_id, sizeof(amd_id) - 1) == 0 ||
memcmp(v, hygon_id, sizeof(hygon_id) - 1) == 0;
- do_cpuid(1, p);
- cpu_id = p[0];
-
if (cpu_feature != 0) {
do_cpuid(0x80000000, p);
cpu_exthigh = p[0];
diff --git a/lib/libc/amd64/gen/_get_tp.c b/lib/libc/x86/sys/sched_getcpu_x86.c
index 3c74b9e769c1..13ba18ef5e36 100644
--- a/lib/libc/amd64/gen/_get_tp.c
+++ b/lib/libc/x86/sys/sched_getcpu_x86.c
@@ -1,9 +1,7 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
* Copyright (c) 2021 The FreeBSD Foundation
*
- * This software were developed by Konstantin Belousov
+ * This software were developed by Konstantin Belousov <kib@FreeBSD.org>
* under sponsorship from the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
@@ -28,19 +26,56 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <string.h>
-#include <stdint.h>
+#include <sys/param.h>
+#include <machine/cpufunc.h>
+#include <machine/specialreg.h>
+#include <machine/sysarch.h>
+#include <x86/ifunc.h>
+#include <errno.h>
+#include <sched.h>
#include "libc_private.h"
-void *
-_get_tp(void)
+static int
+sched_getcpu_sys(void)
+{
+ return (__sys_sched_getcpu());
+}
+
+static int
+sched_getcpu_rdpid(void)
{
- void **res;
+ register_t res;
+
+ __asm("rdpid %0" : "=r" (res));
+ return ((int)res);
+}
+
+static int
+sched_getcpu_rdtscp(void)
+{
+ int res;
+
+ __asm("rdtscp" : "=c" (res) : : "eax", "edx");
+ return (res);
+}
+
+DEFINE_UIFUNC(, int, sched_getcpu, (void))
+{
+ u_int amd_feature, cpu_exthigh, p[4];
+
+ if ((cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0)
+ return (sched_getcpu_rdpid);
+
+ amd_feature = 0;
+ if (cpu_feature != 0) {
+ do_cpuid(0x80000000, p);
+ cpu_exthigh = p[0];
+ if (cpu_exthigh >= 0x80000001) {
+ do_cpuid(0x80000001, p);
+ amd_feature = p[3];
+ }
+ }
- /* This function is used by rtld, avoid ifuncs. */
- __asm __volatile("movq %%fs:0, %0" : "=r" (res));
- return (&res[1]);
+ return ((amd_feature & AMDID_RDTSCP) == 0 ?
+ sched_getcpu_sys : sched_getcpu_rdtscp);
}
diff --git a/lib/libcam/camlib.c b/lib/libcam/camlib.c
index 438b0e502fe0..6ebdb30ab82b 100644
--- a/lib/libcam/camlib.c
+++ b/lib/libcam/camlib.c
@@ -128,10 +128,13 @@ cam_get_device(const char *path, char *dev_name, int devnamelen, int *unit)
}
/*
- * We can be rather destructive to the path string. Make a copy of
- * it so we don't hose the user's string.
+ * Resolve the given path to a real device path in case we are given
+ * an alias or other symbolic link. If the path cannot be resolved
+ * then try to parse it as is.
*/
- newpath = (char *)strdup(path);
+ newpath = realpath(path, NULL);
+ if (newpath == NULL)
+ newpath = strdup(path);
if (newpath == NULL)
return (-1);
diff --git a/lib/libcasper/libcasper/libcasper.3 b/lib/libcasper/libcasper/libcasper.3
index bf678457abeb..2151131e29ec 100644
--- a/lib/libcasper/libcasper/libcasper.3
+++ b/lib/libcasper/libcasper/libcasper.3
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 3, 2021
+.Dd November 15, 2021
.Dt LIBCASPER 3
.Os
.Sh NAME
@@ -78,102 +78,108 @@
.Sh DESCRIPTION
The
.Nm libcasper
-library allows to manage application capabilities through the casper process.
+library provides for the control of application capabilities through
+the casper process.
.Pp
-The application capability (represented by the
+An application capability, represented by the
.Vt cap_channel_t
-type) is a communication channel between the caller and the casper process
-daemon or an instance of one of its services.
-A capability to the casper process obtained with the
+type, is a communication channel between the caller and the casper
+daemon or an instance of one of the daemon's services.
+A capability to the casper process, obtained with the
.Fn cap_init
-function allows to create capabilities to casper's services via the
+function, allows a program to create capabilities to access
+the casper daemon's services via the
.Fn cap_service_open
function.
.Pp
The
.Fn cap_init
-function opens capability to the casper process.
+function instantiates a capability to allow a program to access
+the casper daemon.
.Pp
The
.Fn cap_wrap
-function creates
+function creates a
.Vt cap_channel_t
-based on the given socket.
-The function is used when capability is inherited through
+based on the socket supplied in the call.
+The function is used when a capability is inherited through the
.Xr execve 2
-or send over
+system call,
+or sent over a
.Xr unix 4
-domain socket as a regular file descriptor and has to be represented as
-.Vt cap_channel_t
-again.
+domain socket as a file descriptor,
+and has to be converted into a
+.Vt cap_channel_t .
The
.Fa flags
argument defines the channel behavior.
The supported flags are:
.Bl -ohang -offset indent
.It CASPER_NO_UNIQ
-The communication between process and casper uses no unique version of nvlist.
+The communication between the process and the casper daemon uses no
+unique version of nvlist.
.El
.Pp
The
.Fn cap_unwrap
-function is the opposite of the
-.Fn cap_wrap
-function.
-It frees the
-.Vt cap_channel_t
-structure and returns
+function returns the
.Xr unix 4
-domain socket associated with it.
+domain socket used by the daemon service,
+and frees the
+.Vt cap_channel_t
+structure.
.Pp
The
.Fn cap_clone
-function clones the given capability.
+function returns a clone of the capability passed as its only argument.
.Pp
The
.Fn cap_close
-function closes the given capability.
+function closes, and frees, the given capability.
.Pp
The
.Fn cap_sock
-function returns
+function returns the
.Xr unix 4
domain socket descriptor associated with the given capability for use with
-system calls like
+system calls such as:
.Xr kevent 2 ,
-.Xr poll 2
+.Xr poll 2 ,
and
.Xr select 2 .
.Pp
The
.Fn cap_limit_get
-function stores current limits of the given capability in the
+function stores the current limits of the given capability in the
.Fa limitsp
argument.
-If the function return
+If the function returns
.Va 0
and
.Dv NULL
-is stored in
+is stored in the
.Fa limitsp
-it means there are no limits set.
+argument,
+there are no limits set.
.Pp
The
.Fn cap_limit_set
function sets limits for the given capability.
-The limits are provided as a
+The limits are provided as an
.Xr nvlist 9 .
-The exact format depends on the service the capability represents.
+The exact format of the limits depends on the service that the
+capability represents.
.Fn cap_limit_set
-frees the limits regardless of whether the operation succeeds or fails.
+frees the limits passed to the call,
+whether or not the operation succeeds or fails.
.Pp
The
.Fn cap_send_nvlist
function sends the given
.Xr nvlist 9
over the given capability.
-This is low level interface to communicate with casper services.
-Most services should provide higher level API.
+This is a low level interface to communicate with casper services.
+It is expected that most services will provide a higher level API.
.Pp
The
.Fn cap_recv_nvlist
@@ -185,41 +191,44 @@ The
.Fn cap_xfer_nvlist
function sends the given
.Xr nvlist 9 ,
-destroys it and receives new
+destroys it,
+and receives a new
.Xr nvlist 9
in response over the given capability.
It does not matter if the function succeeds or fails, the
.Xr nvlist 9
-given for sending will always be destroyed once the function returns.
+given for sending will always be destroyed before the function returns.
.Pp
The
.Fn cap_service_open
-function opens casper service of the given name through casper capability
-obtained via the
+function opens the casper service named in the call using
+the casper capability obtained via the
.Fn cap_init
function.
-The function returns capability that provides access to opened service.
+The
+.Fn cap_service_open
+function returns a capability that provides access to the opened service.
Casper supports the following services in the base system:
.Pp
.Bl -tag -width "system.random" -compact -offset indent
.It system.dns
-provides DNS libc compatible API
+provides libc compatible DNS API
.It system.grp
-provides
+provides a
.Xr getgrent 3
compatible API
.It system.net
-provides network libc compatible API
+provides a libc compatible network API
.It system.pwd
-provides
+provides a
.Xr getpwent 3
compatible API
.It system.sysctl
-provides
+provides a
.Xr sysctlbyname 3
compatible API
.It system.syslog
-provides
+provides a
.Xr syslog 3
compatible API
.El
diff --git a/lib/libcasper/libcasper/libcasper_service.3 b/lib/libcasper/libcasper/libcasper_service.3
index c0656a23a572..8ddc41f3d617 100644
--- a/lib/libcasper/libcasper/libcasper_service.3
+++ b/lib/libcasper/libcasper/libcasper_service.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 5, 2020
+.Dd November 15, 2021
.Dt LIBCASPER 3
.Os
.Sh NAME
@@ -47,7 +47,7 @@ typedef int service_command_func_t(const char *, const nvlist_t *, nvlist_t *,
.Sh DESCRIPTION
The
.Nm CREATE_SERVICE
-macro to create a new Casper service.
+macro is used to create a new casper service.
The
.Fa name
is a string containing the service name, which will be used in the
@@ -57,44 +57,44 @@ function to identify it.
The
.Fa limit_func
is a function of type
-.Li service_limit_func_t .
-The first argument of the function contains
+.Li service_limit_func_t
+where the first argument of the function contains an
.Xr nvlist 9 ,
-old service limits and second one the new limits.
-If the services wasn't limited the old limits will be set to
+old service limits and
+the second argument contains the new limits.
+If the service was not limited then the old limits will be set to
.Dv NULL .
-This function should not allow to extend service limits and only limit it
-further.
+This function must not allow the extension of service limits.
The
.Fa command_func
is a function of type
-.Li service_command_func_t .
-First argument is the name of the command that should be executed.
+.Li service_command_func_t
+where the first argument is the name of the command that should be executed.
The first
.Xr nvlist 9
-contains the current limits.
-Next one contains a
+contains the current limits and the second contains an
.Xr nvlist 9
-with current request.
-The last one contains an output
+with the current request.
+The last argument contains a return value
.Xr nvlist 9
-which contains the response from Casper.
+which contains the response from casper.
.Pp
The
.Fa flags
-argument defines limits of the service.
+argument defines the limits of the service.
The supported flags are:
.Bl -ohang -offset indent
.It CASPER_SERVICE_STDIO
-The Casper service has access to the stdio descriptors from the process it was
+The casper service has access to the stdio descriptors from the process it was
spawned from.
.It CASPER_SERVICE_FD
-The Casper service has access to all descriptors besides stdio descriptors from
-the process it was spawned from.
+The casper service has access to all of the descriptors,
+besides the stdio descriptors,
+from the process it was spawned from.
.It CASPER_SERVICE_NO_UNIQ_LIMITS
-The whole Casper communication is using
+The whole casper communication is using an
.Xr nvlist 9
-with
+with the
.Xr NVLIST_NO_UNIQ 9
flag.
.El
diff --git a/lib/libcasper/services/cap_net/cap_net.3 b/lib/libcasper/services/cap_net/cap_net.3
index e74f7dd70d67..e64038a48330 100644
--- a/lib/libcasper/services/cap_net/cap_net.3
+++ b/lib/libcasper/services/cap_net/cap_net.3
@@ -23,7 +23,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 15, 2020
+.Dd November 15, 2021
.Dt CAP_NET 3
.Os
.Sh NAME
@@ -91,7 +91,7 @@ The functions
.Fn cap_gethostbyaddr
and
.Fn cap_getnameinfo
-are respectively equivalent to
+provide a set of APIs equivalent to
.Xr bind 2 ,
.Xr connect 2 ,
.Xr gethostbyname 3 ,
@@ -99,7 +99,7 @@ are respectively equivalent to
.Xr gethostbyaddr 3
and
.Xr getnameinfo 3
-except that the connection to the
+except that a connection to the
.Nm system.net
service needs to be provided.
.Sh LIMITS
@@ -107,8 +107,10 @@ By default, the cap_net capability provides unrestricted access to the network
namespace.
Applications typically only require access to a small portion of the network
namespace:
+The
.Fn cap_net_limit
-interface can be used to restrict access to the network.
+function can be used to restrict access to the network.
+The
.Fn cap_net_limit_init
returns an opaque limit handle used to store a list of capabilities.
The
diff --git a/lib/libcasper/services/cap_net/cap_net.c b/lib/libcasper/services/cap_net/cap_net.c
index 1d5531676268..c6abaa69faf6 100644
--- a/lib/libcasper/services/cap_net/cap_net.c
+++ b/lib/libcasper/services/cap_net/cap_net.c
@@ -326,8 +326,10 @@ cap_getaddrinfo(cap_channel_t *chan, const char *hostname, const char *servname,
break;
nvlai = nvlist_get_nvlist(nvl, nvlname);
curai = addrinfo_unpack(nvlai);
- if (curai == NULL)
+ if (curai == NULL) {
+ nvlist_destroy(nvl);
return (EAI_MEMORY);
+ }
if (prevai != NULL)
prevai->ai_next = curai;
else
@@ -896,8 +898,10 @@ net_getnameinfo(const nvlist_t *limits, const nvlist_t *nvlin, nvlist_t *nvlout)
error = EAI_FAIL;
goto out;
}
- if (!net_allowed_bsaddr(funclimit, sabin, sabinsize))
- return (ENOTCAPABLE);
+ if (!net_allowed_bsaddr(funclimit, sabin, sabinsize)) {
+ error = ENOTCAPABLE;
+ goto out;
+ }
memcpy(&sast, sabin, sabinsize);
salen = (socklen_t)sabinsize;
@@ -1378,7 +1382,7 @@ net_limit(const nvlist_t *oldlimits, const nvlist_t *newlimits)
*/
if (oldlimits == NULL)
return (0);
- if (!hasconnect && nvlist_exists(oldlimits, LIMIT_NV_BIND))
+ if (!hasbind && nvlist_exists(oldlimits, LIMIT_NV_BIND))
return (ENOTCAPABLE);
if (!hasconnect && nvlist_exists(oldlimits, LIMIT_NV_CONNECT))
return (ENOTCAPABLE);
diff --git a/lib/libclang_rt/Makefile b/lib/libclang_rt/Makefile
index c1c72299bdf7..ca0796b0e65d 100644
--- a/lib/libclang_rt/Makefile
+++ b/lib/libclang_rt/Makefile
@@ -30,6 +30,16 @@ SUBDIR+= xray-fdr
SUBDIR+= xray-profiling
.endif # amd64
+.if ${MACHINE_CPUARCH} == "riscv"
+SUBDIR+= asan
+SUBDIR+= asan-preinit
+SUBDIR+= asan_cxx
+SUBDIR+= asan_dynamic
+SUBDIR+= ubsan_minimal
+SUBDIR+= ubsan_standalone
+SUBDIR+= ubsan_standalone_cxx
+.endif # riscv
+
SUBDIR+= profile
SUBDIR_PARALLEL=
diff --git a/lib/libclang_rt/asan/Makefile b/lib/libclang_rt/asan/Makefile
index 647012e8649f..149130e3c5f2 100644
--- a/lib/libclang_rt/asan/Makefile
+++ b/lib/libclang_rt/asan/Makefile
@@ -34,6 +34,7 @@ SRCS+= sanitizer_common/sancov_flags.cpp
SRCS+= sanitizer_common/sanitizer_allocator.cpp
SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp
SRCS+= sanitizer_common/sanitizer_allocator_report.cpp
+SRCS+= sanitizer_common/sanitizer_chained_origin_depot.cpp
SRCS+= sanitizer_common/sanitizer_common.cpp
SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp
SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cpp
@@ -47,6 +48,7 @@ SRCS+= sanitizer_common/sanitizer_libc.cpp
SRCS+= sanitizer_common/sanitizer_libignore.cpp
SRCS+= sanitizer_common/sanitizer_linux.cpp
SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp
+SRCS+= sanitizer_common/sanitizer_mutex.cpp
SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp
diff --git a/lib/libclang_rt/asan_dynamic/Makefile b/lib/libclang_rt/asan_dynamic/Makefile
index 434b1c3c3ed6..0bc0bd898c3c 100644
--- a/lib/libclang_rt/asan_dynamic/Makefile
+++ b/lib/libclang_rt/asan_dynamic/Makefile
@@ -37,6 +37,7 @@ SRCS+= sanitizer_common/sancov_flags.cpp
SRCS+= sanitizer_common/sanitizer_allocator.cpp
SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp
SRCS+= sanitizer_common/sanitizer_allocator_report.cpp
+SRCS+= sanitizer_common/sanitizer_chained_origin_depot.cpp
SRCS+= sanitizer_common/sanitizer_common.cpp
SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp
SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cpp
@@ -50,6 +51,7 @@ SRCS+= sanitizer_common/sanitizer_libc.cpp
SRCS+= sanitizer_common/sanitizer_libignore.cpp
SRCS+= sanitizer_common/sanitizer_linux.cpp
SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp
+SRCS+= sanitizer_common/sanitizer_mutex.cpp
SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp
diff --git a/lib/libclang_rt/cfi/Makefile b/lib/libclang_rt/cfi/Makefile
index b6febc861e89..679ace661496 100644
--- a/lib/libclang_rt/cfi/Makefile
+++ b/lib/libclang_rt/cfi/Makefile
@@ -21,6 +21,7 @@ SRCS+= sanitizer_common/sanitizer_libc.cpp
SRCS+= sanitizer_common/sanitizer_libignore.cpp
SRCS+= sanitizer_common/sanitizer_linux.cpp
SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp
+SRCS+= sanitizer_common/sanitizer_mutex.cpp
SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp
diff --git a/lib/libclang_rt/cfi_diag/Makefile b/lib/libclang_rt/cfi_diag/Makefile
index b60e7031814a..0cc2a3941924 100644
--- a/lib/libclang_rt/cfi_diag/Makefile
+++ b/lib/libclang_rt/cfi_diag/Makefile
@@ -11,6 +11,7 @@ SRCS+= sanitizer_common/sancov_flags.cpp
SRCS+= sanitizer_common/sanitizer_allocator.cpp
SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp
SRCS+= sanitizer_common/sanitizer_allocator_report.cpp
+SRCS+= sanitizer_common/sanitizer_chained_origin_depot.cpp
SRCS+= sanitizer_common/sanitizer_common.cpp
SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp
SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cpp
@@ -24,6 +25,7 @@ SRCS+= sanitizer_common/sanitizer_libc.cpp
SRCS+= sanitizer_common/sanitizer_libignore.cpp
SRCS+= sanitizer_common/sanitizer_linux.cpp
SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp
+SRCS+= sanitizer_common/sanitizer_mutex.cpp
SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp
diff --git a/lib/libclang_rt/compiler-rt-vars.mk b/lib/libclang_rt/compiler-rt-vars.mk
index c270009e5d50..98def5c3da13 100644
--- a/lib/libclang_rt/compiler-rt-vars.mk
+++ b/lib/libclang_rt/compiler-rt-vars.mk
@@ -1,4 +1,4 @@
-CLANG_SUBDIR=clang/12.0.1
+CLANG_SUBDIR=clang/13.0.0
CLANGDIR= /usr/lib/${CLANG_SUBDIR}
SANITIZER_LIBDIR= ${CLANGDIR}/lib/freebsd
diff --git a/lib/libclang_rt/dd/Makefile b/lib/libclang_rt/dd/Makefile
index 432f6d95b289..1f4f1ea7e7e3 100644
--- a/lib/libclang_rt/dd/Makefile
+++ b/lib/libclang_rt/dd/Makefile
@@ -20,6 +20,7 @@ SRCS+= sanitizer_common/sanitizer_libc.cpp
SRCS+= sanitizer_common/sanitizer_libignore.cpp
SRCS+= sanitizer_common/sanitizer_linux.cpp
SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp
+SRCS+= sanitizer_common/sanitizer_mutex.cpp
SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp
diff --git a/lib/libclang_rt/msan/Makefile b/lib/libclang_rt/msan/Makefile
index 2956745b4b12..6871b492d6e0 100644
--- a/lib/libclang_rt/msan/Makefile
+++ b/lib/libclang_rt/msan/Makefile
@@ -18,6 +18,7 @@ SRCS+= sanitizer_common/sancov_flags.cpp
SRCS+= sanitizer_common/sanitizer_allocator.cpp
SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp
SRCS+= sanitizer_common/sanitizer_allocator_report.cpp
+SRCS+= sanitizer_common/sanitizer_chained_origin_depot.cpp
SRCS+= sanitizer_common/sanitizer_common.cpp
SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp
SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cpp
@@ -31,6 +32,7 @@ SRCS+= sanitizer_common/sanitizer_libc.cpp
SRCS+= sanitizer_common/sanitizer_libignore.cpp
SRCS+= sanitizer_common/sanitizer_linux.cpp
SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp
+SRCS+= sanitizer_common/sanitizer_mutex.cpp
SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp
diff --git a/lib/libclang_rt/profile/Makefile b/lib/libclang_rt/profile/Makefile
index ab3eba28ac96..d683983e5b97 100644
--- a/lib/libclang_rt/profile/Makefile
+++ b/lib/libclang_rt/profile/Makefile
@@ -13,7 +13,6 @@ CXXFLAGS+= -fvisibility=default
SRCS+= profile/GCDAProfiling.c
SRCS+= profile/InstrProfiling.c
-SRCS+= profile/InstrProfilingBiasVar.c
SRCS+= profile/InstrProfilingBuffer.c
SRCS+= profile/InstrProfilingFile.c
SRCS+= profile/InstrProfilingInternal.c
@@ -25,6 +24,7 @@ SRCS+= profile/InstrProfilingPlatformOther.c
SRCS+= profile/InstrProfilingRuntime.cpp
SRCS+= profile/InstrProfilingUtil.c
SRCS+= profile/InstrProfilingValue.c
+SRCS+= profile/InstrProfilingVersionVar.c
SRCS+= profile/InstrProfilingWriter.c
.PATH: ${CRTSRC}/include/profile
diff --git a/lib/libclang_rt/stats/Makefile b/lib/libclang_rt/stats/Makefile
index 752443b5bbb7..117af21707a7 100644
--- a/lib/libclang_rt/stats/Makefile
+++ b/lib/libclang_rt/stats/Makefile
@@ -7,6 +7,7 @@ LIB= clang_rt.stats-${CRTARCH}
SRCS+= sanitizer_common/sanitizer_allocator.cpp
SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp
SRCS+= sanitizer_common/sanitizer_allocator_report.cpp
+SRCS+= sanitizer_common/sanitizer_chained_origin_depot.cpp
SRCS+= sanitizer_common/sanitizer_common.cpp
SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp
SRCS+= sanitizer_common/sanitizer_deadlock_detector1.cpp
@@ -19,6 +20,7 @@ SRCS+= sanitizer_common/sanitizer_libc.cpp
SRCS+= sanitizer_common/sanitizer_libignore.cpp
SRCS+= sanitizer_common/sanitizer_linux.cpp
SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp
+SRCS+= sanitizer_common/sanitizer_mutex.cpp
SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp
diff --git a/lib/libclang_rt/tsan/Makefile b/lib/libclang_rt/tsan/Makefile
index db840cdfe47f..a41eb6f38aeb 100644
--- a/lib/libclang_rt/tsan/Makefile
+++ b/lib/libclang_rt/tsan/Makefile
@@ -10,6 +10,7 @@ SRCS+= sanitizer_common/sancov_flags.cpp
SRCS+= sanitizer_common/sanitizer_allocator.cpp
SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp
SRCS+= sanitizer_common/sanitizer_allocator_report.cpp
+SRCS+= sanitizer_common/sanitizer_chained_origin_depot.cpp
SRCS+= sanitizer_common/sanitizer_common.cpp
SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp
SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cpp
@@ -23,6 +24,7 @@ SRCS+= sanitizer_common/sanitizer_libc.cpp
SRCS+= sanitizer_common/sanitizer_libignore.cpp
SRCS+= sanitizer_common/sanitizer_linux.cpp
SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp
+SRCS+= sanitizer_common/sanitizer_mutex.cpp
SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp
@@ -60,7 +62,6 @@ SRCS+= tsan/rtl/tsan_interface_atomic.cpp
SRCS+= tsan/rtl/tsan_interface_java.cpp
SRCS+= tsan/rtl/tsan_md5.cpp
SRCS+= tsan/rtl/tsan_mman.cpp
-SRCS+= tsan/rtl/tsan_mutex.cpp
SRCS+= tsan/rtl/tsan_mutexset.cpp
SRCS+= tsan/rtl/tsan_platform_linux.cpp
SRCS+= tsan/rtl/tsan_platform_posix.cpp
@@ -73,7 +74,6 @@ SRCS+= tsan/rtl/tsan_rtl_proc.cpp
SRCS+= tsan/rtl/tsan_rtl_report.cpp
SRCS+= tsan/rtl/tsan_rtl_thread.cpp
SRCS+= tsan/rtl/tsan_stack_trace.cpp
-SRCS+= tsan/rtl/tsan_stat.cpp
SRCS+= tsan/rtl/tsan_suppressions.cpp
SRCS+= tsan/rtl/tsan_symbolize.cpp
SRCS+= tsan/rtl/tsan_sync.cpp
diff --git a/lib/libclang_rt/ubsan_standalone/Makefile b/lib/libclang_rt/ubsan_standalone/Makefile
index da4c6cab036a..9da97cacc20b 100644
--- a/lib/libclang_rt/ubsan_standalone/Makefile
+++ b/lib/libclang_rt/ubsan_standalone/Makefile
@@ -10,6 +10,7 @@ SRCS+= sanitizer_common/sancov_flags.cpp
SRCS+= sanitizer_common/sanitizer_allocator.cpp
SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp
SRCS+= sanitizer_common/sanitizer_allocator_report.cpp
+SRCS+= sanitizer_common/sanitizer_chained_origin_depot.cpp
SRCS+= sanitizer_common/sanitizer_common.cpp
SRCS+= sanitizer_common/sanitizer_common_libcdep.cpp
SRCS+= sanitizer_common/sanitizer_coverage_libcdep_new.cpp
@@ -23,6 +24,7 @@ SRCS+= sanitizer_common/sanitizer_libc.cpp
SRCS+= sanitizer_common/sanitizer_libignore.cpp
SRCS+= sanitizer_common/sanitizer_linux.cpp
SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp
+SRCS+= sanitizer_common/sanitizer_mutex.cpp
SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp
diff --git a/lib/libclang_rt/xray/Makefile b/lib/libclang_rt/xray/Makefile
index 13e084816a3b..60ed642d330a 100644
--- a/lib/libclang_rt/xray/Makefile
+++ b/lib/libclang_rt/xray/Makefile
@@ -18,6 +18,7 @@ SRCS+= sanitizer_common/sanitizer_libc.cpp
SRCS+= sanitizer_common/sanitizer_libignore.cpp
SRCS+= sanitizer_common/sanitizer_linux.cpp
SRCS+= sanitizer_common/sanitizer_linux_libcdep.cpp
+SRCS+= sanitizer_common/sanitizer_mutex.cpp
SRCS+= sanitizer_common/sanitizer_persistent_allocator.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_freebsd.cpp
SRCS+= sanitizer_common/sanitizer_platform_limits_linux.cpp
diff --git a/lib/libcompiler_rt/Makefile.inc b/lib/libcompiler_rt/Makefile.inc
index 06d662e38d82..45eb72165cd8 100644
--- a/lib/libcompiler_rt/Makefile.inc
+++ b/lib/libcompiler_rt/Makefile.inc
@@ -33,6 +33,7 @@ SRCF+= divdc3
SRCF+= divdi3
SRCF+= divmoddi4
SRCF+= divmodsi4
+SRCF+= divmodti4
SRCF+= divsc3
SRCF+= divsi3
SRCF+= divtc3
@@ -169,6 +170,7 @@ SRCF+= addtf3
SRCF+= comparetf2
SRCF+= divtf3
SRCF+= extenddftf2
+SRCF+= extendhftf2
SRCF+= extendsftf2
SRCF+= fixtfdi
SRCF+= fixtfsi
@@ -183,6 +185,7 @@ SRCF+= floatuntitf
SRCF+= multf3
SRCF+= subtf3
SRCF+= trunctfdf2
+SRCF+= trunctfhf2
SRCF+= trunctfsf2
.endif
diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile
index f222394b45c3..31346cee2e39 100644
--- a/lib/libcrypt/Makefile
+++ b/lib/libcrypt/Makefile
@@ -20,7 +20,7 @@ SRCS= crypt.c misc.c \
MAN= crypt.3
MLINKS= crypt.3 crypt_get_format.3 crypt.3 crypt_r.3 \
crypt.3 crypt_set_format.3
-CFLAGS+= -I${SRCTOP}/lib/libmd -I${SRCTOP}/lib/libutil \
+CFLAGS+= -I${SRCTOP}/lib/libmd \
-I${SRCTOP}/sys/crypto/sha2
# Pull in the strong crypto, if it is present.
diff --git a/lib/libcrypt/crypt.c b/lib/libcrypt/crypt.c
index 8bb3b99e6712..13411321338f 100644
--- a/lib/libcrypt/crypt.c
+++ b/lib/libcrypt/crypt.c
@@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
-#include <libutil.h>
#include <string.h>
#include <unistd.h>
diff --git a/lib/libcxxrt/Makefile b/lib/libcxxrt/Makefile
index 16847f2ddb28..ffd835b71585 100644
--- a/lib/libcxxrt/Makefile
+++ b/lib/libcxxrt/Makefile
@@ -10,15 +10,15 @@ SHLIBDIR?= /lib
LIB= cxxrt
-SRCS+= libelftc_dem_gnu3.c\
- terminate.cc\
- dynamic_cast.cc\
- memory.cc\
- auxhelper.cc\
- exception.cc\
- stdexcept.cc\
- typeinfo.cc\
- guard.cc
+SRCS+= auxhelper.cc
+SRCS+= dynamic_cast.cc
+SRCS+= exception.cc
+SRCS+= guard.cc
+SRCS+= libelftc_dem_gnu3.c
+SRCS+= memory.cc
+SRCS+= stdexcept.cc
+SRCS+= terminate.cc
+SRCS+= typeinfo.cc
WARNS?= 0
CFLAGS+= -isystem ${SRCDIR} -nostdinc++
diff --git a/lib/libdpv/Makefile b/lib/libdpv/Makefile
index 5b432602ff7b..43cc6bce07c7 100644
--- a/lib/libdpv/Makefile
+++ b/lib/libdpv/Makefile
@@ -2,7 +2,7 @@
PACKAGE= dpv
LIB= dpv
-SHLIB_MAJOR= 2
+SHLIB_MAJOR= 3
INCS= dpv.h
MAN= dpv.3
MLINKS= dpv.3 dpv_free.3
diff --git a/lib/libdwarf/Makefile b/lib/libdwarf/Makefile
index 03f40cdd85ee..994c0bc5c1fa 100644
--- a/lib/libdwarf/Makefile
+++ b/lib/libdwarf/Makefile
@@ -73,7 +73,8 @@ SRCS= \
libdwarf_reloc.c \
libdwarf_rw.c \
libdwarf_sections.c \
- libdwarf_str.c
+ libdwarf_str.c \
+ zlib_stub.c
INCS= dwarf.h libdwarf.h
@@ -98,7 +99,7 @@ sys/elf32.h sys/elf64.h sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA
mkdir -p ${.OBJDIR}/sys
ln -sf ${.ALLSRC} ${.TARGET}
-LIBADD+= elf
+LIBADD+= elf z
SHLIB_MAJOR= 4
diff --git a/lib/libefivar/Makefile b/lib/libefivar/Makefile
index 7b814898721f..5a6077d4b8f8 100644
--- a/lib/libefivar/Makefile
+++ b/lib/libefivar/Makefile
@@ -45,7 +45,7 @@ CFLAGS+= -I${EFIBOOT}/include
CFLAGS+= -I${.CURDIR} -I${EDK2INC}
CFLAGS+= -fno-strict-aliasing
-MLINKS+=efivar.3 efi_set_variables_supported.3 \
+MLINKS+=efivar.3 efi_variables_supported.3 \
efivar.3 efi_del_variable.3 \
efivar.3 efi_get_variable.3 \
efivar.3 efi_get_variable_attributes.3 \
diff --git a/lib/libelf/Makefile b/lib/libelf/Makefile
index 8174f4e06bba..9f21da5267eb 100644
--- a/lib/libelf/Makefile
+++ b/lib/libelf/Makefile
@@ -132,6 +132,7 @@ MAN= elf.3 \
gelf_checksum.3 \
gelf_fsize.3 \
gelf_getcap.3 \
+ gelf_getchdr.3 \
gelf_getclass.3 \
gelf_getdyn.3 \
gelf_getehdr.3 \
@@ -179,6 +180,7 @@ MLINKS+= \
MLINKS+= \
gelf_checksum.3 elf${E}_checksum.3 \
gelf_fsize.3 elf${E}_fsize.3 \
+ gelf_getchdr.3 elf${E}_getchdr.3 \
gelf_getehdr.3 elf${E}_getehdr.3 \
gelf_getphdr.3 elf${E}_getphdr.3 \
gelf_getshdr.3 elf${E}_getshdr.3 \
diff --git a/lib/libexpat/expat_config.h b/lib/libexpat/expat_config.h
index d4cb92cafdb5..e2ffcb15c7ef 100644
--- a/lib/libexpat/expat_config.h
+++ b/lib/libexpat/expat_config.h
@@ -1,5 +1,3 @@
-/* $FreeBSD$ */
-
/* expat_config.h. Generated from expat_config.h.in by configure. */
/* expat_config.h.in. Generated from configure.ac by autoheader. */
@@ -39,15 +37,15 @@
/* Define to 1 if you have the `bsd' library (-lbsd). */
/* #undef HAVE_LIBBSD */
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
/* Define to 1 if you have a working `mmap' system call. */
#define HAVE_MMAP 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
+/* Define to 1 if you have the <stdio.h> header file. */
+#define HAVE_STDIO_H 1
+
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
@@ -85,7 +83,7 @@
#define PACKAGE_NAME "expat"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "expat 2.2.9"
+#define PACKAGE_STRING "expat 2.4.3"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "expat"
@@ -94,13 +92,15 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "2.2.9"
+#define PACKAGE_VERSION "2.4.3"
-/* Define to 1 if you have the ANSI C header files. */
+/* Define to 1 if all of the C90 standard headers exist (not just the ones
+ required in a freestanding environment). This macro is provided for
+ backward compatibility; new code need not use it. */
#define STDC_HEADERS 1
/* Version number of package */
-#define VERSION "2.2.9"
+#define VERSION "2.4.3"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
diff --git a/lib/libfetch/Makefile b/lib/libfetch/Makefile
index 99c4ceea9dd9..607ff6e05c5e 100644
--- a/lib/libfetch/Makefile
+++ b/lib/libfetch/Makefile
@@ -2,6 +2,8 @@
.include <src.opts.mk>
+PACKAGE= fetch
+
LIB= fetch
CFLAGS+= -I.
SRCS= fetch.c common.c ftp.c http.c file.c \
diff --git a/lib/libfido2/Makefile b/lib/libfido2/Makefile
new file mode 100644
index 000000000000..edf737b9dafc
--- /dev/null
+++ b/lib/libfido2/Makefile
@@ -0,0 +1,73 @@
+PACKAGE=ssh
+LIB= fido2
+PRIVATELIB=
+DIST= ${SRCTOP}/contrib/libfido2
+
+.PATH: ${DIST}/src ${DIST}
+
+SRCS+= aes256.c
+SRCS+= assert.c
+SRCS+= authkey.c
+SRCS+= bio.c
+SRCS+= blob.c
+SRCS+= buf.c
+SRCS+= cbor.c
+SRCS+= compress.c
+SRCS+= config.c
+SRCS+= cred.c
+SRCS+= credman.c
+SRCS+= dev.c
+SRCS+= ecdh.c
+SRCS+= eddsa.c
+SRCS+= err.c
+SRCS+= es256.c
+SRCS+= hid_freebsd.c
+SRCS+= hid_unix.c
+SRCS+= hid.c
+SRCS+= info.c
+SRCS+= io.c
+SRCS+= iso7816.c
+SRCS+= largeblob.c
+SRCS+= log.c
+SRCS+= pin.c
+SRCS+= random.c
+SRCS+= reset.c
+SRCS+= rs256.c
+SRCS+= u2f.c
+
+SRCS+= openbsd-compat/freezero.c
+SRCS+= openbsd-compat/recallocarray.c
+
+CFLAGS+= -I ${DIST}/src -I${SRCTOP}/contrib/libcbor/src -I${.CURDIR}/../libcbor
+CFLAGS+= -D_FIDO_INTERNAL
+CFLAGS+= -DHAVE_ARC4RANDOM_BUF
+CFLAGS+= -DHAVE_CLOCK_GETTIME
+CFLAGS+= -DHAVE_DEV_URANDOM
+CFLAGS+= -DHAVE_ERR_H
+CFLAGS+= -DHAVE_EXPLICIT_BZERO
+CFLAGS+= -DHAVE_GETLINE
+CFLAGS+= -DHAVE_GETOPT
+CFLAGS+= -DHAVE_GETPAGESIZE
+CFLAGS+= -DHAVE_GETRANDOM
+CFLAGS+= -DHAVE_OPENSSLV_H
+CFLAGS+= -DHAVE_READPASSPHRASE
+CFLAGS+= -DHAVE_SIGNAL_H
+CFLAGS+= -DHAVE_STRLCAT
+CFLAGS+= -DHAVE_STRLCPY
+CFLAGS+= -DHAVE_STRSEP
+CFLAGS+= -DHAVE_SYSCONF
+CFLAGS+= -DHAVE_SYS_RANDOM_H
+CFLAGS+= -DHAVE_TIMESPECSUB
+CFLAGS+= -DHAVE_TIMINGSAFE_BCMP
+CFLAGS+= -DHAVE_UNISTD_H
+CFLAGS+= -DTLS=__thread
+CFLAGS+= -D_FIDO_MAJOR=1
+CFLAGS+= -D_FIDO_MINOR=9
+CFLAGS+= -D_FIDO_PATCH=0
+
+LIBADD= crypto z
+
+WARNS=2
+MAN=
+
+.include <bsd.lib.mk>
diff --git a/lib/libiscsiutil/Makefile b/lib/libiscsiutil/Makefile
new file mode 100644
index 000000000000..c99fb6366536
--- /dev/null
+++ b/lib/libiscsiutil/Makefile
@@ -0,0 +1,10 @@
+LIB= iscsiutil
+INTERNALLIB=
+PACKAGE= iscsi
+
+INCS= libiscsiutil.h
+
+SRCS= chap.c connection.c keys.c log.c pdu.c text.c utils.c
+CFLAGS+= -I${SRCTOP}/sys/dev/iscsi
+
+.include <bsd.lib.mk>
diff --git a/lib/libiscsiutil/chap.c b/lib/libiscsiutil/chap.c
new file mode 100644
index 000000000000..b33fef220106
--- /dev/null
+++ b/lib/libiscsiutil/chap.c
@@ -0,0 +1,419 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2014 The FreeBSD Foundation
+ *
+ * This software was developed by Edward Tomasz Napierala under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <netinet/in.h>
+#include <resolv.h>
+#include <md5.h>
+
+#include "libiscsiutil.h"
+
+static void
+chap_compute_md5(const char id, const char *secret,
+ const void *challenge, size_t challenge_len, void *response,
+ size_t response_len)
+{
+ MD5_CTX ctx;
+
+ assert(response_len == CHAP_DIGEST_LEN);
+
+ MD5Init(&ctx);
+ MD5Update(&ctx, &id, sizeof(id));
+ MD5Update(&ctx, secret, strlen(secret));
+ MD5Update(&ctx, challenge, challenge_len);
+ MD5Final(response, &ctx);
+}
+
+static int
+chap_hex2int(const char hex)
+{
+ switch (hex) {
+ case '0':
+ return (0x00);
+ case '1':
+ return (0x01);
+ case '2':
+ return (0x02);
+ case '3':
+ return (0x03);
+ case '4':
+ return (0x04);
+ case '5':
+ return (0x05);
+ case '6':
+ return (0x06);
+ case '7':
+ return (0x07);
+ case '8':
+ return (0x08);
+ case '9':
+ return (0x09);
+ case 'a':
+ case 'A':
+ return (0x0a);
+ case 'b':
+ case 'B':
+ return (0x0b);
+ case 'c':
+ case 'C':
+ return (0x0c);
+ case 'd':
+ case 'D':
+ return (0x0d);
+ case 'e':
+ case 'E':
+ return (0x0e);
+ case 'f':
+ case 'F':
+ return (0x0f);
+ default:
+ return (-1);
+ }
+}
+
+static int
+chap_b642bin(const char *b64, void **binp, size_t *bin_lenp)
+{
+ char *bin;
+ int b64_len, bin_len;
+
+ b64_len = strlen(b64);
+ bin_len = (b64_len + 3) / 4 * 3;
+ bin = calloc(bin_len, 1);
+ if (bin == NULL)
+ log_err(1, "calloc");
+
+ bin_len = b64_pton(b64, bin, bin_len);
+ if (bin_len < 0) {
+ log_warnx("malformed base64 variable");
+ free(bin);
+ return (-1);
+ }
+ *binp = bin;
+ *bin_lenp = bin_len;
+ return (0);
+}
+
+/*
+ * XXX: Review this _carefully_.
+ */
+static int
+chap_hex2bin(const char *hex, void **binp, size_t *bin_lenp)
+{
+ int i, hex_len, nibble;
+ bool lo = true; /* As opposed to 'hi'. */
+ char *bin;
+ size_t bin_off, bin_len;
+
+ if (strncasecmp(hex, "0b", strlen("0b")) == 0)
+ return (chap_b642bin(hex + 2, binp, bin_lenp));
+
+ if (strncasecmp(hex, "0x", strlen("0x")) != 0) {
+ log_warnx("malformed variable, should start with \"0x\""
+ " or \"0b\"");
+ return (-1);
+ }
+
+ hex += strlen("0x");
+ hex_len = strlen(hex);
+ if (hex_len < 1) {
+ log_warnx("malformed variable; doesn't contain anything "
+ "but \"0x\"");
+ return (-1);
+ }
+
+ bin_len = hex_len / 2 + hex_len % 2;
+ bin = calloc(bin_len, 1);
+ if (bin == NULL)
+ log_err(1, "calloc");
+
+ bin_off = bin_len - 1;
+ for (i = hex_len - 1; i >= 0; i--) {
+ nibble = chap_hex2int(hex[i]);
+ if (nibble < 0) {
+ log_warnx("malformed variable, invalid char \"%c\"",
+ hex[i]);
+ free(bin);
+ return (-1);
+ }
+
+ assert(bin_off < bin_len);
+ if (lo) {
+ bin[bin_off] = nibble;
+ lo = false;
+ } else {
+ bin[bin_off] |= nibble << 4;
+ bin_off--;
+ lo = true;
+ }
+ }
+
+ *binp = bin;
+ *bin_lenp = bin_len;
+ return (0);
+}
+
+#ifdef USE_BASE64
+static char *
+chap_bin2hex(const char *bin, size_t bin_len)
+{
+ unsigned char *b64, *tmp;
+ size_t b64_len;
+
+ b64_len = (bin_len + 2) / 3 * 4 + 3; /* +2 for "0b", +1 for '\0'. */
+ b64 = malloc(b64_len);
+ if (b64 == NULL)
+ log_err(1, "malloc");
+
+ tmp = b64;
+ tmp += sprintf(tmp, "0b");
+ b64_ntop(bin, bin_len, tmp, b64_len - 2);
+
+ return (b64);
+}
+#else
+static char *
+chap_bin2hex(const char *bin, size_t bin_len)
+{
+ unsigned char *hex, *tmp, ch;
+ size_t hex_len;
+ size_t i;
+
+ hex_len = bin_len * 2 + 3; /* +2 for "0x", +1 for '\0'. */
+ hex = malloc(hex_len);
+ if (hex == NULL)
+ log_err(1, "malloc");
+
+ tmp = hex;
+ tmp += sprintf(tmp, "0x");
+ for (i = 0; i < bin_len; i++) {
+ ch = bin[i];
+ tmp += sprintf(tmp, "%02x", ch);
+ }
+
+ return (hex);
+}
+#endif /* !USE_BASE64 */
+
+struct chap *
+chap_new(void)
+{
+ struct chap *chap;
+
+ chap = calloc(1, sizeof(*chap));
+ if (chap == NULL)
+ log_err(1, "calloc");
+
+ /*
+ * Generate the challenge.
+ */
+ arc4random_buf(chap->chap_challenge, sizeof(chap->chap_challenge));
+ arc4random_buf(&chap->chap_id, sizeof(chap->chap_id));
+
+ return (chap);
+}
+
+char *
+chap_get_id(const struct chap *chap)
+{
+ char *chap_i;
+ int ret;
+
+ ret = asprintf(&chap_i, "%d", chap->chap_id);
+ if (ret < 0)
+ log_err(1, "asprintf");
+
+ return (chap_i);
+}
+
+char *
+chap_get_challenge(const struct chap *chap)
+{
+ char *chap_c;
+
+ chap_c = chap_bin2hex(chap->chap_challenge,
+ sizeof(chap->chap_challenge));
+
+ return (chap_c);
+}
+
+static int
+chap_receive_bin(struct chap *chap, void *response, size_t response_len)
+{
+
+ if (response_len != sizeof(chap->chap_response)) {
+ log_debugx("got CHAP response with invalid length; "
+ "got %zd, should be %zd",
+ response_len, sizeof(chap->chap_response));
+ return (1);
+ }
+
+ memcpy(chap->chap_response, response, response_len);
+ return (0);
+}
+
+int
+chap_receive(struct chap *chap, const char *response)
+{
+ void *response_bin;
+ size_t response_bin_len;
+ int error;
+
+ error = chap_hex2bin(response, &response_bin, &response_bin_len);
+ if (error != 0) {
+ log_debugx("got incorrectly encoded CHAP response \"%s\"",
+ response);
+ return (1);
+ }
+
+ error = chap_receive_bin(chap, response_bin, response_bin_len);
+ free(response_bin);
+
+ return (error);
+}
+
+int
+chap_authenticate(struct chap *chap, const char *secret)
+{
+ char expected_response[CHAP_DIGEST_LEN];
+
+ chap_compute_md5(chap->chap_id, secret,
+ chap->chap_challenge, sizeof(chap->chap_challenge),
+ expected_response, sizeof(expected_response));
+
+ if (memcmp(chap->chap_response,
+ expected_response, sizeof(expected_response)) != 0) {
+ return (-1);
+ }
+
+ return (0);
+}
+
+void
+chap_delete(struct chap *chap)
+{
+
+ free(chap);
+}
+
+struct rchap *
+rchap_new(const char *secret)
+{
+ struct rchap *rchap;
+
+ rchap = calloc(1, sizeof(*rchap));
+ if (rchap == NULL)
+ log_err(1, "calloc");
+
+ rchap->rchap_secret = checked_strdup(secret);
+
+ return (rchap);
+}
+
+static void
+rchap_receive_bin(struct rchap *rchap, const unsigned char id,
+ const void *challenge, size_t challenge_len)
+{
+
+ rchap->rchap_id = id;
+ rchap->rchap_challenge = calloc(challenge_len, 1);
+ if (rchap->rchap_challenge == NULL)
+ log_err(1, "calloc");
+ memcpy(rchap->rchap_challenge, challenge, challenge_len);
+ rchap->rchap_challenge_len = challenge_len;
+}
+
+int
+rchap_receive(struct rchap *rchap, const char *id, const char *challenge)
+{
+ unsigned char id_bin;
+ void *challenge_bin;
+ size_t challenge_bin_len;
+
+ int error;
+
+ id_bin = strtoul(id, NULL, 10);
+
+ error = chap_hex2bin(challenge, &challenge_bin, &challenge_bin_len);
+ if (error != 0) {
+ log_debugx("got incorrectly encoded CHAP challenge \"%s\"",
+ challenge);
+ return (1);
+ }
+
+ rchap_receive_bin(rchap, id_bin, challenge_bin, challenge_bin_len);
+ free(challenge_bin);
+
+ return (0);
+}
+
+static void
+rchap_get_response_bin(struct rchap *rchap,
+ void **responsep, size_t *response_lenp)
+{
+ void *response_bin;
+ size_t response_bin_len = CHAP_DIGEST_LEN;
+
+ response_bin = calloc(response_bin_len, 1);
+ if (response_bin == NULL)
+ log_err(1, "calloc");
+
+ chap_compute_md5(rchap->rchap_id, rchap->rchap_secret,
+ rchap->rchap_challenge, rchap->rchap_challenge_len,
+ response_bin, response_bin_len);
+
+ *responsep = response_bin;
+ *response_lenp = response_bin_len;
+}
+
+char *
+rchap_get_response(struct rchap *rchap)
+{
+ void *response;
+ size_t response_len;
+ char *chap_r;
+
+ rchap_get_response_bin(rchap, &response, &response_len);
+ chap_r = chap_bin2hex(response, response_len);
+ free(response);
+
+ return (chap_r);
+}
+
+void
+rchap_delete(struct rchap *rchap)
+{
+
+ free(rchap->rchap_secret);
+ free(rchap->rchap_challenge);
+ free(rchap);
+}
diff --git a/lib/libc/arm/gen/_set_tp.c b/lib/libiscsiutil/connection.c
index 1346ece5c9ef..7dc50574644c 100644
--- a/lib/libc/arm/gen/_set_tp.c
+++ b/lib/libiscsiutil/connection.c
@@ -1,8 +1,10 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
- * Copyright (c) 2004 Doug Rabson
- * All rights reserved.
+ * Copyright (c) 2012 The FreeBSD Foundation
+ *
+ * This software was developed by Edward Tomasz Napierala under sponsorship
+ * from the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,19 +26,28 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
#include <string.h>
-#include <sys/types.h>
-#include <machine/sysarch.h>
-#include "libc_private.h"
+#include "libiscsiutil.h"
void
-_set_tp(void *tp)
+connection_init(struct connection *conn, const struct connection_ops *ops,
+ bool use_proxy)
{
+ memset(conn, 0, sizeof(*conn));
+ conn->conn_ops = ops;
+ conn->conn_use_proxy = use_proxy;
- sysarch(ARM_SET_TP, tp);
+ /*
+ * Default values, from RFC 3720, section 12.
+ */
+ conn->conn_header_digest = CONN_DIGEST_NONE;
+ conn->conn_data_digest = CONN_DIGEST_NONE;
+ conn->conn_immediate_data = true;
+ conn->conn_max_recv_data_segment_length = 8192;
+ conn->conn_max_send_data_segment_length = 8192;
+ conn->conn_max_burst_length = 262144;
+ conn->conn_first_burst_length = 65536;
}
diff --git a/lib/libiscsiutil/keys.c b/lib/libiscsiutil/keys.c
new file mode 100644
index 000000000000..349be2a24f18
--- /dev/null
+++ b/lib/libiscsiutil/keys.c
@@ -0,0 +1,191 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2012 The FreeBSD Foundation
+ *
+ * This software was developed by Edward Tomasz Napierala under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "libiscsiutil.h"
+
+struct keys *
+keys_new(void)
+{
+ struct keys *keys;
+
+ keys = calloc(1, sizeof(*keys));
+ if (keys == NULL)
+ log_err(1, "calloc");
+
+ return (keys);
+}
+
+void
+keys_delete(struct keys *keys)
+{
+
+ for (int i = 0; i < KEYS_MAX; i++) {
+ free(keys->keys_names[i]);
+ free(keys->keys_values[i]);
+ }
+ free(keys);
+}
+
+void
+keys_load(struct keys *keys, const char *data, size_t len)
+{
+ int i;
+ char *keys_data, *name, *pair, *value;
+ size_t pair_len;
+
+ if (len == 0)
+ return;
+
+ if (data[len - 1] != '\0')
+ log_errx(1, "protocol error: key not NULL-terminated\n");
+
+ keys_data = malloc(len);
+ if (keys_data == NULL)
+ log_err(1, "malloc");
+ memcpy(keys_data, data, len);
+
+ /*
+ * XXX: Review this carefully.
+ */
+ pair = keys_data;
+ for (i = 0;; i++) {
+ if (i >= KEYS_MAX)
+ log_errx(1, "too many keys received");
+
+ pair_len = strlen(pair);
+
+ value = pair;
+ name = strsep(&value, "=");
+ if (name == NULL || value == NULL)
+ log_errx(1, "malformed keys");
+ keys->keys_names[i] = checked_strdup(name);
+ keys->keys_values[i] = checked_strdup(value);
+ log_debugx("key received: \"%s=%s\"",
+ keys->keys_names[i], keys->keys_values[i]);
+
+ pair += pair_len + 1; /* +1 to skip the terminating '\0'. */
+ if (pair == keys_data + len)
+ break;
+ assert(pair < keys_data + len);
+ }
+ free(keys_data);
+}
+
+void
+keys_save(struct keys *keys, char **datap, size_t *lenp)
+{
+ FILE *fp;
+ char *data;
+ size_t len;
+ int i;
+
+ fp = open_memstream(&data, &len);
+ if (fp == NULL)
+ log_err(1, "open_memstream");
+ for (i = 0; i < KEYS_MAX; i++) {
+ if (keys->keys_names[i] == NULL)
+ break;
+
+ fprintf(fp, "%s=%s", keys->keys_names[i], keys->keys_values[i]);
+
+ /* Append a '\0' after each key pair. */
+ fputc('\0', fp);
+ }
+ if (fclose(fp) != 0)
+ log_err(1, "fclose");
+
+ if (len == 0) {
+ free(data);
+ data = NULL;
+ }
+
+ *datap = data;
+ *lenp = len;
+}
+
+const char *
+keys_find(struct keys *keys, const char *name)
+{
+ int i;
+
+ /*
+ * Note that we don't handle duplicated key names here,
+ * as they are not supposed to happen in requests, and if they do,
+ * it's an initiator error.
+ */
+ for (i = 0; i < KEYS_MAX; i++) {
+ if (keys->keys_names[i] == NULL)
+ return (NULL);
+ if (strcmp(keys->keys_names[i], name) == 0)
+ return (keys->keys_values[i]);
+ }
+ return (NULL);
+}
+
+void
+keys_add(struct keys *keys, const char *name, const char *value)
+{
+ int i;
+
+ log_debugx("key to send: \"%s=%s\"", name, value);
+
+ /*
+ * Note that we don't check for duplicates here, as they are perfectly
+ * fine in responses, e.g. the "TargetName" keys in discovery sesion
+ * response.
+ */
+ for (i = 0; i < KEYS_MAX; i++) {
+ if (keys->keys_names[i] == NULL) {
+ keys->keys_names[i] = checked_strdup(name);
+ keys->keys_values[i] = checked_strdup(value);
+ return;
+ }
+ }
+ log_errx(1, "too many keys");
+}
+
+void
+keys_add_int(struct keys *keys, const char *name, int value)
+{
+ char *str;
+ int ret;
+
+ ret = asprintf(&str, "%d", value);
+ if (ret <= 0)
+ log_err(1, "asprintf");
+
+ keys_add(keys, name, str);
+ free(str);
+}
diff --git a/lib/libiscsiutil/libiscsiutil.h b/lib/libiscsiutil/libiscsiutil.h
new file mode 100644
index 000000000000..97d699c6c4b9
--- /dev/null
+++ b/lib/libiscsiutil/libiscsiutil.h
@@ -0,0 +1,168 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2012 The FreeBSD Foundation
+ *
+ * This software was developed by Edward Tomasz Napierala under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef __LIBISCSIUTIL_H__
+#define __LIBISCSIUTIL_H__
+
+#include <sys/types.h>
+#include <stdbool.h>
+
+struct connection_ops;
+
+#define CONN_DIGEST_NONE 0
+#define CONN_DIGEST_CRC32C 1
+
+struct connection {
+ const struct connection_ops *conn_ops;
+ int conn_socket;
+ uint8_t conn_isid[6];
+ uint16_t conn_tsih;
+ uint32_t conn_cmdsn;
+ uint32_t conn_statsn;
+ int conn_header_digest;
+ int conn_data_digest;
+ bool conn_immediate_data;
+ bool conn_use_proxy;
+ int conn_max_recv_data_segment_length;
+ int conn_max_send_data_segment_length;
+ int conn_max_burst_length;
+ int conn_first_burst_length;
+};
+
+struct pdu {
+ struct connection *pdu_connection;
+ struct iscsi_bhs *pdu_bhs;
+ char *pdu_data;
+ size_t pdu_data_len;
+};
+
+struct connection_ops {
+ bool (*timed_out)(void);
+ void (*pdu_receive_proxy)(struct pdu *);
+ void (*pdu_send_proxy)(struct pdu *);
+ void (*fail)(const struct connection *, const char *);
+};
+
+#define KEYS_MAX 1024
+
+struct keys {
+ char *keys_names[KEYS_MAX];
+ char *keys_values[KEYS_MAX];
+};
+
+#define CHAP_CHALLENGE_LEN 1024
+#define CHAP_DIGEST_LEN 16 /* Equal to MD5 digest size. */
+
+struct chap {
+ unsigned char chap_id;
+ char chap_challenge[CHAP_CHALLENGE_LEN];
+ char chap_response[CHAP_DIGEST_LEN];
+};
+
+struct rchap {
+ char *rchap_secret;
+ unsigned char rchap_id;
+ void *rchap_challenge;
+ size_t rchap_challenge_len;
+};
+
+struct chap *chap_new(void);
+char *chap_get_id(const struct chap *chap);
+char *chap_get_challenge(const struct chap *chap);
+int chap_receive(struct chap *chap, const char *response);
+int chap_authenticate(struct chap *chap,
+ const char *secret);
+void chap_delete(struct chap *chap);
+
+struct rchap *rchap_new(const char *secret);
+int rchap_receive(struct rchap *rchap,
+ const char *id, const char *challenge);
+char *rchap_get_response(struct rchap *rchap);
+void rchap_delete(struct rchap *rchap);
+
+struct keys *keys_new(void);
+void keys_delete(struct keys *key);
+void keys_load(struct keys *keys, const char *data,
+ size_t len);
+void keys_save(struct keys *keys, char **datap,
+ size_t *lenp);
+const char *keys_find(struct keys *keys, const char *name);
+void keys_add(struct keys *keys,
+ const char *name, const char *value);
+void keys_add_int(struct keys *keys,
+ const char *name, int value);
+
+static __inline void
+keys_load_pdu(struct keys *keys, const struct pdu *pdu)
+{
+ keys_load(keys, pdu->pdu_data, pdu->pdu_data_len);
+}
+
+static __inline void
+keys_save_pdu(struct keys *keys, struct pdu *pdu)
+{
+ keys_save(keys, &pdu->pdu_data, &pdu->pdu_data_len);
+}
+
+struct pdu *pdu_new(struct connection *ic);
+struct pdu *pdu_new_response(struct pdu *request);
+int pdu_ahs_length(const struct pdu *pdu);
+int pdu_data_segment_length(const struct pdu *pdu);
+void pdu_set_data_segment_length(struct pdu *pdu,
+ uint32_t len);
+void pdu_receive(struct pdu *request);
+void pdu_send(struct pdu *response);
+void pdu_delete(struct pdu *ip);
+
+void text_send_request(struct connection *conn,
+ struct keys *request_keys);
+struct keys * text_read_response(struct connection *conn);
+struct keys * text_read_request(struct connection *conn,
+ struct pdu **requestp);
+void text_send_response(struct pdu *request,
+ struct keys *response_keys);
+
+void connection_init(struct connection *conn,
+ const struct connection_ops *ops, bool use_proxy);
+
+void log_init(int level);
+void log_set_peer_name(const char *name);
+void log_set_peer_addr(const char *addr);
+void log_err(int, const char *, ...)
+ __dead2 __printflike(2, 3);
+void log_errx(int, const char *, ...)
+ __dead2 __printflike(2, 3);
+void log_warn(const char *, ...) __printflike(1, 2);
+void log_warnx(const char *, ...) __printflike(1, 2);
+void log_debugx(const char *, ...) __printflike(1, 2);
+
+char *checked_strdup(const char *);
+
+#endif /* !__LIBISCSIUTIL_H__ */
diff --git a/lib/libiscsiutil/log.c b/lib/libiscsiutil/log.c
new file mode 100644
index 000000000000..7d7a13bb11f2
--- /dev/null
+++ b/lib/libiscsiutil/log.c
@@ -0,0 +1,198 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2012 The FreeBSD Foundation
+ *
+ * This software was developed by Edward Tomasz Napierala under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <vis.h>
+
+#include "libiscsiutil.h"
+
+static int log_level = 0;
+static char *peer_name = NULL;
+static char *peer_addr = NULL;
+
+#define MSGBUF_LEN 1024
+
+void
+log_init(int level)
+{
+
+ log_level = level;
+ openlog(getprogname(), LOG_NDELAY | LOG_PID, LOG_DAEMON);
+}
+
+void
+log_set_peer_name(const char *name)
+{
+
+ /*
+ * XXX: Turn it into assertion?
+ */
+ if (peer_name != NULL)
+ log_errx(1, "%s called twice", __func__);
+ if (peer_addr == NULL)
+ log_errx(1, "%s called before log_set_peer_addr", __func__);
+
+ peer_name = checked_strdup(name);
+}
+
+void
+log_set_peer_addr(const char *addr)
+{
+
+ /*
+ * XXX: Turn it into assertion?
+ */
+ if (peer_addr != NULL)
+ log_errx(1, "%s called twice", __func__);
+
+ peer_addr = checked_strdup(addr);
+}
+
+static void
+log_common(int priority, int log_errno, const char *fmt, va_list ap)
+{
+ static char msgbuf[MSGBUF_LEN];
+ static char msgbuf_strvised[MSGBUF_LEN * 4 + 1];
+ char *errstr;
+ int ret;
+
+ ret = vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
+ if (ret < 0) {
+ fprintf(stderr, "%s: snprintf failed", getprogname());
+ syslog(LOG_CRIT, "snprintf failed");
+ exit(1);
+ }
+
+ ret = strnvis(msgbuf_strvised, sizeof(msgbuf_strvised), msgbuf, VIS_NL);
+ if (ret < 0) {
+ fprintf(stderr, "%s: strnvis failed", getprogname());
+ syslog(LOG_CRIT, "strnvis failed");
+ exit(1);
+ }
+
+ if (log_errno == -1) {
+ if (peer_name != NULL) {
+ fprintf(stderr, "%s: %s (%s): %s\n", getprogname(),
+ peer_addr, peer_name, msgbuf_strvised);
+ syslog(priority, "%s (%s): %s",
+ peer_addr, peer_name, msgbuf_strvised);
+ } else if (peer_addr != NULL) {
+ fprintf(stderr, "%s: %s: %s\n", getprogname(),
+ peer_addr, msgbuf_strvised);
+ syslog(priority, "%s: %s",
+ peer_addr, msgbuf_strvised);
+ } else {
+ fprintf(stderr, "%s: %s\n", getprogname(), msgbuf_strvised);
+ syslog(priority, "%s", msgbuf_strvised);
+ }
+
+ } else {
+ errstr = strerror(log_errno);
+
+ if (peer_name != NULL) {
+ fprintf(stderr, "%s: %s (%s): %s: %s\n", getprogname(),
+ peer_addr, peer_name, msgbuf_strvised, errstr);
+ syslog(priority, "%s (%s): %s: %s",
+ peer_addr, peer_name, msgbuf_strvised, errstr);
+ } else if (peer_addr != NULL) {
+ fprintf(stderr, "%s: %s: %s: %s\n", getprogname(),
+ peer_addr, msgbuf_strvised, errstr);
+ syslog(priority, "%s: %s: %s",
+ peer_addr, msgbuf_strvised, errstr);
+ } else {
+ fprintf(stderr, "%s: %s: %s\n", getprogname(),
+ msgbuf_strvised, errstr);
+ syslog(priority, "%s: %s",
+ msgbuf_strvised, errstr);
+ }
+ }
+}
+
+void
+log_err(int eval, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ log_common(LOG_CRIT, errno, fmt, ap);
+ va_end(ap);
+
+ exit(eval);
+}
+
+void
+log_errx(int eval, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ log_common(LOG_CRIT, -1, fmt, ap);
+ va_end(ap);
+
+ exit(eval);
+}
+
+void
+log_warn(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ log_common(LOG_WARNING, errno, fmt, ap);
+ va_end(ap);
+}
+
+void
+log_warnx(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ log_common(LOG_WARNING, -1, fmt, ap);
+ va_end(ap);
+}
+
+void
+log_debugx(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (log_level == 0)
+ return;
+
+ va_start(ap, fmt);
+ log_common(LOG_DEBUG, -1, fmt, ap);
+ va_end(ap);
+}
diff --git a/lib/libiscsiutil/pdu.c b/lib/libiscsiutil/pdu.c
new file mode 100644
index 000000000000..ed5ee5b71766
--- /dev/null
+++ b/lib/libiscsiutil/pdu.c
@@ -0,0 +1,228 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2012 The FreeBSD Foundation
+ *
+ * This software was developed by Edward Tomasz Napierala under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <iscsi_proto.h>
+#include "libiscsiutil.h"
+
+int
+pdu_ahs_length(const struct pdu *pdu)
+{
+
+ return (pdu->pdu_bhs->bhs_total_ahs_len * 4);
+}
+
+int
+pdu_data_segment_length(const struct pdu *pdu)
+{
+ uint32_t len = 0;
+
+ len += pdu->pdu_bhs->bhs_data_segment_len[0];
+ len <<= 8;
+ len += pdu->pdu_bhs->bhs_data_segment_len[1];
+ len <<= 8;
+ len += pdu->pdu_bhs->bhs_data_segment_len[2];
+
+ return (len);
+}
+
+void
+pdu_set_data_segment_length(struct pdu *pdu, uint32_t len)
+{
+
+ pdu->pdu_bhs->bhs_data_segment_len[2] = len;
+ pdu->pdu_bhs->bhs_data_segment_len[1] = len >> 8;
+ pdu->pdu_bhs->bhs_data_segment_len[0] = len >> 16;
+}
+
+struct pdu *
+pdu_new(struct connection *conn)
+{
+ struct pdu *pdu;
+
+ pdu = calloc(1, sizeof(*pdu));
+ if (pdu == NULL)
+ log_err(1, "calloc");
+
+ pdu->pdu_bhs = calloc(1, sizeof(*pdu->pdu_bhs));
+ if (pdu->pdu_bhs == NULL)
+ log_err(1, "calloc");
+
+ pdu->pdu_connection = conn;
+
+ return (pdu);
+}
+
+struct pdu *
+pdu_new_response(struct pdu *request)
+{
+
+ return (pdu_new(request->pdu_connection));
+}
+
+static size_t
+pdu_padding(const struct pdu *pdu)
+{
+
+ if ((pdu->pdu_data_len % 4) != 0)
+ return (4 - (pdu->pdu_data_len % 4));
+
+ return (0);
+}
+
+static void
+pdu_read(const struct connection *conn, char *data, size_t len)
+{
+ ssize_t ret;
+
+ while (len > 0) {
+ ret = read(conn->conn_socket, data, len);
+ if (ret < 0) {
+ if (conn->conn_ops->timed_out()) {
+ conn->conn_ops->fail(conn,
+ "Login Phase timeout");
+ log_errx(1, "exiting due to timeout");
+ }
+ conn->conn_ops->fail(conn, strerror(errno));
+ log_err(1, "read");
+ } else if (ret == 0) {
+ conn->conn_ops->fail(conn, "connection lost");
+ log_errx(1, "read: connection lost");
+ }
+ len -= ret;
+ data += ret;
+ }
+}
+
+void
+pdu_receive(struct pdu *pdu)
+{
+ struct connection *conn;
+ size_t len, padding;
+ char dummy[4];
+
+ conn = pdu->pdu_connection;
+ if (conn->conn_use_proxy)
+ return (conn->conn_ops->pdu_receive_proxy(pdu));
+
+ pdu_read(conn, (char *)pdu->pdu_bhs, sizeof(*pdu->pdu_bhs));
+
+ len = pdu_ahs_length(pdu);
+ if (len > 0)
+ log_errx(1, "protocol error: non-empty AHS");
+
+ len = pdu_data_segment_length(pdu);
+ if (len > 0) {
+ if (len > (size_t)conn->conn_max_recv_data_segment_length) {
+ log_errx(1, "protocol error: received PDU "
+ "with DataSegmentLength exceeding %d",
+ conn->conn_max_recv_data_segment_length);
+ }
+
+ pdu->pdu_data_len = len;
+ pdu->pdu_data = malloc(len);
+ if (pdu->pdu_data == NULL)
+ log_err(1, "malloc");
+
+ pdu_read(conn, (char *)pdu->pdu_data, pdu->pdu_data_len);
+
+ padding = pdu_padding(pdu);
+ if (padding != 0) {
+ assert(padding < sizeof(dummy));
+ pdu_read(conn, (char *)dummy, padding);
+ }
+ }
+}
+
+void
+pdu_send(struct pdu *pdu)
+{
+ struct connection *conn;
+ ssize_t ret, total_len;
+ size_t padding;
+ uint32_t zero = 0;
+ struct iovec iov[3];
+ int iovcnt;
+
+ conn = pdu->pdu_connection;
+ if (conn->conn_use_proxy)
+ return (conn->conn_ops->pdu_send_proxy(pdu));
+
+ pdu_set_data_segment_length(pdu, pdu->pdu_data_len);
+ iov[0].iov_base = pdu->pdu_bhs;
+ iov[0].iov_len = sizeof(*pdu->pdu_bhs);
+ total_len = iov[0].iov_len;
+ iovcnt = 1;
+
+ if (pdu->pdu_data_len > 0) {
+ iov[1].iov_base = pdu->pdu_data;
+ iov[1].iov_len = pdu->pdu_data_len;
+ total_len += iov[1].iov_len;
+ iovcnt = 2;
+
+ padding = pdu_padding(pdu);
+ if (padding > 0) {
+ assert(padding < sizeof(zero));
+ iov[2].iov_base = &zero;
+ iov[2].iov_len = padding;
+ total_len += iov[2].iov_len;
+ iovcnt = 3;
+ }
+ }
+
+ ret = writev(conn->conn_socket, iov, iovcnt);
+ if (ret < 0) {
+ if (conn->conn_ops->timed_out())
+ log_errx(1, "exiting due to timeout");
+ log_err(1, "writev");
+ }
+ if (ret != total_len)
+ log_errx(1, "short write");
+}
+
+void
+pdu_delete(struct pdu *pdu)
+{
+
+ free(pdu->pdu_data);
+ free(pdu->pdu_bhs);
+ free(pdu);
+}
diff --git a/lib/libiscsiutil/text.c b/lib/libiscsiutil/text.c
new file mode 100644
index 000000000000..f8b88e4f70be
--- /dev/null
+++ b/lib/libiscsiutil/text.c
@@ -0,0 +1,333 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2012 The FreeBSD Foundation
+ *
+ * This software was developed by Edward Tomasz Napierala under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <iscsi_proto.h>
+#include "libiscsiutil.h"
+
+/* Construct a new TextRequest PDU. */
+static struct pdu *
+text_new_request(struct connection *conn, uint32_t ttt)
+{
+ struct pdu *request;
+ struct iscsi_bhs_text_request *bhstr;
+
+ request = pdu_new(conn);
+ bhstr = (struct iscsi_bhs_text_request *)request->pdu_bhs;
+ bhstr->bhstr_opcode = ISCSI_BHS_OPCODE_TEXT_REQUEST |
+ ISCSI_BHS_OPCODE_IMMEDIATE;
+ bhstr->bhstr_flags = BHSTR_FLAGS_FINAL;
+ bhstr->bhstr_initiator_task_tag = 0;
+ bhstr->bhstr_target_transfer_tag = ttt;
+
+ bhstr->bhstr_cmdsn = conn->conn_cmdsn;
+ bhstr->bhstr_expstatsn = htonl(conn->conn_statsn + 1);
+
+ return (request);
+}
+
+/* Receive a TextRequest PDU from a connection. */
+static struct pdu *
+text_receive_request(struct connection *conn)
+{
+ struct pdu *request;
+ struct iscsi_bhs_text_request *bhstr;
+
+ request = pdu_new(conn);
+ pdu_receive(request);
+ if ((request->pdu_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) !=
+ ISCSI_BHS_OPCODE_TEXT_REQUEST)
+ log_errx(1, "protocol error: received invalid opcode 0x%x",
+ request->pdu_bhs->bhs_opcode);
+ bhstr = (struct iscsi_bhs_text_request *)request->pdu_bhs;
+
+ /*
+ * XXX: Implement the C flag some day.
+ */
+ if ((bhstr->bhstr_flags & (BHSTR_FLAGS_FINAL | BHSTR_FLAGS_CONTINUE)) !=
+ BHSTR_FLAGS_FINAL)
+ log_errx(1, "received TextRequest PDU with invalid "
+ "flags: %u", bhstr->bhstr_flags);
+ if (ISCSI_SNLT(ntohl(bhstr->bhstr_cmdsn), conn->conn_cmdsn)) {
+ log_errx(1, "received TextRequest PDU with decreasing CmdSN: "
+ "was %u, is %u", conn->conn_cmdsn, ntohl(bhstr->bhstr_cmdsn));
+ }
+ conn->conn_cmdsn = ntohl(bhstr->bhstr_cmdsn);
+ if ((bhstr->bhstr_opcode & ISCSI_BHS_OPCODE_IMMEDIATE) == 0)
+ conn->conn_cmdsn++;
+
+ return (request);
+}
+
+/* Construct a new TextResponse PDU in reply to a request. */
+static struct pdu *
+text_new_response(struct pdu *request, uint32_t ttt, bool final)
+{
+ struct pdu *response;
+ struct connection *conn;
+ struct iscsi_bhs_text_request *bhstr;
+ struct iscsi_bhs_text_response *bhstr2;
+
+ bhstr = (struct iscsi_bhs_text_request *)request->pdu_bhs;
+ conn = request->pdu_connection;
+
+ response = pdu_new_response(request);
+ bhstr2 = (struct iscsi_bhs_text_response *)response->pdu_bhs;
+ bhstr2->bhstr_opcode = ISCSI_BHS_OPCODE_TEXT_RESPONSE;
+ if (final)
+ bhstr2->bhstr_flags = BHSTR_FLAGS_FINAL;
+ else
+ bhstr2->bhstr_flags = BHSTR_FLAGS_CONTINUE;
+ bhstr2->bhstr_lun = bhstr->bhstr_lun;
+ bhstr2->bhstr_initiator_task_tag = bhstr->bhstr_initiator_task_tag;
+ bhstr2->bhstr_target_transfer_tag = ttt;
+ bhstr2->bhstr_statsn = htonl(conn->conn_statsn++);
+ bhstr2->bhstr_expcmdsn = htonl(conn->conn_cmdsn);
+ bhstr2->bhstr_maxcmdsn = htonl(conn->conn_cmdsn);
+
+ return (response);
+}
+
+/* Receive a TextResponse PDU from a connection. */
+static struct pdu *
+text_receive_response(struct connection *conn)
+{
+ struct pdu *response;
+ struct iscsi_bhs_text_response *bhstr;
+ uint8_t flags;
+
+ response = pdu_new(conn);
+ pdu_receive(response);
+ if (response->pdu_bhs->bhs_opcode != ISCSI_BHS_OPCODE_TEXT_RESPONSE)
+ log_errx(1, "protocol error: received invalid opcode 0x%x",
+ response->pdu_bhs->bhs_opcode);
+ bhstr = (struct iscsi_bhs_text_response *)response->pdu_bhs;
+ flags = bhstr->bhstr_flags & (BHSTR_FLAGS_FINAL | BHSTR_FLAGS_CONTINUE);
+ switch (flags) {
+ case BHSTR_FLAGS_CONTINUE:
+ if (bhstr->bhstr_target_transfer_tag == 0xffffffff)
+ log_errx(1, "received continue TextResponse PDU with "
+ "invalid TTT 0x%x",
+ bhstr->bhstr_target_transfer_tag);
+ break;
+ case BHSTR_FLAGS_FINAL:
+ if (bhstr->bhstr_target_transfer_tag != 0xffffffff)
+ log_errx(1, "received final TextResponse PDU with "
+ "invalid TTT 0x%x",
+ bhstr->bhstr_target_transfer_tag);
+ break;
+ default:
+ log_errx(1, "received TextResponse PDU with invalid "
+ "flags: %u", bhstr->bhstr_flags);
+ }
+ if (ntohl(bhstr->bhstr_statsn) != conn->conn_statsn + 1) {
+ log_errx(1, "received TextResponse PDU with wrong StatSN: "
+ "is %u, should be %u", ntohl(bhstr->bhstr_statsn),
+ conn->conn_statsn + 1);
+ }
+ conn->conn_statsn = ntohl(bhstr->bhstr_statsn);
+
+ return (response);
+}
+
+/*
+ * Send a list of keys from the initiator to the target in a
+ * TextRequest PDU.
+ */
+void
+text_send_request(struct connection *conn, struct keys *request_keys)
+{
+ struct pdu *request;
+
+ request = text_new_request(conn, 0xffffffff);
+ keys_save_pdu(request_keys, request);
+ if (request->pdu_data_len == 0)
+ log_errx(1, "No keys to send in a TextRequest");
+ if (request->pdu_data_len >
+ (size_t)conn->conn_max_send_data_segment_length)
+ log_errx(1, "Keys to send in TextRequest are too long");
+
+ pdu_send(request);
+ pdu_delete(request);
+}
+
+/*
+ * Read a list of keys from the target in a series of TextResponse
+ * PDUs.
+ */
+struct keys *
+text_read_response(struct connection *conn)
+{
+ struct keys *response_keys;
+ char *keys_data;
+ size_t keys_len;
+ uint32_t ttt;
+
+ keys_data = NULL;
+ keys_len = 0;
+ ttt = 0xffffffff;
+ for (;;) {
+ struct pdu *request, *response;
+ struct iscsi_bhs_text_response *bhstr;
+
+ response = text_receive_response(conn);
+ bhstr = (struct iscsi_bhs_text_response *)response->pdu_bhs;
+ if (keys_data == NULL) {
+ ttt = bhstr->bhstr_target_transfer_tag;
+ keys_data = response->pdu_data;
+ keys_len = response->pdu_data_len;
+ response->pdu_data = NULL;
+ } else {
+ keys_data = realloc(keys_data,
+ keys_len + response->pdu_data_len);
+ if (keys_data == NULL)
+ log_err(1, "failed to grow keys block");
+ memcpy(keys_data + keys_len, response->pdu_data,
+ response->pdu_data_len);
+ keys_len += response->pdu_data_len;
+ }
+ if ((bhstr->bhstr_flags & BHSTR_FLAGS_FINAL) != 0) {
+ pdu_delete(response);
+ break;
+ }
+ if (bhstr->bhstr_target_transfer_tag != ttt)
+ log_errx(1, "received non-final TextRequest PDU with "
+ "invalid TTT 0x%x",
+ bhstr->bhstr_target_transfer_tag);
+ pdu_delete(response);
+
+ /* Send an empty request. */
+ request = text_new_request(conn, ttt);
+ pdu_send(request);
+ pdu_delete(request);
+ }
+
+ response_keys = keys_new();
+ keys_load(response_keys, keys_data, keys_len);
+ free(keys_data);
+ return (response_keys);
+}
+
+/*
+ * Read a list of keys from the initiator in a TextRequest PDU.
+ */
+struct keys *
+text_read_request(struct connection *conn, struct pdu **requestp)
+{
+ struct iscsi_bhs_text_request *bhstr;
+ struct pdu *request;
+ struct keys *request_keys;
+
+ request = text_receive_request(conn);
+ bhstr = (struct iscsi_bhs_text_request *)request->pdu_bhs;
+ if (bhstr->bhstr_target_transfer_tag != 0xffffffff)
+ log_errx(1, "received TextRequest PDU with invalid TTT 0x%x",
+ bhstr->bhstr_target_transfer_tag);
+ if (ntohl(bhstr->bhstr_expstatsn) != conn->conn_statsn) {
+ log_errx(1, "received TextRequest PDU with wrong ExpStatSN: "
+ "is %u, should be %u", ntohl(bhstr->bhstr_expstatsn),
+ conn->conn_statsn);
+ }
+
+ request_keys = keys_new();
+ keys_load_pdu(request_keys, request);
+ *requestp = request;
+ return (request_keys);
+}
+
+/*
+ * Send a response back to the initiator as a series of TextResponse
+ * PDUs.
+ */
+void
+text_send_response(struct pdu *request, struct keys *response_keys)
+{
+ struct connection *conn = request->pdu_connection;
+ char *keys_data;
+ size_t keys_len;
+ size_t keys_offset;
+ uint32_t ttt;
+
+ keys_save(response_keys, &keys_data, &keys_len);
+ keys_offset = 0;
+ ttt = keys_len;
+ for (;;) {
+ struct pdu *request2, *response;
+ struct iscsi_bhs_text_request *bhstr;
+ size_t todo;
+ bool final;
+
+ todo = keys_len - keys_offset;
+ if (todo > (size_t)conn->conn_max_send_data_segment_length) {
+ final = false;
+ todo = conn->conn_max_send_data_segment_length;
+ } else {
+ final = true;
+ ttt = 0xffffffff;
+ }
+
+ response = text_new_response(request, ttt, final);
+ response->pdu_data = keys_data + keys_offset;
+ response->pdu_data_len = todo;
+ keys_offset += todo;
+
+ pdu_send(response);
+ response->pdu_data = NULL;
+ pdu_delete(response);
+
+ if (final)
+ break;
+
+ /*
+ * Wait for an empty request.
+ *
+ * XXX: Linux's Open-iSCSI initiator doesn't update
+ * ExpStatSN when receiving a TextResponse PDU.
+ */
+ request2 = text_receive_request(conn);
+ bhstr = (struct iscsi_bhs_text_request *)request2->pdu_bhs;
+ if ((bhstr->bhstr_flags & BHSTR_FLAGS_FINAL) == 0)
+ log_errx(1, "received continuation TextRequest PDU "
+ "without F set");
+ if (pdu_data_segment_length(request2) != 0)
+ log_errx(1, "received non-empty continuation "
+ "TextRequest PDU");
+ if (bhstr->bhstr_target_transfer_tag != ttt)
+ log_errx(1, "received TextRequest PDU with invalid "
+ "TTT 0x%x", bhstr->bhstr_target_transfer_tag);
+ pdu_delete(request2);
+ }
+ free(keys_data);
+}
diff --git a/lib/libc/mips/gen/_set_tp.c b/lib/libiscsiutil/utils.c
index d20a55149a53..1e04490c477c 100644
--- a/lib/libc/mips/gen/_set_tp.c
+++ b/lib/libiscsiutil/utils.c
@@ -1,8 +1,10 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
- * Copyright (c) 2004 Doug Rabson
- * All rights reserved.
+ * Copyright (c) 2012 The FreeBSD Foundation
+ *
+ * This software was developed by Edward Tomasz Napierala under sponsorship
+ * from the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,19 +26,19 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
#include <string.h>
-#include <stdint.h>
-#include <machine/sysarch.h>
-#include "libc_private.h"
+#include "libiscsiutil.h"
-void
-_set_tp(void *tp)
+char *
+checked_strdup(const char *s)
{
+ char *c;
- sysarch(MIPS_SET_TLS, tp);
+ c = strdup(s);
+ if (c == NULL)
+ log_err(1, "strdup");
+ return (c);
}
diff --git a/lib/libkvm/Makefile b/lib/libkvm/Makefile
index 7747518d05eb..7ebca5556ef6 100644
--- a/lib/libkvm/Makefile
+++ b/lib/libkvm/Makefile
@@ -14,7 +14,6 @@ SRCS= kvm.c kvm_cptime.c kvm_getloadavg.c \
kvm_amd64.c kvm_minidump_amd64.c \
kvm_arm.c kvm_minidump_arm.c \
kvm_i386.c kvm_minidump_i386.c \
- kvm_minidump_mips.c \
kvm_powerpc.c kvm_powerpc64.c \
kvm_minidump_riscv.c \
kvm_minidump_powerpc64.c kvm_minidump_powerpc64_hpt.c
diff --git a/lib/libkvm/kvm.3 b/lib/libkvm/kvm.3
index fbddcd475cc8..45e095ede2b6 100644
--- a/lib/libkvm/kvm.3
+++ b/lib/libkvm/kvm.3
@@ -161,3 +161,12 @@ and
.Xr sysctl 3 ,
.Xr kmem 4 ,
.Xr mem 4
+.Sh HISTORY
+The
+.Fn kvm_native ,
+.Fn kvm_nlist2 ,
+.Fn kvm_open2 ,
+and
+.Fn kvm_read2
+functions first appeared in
+.Fx 11.0 .
diff --git a/lib/libkvm/kvm_getloadavg.c b/lib/libkvm/kvm_getloadavg.c
index 0f2a5f69bcf0..f94b1d844663 100644
--- a/lib/libkvm/kvm_getloadavg.c
+++ b/lib/libkvm/kvm_getloadavg.c
@@ -62,7 +62,6 @@ int
kvm_getloadavg(kvm_t *kd, double loadavg[], int nelem)
{
struct loadavg loadinfo;
- struct nlist *p;
int fscale, i;
if (ISALIVE(kd))
@@ -74,10 +73,9 @@ kvm_getloadavg(kvm_t *kd, double loadavg[], int nelem)
return (-1);
}
- if (kvm_nlist(kd, nl) != 0) {
- for (p = nl; p->n_type != 0; ++p);
+ if (kvm_nlist(kd, nl) != 0 && nl[X_AVERUNNABLE].n_type == 0) {
_kvm_err(kd, kd->program,
- "%s: no such symbol", p->n_name);
+ "%s: no such symbol", nl[X_AVERUNNABLE].n_name);
return (-1);
}
@@ -92,7 +90,8 @@ kvm_getloadavg(kvm_t *kd, double loadavg[], int nelem)
* Old kernels have fscale separately; if not found assume
* running new format.
*/
- if (!KREAD(kd, nl[X_FSCALE].n_value, &fscale))
+ if (nl[X_FSCALE].n_type != 0 &&
+ !KREAD(kd, nl[X_FSCALE].n_value, &fscale))
loadinfo.fscale = fscale;
nelem = MIN(nelem, (int)(sizeof(loadinfo.ldavg) / sizeof(fixpt_t)));
diff --git a/lib/libkvm/kvm_minidump_mips.c b/lib/libkvm/kvm_minidump_mips.c
deleted file mode 100644
index dda6f3551872..000000000000
--- a/lib/libkvm/kvm_minidump_mips.c
+++ /dev/null
@@ -1,372 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2010 Oleksandr Tymoshenko
- * Copyright (c) 2008 Semihalf, Grzegorz Bernacki
- * Copyright (c) 2006 Peter Wemm
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * From: FreeBSD: src/lib/libkvm/kvm_minidump_arm.c r214223
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-/*
- * MIPS machine dependent routines for kvm and minidumps.
- */
-
-#include <sys/param.h>
-#include <vm/vm.h>
-#include <kvm.h>
-#include <limits.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "../../sys/mips/include/cca.h"
-#define _KVM_MINIDUMP
-#include "../../sys/mips/include/cpuregs.h"
-#include "../../sys/mips/include/minidump.h"
-
-#include "kvm_private.h"
-#include "kvm_mips.h"
-
-#define mips_round_page(x) roundup2((kvaddr_t)(x), MIPS_PAGE_SIZE)
-
-struct vmstate {
- struct minidumphdr hdr;
- int pte_size;
-};
-
-static int
-_mips_minidump_probe(kvm_t *kd)
-{
-
- if (kd->nlehdr.e_ident[EI_CLASS] != ELFCLASS32 &&
- kd->nlehdr.e_ident[EI_CLASS] != ELFCLASS64)
- return (0);
- if (kd->nlehdr.e_machine != EM_MIPS)
- return (0);
- return (_kvm_is_minidump(kd));
-}
-
-static void
-_mips_minidump_freevtop(kvm_t *kd)
-{
- struct vmstate *vm = kd->vmst;
-
- free(vm);
- kd->vmst = NULL;
-}
-
-static int
-_mips_minidump_initvtop(kvm_t *kd)
-{
- struct vmstate *vmst;
- off_t off, dump_avail_off, sparse_off;
-
- vmst = _kvm_malloc(kd, sizeof(*vmst));
- if (vmst == NULL) {
- _kvm_err(kd, kd->program, "cannot allocate vm");
- return (-1);
- }
-
- kd->vmst = vmst;
-
- if (kd->nlehdr.e_ident[EI_CLASS] == ELFCLASS64 ||
- kd->nlehdr.e_flags & EF_MIPS_ABI2)
- vmst->pte_size = 64;
- else
- vmst->pte_size = 32;
-
- if (pread(kd->pmfd, &vmst->hdr,
- sizeof(vmst->hdr), 0) != sizeof(vmst->hdr)) {
- _kvm_err(kd, kd->program, "cannot read dump header");
- return (-1);
- }
-
- if (strncmp(MINIDUMP_MAGIC, vmst->hdr.magic,
- sizeof(vmst->hdr.magic)) != 0) {
- _kvm_err(kd, kd->program, "not a minidump for this platform");
- return (-1);
- }
- vmst->hdr.version = _kvm32toh(kd, vmst->hdr.version);
- if (vmst->hdr.version != MINIDUMP_VERSION && vmst->hdr.version != 1) {
- _kvm_err(kd, kd->program, "wrong minidump version. "
- "Expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version);
- return (-1);
- }
- vmst->hdr.msgbufsize = _kvm32toh(kd, vmst->hdr.msgbufsize);
- vmst->hdr.bitmapsize = _kvm32toh(kd, vmst->hdr.bitmapsize);
- vmst->hdr.ptesize = _kvm32toh(kd, vmst->hdr.ptesize);
- vmst->hdr.kernbase = _kvm64toh(kd, vmst->hdr.kernbase);
- vmst->hdr.dmapbase = _kvm64toh(kd, vmst->hdr.dmapbase);
- vmst->hdr.dmapend = _kvm64toh(kd, vmst->hdr.dmapend);
- vmst->hdr.dumpavailsize = vmst->hdr.version == MINIDUMP_VERSION ?
- _kvm32toh(kd, vmst->hdr.dumpavailsize) : 0;
-
- /* Skip header and msgbuf */
- dump_avail_off = MIPS_PAGE_SIZE + mips_round_page(vmst->hdr.msgbufsize);
-
- /* Skip dump_avail */
- off = dump_avail_off + mips_round_page(vmst->hdr.dumpavailsize);
-
- sparse_off = off + mips_round_page(vmst->hdr.bitmapsize) +
- mips_round_page(vmst->hdr.ptesize);
- if (_kvm_pt_init(kd, vmst->hdr.dumpavailsize, dump_avail_off,
- vmst->hdr.bitmapsize, off, sparse_off, MIPS_PAGE_SIZE) == -1) {
- return (-1);
- }
- off += mips_round_page(vmst->hdr.bitmapsize);
-
- if (_kvm_pmap_init(kd, vmst->hdr.ptesize, off) == -1) {
- return (-1);
- }
- off += mips_round_page(vmst->hdr.ptesize);
-
- return (0);
-}
-
-static int
-_mips_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
-{
- struct vmstate *vm;
- mips_physaddr_t offset, a;
- kvaddr_t pteindex;
- u_long valid;
- off_t ofs;
- mips32_pte_t pte32;
- mips64_pte_t pte64;
-
- if (ISALIVE(kd)) {
- _kvm_err(kd, 0, "_mips_minidump_kvatop called in live kernel!");
- return (0);
- }
-
- offset = va & MIPS_PAGE_MASK;
- /* Operate with page-aligned address */
- va &= ~MIPS_PAGE_MASK;
-
- vm = kd->vmst;
- if (kd->nlehdr.e_ident[EI_CLASS] == ELFCLASS64) {
- if (va >= MIPS_XKPHYS_START && va < MIPS_XKPHYS_END) {
- a = va & MIPS_XKPHYS_PHYS_MASK;
- goto found;
- }
- if (va >= MIPS64_KSEG0_START && va < MIPS64_KSEG0_END) {
- a = va & MIPS_KSEG0_PHYS_MASK;
- goto found;
- }
- if (va >= MIPS64_KSEG1_START && va < MIPS64_KSEG1_END) {
- a = va & MIPS_KSEG0_PHYS_MASK;
- goto found;
- }
- } else {
- if (va >= MIPS32_KSEG0_START && va < MIPS32_KSEG0_END) {
- a = va & MIPS_KSEG0_PHYS_MASK;
- goto found;
- }
- if (va >= MIPS32_KSEG1_START && va < MIPS32_KSEG1_END) {
- a = va & MIPS_KSEG0_PHYS_MASK;
- goto found;
- }
- }
- if (va >= vm->hdr.kernbase) {
- pteindex = (va - vm->hdr.kernbase) >> MIPS_PAGE_SHIFT;
- if (vm->pte_size == 64) {
- valid = pteindex < vm->hdr.ptesize / sizeof(pte64);
- if (pteindex >= vm->hdr.ptesize / sizeof(pte64))
- goto invalid;
- pte64 = _mips64_pte_get(kd, pteindex);
- valid = pte64 & MIPS_PTE_V;
- if (valid)
- a = MIPS64_PTE_TO_PA(pte64);
- } else {
- if (pteindex >= vm->hdr.ptesize / sizeof(pte32))
- goto invalid;
- pte32 = _mips32_pte_get(kd, pteindex);
- valid = pte32 & MIPS_PTE_V;
- if (valid)
- a = MIPS32_PTE_TO_PA(pte32);
- }
- if (!valid) {
- _kvm_err(kd, kd->program, "_mips_minidump_kvatop: pte "
- "not valid");
- goto invalid;
- }
- } else {
- _kvm_err(kd, kd->program, "_mips_minidump_kvatop: virtual "
- "address 0x%jx not minidumped", (uintmax_t)va);
- return (0);
- }
-
-found:
- ofs = _kvm_pt_find(kd, a, MIPS_PAGE_SIZE);
- if (ofs == -1) {
- _kvm_err(kd, kd->program, "_mips_minidump_kvatop: physical "
- "address 0x%jx not in minidump", (uintmax_t)a);
- goto invalid;
- }
-
- *pa = ofs + offset;
- return (MIPS_PAGE_SIZE - offset);
-
-
-invalid:
- _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va);
- return (0);
-}
-
-static int
-#ifdef __mips__
-_mips_native(kvm_t *kd)
-#else
-_mips_native(kvm_t *kd __unused)
-#endif
-{
-
-#ifdef __mips__
-#ifdef __mips_n64
- if (kd->nlehdr.e_ident[EI_CLASS] != ELFCLASS64)
- return (0);
-#else
- if (kd->nlehdr.e_ident[EI_CLASS] != ELFCLASS32)
- return (0);
-#ifdef __mips_n32
- if (!(kd->nlehdr.e_flags & EF_MIPS_ABI2))
- return (0);
-#else
- if (kd->nlehdr.e_flags & EF_MIPS_ABI2)
- return (0);
-#endif
-#endif
-#if _BYTE_ORDER == _LITTLE_ENDIAN
- return (kd->nlehdr.e_ident[EI_DATA] == ELFDATA2LSB);
-#else
- return (kd->nlehdr.e_ident[EI_DATA] == ELFDATA2MSB);
-#endif
-#else
- return (0);
-#endif
-}
-
-struct mips_iter {
- kvm_t *kd;
- u_long nptes;
- u_long pteindex;
-};
-
-static void
-_mips_iterator_init(struct mips_iter *it, kvm_t *kd)
-{
- struct vmstate *vm = kd->vmst;
-
- it->kd = kd;
- it->pteindex = 0;
- if (vm->pte_size == 64)
- it->nptes = vm->hdr.ptesize / sizeof(mips64_pte_t);
- else
- it->nptes = vm->hdr.ptesize / sizeof(mips32_pte_t);
- return;
-}
-
-static int
-_mips_iterator_next(struct mips_iter *it, u_long *pa, u_long *va, u_long *dva,
- vm_prot_t *prot)
-{
- struct vmstate *vm = it->kd->vmst;
- int found = 0;
- mips64_pte_t pte64;
- mips32_pte_t pte32;
-
- /*
- * mips/mips/pmap.c: init_pte_prot / pmap_protect indicate that all
- * pages are R|X at least.
- */
- *prot = VM_PROT_READ | VM_PROT_EXECUTE;
- *pa = 0;
- *va = 0;
- *dva = 0;
- for (;it->pteindex < it->nptes && found == 0; it->pteindex++) {
- if (vm->pte_size == 64) {
- pte64 = _mips64_pte_get(it->kd, it->pteindex);
- if ((pte64 & MIPS_PTE_V) == 0)
- continue;
- if ((pte64 & MIPS64_PTE_RO) == 0)
- *prot |= VM_PROT_WRITE;
- *pa = MIPS64_PTE_TO_PA(pte64);
- } else {
- pte32 = _mips32_pte_get(it->kd, it->pteindex);
- if ((pte32 & MIPS_PTE_V) == 0)
- continue;
- if ((pte32 & MIPS32_PTE_RO) == 0)
- *prot |= VM_PROT_WRITE;
- *pa = MIPS32_PTE_TO_PA(pte32);
- }
- *va = vm->hdr.kernbase + (it->pteindex << MIPS_PAGE_SHIFT);
- found = 1;
- /* advance pteindex regardless */
- }
-
- return found;
-}
-
-static int
-_mips_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg)
-{
- struct mips_iter it;
- u_long dva, pa, va;
- vm_prot_t prot;
-
- /* Generate direct mapped entries; need page entries for prot etc? */
- if (kd->nlehdr.e_ident[EI_CLASS] == ELFCLASS64) {
- /* MIPS_XKPHYS_START..MIPS_XKPHYS_END */
- /* MIPS64_KSEG0_START..MIPS64_KSEG0_END */
- /* MIPS64_KSEG1_START..MIPS64_KSEG1_START */
- } else {
- /* MIPS32_KSEG0_START..MIPS32_KSEG0_END */
- /* MIPS32_KSEG1_START..MIPS32_KSEG1_END */
- }
-
- _mips_iterator_init(&it, kd);
- while (_mips_iterator_next(&it, &pa, &va, &dva, &prot)) {
- if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva,
- prot, MIPS_PAGE_SIZE, 0)) {
- return (0);
- }
- }
- return (1);
-}
-
-static struct kvm_arch kvm_mips_minidump = {
- .ka_probe = _mips_minidump_probe,
- .ka_initvtop = _mips_minidump_initvtop,
- .ka_freevtop = _mips_minidump_freevtop,
- .ka_kvatop = _mips_minidump_kvatop,
- .ka_native = _mips_native,
- .ka_walk_pages = _mips_minidump_walk_pages,
-};
-
-KVM_ARCH(kvm_mips_minidump);
diff --git a/lib/libkvm/kvm_mips.h b/lib/libkvm/kvm_mips.h
deleted file mode 100644
index 9efe5b8e9093..000000000000
--- a/lib/libkvm/kvm_mips.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*-
- * Copyright (c) 2015 John H. Baldwin <jhb@FreeBSD.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef __KVM_MIPS_H__
-#define __KVM_MIPS_H__
-
-#ifdef __mips__
-#include <machine/pte.h>
-#endif
-
-typedef uint64_t mips_physaddr_t;
-
-typedef uint32_t mips32_pte_t;
-typedef uint64_t mips64_pte_t;
-
-#define MIPS_PAGE_SHIFT 12
-#define MIPS_PAGE_SIZE (1 << MIPS_PAGE_SHIFT)
-#define MIPS_PAGE_MASK (MIPS_PAGE_SIZE - 1)
-
-#define MIPS32_KSEG0_START 0x80000000
-#define MIPS32_KSEG0_END 0x9fffffff
-#define MIPS32_KSEG1_START 0xa0000000
-#define MIPS32_KSEG1_END 0xbfffffff
-#define MIPS64_KSEG0_START 0xffffffff80000000
-#define MIPS64_KSEG0_END 0xffffffff9fffffff
-#define MIPS64_KSEG1_START 0xffffffffa0000000
-#define MIPS64_KSEG1_END 0xffffffffbfffffff
-
-#define MIPS32_PFN_MASK (0x1FFFFFC0)
-#define MIPS64_PFN_MASK 0x3FFFFFFC0
-#define MIPS_PFN_SHIFT (6)
-
-#define MIPS_PFN_TO_PA(pfn) (((pfn) >> MIPS_PFN_SHIFT) << MIPS_PAGE_SHIFT)
-#define MIPS32_PTE_TO_PFN(pte) ((pte) & MIPS32_PFN_MASK)
-#define MIPS32_PTE_TO_PA(pte) (MIPS_PFN_TO_PA(MIPS32_PTE_TO_PFN((pte))))
-#define MIPS64_PTE_TO_PFN(pte) ((pte) & MIPS64_PFN_MASK)
-#define MIPS64_PTE_TO_PA(pte) (MIPS_PFN_TO_PA(MIPS64_PTE_TO_PFN((pte))))
-
-#define MIPS32_SWBITS_SHIFT 29
-#define MIPS64_SWBITS_SHIFT 55
-#define MIPS_PTE_V 0x02
-#define MIPS32_PTE_RO ((mips32_pte_t)0x01 << MIPS32_SWBITS_SHIFT)
-#define MIPS64_PTE_RO ((mips64_pte_t)0x01 << MIPS64_SWBITS_SHIFT)
-
-static inline mips32_pte_t
-_mips32_pte_get(kvm_t *kd, u_long pteindex)
-{
- mips32_pte_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte));
-
- return _kvm32toh(kd, *pte);
-}
-
-static inline mips64_pte_t
-_mips64_pte_get(kvm_t *kd, u_long pteindex)
-{
- mips64_pte_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte));
-
- return _kvm64toh(kd, *pte);
-}
-
-#ifdef __mips__
-_Static_assert(PAGE_SHIFT == MIPS_PAGE_SHIFT, "PAGE_SHIFT mismatch");
-_Static_assert(PAGE_SIZE == MIPS_PAGE_SIZE, "PAGE_SIZE mismatch");
-_Static_assert(PAGE_MASK == MIPS_PAGE_MASK, "PAGE_MASK mismatch");
-#ifdef __mips_n64
-_Static_assert((uint64_t)MIPS_KSEG0_START == MIPS64_KSEG0_START,
- "MIPS_KSEG0_START mismatch");
-_Static_assert((uint64_t)MIPS_KSEG0_END == MIPS64_KSEG0_END,
- "MIPS_KSEG0_END mismatch");
-_Static_assert((uint64_t)MIPS_KSEG1_START == MIPS64_KSEG1_START,
- "MIPS_KSEG1_START mismatch");
-_Static_assert((uint64_t)MIPS_KSEG1_END == MIPS64_KSEG1_END,
- "MIPS_KSEG1_END mismatch");
-#else
-_Static_assert((uint32_t)MIPS_KSEG0_START == MIPS32_KSEG0_START,
- "MIPS_KSEG0_START mismatch");
-_Static_assert((uint32_t)MIPS_KSEG0_END == MIPS32_KSEG0_END,
- "MIPS_KSEG0_END mismatch");
-_Static_assert((uint32_t)MIPS_KSEG1_START == MIPS32_KSEG1_START,
- "MIPS_KSEG1_START mismatch");
-_Static_assert((uint32_t)MIPS_KSEG1_END == MIPS32_KSEG1_END,
- "MIPS_KSEG1_END mismatch");
-#endif
-#if defined(__mips_n64) || defined(__mips_n32)
-_Static_assert(TLBLO_PFN_MASK == MIPS64_PFN_MASK, "TLBLO_PFN_MASK mismatch");
-#else
-_Static_assert(TLBLO_PFN_MASK == MIPS32_PFN_MASK, "TLBLO_PFN_MASK mismatch");
-#endif
-_Static_assert(TLBLO_PFN_SHIFT == MIPS_PFN_SHIFT, "TLBLO_PFN_SHIFT mismatch");
-_Static_assert(TLB_PAGE_SHIFT == MIPS_PAGE_SHIFT, "TLB_PAGE_SHIFT mismatch");
-#endif
-
-#endif /* !__KVM_MIPS_H__ */
diff --git a/lib/libkvm/kvm_nlist.3 b/lib/libkvm/kvm_nlist.3
index c9b870e13e75..31e1c15e9cd9 100644
--- a/lib/libkvm/kvm_nlist.3
+++ b/lib/libkvm/kvm_nlist.3
@@ -116,3 +116,8 @@ If the kernel symbol table was unreadable, -1 is returned.
.Xr kvm_openfiles 3 ,
.Xr kvm_read 3 ,
.Xr kvm_write 3
+.Sh HISTORY
+The
+.Fn kvm_nlist2
+function first appeared in
+.Fx 11.0 .
diff --git a/lib/libkvm/kvm_open.3 b/lib/libkvm/kvm_open.3
index f66e7af10efd..2b4a784447dd 100644
--- a/lib/libkvm/kvm_open.3
+++ b/lib/libkvm/kvm_open.3
@@ -269,3 +269,8 @@ of the Sun library and the desire to have a backward-compatible library
for
.Bx
left little choice.
+.Sh HISTORY
+The
+.Fn kvm_open2
+function first appeared in
+.Fx 11.0 .
diff --git a/lib/libkvm/kvm_private.c b/lib/libkvm/kvm_private.c
index d853d1643101..a45f66caf2fe 100644
--- a/lib/libkvm/kvm_private.c
+++ b/lib/libkvm/kvm_private.c
@@ -792,8 +792,8 @@ _kvm_bitmap_next(struct kvm_bitmap *bm, u_long *idx)
/* Find the next valid idx. */
for (; *idx < first_invalid; (*idx)++) {
- unsigned int mask = *idx % CHAR_BIT;
- if ((bm->map[*idx * CHAR_BIT] & mask) == 0)
+ unsigned int mask = 1U << (*idx % CHAR_BIT);
+ if ((bm->map[*idx / CHAR_BIT] & mask) != 0)
break;
}
diff --git a/lib/libkvm/kvm_read.3 b/lib/libkvm/kvm_read.3
index 19a1aafea780..83870a24d188 100644
--- a/lib/libkvm/kvm_read.3
+++ b/lib/libkvm/kvm_read.3
@@ -104,3 +104,8 @@ Otherwise, -1 is returned.
.Xr kvm_nlist 3 ,
.Xr kvm_open 3 ,
.Xr kvm_openfiles 3
+.Sh HISTORY
+The
+.Fn kvm_read2
+function first appeared in
+.Fx 11.0 .
diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h
index 263fdfb571cd..f19fc581f6f5 100644
--- a/lib/libmagic/config.h
+++ b/lib/libmagic/config.h
@@ -1,13 +1,3 @@
-/* $FreeBSD$ */
-
-/* Get __FreeBSD_version. */
-#include <osreldate.h>
-
-/* Only specific versions of FreeBSD support xlocale */
-#if __FreeBSD_version >= 1000002 || (__FreeBSD_version < 1000000 && __FreeBSD_version >= 900506)
-#define FREEBSD_XLOCALE_SUPPORT 1
-#endif
-
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
@@ -17,6 +7,9 @@
/* Define in built-in ELF support is used */
#define BUILTIN_ELF 1
+/* Enable bzlib compression support */
+/* #undef BZLIBSUPPORT */
+
/* Define for ELF core file support */
#define ELFCORE 1
@@ -26,6 +19,9 @@
/* Define to 1 if you have the `asprintf' function. */
#define HAVE_ASPRINTF 1
+/* Define to 1 if you have the <bzlib.h> header file. */
+/* #undef HAVE_BZLIB_H */
+
/* Define to 1 if you have the `ctime_r' function. */
#define HAVE_CTIME_R 1
@@ -59,9 +55,7 @@
#define HAVE_FORK 1
/* Define to 1 if you have the `freelocale' function. */
-#ifdef FREEBSD_XLOCALE_SUPPORT
#define HAVE_FREELOCALE 1
-#endif
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#define HAVE_FSEEKO 1
@@ -87,9 +81,15 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
+/* Define to 1 if you have the `bz2' library (-lbz2). */
+/* #undef HAVE_LIBBZ2 */
+
/* Define to 1 if you have the `gnurx' library (-lgnurx). */
/* #undef HAVE_LIBGNURX */
+/* Define to 1 if you have the `lzma' library (-llzma). */
+/* #undef HAVE_LIBLZMA */
+
/* Define to 1 if you have the `seccomp' library (-lseccomp). */
/* #undef HAVE_LIBSECCOMP */
@@ -99,6 +99,9 @@
/* Define to 1 if you have the `localtime_r' function. */
#define HAVE_LOCALTIME_R 1
+/* Define to 1 if you have the <lzma.h> header file. */
+/* #undef HAVE_LZMA_H */
+
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
#define HAVE_MBRTOWC 1
@@ -121,8 +124,11 @@
#define HAVE_MMAP 1
/* Define to 1 if you have the `newlocale' function. */
-#ifdef FREEBSD_XLOCALE_SUPPORT
#define HAVE_NEWLOCALE 1
+
+/* Define to 1 if you have the `pipe2' function. */
+#ifndef __APPLE__ /* Cross building tools on macOS */
+#define HAVE_PIPE2 1
#endif
/* Define to 1 if you have the `pread' function. */
@@ -210,9 +216,7 @@
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `uselocale' function. */
-#ifdef FREEBSD_XLOCALE_SUPPORT
#define HAVE_USELOCALE 1
-#endif
/* Define to 1 if you have the `utime' function. */
#define HAVE_UTIME 1
@@ -252,7 +256,7 @@
#define HAVE_WORKING_VFORK 1
/* Define to 1 if you have the <xlocale.h> header file. */
-#ifdef FREEBSD_XLOCALE_SUPPORT
+#ifndef __linux__ /* Cross building tools build with glibc on linux */
#define HAVE_XLOCALE_H 1
#endif
@@ -280,7 +284,7 @@
#define PACKAGE_NAME "file"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "file 5.39"
+#define PACKAGE_STRING "file 5.41"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "file"
@@ -289,7 +293,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "5.39"
+#define PACKAGE_VERSION "5.41"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
@@ -320,7 +324,7 @@
/* Version number of package */
-#define VERSION "5.39"
+#define VERSION "5.41"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
@@ -334,6 +338,9 @@
# endif
#endif
+/* Enable xzlib compression support */
+/* #undef XZLIBSUPPORT */
+
/* Enable zlib compression support */
#define ZLIBSUPPORT 1
diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile
index 480796ae5029..c98c33bae3f5 100644
--- a/lib/libmd/Makefile
+++ b/lib/libmd/Makefile
@@ -3,6 +3,7 @@
SHLIBDIR?= /lib
.include <src.opts.mk>
+.include <bsd.compiler.mk>
PACKAGE= runtime
LIB= md
@@ -133,6 +134,11 @@ ACFLAGS+= -DELF -Wa,--noexecstack
SRCS+= sha256c_arm64.c
CFLAGS+= -DARM64_SHA2
CFLAGS.sha256c_arm64.c+= -march=armv8-a+crypto
+.if ${COMPILER_FEATURES:Maarch64-sha512}
+SRCS+= sha512c_arm64.c
+CFLAGS+= -DARM64_SHA512
+CFLAGS.sha512c_arm64.c+= -march=armv8.2-a+sha3
+.endif # aarch64-sha512
.endif
.endif # ${USE_ASM_SOURCES} != 0
diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c
index b416cbc63297..980a674ab76e 100644
--- a/lib/libmemstat/memstat_uma.c
+++ b/lib/libmemstat/memstat_uma.c
@@ -28,6 +28,8 @@
* $FreeBSD$
*/
+#define _WANT_FREEBSD_BITSET
+
#include <sys/param.h>
#include <sys/counter.h>
#include <sys/cpuset.h>
diff --git a/lib/libmixer/mixer.3 b/lib/libmixer/mixer.3
index b541c94af779..25e93440f32c 100644
--- a/lib/libmixer/mixer.3
+++ b/lib/libmixer/mixer.3
@@ -23,7 +23,7 @@
.\"
.Dd September 22, 2021
-.Dt mixer 3
+.Dt MIXER 3
.Os
.Sh NAME
.Nm mixer_open ,
diff --git a/lib/libmixer/mixer.c b/lib/libmixer/mixer.c
index 4bae6980c1c4..1a448d222bb7 100644
--- a/lib/libmixer/mixer.c
+++ b/lib/libmixer/mixer.c
@@ -455,7 +455,7 @@ mixer_set_dunit(struct mixer *m, int unit)
/*
* Get sound device mode (none, play, rec, play+rec). Userland programs can
- * use the MIX_STATUS_* flags to determine the mode of the device.
+ * use the MIX_MODE_* flags to determine the mode of the device.
*/
int
mixer_get_mode(int unit)
diff --git a/lib/libnetgraph/debug.c b/lib/libnetgraph/debug.c
index f44504140b8b..513d3350760d 100644
--- a/lib/libnetgraph/debug.c
+++ b/lib/libnetgraph/debug.c
@@ -96,7 +96,6 @@ __FBSDID("$FreeBSD$");
#include <netgraph/ng_socket.h>
#include <netgraph/ng_source.h>
#include <netgraph/ng_split.h>
-#include <netgraph/ng_sppp.h>
#include <netgraph/ng_tag.h>
#include <netgraph/ng_tcpmss.h>
#include <netgraph/ng_tee.h>
@@ -172,7 +171,6 @@ static const struct ng_cookie cookies[] = {
COOKIE(SOCKET),
COOKIE(SOURCE),
COOKIE(SPLIT),
- COOKIE(SPPP),
COOKIE(TAG),
COOKIE(TCPMSS),
COOKIE(TEE),
diff --git a/lib/libnv/msgio.c b/lib/libnv/msgio.c
index 7cec4c898f04..899f2d3a0ff1 100644
--- a/lib/libnv/msgio.c
+++ b/lib/libnv/msgio.c
@@ -450,7 +450,7 @@ buf_send(int sock, void *buf, size_t size)
}
int
-buf_recv(int sock, void *buf, size_t size)
+buf_recv(int sock, void *buf, size_t size, int flags)
{
ssize_t done;
unsigned char *ptr;
@@ -461,7 +461,7 @@ buf_recv(int sock, void *buf, size_t size)
ptr = buf;
while (size > 0) {
fd_wait(sock, true);
- done = recv(sock, ptr, size, 0);
+ done = recv(sock, ptr, size, flags);
if (done == -1) {
if (errno == EINTR)
continue;
diff --git a/lib/libnv/msgio.h b/lib/libnv/msgio.h
index 13592e4cd0fb..0686c47f294c 100644
--- a/lib/libnv/msgio.h
+++ b/lib/libnv/msgio.h
@@ -47,6 +47,6 @@ int fd_send(int sock, const int *fds, size_t nfds);
int fd_recv(int sock, int *fds, size_t nfds);
int buf_send(int sock, void *buf, size_t size);
-int buf_recv(int sock, void *buf, size_t size);
+int buf_recv(int sock, void *buf, size_t size, int flags);
#endif /* !_MSGIO_H_ */
diff --git a/lib/libnv/tests/nvlist_send_recv_test.c b/lib/libnv/tests/nvlist_send_recv_test.c
index a8eed7adcd8d..133a487b8a7c 100644
--- a/lib/libnv/tests/nvlist_send_recv_test.c
+++ b/lib/libnv/tests/nvlist_send_recv_test.c
@@ -337,13 +337,13 @@ send_nvlist_parent(int sock)
nvlist_destroy(nvl);
}
-ATF_TC_WITHOUT_HEAD(nvlist_send_recv__send_nvlist);
-ATF_TC_BODY(nvlist_send_recv__send_nvlist, tc)
+static void
+nvlist_send_recv__send_nvlist(short sotype)
{
int socks[2], status;
pid_t pid;
- ATF_REQUIRE(socketpair(PF_UNIX, SOCK_STREAM, 0, socks) == 0);
+ ATF_REQUIRE(socketpair(PF_UNIX, sotype, 0, socks) == 0);
pid = fork();
ATF_REQUIRE(pid >= 0);
@@ -361,13 +361,13 @@ ATF_TC_BODY(nvlist_send_recv__send_nvlist, tc)
ATF_REQUIRE(status == 0);
}
-ATF_TC_WITHOUT_HEAD(nvlist_send_recv__send_closed_fd);
-ATF_TC_BODY(nvlist_send_recv__send_closed_fd, tc)
+static void
+nvlist_send_recv__send_closed_fd(short sotype)
{
nvlist_t *nvl;
int socks[2];
- ATF_REQUIRE(socketpair(PF_UNIX, SOCK_STREAM, 0, socks) == 0);
+ ATF_REQUIRE(socketpair(PF_UNIX, sotype, 0, socks) == 0);
nvl = nvlist_create(0);
ATF_REQUIRE(nvl != NULL);
@@ -428,15 +428,15 @@ send_many_fds_child(int sock)
}
}
-ATF_TC_WITHOUT_HEAD(nvlist_send_recv__send_many_fds);
-ATF_TC_BODY(nvlist_send_recv__send_many_fds, tc)
+static void
+nvlist_send_recv__send_many_fds(short sotype)
{
char name[16];
nvlist_t *nvl;
int anfds, bnfds, fd, i, j, socks[2], status;
pid_t pid;
- ATF_REQUIRE(socketpair(PF_UNIX, SOCK_STREAM, 0, socks) == 0);
+ ATF_REQUIRE(socketpair(PF_UNIX, sotype, 0, socks) == 0);
pid = fork();
ATF_REQUIRE(pid >= 0);
@@ -471,12 +471,90 @@ ATF_TC_BODY(nvlist_send_recv__send_many_fds, tc)
ATF_REQUIRE(status == 0);
}
+/*
+ * This test needs to tune the following sysctl's:
+ * net.local.dgram.maxdgram
+ * net.local.dgram.recvspace
+ */
+ATF_TC_WITHOUT_HEAD(nvlist_send_recv__send_many_fds__dgram);
+ATF_TC_BODY(nvlist_send_recv__send_many_fds__dgram, tc)
+{
+ u_long maxdgram, recvspace, temp_maxdgram, temp_recvspace;
+ size_t len;
+ int error;
+
+ atf_tc_skip("https://bugs.freebsd.org/260891");
+
+ /* size of the largest datagram to send */
+ temp_maxdgram = 16772;
+ len = sizeof(maxdgram);
+ error = sysctlbyname("net.local.dgram.maxdgram", &maxdgram,
+ &len, &temp_maxdgram, sizeof(temp_maxdgram));
+ if (error != 0)
+ atf_tc_skip("cannot set net.local.dgram.maxdgram: %s", strerror(errno));
+
+ /*
+ * The receive queue fills up quicker than it's being emptied,
+ * bump it to a sufficiently large enough value, 1M.
+ */
+ temp_recvspace = 1048576;
+ len = sizeof(recvspace);
+ error = sysctlbyname("net.local.dgram.recvspace", &recvspace,
+ &len, &temp_recvspace, sizeof(temp_recvspace));
+ if (error != 0)
+ atf_tc_skip("cannot set net.local.dgram.recvspace: %s", strerror(errno));
+
+ nvlist_send_recv__send_many_fds(SOCK_DGRAM);
+
+ /* restore original values */
+ error = sysctlbyname("net.local.dgram.maxdgram", NULL, NULL, &maxdgram, sizeof(maxdgram));
+ if (error != 0)
+ warn("failed to restore net.local.dgram.maxdgram");
+
+ error = sysctlbyname("net.local.dgram.recvspace", NULL, NULL, &recvspace, sizeof(recvspace));
+ if (error != 0)
+ warn("failed to restore net.local.dgram.recvspace");
+}
+
+ATF_TC_WITHOUT_HEAD(nvlist_send_recv__send_many_fds__stream);
+ATF_TC_BODY(nvlist_send_recv__send_many_fds__stream, tc)
+{
+ nvlist_send_recv__send_many_fds(SOCK_STREAM);
+}
+
+ATF_TC_WITHOUT_HEAD(nvlist_send_recv__send_nvlist__dgram);
+ATF_TC_BODY(nvlist_send_recv__send_nvlist__dgram, tc)
+{
+ nvlist_send_recv__send_nvlist(SOCK_DGRAM);
+}
+
+ATF_TC_WITHOUT_HEAD(nvlist_send_recv__send_nvlist__stream);
+ATF_TC_BODY(nvlist_send_recv__send_nvlist__stream, tc)
+{
+ nvlist_send_recv__send_nvlist(SOCK_STREAM);
+}
+
+ATF_TC_WITHOUT_HEAD(nvlist_send_recv__send_closed_fd__dgram);
+ATF_TC_BODY(nvlist_send_recv__send_closed_fd__dgram, tc)
+{
+ nvlist_send_recv__send_closed_fd(SOCK_DGRAM);
+}
+
+ATF_TC_WITHOUT_HEAD(nvlist_send_recv__send_closed_fd__stream);
+ATF_TC_BODY(nvlist_send_recv__send_closed_fd__stream, tc)
+{
+ nvlist_send_recv__send_closed_fd(SOCK_STREAM);
+}
+
ATF_TP_ADD_TCS(tp)
{
- ATF_TP_ADD_TC(tp, nvlist_send_recv__send_nvlist);
- ATF_TP_ADD_TC(tp, nvlist_send_recv__send_closed_fd);
- ATF_TP_ADD_TC(tp, nvlist_send_recv__send_many_fds);
+ ATF_TP_ADD_TC(tp, nvlist_send_recv__send_nvlist__dgram);
+ ATF_TP_ADD_TC(tp, nvlist_send_recv__send_nvlist__stream);
+ ATF_TP_ADD_TC(tp, nvlist_send_recv__send_closed_fd__dgram);
+ ATF_TP_ADD_TC(tp, nvlist_send_recv__send_closed_fd__stream);
+ ATF_TP_ADD_TC(tp, nvlist_send_recv__send_many_fds__dgram);
+ ATF_TP_ADD_TC(tp, nvlist_send_recv__send_many_fds__stream);
return (atf_no_error());
}
diff --git a/lib/libomp/kmp_config.h b/lib/libomp/kmp_config.h
index 3c1f750351dc..81af653b5327 100644
--- a/lib/libomp/kmp_config.h
+++ b/lib/libomp/kmp_config.h
@@ -45,6 +45,8 @@
#define OMPT_DEBUG LIBOMP_OMPT_DEBUG
#define LIBOMP_OMPT_SUPPORT 1
#define OMPT_SUPPORT LIBOMP_OMPT_SUPPORT
+#define LIBOMP_OMPD_SUPPORT 0
+#define OMPD_SUPPORT LIBOMP_OMPD_SUPPORT
#define LIBOMP_PROFILING_SUPPORT 0
#define OMP_PROFILING_SUPPORT LIBOMP_PROFILING_SUPPORT
#define LIBOMP_OMPT_OPTIONAL 1
@@ -67,10 +69,6 @@
#define KMP_LIBRARY_FILE "libomp.so"
#define KMP_VERSION_MAJOR 5
#define KMP_VERSION_MINOR 0
-#define LIBOMP_TSAN_SUPPORT 0
-#if LIBOMP_TSAN_SUPPORT
-#define TSAN_SUPPORT
-#endif
#define MSVC 0
#define KMP_MSVC_COMPAT MSVC
#define LIBOMP_HAVE_WAITPKG_INTRINSICS 1
diff --git a/lib/libomp/kmp_i18n_default.inc b/lib/libomp/kmp_i18n_default.inc
index a0e200808292..807b3c4786e2 100644
--- a/lib/libomp/kmp_i18n_default.inc
+++ b/lib/libomp/kmp_i18n_default.inc
@@ -1,6 +1,6 @@
// $FreeBSD$
// Do not edit this file! //
-// The file was generated from en_US.txt by message-converter.pl on Mon Apr 26 14:12:23 2021. //
+// The file was generated from en_US.txt by message-converter.pl on Thu Aug 26 11:36:17 2021. //
static char const *
__kmp_i18n_default_meta[] =
@@ -73,6 +73,30 @@ __kmp_i18n_default_strings[] =
"[device]",
"[host]",
"tile",
+ "tiles",
+ "threads",
+ "cores",
+ "socket",
+ "sockets",
+ "die",
+ "dice",
+ "module",
+ "modules",
+ "L1 cache",
+ "L1 caches",
+ "L2 cache",
+ "L2 caches",
+ "L3 cache",
+ "L3 caches",
+ "NUMA domain",
+ "NUMA domains",
+ "processor group",
+ "processor groups",
+ "unknown",
+ "cpuid leaf 31 not supported",
+ "Hwloc api failure",
+ "LL cache",
+ "LL caches",
NULL
};
@@ -282,6 +306,8 @@ __kmp_i18n_default_messages[] =
"%1$s: %2$d packages x %3$d nodes/pkg x %4$d tiles/node x %5$d cores/tile x %6$d threads/core (%7$d total cores)",
"OMPT: Cannot determine workshare type; using the default (loop) instead. This issue is fixed in an up-to-date compiler.",
"Allocator %1$s is not available, will use default allocator.",
+ "%1$s: %2$s (%3$d total cores)",
+ "%1$s: granularity setting: %2$s does not exist in topology. Using granularity=%3$s instead.",
"%1$s must be bound to a work-sharing or work-queuing construct with an \"ordered\" clause",
"Detected end of %1$s without first executing a corresponding beginning.",
"Iteration range too large in %1$s.",
@@ -365,6 +391,18 @@ __kmp_i18n_default_messages[] =
"OMP: pid %1$s tid %2$s thread %3$s bound to OS proc set {%4$s}",