aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile14
-rw-r--r--lib/clang/llvm.build.mk13
-rw-r--r--lib/flua/libjail/lua_jail.c2
-rw-r--r--lib/geom/mirror/gmirror.837
-rw-r--r--lib/geom/part/gpart.82
-rw-r--r--lib/libbegemot/Makefile2
-rw-r--r--lib/libbsddialog/Makefile1
-rw-r--r--lib/libc/Makefile7
-rw-r--r--lib/libc/aarch64/SYS.h1
-rw-r--r--lib/libc/aarch64/gen/_ctx_start.S1
-rw-r--r--lib/libc/aarch64/gen/_setjmp.S1
-rw-r--r--lib/libc/aarch64/gen/fabs.S1
-rw-r--r--lib/libc/aarch64/gen/fpgetmask.c1
-rw-r--r--lib/libc/aarch64/gen/fpsetmask.c1
-rw-r--r--lib/libc/aarch64/gen/makecontext.c1
-rw-r--r--lib/libc/aarch64/gen/setjmp.S1
-rw-r--r--lib/libc/aarch64/gen/sigsetjmp.S1
-rw-r--r--lib/libc/aarch64/sys/cerror.S1
-rw-r--r--lib/libc/aarch64/sys/syscall.S1
-rw-r--r--lib/libc/aarch64/sys/vfork.S1
-rw-r--r--lib/libc/capability/cap_rights_init.31
-rw-r--r--lib/libc/gdtoa/machdep_ldisQ.c2
-rw-r--r--lib/libc/gdtoa/machdep_ldisd.c2
-rw-r--r--lib/libc/gdtoa/machdep_ldisx.c2
-rw-r--r--lib/libc/gen/Makefile.inc5
-rw-r--r--lib/libc/gen/Symbol.map2
-rw-r--r--lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c1
-rw-r--r--lib/libc/gen/arc4random.c10
-rw-r--r--lib/libc/gen/auxv.36
-rw-r--r--lib/libc/gen/auxv.c23
-rw-r--r--lib/libc/gen/cap_rights_get.31
-rw-r--r--lib/libc/gen/cap_sandboxed.31
-rw-r--r--lib/libc/gen/cap_sandboxed.c1
-rw-r--r--lib/libc/gen/dlopen.38
-rw-r--r--lib/libc/gen/elf_utils.c29
-rw-r--r--lib/libc/gen/fnmatch.c2
-rw-r--r--lib/libc/gen/glob.c2
-rw-r--r--lib/libc/gen/memalign.c1
-rw-r--r--lib/libc/gen/scandir-compat11.c8
-rw-r--r--lib/libc/gen/scandir.384
-rw-r--r--lib/libc/gen/scandir.c70
-rw-r--r--lib/libc/gen/syslog.c54
-rw-r--r--lib/libc/iconv/bsd_iconv.c16
-rw-r--r--lib/libc/iconv/citrus_iconv.c28
-rw-r--r--lib/libc/iconv/citrus_module.c2
-rw-r--r--lib/libc/iconv/citrus_namespace.h1
-rw-r--r--lib/libc/iconv/citrus_stdenc.h14
-rw-r--r--lib/libc/iconv/citrus_stdenc_local.h2
-rw-r--r--lib/libc/iconv/citrus_stdenc_template.h6
-rw-r--r--lib/libc/locale/ascii.c2
-rw-r--r--lib/libc/locale/big5.c2
-rw-r--r--lib/libc/locale/btowc.c2
-rw-r--r--lib/libc/locale/collate.c2
-rw-r--r--lib/libc/locale/collate.h2
-rw-r--r--lib/libc/locale/collcmp.c2
-rw-r--r--lib/libc/locale/ctype.c1
-rw-r--r--lib/libc/locale/ctype_l.31
-rw-r--r--lib/libc/locale/duplocale.31
-rw-r--r--lib/libc/locale/euc.c2
-rw-r--r--lib/libc/locale/freelocale.31
-rw-r--r--lib/libc/locale/gb18030.c2
-rw-r--r--lib/libc/locale/gb2312.c2
-rw-r--r--lib/libc/locale/gbk.c2
-rw-r--r--lib/libc/locale/lmessages.c2
-rw-r--r--lib/libc/locale/lmessages.h2
-rw-r--r--lib/libc/locale/lmonetary.c2
-rw-r--r--lib/libc/locale/lmonetary.h2
-rw-r--r--lib/libc/locale/lnumeric.c2
-rw-r--r--lib/libc/locale/lnumeric.h2
-rw-r--r--lib/libc/locale/localeconv.c2
-rw-r--r--lib/libc/locale/mblen.c2
-rw-r--r--lib/libc/locale/mblocal.h2
-rw-r--r--lib/libc/locale/mbrlen.c2
-rw-r--r--lib/libc/locale/mbrtowc.c2
-rw-r--r--lib/libc/locale/mbsinit.c2
-rw-r--r--lib/libc/locale/mbsnrtowcs.c3
-rw-r--r--lib/libc/locale/mbsrtowcs.c2
-rw-r--r--lib/libc/locale/mbstowcs.c2
-rw-r--r--lib/libc/locale/mbtowc.c2
-rw-r--r--lib/libc/locale/mskanji.c2
-rw-r--r--lib/libc/locale/newlocale.31
-rw-r--r--lib/libc/locale/nextwctype.c2
-rw-r--r--lib/libc/locale/nl_langinfo.c2
-rw-r--r--lib/libc/locale/none.c2
-rw-r--r--lib/libc/locale/querylocale.31
-rw-r--r--lib/libc/locale/runetype.c2
-rw-r--r--lib/libc/locale/setrunelocale.c2
-rw-r--r--lib/libc/locale/table.c2
-rw-r--r--lib/libc/locale/tolower.c2
-rw-r--r--lib/libc/locale/toupper.c2
-rw-r--r--lib/libc/locale/uselocale.31
-rw-r--r--lib/libc/locale/utf8.c2
-rw-r--r--lib/libc/locale/wcrtomb.c2
-rw-r--r--lib/libc/locale/wcsftime.c2
-rw-r--r--lib/libc/locale/wcsnrtombs.c2
-rw-r--r--lib/libc/locale/wcsrtombs.c2
-rw-r--r--lib/libc/locale/wcstod.c2
-rw-r--r--lib/libc/locale/wcstof.c2
-rw-r--r--lib/libc/locale/wcstoimax.c2
-rw-r--r--lib/libc/locale/wcstol.c2
-rw-r--r--lib/libc/locale/wcstold.c2
-rw-r--r--lib/libc/locale/wcstoll.c2
-rw-r--r--lib/libc/locale/wcstombs.c2
-rw-r--r--lib/libc/locale/wcstoul.c2
-rw-r--r--lib/libc/locale/wcstoull.c2
-rw-r--r--lib/libc/locale/wcstoumax.c2
-rw-r--r--lib/libc/locale/wctob.c2
-rw-r--r--lib/libc/locale/wctomb.c2
-rw-r--r--lib/libc/locale/wctrans.c2
-rw-r--r--lib/libc/locale/wctype.c2
-rw-r--r--lib/libc/locale/wcwidth.c2
-rw-r--r--lib/libc/locale/xlocale.31
-rw-r--r--lib/libc/locale/xlocale.c1
-rw-r--r--lib/libc/locale/xlocale_private.h1
-rw-r--r--lib/libc/net/getaddrinfo.32
-rw-r--r--lib/libc/net/resolver.35
-rw-r--r--lib/libc/quad/qdivrem.c2
-rw-r--r--lib/libc/regex/regcomp.c2
-rw-r--r--lib/libc/rpc/netnamer.c2
-rw-r--r--lib/libc/stdio/asprintf.c2
-rw-r--r--lib/libc/stdio/fflush.c3
-rw-r--r--lib/libc/stdio/fgetwc.c2
-rw-r--r--lib/libc/stdio/fgetwln.c2
-rw-r--r--lib/libc/stdio/fgetws.c2
-rw-r--r--lib/libc/stdio/fprintf.c2
-rw-r--r--lib/libc/stdio/fputwc.c2
-rw-r--r--lib/libc/stdio/fputws.c2
-rw-r--r--lib/libc/stdio/fscanf.c2
-rw-r--r--lib/libc/stdio/fvwrite.c5
-rw-r--r--lib/libc/stdio/fwprintf.c2
-rw-r--r--lib/libc/stdio/fwscanf.c2
-rw-r--r--lib/libc/stdio/getwc.c2
-rw-r--r--lib/libc/stdio/getwchar.c2
-rw-r--r--lib/libc/stdio/local.h2
-rw-r--r--lib/libc/stdio/printf.c2
-rw-r--r--lib/libc/stdio/printfcommon.h2
-rw-r--r--lib/libc/stdio/putwc.c2
-rw-r--r--lib/libc/stdio/putwchar.c2
-rw-r--r--lib/libc/stdio/scanf.c2
-rw-r--r--lib/libc/stdio/setvbuf.c3
-rw-r--r--lib/libc/stdio/snprintf.c2
-rw-r--r--lib/libc/stdio/sprintf.c2
-rw-r--r--lib/libc/stdio/sscanf.c2
-rw-r--r--lib/libc/stdio/swprintf.c2
-rw-r--r--lib/libc/stdio/swscanf.c2
-rw-r--r--lib/libc/stdio/ungetwc.c2
-rw-r--r--lib/libc/stdio/vasprintf.c2
-rw-r--r--lib/libc/stdio/vdprintf.c2
-rw-r--r--lib/libc/stdio/vfprintf.c2
-rw-r--r--lib/libc/stdio/vfscanf.c2
-rw-r--r--lib/libc/stdio/vfwprintf.c2
-rw-r--r--lib/libc/stdio/vfwscanf.c2
-rw-r--r--lib/libc/stdio/vprintf.c2
-rw-r--r--lib/libc/stdio/vscanf.c2
-rw-r--r--lib/libc/stdio/vsnprintf.c2
-rw-r--r--lib/libc/stdio/vsprintf.c2
-rw-r--r--lib/libc/stdio/vsscanf.c2
-rw-r--r--lib/libc/stdio/vswprintf.c2
-rw-r--r--lib/libc/stdio/vswscanf.c2
-rw-r--r--lib/libc/stdio/vwprintf.c2
-rw-r--r--lib/libc/stdio/vwscanf.c2
-rw-r--r--lib/libc/stdio/wbuf.c6
-rw-r--r--lib/libc/stdio/wprintf.c2
-rw-r--r--lib/libc/stdio/wscanf.c2
-rw-r--r--lib/libc/stdlib/Makefile.inc4
-rw-r--r--lib/libc/stdlib/Symbol.map2
-rw-r--r--lib/libc/stdlib/atof.c2
-rw-r--r--lib/libc/stdlib/atoi.c2
-rw-r--r--lib/libc/stdlib/atol.c2
-rw-r--r--lib/libc/stdlib/atoll.c2
-rw-r--r--lib/libc/stdlib/cxa_thread_atexit.c1
-rw-r--r--lib/libc/stdlib/div.c3
-rw-r--r--lib/libc/stdlib/ldiv.c3
-rw-r--r--lib/libc/stdlib/qsort.312
-rw-r--r--lib/libc/stdlib/qsort.c16
-rw-r--r--lib/libc/stdlib/qsort_r.c11
-rw-r--r--lib/libc/stdlib/qsort_r_compat.c21
-rw-r--r--lib/libc/stdlib/strfmon.c2
-rw-r--r--lib/libc/stdlib/strtoimax.c2
-rw-r--r--lib/libc/stdlib/strtol.c2
-rw-r--r--lib/libc/stdlib/strtold.c1
-rw-r--r--lib/libc/stdlib/strtoll.c2
-rw-r--r--lib/libc/stdlib/strtoul.c2
-rw-r--r--lib/libc/stdlib/strtoull.c2
-rw-r--r--lib/libc/stdlib/strtoumax.c2
-rw-r--r--lib/libc/stdtime/strftime.c2
-rw-r--r--lib/libc/stdtime/strptime.c2
-rw-r--r--lib/libc/stdtime/timelocal.c2
-rw-r--r--lib/libc/stdtime/timelocal.h2
-rw-r--r--lib/libc/string/Makefile.inc4
-rw-r--r--lib/libc/string/Symbol.map1
-rw-r--r--lib/libc/string/mempcpy.c1
-rw-r--r--lib/libc/string/strcasecmp.c2
-rw-r--r--lib/libc/string/strcasestr.c2
-rw-r--r--lib/libc/string/strcoll.c2
-rw-r--r--lib/libc/string/strverscmp.356
-rw-r--r--lib/libc/string/strverscmp.c91
-rw-r--r--lib/libc/string/strxfrm.c2
-rw-r--r--lib/libc/string/wcscoll.c2
-rw-r--r--lib/libc/string/wcswidth.c2
-rw-r--r--lib/libc/string/wcsxfrm.c2
-rw-r--r--lib/libc/string/wmempcpy.c1
-rw-r--r--lib/libc/sys/POSIX2x_Fork.c1
-rw-r--r--lib/libc/sys/_umtx_op.21
-rw-r--r--lib/libc/sys/accept.c1
-rw-r--r--lib/libc/sys/accept4.c1
-rw-r--r--lib/libc/sys/aio_suspend.c1
-rw-r--r--lib/libc/sys/bindat.21
-rw-r--r--lib/libc/sys/cap_fcntls_limit.21
-rw-r--r--lib/libc/sys/cap_ioctls_limit.21
-rw-r--r--lib/libc/sys/clock_gettime.225
-rw-r--r--lib/libc/sys/close.c1
-rw-r--r--lib/libc/sys/connect.c1
-rw-r--r--lib/libc/sys/connectat.21
-rw-r--r--lib/libc/sys/fcntl.c1
-rw-r--r--lib/libc/sys/fdatasync.c1
-rw-r--r--lib/libc/sys/fork.c1
-rw-r--r--lib/libc/sys/fsync.21
-rw-r--r--lib/libc/sys/fsync.c1
-rw-r--r--lib/libc/sys/interposing_table.c1
-rw-r--r--lib/libc/sys/kevent.c1
-rw-r--r--lib/libc/sys/ktrace.22
-rw-r--r--lib/libc/sys/msync.c1
-rw-r--r--lib/libc/sys/nanosleep.c1
-rw-r--r--lib/libc/sys/open.c1
-rw-r--r--lib/libc/sys/openat.c1
-rw-r--r--lib/libc/sys/pdfork.c1
-rw-r--r--lib/libc/sys/poll.c1
-rw-r--r--lib/libc/sys/ppoll.c1
-rw-r--r--lib/libc/sys/pselect.c1
-rw-r--r--lib/libc/sys/ptrace.c1
-rw-r--r--lib/libc/sys/read.c1
-rw-r--r--lib/libc/sys/readv.c1
-rw-r--r--lib/libc/sys/recv.214
-rw-r--r--lib/libc/sys/recvfrom.c1
-rw-r--r--lib/libc/sys/recvmsg.c1
-rw-r--r--lib/libc/sys/select.c1
-rw-r--r--lib/libc/sys/sendmsg.c1
-rw-r--r--lib/libc/sys/sendto.c1
-rw-r--r--lib/libc/sys/setcontext.c1
-rw-r--r--lib/libc/sys/sigaction.c1
-rw-r--r--lib/libc/sys/sigprocmask.c1
-rw-r--r--lib/libc/sys/sigsuspend.c1
-rw-r--r--lib/libc/sys/sigtimedwait.c1
-rw-r--r--lib/libc/sys/sigwaitinfo.c1
-rw-r--r--lib/libc/sys/socket.224
-rw-r--r--lib/libc/sys/thr_exit.21
-rw-r--r--lib/libc/sys/thr_kill.21
-rw-r--r--lib/libc/sys/thr_new.27
-rw-r--r--lib/libc/sys/thr_self.21
-rw-r--r--lib/libc/sys/thr_set_name.21
-rw-r--r--lib/libc/sys/thr_suspend.21
-rw-r--r--lib/libc/sys/thr_wake.21
-rw-r--r--lib/libc/sys/wait4.c1
-rw-r--r--lib/libc/sys/wait6.c1
-rw-r--r--lib/libc/sys/write.c1
-rw-r--r--lib/libc/sys/writev.c1
-rw-r--r--lib/libc/tests/locale/c16rtomb_test.c3
-rw-r--r--lib/libc/tests/stdlib/Makefile10
-rw-r--r--lib/libc/tests/stdlib/qsort_b_test.c76
-rw-r--r--lib/libc/tests/stdlib/qsort_r_compat_test.c92
-rw-r--r--lib/libc/tests/stdlib/qsort_r_test.c6
-rw-r--r--lib/libc/tests/string/Makefile5
-rw-r--r--lib/libc/tests/string/strverscmp_test.c93
-rw-r--r--lib/libc/x86/sys/pkru.31
-rw-r--r--lib/libc/x86/sys/pkru.c1
-rw-r--r--lib/libcasper/libcasper/libcasper.35
-rw-r--r--lib/libcasper/libcasper/libcasper_service.32
-rw-r--r--lib/libcasper/services/cap_netdb/cap_netdb.33
-rw-r--r--lib/libcuse/cuse.320
-rw-r--r--lib/libcuse/cuse.h2
-rw-r--r--lib/libcuse/cuse_lib.c95
-rw-r--r--lib/libdpv/dpv.324
-rw-r--r--lib/libedit/Makefile2
-rw-r--r--lib/libefivar/efivar-dp-format.c3
-rw-r--r--lib/libexpat/expat_config.h6
-rw-r--r--lib/libexpat/libbsdxml.34
-rw-r--r--lib/libfetch/common.c2
-rw-r--r--lib/libfetch/fetch.33
-rw-r--r--lib/libgeom/geom_ctl.c6
-rw-r--r--lib/libgeom/libgeom.32
-rw-r--r--lib/libgssapi/Makefile1
-rw-r--r--lib/libiconv_modules/Makefile.inc2
-rw-r--r--lib/libiconv_modules/UTF1632/citrus_utf1632.c3
-rw-r--r--lib/libiconv_modules/VIQR/citrus_viqr.c4
-rw-r--r--lib/libiconv_modules/iconv_std/citrus_iconv_std.c18
-rw-r--r--lib/libifconfig/libifconfig.h6
-rw-r--r--lib/libifconfig/libifconfig_internal.h4
-rw-r--r--lib/libldns/Makefile2
-rw-r--r--lib/liblzma/Makefile5
-rw-r--r--lib/libmagic/Makefile6
-rw-r--r--lib/libmagic/config.h108
-rw-r--r--lib/libmd/Makefile2
-rw-r--r--lib/libmd/mdX.32
-rw-r--r--lib/libmd/ripemd.32
-rw-r--r--lib/libmd/sha.32
-rw-r--r--lib/libmd/sha256.32
-rw-r--r--lib/libmd/sha512.32
-rw-r--r--lib/libmd/skein.32
-rw-r--r--lib/libnv/Makefile5
-rw-r--r--lib/libnv/Version.map256
-rw-r--r--lib/libopie/Makefile40
-rw-r--r--lib/libopie/Makefile.depend18
-rw-r--r--lib/libopie/config.h381
-rw-r--r--lib/libopie/opieaccess13
-rw-r--r--lib/libopie/opieextra.c98
-rw-r--r--lib/libpam/modules/modules.inc2
-rw-r--r--lib/libpam/modules/pam_chroot/pam_chroot.82
-rw-r--r--lib/libpam/modules/pam_deny/pam_deny.82
-rw-r--r--lib/libpam/modules/pam_echo/pam_echo.82
-rw-r--r--lib/libpam/modules/pam_exec/pam_exec.814
-rw-r--r--lib/libpam/modules/pam_ftpusers/pam_ftpusers.82
-rw-r--r--lib/libpam/modules/pam_group/pam_group.82
-rw-r--r--lib/libpam/modules/pam_guest/pam_guest.82
-rw-r--r--lib/libpam/modules/pam_krb5/pam_krb5.82
-rw-r--r--lib/libpam/modules/pam_ksu/pam_ksu.82
-rw-r--r--lib/libpam/modules/pam_lastlog/pam_lastlog.86
-rw-r--r--lib/libpam/modules/pam_nologin/pam_nologin.82
-rw-r--r--lib/libpam/modules/pam_opie/Makefile36
-rw-r--r--lib/libpam/modules/pam_opie/Makefile.depend19
-rw-r--r--lib/libpam/modules/pam_opie/pam_opie.8123
-rw-r--r--lib/libpam/modules/pam_opie/pam_opie.c157
-rw-r--r--lib/libpam/modules/pam_opieaccess/Makefile11
-rw-r--r--lib/libpam/modules/pam_opieaccess/Makefile.depend18
-rw-r--r--lib/libpam/modules/pam_opieaccess/pam_opieaccess.8142
-rw-r--r--lib/libpam/modules/pam_opieaccess/pam_opieaccess.c97
-rw-r--r--lib/libpam/modules/pam_passwdqc/pam_passwdqc.82
-rw-r--r--lib/libpam/modules/pam_permit/pam_permit.82
-rw-r--r--lib/libpam/modules/pam_radius/pam_radius.82
-rw-r--r--lib/libpam/modules/pam_rhosts/pam_rhosts.82
-rw-r--r--lib/libpam/modules/pam_rootok/pam_rootok.82
-rw-r--r--lib/libpam/modules/pam_securetty/pam_securetty.82
-rw-r--r--lib/libpam/modules/pam_self/pam_self.82
-rw-r--r--lib/libpam/modules/pam_ssh/pam_ssh.82
-rw-r--r--lib/libpam/modules/pam_tacplus/pam_tacplus.82
-rw-r--r--lib/libpam/modules/pam_unix/pam_unix.82
-rw-r--r--lib/libpam/modules/pam_unix/pam_unix.c4
-rw-r--r--lib/libpam/pam.d/Makefile6
-rw-r--r--lib/libpam/pam.d/ftpd2
-rw-r--r--lib/libpam/pam.d/other2
-rw-r--r--lib/libpam/pam.d/sshd2
-rw-r--r--lib/libpam/pam.d/system2
-rw-r--r--lib/libpam/pam.d/telnetd26
-rw-r--r--lib/libpam/static_libpam/Makefile.depend2
-rw-r--r--lib/libpathconv/abs2rel.344
-rw-r--r--lib/libpathconv/rel2abs.340
-rw-r--r--lib/libpfctl/libpfctl.c12
-rw-r--r--lib/libpfctl/libpfctl.h4
-rw-r--r--lib/libpmc/Makefile4
-rw-r--r--lib/libpmc/libpmc.c108
-rw-r--r--lib/libpmc/libpmc_pmu_util.c15
-rw-r--r--lib/libpmc/pmc.cmn-600.3597
-rw-r--r--lib/libpmc/pmc.dmc-620.3165
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/ampere/emag/branch.json19
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/ampere/emag/bus.json23
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/ampere/emag/cache.json161
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/ampere/emag/clock.json18
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/ampere/emag/exception.json44
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/ampere/emag/instruction.json73
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/ampere/emag/intrinsic.json14
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/ampere/emag/memory.json24
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/ampere/emag/pipeline.json50
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/branch.json11
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/bus.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/cache.json32
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/exception.json14
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/instruction.json29
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/memory.json8
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/branch.json11
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/bus.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/cache.json32
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/exception.json14
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/instruction.json44
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/memory.json8
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/branch.json59
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/bus.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/cache.json182
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/exception.json14
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/instruction.json95
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/memory.json32
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/pipeline.json107
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/pmu.json8
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/trace.json32
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/branch.json59
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/bus.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/cache.json188
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/exception.json20
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/instruction.json65
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/memory.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/pipeline.json80
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/branch.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/bus.json29
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/cache.json80
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/exception.json47
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/instruction.json68
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/memory.json20
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/branch.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/bus.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/cache.json236
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/dpu.json32
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/exception.json14
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/ifu.json122
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/instruction.json71
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/memory.json35
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/pipeline.json8
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/branch.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/bus.json20
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/cache.json155
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/exception.json47
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/instruction.json134
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/memory.json41
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/pipeline.json23
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/trace.json29
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/branch.json11
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/bus.json23
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/cache.json107
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/etm.json14
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/exception.json14
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/instruction.json65
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/memory.json14
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/mmu.json44
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/pipeline.json38
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/branch.json11
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/bus.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/cache.json164
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/etm.json14
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/exception.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/instruction.json74
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/memory.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/mmu.json44
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/pipeline.json44
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/branch.json10
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/bus.json21
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/cache.json169
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/exception.json48
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/instruction.json91
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/memory.json21
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/other.json5
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/pipeline.json10
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a77/branch.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a77/bus.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a77/cache.json143
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a77/exception.json47
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a77/instruction.json77
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a77/memory.json23
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a77/pipeline.json8
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a78/branch.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a78/bus.json20
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a78/cache.json155
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a78/exception.json47
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a78/instruction.json80
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a78/memory.json23
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-a78/pipeline.json23
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x1/branch.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x1/bus.json20
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x1/cache.json155
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x1/exception.json47
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x1/instruction.json80
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x1/memory.json23
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x1/pipeline.json23
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x2/branch.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x2/bus.json20
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x2/cache.json155
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x2/exception.json47
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x2/instruction.json134
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x2/memory.json41
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x2/pipeline.json23
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/cortex-x2/trace.json29
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-e1/branch.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-e1/bus.json17
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-e1/cache.json107
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-e1/exception.json14
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-e1/instruction.json65
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-e1/memory.json23
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-e1/pipeline.json8
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-e1/spe.json14
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-n2/branch.json8
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-n2/bus.json20
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-n2/cache.json155
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-n2/exception.json47
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-n2/instruction.json143
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-n2/memory.json38
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-n2/other.json5
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-n2/pipeline.json23
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-n2/spe.json14
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-n2/trace.json29
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-v1/branch.json8
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-v1/bus.json20
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-v1/cache.json155
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-v1/exception.json47
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-v1/instruction.json89
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-v1/memory.json20
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-v1/other.json5
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/arm/neoverse-v1/pipeline.json23
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/cavium/thunderx2/core-imp-def.json87
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/common-and-microarch.json812
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/freescale/imx8mm/sys/ddrc.json39
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/freescale/imx8mm/sys/metrics.json18
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/freescale/imx8mn/sys/ddrc.json37
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/freescale/imx8mn/sys/metrics.json18
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/freescale/imx8mp/sys/ddrc.json37
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/freescale/imx8mp/sys/metrics.json466
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/freescale/imx8mq/sys/ddrc.json37
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/freescale/imx8mq/sys/metrics.json18
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/fujitsu/a64fx/branch.json8
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/fujitsu/a64fx/bus.json62
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/fujitsu/a64fx/cache.json128
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/fujitsu/a64fx/cycle.json5
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/fujitsu/a64fx/exception.json29
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/fujitsu/a64fx/instruction.json131
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/fujitsu/a64fx/memory.json8
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/fujitsu/a64fx/other.json188
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/fujitsu/a64fx/pipeline.json194
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/fujitsu/a64fx/sve.json110
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/hisilicon/hip08/metrics.json233
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json58
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/hisilicon/hip08/uncore-hha.json152
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/hisilicon/hip08/uncore-l3c.json93
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/hisilicon/hip09/sys/uncore-cpa.json81
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/mapfile.csv24
-rw-r--r--lib/libpmc/pmu-events/arch/arm64/recommended.json452
-rw-r--r--lib/libpmc/pmu-events/arch/x86/broadwell/pipeline.json4
-rw-r--r--lib/libpmc/pmu-events/arch/x86/broadwellde/pipeline.json4
-rw-r--r--lib/libpmc/pmu-events/arch/x86/broadwellx/pipeline.json4
-rw-r--r--lib/libpmc/pmu-events/arch/x86/cascadelakex/uncore-other.json2
-rw-r--r--lib/libpmc/pmu-events/arch/x86/silvermont/pipeline.json4
-rw-r--r--lib/libpmc/pmu-events/arch/x86/skylakex/uncore-other.json2
-rw-r--r--lib/libproc/Makefile5
-rw-r--r--lib/libproc/crc32.c57
-rw-r--r--lib/libproc/crc32.h28
-rw-r--r--lib/libproc/proc_sym.c21
-rw-r--r--lib/libprocstat/libprocstat.h1
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_error.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_mech_info.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_mechanisms.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_principal_name.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_get_versions.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_getcred.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_is_installed.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_max_data_length.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_mech_to_oid.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_oid_to_mech.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_qop_to_num.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_seccreate.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_set_callback.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_set_defaults.34
-rw-r--r--lib/librpcsec_gss/rpc_gss_set_svc_name.32
-rw-r--r--lib/librpcsec_gss/rpc_gss_svc_max_data_length.32
-rw-r--r--lib/librpcsec_gss/rpcsec_gss.31
-rw-r--r--lib/libsecureboot/Makefile.depend.host1
-rw-r--r--lib/libsecureboot/h/libsecureboot.h1
-rw-r--r--lib/libsecureboot/vets.c44
-rw-r--r--lib/libsysdecode/Makefile.depend1
-rw-r--r--lib/libthr/thread/thr_init.c51
-rw-r--r--lib/libthr/thread/thr_private.h2
-rw-r--r--lib/libthr/thread/thr_stack.c21
-rw-r--r--lib/libufs/Makefile2
-rw-r--r--lib/libufs/libufs.h10
-rw-r--r--lib/libufs/sblock.c108
-rw-r--r--lib/libufs/sbread.381
-rw-r--r--lib/libufs/type.c2
-rw-r--r--lib/libusb/Makefile7
-rw-r--r--lib/libusb/libusb-0.1.pc.in (renamed from lib/libusb/libusb-0.1.pc)5
-rw-r--r--lib/libusb/libusb-1.0.pc.in (renamed from lib/libusb/libusb-1.0.pc)5
-rw-r--r--lib/libusb/libusb-2.0.pc.in (renamed from lib/libusb/libusb-2.0.pc)5
-rw-r--r--lib/libusb/libusb.313
-rw-r--r--lib/libusb/libusb.h1
-rw-r--r--lib/libusb/libusb10.c22
-rw-r--r--lib/libutil/humanize_number.38
-rw-r--r--lib/libutil/kinfo_getvmmap.314
-rw-r--r--lib/libutil/login_tty.31
-rw-r--r--lib/libutil/pty.32
-rw-r--r--lib/libutil/pw_util.32
-rw-r--r--lib/libutil/quotafile.322
-rw-r--r--lib/libvmmapi/vmmapi.c40
-rw-r--r--lib/libvmmapi/vmmapi.h3
-rw-r--r--lib/libz/Makefile6
-rw-r--r--lib/msun/Makefile2
-rw-r--r--lib/msun/i387/s_ceil.S2
-rw-r--r--lib/msun/i387/s_ceilf.S2
-rw-r--r--lib/msun/i387/s_ceill.S2
-rw-r--r--lib/msun/i387/s_floor.S2
-rw-r--r--lib/msun/i387/s_floorf.S2
-rw-r--r--lib/msun/i387/s_floorl.S2
-rw-r--r--lib/msun/i387/s_trunc.S2
-rw-r--r--lib/msun/i387/s_truncf.S2
-rw-r--r--lib/msun/i387/s_truncl.S2
-rw-r--r--lib/msun/man/clog.32
-rw-r--r--lib/msun/man/cospi.34
-rw-r--r--lib/msun/man/sinpi.34
-rw-r--r--lib/msun/man/tanpi.38
-rw-r--r--lib/msun/src/e_jn.c12
-rw-r--r--lib/msun/src/e_lgamma_r.c2
-rw-r--r--lib/msun/src/k_tanf.c2
-rw-r--r--lib/msun/src/math.h11
-rw-r--r--lib/msun/src/s_cbrt.c2
-rw-r--r--lib/msun/src/s_cbrtl.c2
-rw-r--r--lib/msun/src/w_cabsf.c3
-rw-r--r--lib/msun/src/w_drem.c3
-rw-r--r--lib/msun/tests/fenv_test.c2
-rw-r--r--lib/ncurses/tinfo/Makefile4
-rw-r--r--lib/ofed/libirdma/Makefile1
602 files changed, 13078 insertions, 2108 deletions
diff --git a/lib/Makefile b/lib/Makefile
index 816374552f0a..6b4b356707fe 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -57,7 +57,6 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \
libexecinfo \
libexpat \
libfetch \
- libfigpar \
libgcc_eh \
libgcc_s \
libgeom \
@@ -78,7 +77,6 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \
libnetmap \
libnv \
libopenbsd \
- libopie \
libpam \
libpathconv \
libpcap \
@@ -133,8 +131,7 @@ SUBDIR_DEPEND_libgeom= libexpat libsbuf
SUBDIR_DEPEND_librpcsec_gss= libgssapi
SUBDIR_DEPEND_libmagic= libz
SUBDIR_DEPEND_libmemstat= libkvm
-SUBDIR_DEPEND_libopie= libmd
-SUBDIR_DEPEND_libpam= libcrypt libopie ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
+SUBDIR_DEPEND_libpam= libcrypt ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
SUBDIR_DEPEND_libpjdlog= libutil
SUBDIR_DEPEND_libprocstat= libkvm libutil
SUBDIR_DEPEND_libradius= libmd
@@ -170,7 +167,7 @@ SUBDIR+= clang
SUBDIR.${MK_CUSE}+= libcuse
SUBDIR.${MK_CXX}+= libdevdctl
SUBDIR.${MK_TOOLCHAIN}+=libpe
-SUBDIR.${MK_DIALOG}+= libdpv
+SUBDIR.${MK_DIALOG}+= libdpv libfigpar
SUBDIR.${MK_FILE}+= libmagic
SUBDIR.${MK_GPIO}+= libgpio
SUBDIR.${MK_GSSAPI}+= libgssapi librpcsec_gss
@@ -180,11 +177,8 @@ SUBDIR.${MK_LDNS}+= libldns
SUBDIR.${MK_STATS}+= libstats
# 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" || ${MACHINE_CPUARCH} == "riscv")
+# C++ support.
+.if ${COMPILER_TYPE} == "clang" && ${MK_CXX} != "no"
_libclang_rt= libclang_rt
.elif (${MK_ASAN} != "no" || ${MK_UBSAN} != "no") && make(all)
.error Requested build with sanitizers but cannot build runtime libraries!
diff --git a/lib/clang/llvm.build.mk b/lib/clang/llvm.build.mk
index dd54bf7312d9..cd8b523cb423 100644
--- a/lib/clang/llvm.build.mk
+++ b/lib/clang/llvm.build.mk
@@ -30,22 +30,21 @@ CFLAGS+= -DHAVE_VCS_VERSION_INC
CFLAGS+= -DNDEBUG
.endif
-TARGET_ARCH?= ${MACHINE_ARCH}
BUILD_ARCH?= ${MACHINE_ARCH}
# Armv6 and armv7 uses hard float abi, unless the CPUTYPE has soft in it.
# arm (for armv4 and armv5 CPUs) always uses the soft float ABI.
# For all other targets, we stick with 'unknown'.
-.if ${TARGET_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "")
-TARGET_ABI= -gnueabihf
-.elif ${TARGET_ARCH:Marm*}
-TARGET_ABI= -gnueabi
+.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "")
+TARGET_TRIPLE_ABI= -gnueabihf
+.elif ${MACHINE_ARCH:Marm*}
+TARGET_TRIPLE_ABI= -gnueabi
.else
-TARGET_ABI=
+TARGET_TRIPLE_ABI=
.endif
VENDOR= unknown
-LLVM_TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-freebsd${OS_REVISION}${TARGET_ABI}
+LLVM_TARGET_TRIPLE?= ${MACHINE_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-freebsd${OS_REVISION}${TARGET_TRIPLE_ABI}
LLVM_BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-freebsd${OS_REVISION}
CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${LLVM_TARGET_TRIPLE}\"
diff --git a/lib/flua/libjail/lua_jail.c b/lib/flua/libjail/lua_jail.c
index 025694bf1181..27db9c52f319 100644
--- a/lib/flua/libjail/lua_jail.c
+++ b/lib/flua/libjail/lua_jail.c
@@ -78,7 +78,7 @@ l_jail_filter(const char *param_name, void *data __unused)
/*
* Allowing lastjid will mess up our iteration over all jails on the
- * system, as this is a special paramter that indicates where the search
+ * system, as this is a special parameter that indicates where the search
* starts from. We'll always add jid and name, so just silently remove
* these.
*/
diff --git a/lib/geom/mirror/gmirror.8 b/lib/geom/mirror/gmirror.8
index 128138bbd2e4..c7d2b0e0e7ac 100644
--- a/lib/geom/mirror/gmirror.8
+++ b/lib/geom/mirror/gmirror.8
@@ -24,13 +24,29 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 30, 2017
+.Dd October 5, 2022
.Dt GMIRROR 8
.Os
.Sh NAME
.Nm gmirror
.Nd "control utility for mirrored devices"
.Sh SYNOPSIS
+To compile GEOM_MIRROR into your kernel, add the following lines to your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "options GEOM_MIRROR"
+.Ed
+.Pp
+Alternatively, to load the GEOM_MIRROR module at boot time, add the following
+line to your
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+geom_mirror_load="YES"
+.Ed
+.Pp
+.No Usage of the Nm
+utility:
+.Pp
.Nm
.Cm label
.Op Fl Fhnv
@@ -388,21 +404,26 @@ Reading a dump from the mirror on boot will only work if the
balance algorithm is used (that way
.Nm
will read only from the component with the highest priority).
-If you use a different balance algorithm, you should add:
+If you use a different balance algorithm, you should create an
+.Xr rc 8
+script that sets the balance algorithm to
+.Cm prefer ,
+for example with the following command:
.Bd -literal -offset indent
gmirror configure -b prefer data
.Ed
.Pp
-to the
-.Pa /etc/rc.early
-script and:
+Make sure that
+.Xr rcorder 8
+schedules the new script before
+.Xr savecore 8 .
+The desired balance algorithm can be restored later on
+by placing the following command in
+.Xr rc.local 8 :
.Bd -literal -offset indent
gmirror configure -b round-robin data
.Ed
.Pp
-to the
-.Pa /etc/rc.local
-script.
The decision which component to choose for dumping is made when
.Xr dumpon 8
is called.
diff --git a/lib/geom/part/gpart.8 b/lib/geom/part/gpart.8
index 4dbe45b9953e..81d5a7a2bb3c 100644
--- a/lib/geom/part/gpart.8
+++ b/lib/geom/part/gpart.8
@@ -221,7 +221,7 @@ MBR bootcode contains Volume Serial Number by default, and
.Nm
tries to preserve it when installing new bootstrap code.
This option skips preservation to help with some versions of
-.Xr boot0 8
+.Xr boot0cfg 8
that do not support Volume Serial Number.
.It Fl b Ar bootcode
Embed bootstrap code from the file
diff --git a/lib/libbegemot/Makefile b/lib/libbegemot/Makefile
index c5d3bb8badc2..6ce1310ae97b 100644
--- a/lib/libbegemot/Makefile
+++ b/lib/libbegemot/Makefile
@@ -25,3 +25,5 @@ MLINKS= rpoll.3 poll_register.3 \
rpoll.3 poll_dispatch.3
.include <bsd.lib.mk>
+
+CWARNFLAGS+= ${NO_WUSE_AFTER_FREE}
diff --git a/lib/libbsddialog/Makefile b/lib/libbsddialog/Makefile
index 08e5bebcb6a5..ddb7e08f71ba 100644
--- a/lib/libbsddialog/Makefile
+++ b/lib/libbsddialog/Makefile
@@ -6,6 +6,7 @@ LIB= bsddialog
PRIVATELIB= yes
SHLIB_MAJOR= 0
SRCS= barbox.c \
+ calendarbox.c \
formbox.c \
infobox.c \
lib_util.c \
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index 3667eea15307..c9150869f223 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -109,10 +109,7 @@ NOASM=
.include "${LIBC_SRCTOP}/net/Makefile.inc"
.include "${LIBC_SRCTOP}/nls/Makefile.inc"
.include "${LIBC_SRCTOP}/posix1e/Makefile.inc"
-.if ${LIBC_ARCH} != "aarch64" && \
- ${LIBC_ARCH} != "amd64" && \
- ${LIBC_ARCH} != "powerpc64" && \
- ${LIBC_ARCH} != "riscv"
+.if ${MACHINE_ABI:Mlong32}
.include "${LIBC_SRCTOP}/quad/Makefile.inc"
.endif
.include "${LIBC_SRCTOP}/regex/Makefile.inc"
@@ -162,7 +159,7 @@ CFLAGS+= -DSYMBOL_VERSIONING
# If there are no machine dependent sources, append all the
# machine-independent sources:
-.if empty(MDSRCS)
+.if empty(MDSRCS) || ${MK_MACHDEP_OPTIMIZATIONS} == no
SRCS+= ${MISRCS}
.else
# Append machine-dependent sources, then append machine-independent sources
diff --git a/lib/libc/aarch64/SYS.h b/lib/libc/aarch64/SYS.h
index 2cefc8c123d6..84b41028f2af 100644
--- a/lib/libc/aarch64/SYS.h
+++ b/lib/libc/aarch64/SYS.h
@@ -1,7 +1,6 @@
/*-
* Copyright (c) 2014 Andrew Turner
* Copyright (c) 2015 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Andrew Turner under
* sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/aarch64/gen/_ctx_start.S b/lib/libc/aarch64/gen/_ctx_start.S
index 8664f69667c3..6f3634c052a7 100644
--- a/lib/libc/aarch64/gen/_ctx_start.S
+++ b/lib/libc/aarch64/gen/_ctx_start.S
@@ -1,6 +1,5 @@
/*-
* Copyright (c) 2015 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Andrew Turner under
* sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/aarch64/gen/_setjmp.S b/lib/libc/aarch64/gen/_setjmp.S
index ae00195d3ff7..49bf4df4f524 100644
--- a/lib/libc/aarch64/gen/_setjmp.S
+++ b/lib/libc/aarch64/gen/_setjmp.S
@@ -1,7 +1,6 @@
/*-
* Copyright (c) 2014 Andrew Turner
* Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
*
* Portions of this software were developed by Andrew Turner
* under sponsorship from the FreeBSD Foundation
diff --git a/lib/libc/aarch64/gen/fabs.S b/lib/libc/aarch64/gen/fabs.S
index 2f5fd06dec6c..a6a1873c82fa 100644
--- a/lib/libc/aarch64/gen/fabs.S
+++ b/lib/libc/aarch64/gen/fabs.S
@@ -1,6 +1,5 @@
/*-
* Copyright (c) 2015 The FreeBSD Foundation
- * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/lib/libc/aarch64/gen/fpgetmask.c b/lib/libc/aarch64/gen/fpgetmask.c
index afc05b479a44..aa0d88e99238 100644
--- a/lib/libc/aarch64/gen/fpgetmask.c
+++ b/lib/libc/aarch64/gen/fpgetmask.c
@@ -1,6 +1,5 @@
/*-
* Copyright (c) 2015 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Andrew Turner under
* sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/aarch64/gen/fpsetmask.c b/lib/libc/aarch64/gen/fpsetmask.c
index de9ac043b472..15f59d377653 100644
--- a/lib/libc/aarch64/gen/fpsetmask.c
+++ b/lib/libc/aarch64/gen/fpsetmask.c
@@ -1,6 +1,5 @@
/*-
* Copyright (c) 2015 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Andrew Turner under
* sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/aarch64/gen/makecontext.c b/lib/libc/aarch64/gen/makecontext.c
index 747d2c53b198..a87541d57608 100644
--- a/lib/libc/aarch64/gen/makecontext.c
+++ b/lib/libc/aarch64/gen/makecontext.c
@@ -1,6 +1,5 @@
/*-
* Copyright (c) 2015 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Andrew Turner under
* sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/aarch64/gen/setjmp.S b/lib/libc/aarch64/gen/setjmp.S
index 7d68406f00be..b302594ff549 100644
--- a/lib/libc/aarch64/gen/setjmp.S
+++ b/lib/libc/aarch64/gen/setjmp.S
@@ -1,7 +1,6 @@
/*-
* Copyright (c) 2014 Andrew Turner
* Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
*
* Portions of this software were developed by Andrew Turner
* under sponsorship from the FreeBSD Foundation
diff --git a/lib/libc/aarch64/gen/sigsetjmp.S b/lib/libc/aarch64/gen/sigsetjmp.S
index 917e1ef6ee56..e0d0cd1aba20 100644
--- a/lib/libc/aarch64/gen/sigsetjmp.S
+++ b/lib/libc/aarch64/gen/sigsetjmp.S
@@ -1,6 +1,5 @@
/*-
* Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Andrew Turner under
* sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/aarch64/sys/cerror.S b/lib/libc/aarch64/sys/cerror.S
index 7e1627dc8ab8..a85b6b242a41 100644
--- a/lib/libc/aarch64/sys/cerror.S
+++ b/lib/libc/aarch64/sys/cerror.S
@@ -1,6 +1,5 @@
/*-
* 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
diff --git a/lib/libc/aarch64/sys/syscall.S b/lib/libc/aarch64/sys/syscall.S
index 63148357d567..bd460279e4a0 100644
--- a/lib/libc/aarch64/sys/syscall.S
+++ b/lib/libc/aarch64/sys/syscall.S
@@ -1,6 +1,5 @@
/*-
* Copyright (c) 2014 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Andrew Turner under
* sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/aarch64/sys/vfork.S b/lib/libc/aarch64/sys/vfork.S
index daecd1f04a33..77c1e0cfb0e2 100644
--- a/lib/libc/aarch64/sys/vfork.S
+++ b/lib/libc/aarch64/sys/vfork.S
@@ -1,6 +1,5 @@
/*-
* 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
diff --git a/lib/libc/capability/cap_rights_init.3 b/lib/libc/capability/cap_rights_init.3
index 9695a188e317..e823a5a1496b 100644
--- a/lib/libc/capability/cap_rights_init.3
+++ b/lib/libc/capability/cap_rights_init.3
@@ -1,6 +1,5 @@
.\"
.\" Copyright (c) 2013 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by Pawel Jakub Dawidek under sponsorship
.\" from the FreeBSD Foundation.
diff --git a/lib/libc/gdtoa/machdep_ldisQ.c b/lib/libc/gdtoa/machdep_ldisQ.c
index a64f889b6e23..e7f6d19d50c2 100644
--- a/lib/libc/gdtoa/machdep_ldisQ.c
+++ b/lib/libc/gdtoa/machdep_ldisQ.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/gdtoa/machdep_ldisd.c b/lib/libc/gdtoa/machdep_ldisd.c
index 456d782a2a8a..f000f2a8ab71 100644
--- a/lib/libc/gdtoa/machdep_ldisd.c
+++ b/lib/libc/gdtoa/machdep_ldisd.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/gdtoa/machdep_ldisx.c b/lib/libc/gdtoa/machdep_ldisx.c
index ad918a03d52f..69e0ea16c8da 100644
--- a/lib/libc/gdtoa/machdep_ldisx.c
+++ b/lib/libc/gdtoa/machdep_ldisx.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 395edefc0503..45977b6b9005 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -493,7 +493,10 @@ MLINKS+=rand48.3 _rand48.3 \
rand48.3 seed48.3 \
rand48.3 srand48.3
MLINKS+=recv.2 recvmmsg.2
-MLINKS+=scandir.3 alphasort.3
+MLINKS+=scandir.3 alphasort.3 \
+ scandir.3 scandirat.3 \
+ scandir.3 scandir_b.3 \
+ scandir.3 versionsort.3
MLINKS+=sem_open.3 sem_close.3 \
sem_open.3 sem_unlink.3
MLINKS+=sem_wait.3 sem_trywait.3
diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map
index 012c9ff11f04..0a20a41d0e20 100644
--- a/lib/libc/gen/Symbol.map
+++ b/lib/libc/gen/Symbol.map
@@ -439,9 +439,11 @@ FBSD_1.7 {
posix_spawn_file_actions_addchdir_np;
posix_spawn_file_actions_addclosefrom_np;
posix_spawn_file_actions_addfchdir_np;
+ scandirat;
sched_getaffinity;
sched_setaffinity;
sched_getcpu;
+ versionsort;
__cpuset_alloc;
__cpuset_free;
};
diff --git a/lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c b/lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c
index 1c566ecf4809..197d77c69541 100644
--- a/lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c
+++ b/lib/libc/gen/__pthread_mutex_init_calloc_cb_stub.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/gen/arc4random.c b/lib/libc/gen/arc4random.c
index aecbdb8911bd..07e31e64e758 100644
--- a/lib/libc/gen/arc4random.c
+++ b/lib/libc/gen/arc4random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc4random.c,v 1.55 2019/03/24 17:56:54 deraadt Exp $ */
+/* $OpenBSD: arc4random.c,v 1.58 2022/07/31 13:41:45 tb Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$");
#define BLOCKSZ 64
#define RSBUFSZ (16*BLOCKSZ)
+#define REKEY_BASE (1024*1024) /* NB. should be a power of 2 */
+
/* Marked INHERIT_ZERO, so zero'd out in fork children. */
static struct _rs {
size_t rs_have; /* valid bytes at end of rs_buf */
@@ -106,6 +108,7 @@ static void
_rs_stir(void)
{
u_char rnd[KEYSZ + IVSZ];
+ uint32_t rekey_fuzz = 0;
#if defined(__FreeBSD__)
bool need_init;
@@ -152,7 +155,10 @@ _rs_stir(void)
rs->rs_have = 0;
memset(rsx->rs_buf, 0, sizeof(rsx->rs_buf));
- rs->rs_count = 1600000;
+ /* rekey interval should not be predictable */
+ chacha_encrypt_bytes(&rsx->rs_chacha, (uint8_t *)&rekey_fuzz,
+ (uint8_t *)&rekey_fuzz, sizeof(rekey_fuzz));
+ rs->rs_count = REKEY_BASE + (rekey_fuzz % REKEY_BASE);
}
static inline void
diff --git a/lib/libc/gen/auxv.3 b/lib/libc/gen/auxv.3
index 007e8066c791..bf09eb0286be 100644
--- a/lib/libc/gen/auxv.3
+++ b/lib/libc/gen/auxv.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 17, 2019
+.Dd September 16, 2022
.Dt ELF_AUX_INFO 3
.Os
.Sh NAME
@@ -79,6 +79,10 @@ Page size in bytes
.It AT_TIMEKEEP
Pointer to VDSO timehands (for library internal use,
.Dv sizeof(void *)).
+.It AT_USRSTACKBASE
+Top of the user stack for main thread.
+.It AT_USRSTACKLIM
+Limit for grow of the user stack for main thread.
.El
.Sh RETURN VALUES
Returns zero on success, or an error number on failure.
diff --git a/lib/libc/gen/auxv.c b/lib/libc/gen/auxv.c
index ae21d088a8d1..af59a2dda90a 100644
--- a/lib/libc/gen/auxv.c
+++ b/lib/libc/gen/auxv.c
@@ -73,6 +73,7 @@ static char *canary, *pagesizes, *execpath;
static void *ps_strings, *timekeep;
static u_long hwcap, hwcap2;
static void *fxrng_seed_version;
+static u_long usrstackbase, usrstacklim;
#ifdef __powerpc__
static int powerpc_new_auxv_format = 0;
@@ -144,6 +145,14 @@ init_aux(void)
case AT_FXRNG:
fxrng_seed_version = aux->a_un.a_ptr;
break;
+
+ case AT_USRSTACKBASE:
+ usrstackbase = aux->a_un.a_val;
+ break;
+
+ case AT_USRSTACKLIM:
+ usrstacklim = aux->a_un.a_val;
+ break;
#ifdef __powerpc__
/*
* Since AT_STACKPROT is always set, and the common
@@ -370,6 +379,20 @@ _elf_aux_info(int aux, void *buf, int buflen)
} else
res = EINVAL;
break;
+ case AT_USRSTACKBASE:
+ if (buflen == sizeof(u_long)) {
+ *(u_long *)buf = usrstackbase;
+ res = 0;
+ } else
+ res = EINVAL;
+ break;
+ case AT_USRSTACKLIM:
+ if (buflen == sizeof(u_long)) {
+ *(u_long *)buf = usrstacklim;
+ res = 0;
+ } else
+ res = EINVAL;
+ break;
default:
res = ENOENT;
break;
diff --git a/lib/libc/gen/cap_rights_get.3 b/lib/libc/gen/cap_rights_get.3
index 521f3cde25c5..21815b73aa71 100644
--- a/lib/libc/gen/cap_rights_get.3
+++ b/lib/libc/gen/cap_rights_get.3
@@ -1,6 +1,5 @@
.\"
.\" Copyright (c) 2013 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by Pawel Jakub Dawidek under sponsorship
.\" from the FreeBSD Foundation.
diff --git a/lib/libc/gen/cap_sandboxed.3 b/lib/libc/gen/cap_sandboxed.3
index 5dc5c8be6570..0db42276ca28 100644
--- a/lib/libc/gen/cap_sandboxed.3
+++ b/lib/libc/gen/cap_sandboxed.3
@@ -1,6 +1,5 @@
.\"
.\" Copyright (c) 2012 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by Pawel Jakub Dawidek under sponsorship
.\" from the FreeBSD Foundation.
diff --git a/lib/libc/gen/cap_sandboxed.c b/lib/libc/gen/cap_sandboxed.c
index fd16c4845dce..f81d12217e33 100644
--- a/lib/libc/gen/cap_sandboxed.c
+++ b/lib/libc/gen/cap_sandboxed.c
@@ -2,7 +2,6 @@
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2012 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Pawel Jakub Dawidek under sponsorship from
* the FreeBSD Foundation.
diff --git a/lib/libc/gen/dlopen.3 b/lib/libc/gen/dlopen.3
index 8bafb0897fd9..9cd572ef7165 100644
--- a/lib/libc/gen/dlopen.3
+++ b/lib/libc/gen/dlopen.3
@@ -326,11 +326,9 @@ triggering compiler diagnostics.
(The
.Fn dlsym
function
-returns a data pointer; in the C standard, conversions between
-data and function pointer types are undefined.
-Some compilers and
-.Xr lint 1
-utilities warn about such casts.)
+returns an object pointer; in the C standard, conversions between
+object and function pointer types are undefined.
+Some compilers and lint utilities warn about such casts.)
The precise return type of
.Fn dlfunc
is unspecified; applications must cast it to an appropriate function pointer
diff --git a/lib/libc/gen/elf_utils.c b/lib/libc/gen/elf_utils.c
index fbf3bf17082c..ed3ac843f7c3 100644
--- a/lib/libc/gen/elf_utils.c
+++ b/lib/libc/gen/elf_utils.c
@@ -28,7 +28,8 @@
* $FreeBSD$
*/
-#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/auxv.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/sysctl.h>
@@ -77,19 +78,23 @@ __libc_map_stacks_exec(void)
{
int mib[2];
struct rlimit rlim;
- u_long usrstack;
+ u_long usrstack, stacksz;
size_t len;
- mib[0] = CTL_KERN;
- mib[1] = KERN_USRSTACK;
- len = sizeof(usrstack);
- if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), &usrstack, &len, NULL, 0)
- == -1)
- return;
- if (getrlimit(RLIMIT_STACK, &rlim) == -1)
- return;
- mprotect((void *)(uintptr_t)(usrstack - rlim.rlim_cur),
- rlim.rlim_cur, _rtld_get_stack_prot());
+ if (_elf_aux_info(AT_USRSTACKBASE, &usrstack, sizeof(usrstack)) != 0) {
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_USRSTACK;
+ len = sizeof(usrstack);
+ if (sysctl(mib, nitems(mib), &usrstack, &len, NULL, 0) == -1)
+ return;
+ }
+ if (_elf_aux_info(AT_USRSTACKLIM, &stacksz, sizeof(stacksz)) != 0) {
+ if (getrlimit(RLIMIT_STACK, &rlim) == -1)
+ return;
+ stacksz = rlim.rlim_cur;
+ }
+ mprotect((void *)(uintptr_t)(usrstack - stacksz), stacksz,
+ _rtld_get_stack_prot());
}
#pragma weak __pthread_map_stacks_exec
diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c
index a14905cc0747..406705459938 100644
--- a/lib/libc/gen/fnmatch.c
+++ b/lib/libc/gen/fnmatch.c
@@ -8,7 +8,7 @@
* Guido van Rossum.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c
index b014c8b716fa..2e8bf6310641 100644
--- a/lib/libc/gen/glob.c
+++ b/lib/libc/gen/glob.c
@@ -8,7 +8,7 @@
* Guido van Rossum.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/gen/memalign.c b/lib/libc/gen/memalign.c
index ff1c967482cd..4f5ea2fd61fd 100644
--- a/lib/libc/gen/memalign.c
+++ b/lib/libc/gen/memalign.c
@@ -1,6 +1,5 @@
/*-
* Copyright (c) 2020 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/gen/scandir-compat11.c b/lib/libc/gen/scandir-compat11.c
index 2c86b548f1d9..fe8d34d4b7d6 100644
--- a/lib/libc/gen/scandir-compat11.c
+++ b/lib/libc/gen/scandir-compat11.c
@@ -58,8 +58,8 @@ __FBSDID("$FreeBSD$");
#define SELECT(x) select(x)
-static int freebsd11_alphasort_thunk(void *thunk, const void *p1,
- const void *p2);
+static int freebsd11_scandir_thunk_cmp(const void *p1, const void *p2,
+ void *thunk);
int
freebsd11_scandir(const char *dirname, struct freebsd11_dirent ***namelist,
@@ -116,7 +116,7 @@ freebsd11_scandir(const char *dirname, struct freebsd11_dirent ***namelist,
closedir(dirp);
if (numitems && dcomp != NULL)
qsort_r(names, numitems, sizeof(struct freebsd11_dirent *),
- &dcomp, freebsd11_alphasort_thunk);
+ freebsd11_scandir_thunk_cmp, &dcomp);
*namelist = names;
return (numitems);
@@ -141,7 +141,7 @@ freebsd11_alphasort(const struct freebsd11_dirent **d1,
}
static int
-freebsd11_alphasort_thunk(void *thunk, const void *p1, const void *p2)
+freebsd11_scandir_thunk_cmp(const void *p1, const void *p2, void *thunk)
{
int (*dc)(const struct freebsd11_dirent **, const struct
freebsd11_dirent **);
diff --git a/lib/libc/gen/scandir.3 b/lib/libc/gen/scandir.3
index 7f9891343a1a..07d8074ae592 100644
--- a/lib/libc/gen/scandir.3
+++ b/lib/libc/gen/scandir.3
@@ -28,23 +28,46 @@
.\" @(#)scandir.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd January 3, 2010
+.Dd August 23, 2022
.Dt SCANDIR 3
.Os
.Sh NAME
.Nm scandir ,
-.Nm alphasort
+.Nm scandirat ,
+.Nm scandir_b ,
+.Nm alphasort ,
+.Nm versionsort
.Nd scan a directory
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In dirent.h
.Ft int
-.Fn scandir "const char *dirname" "struct dirent ***namelist" "int \*(lp*select\*(rp\*(lpconst struct dirent *\*(rp" "int \*(lp*compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp"
+.Fo scandir
+.Fa "const char *dirname"
+.Fa "struct dirent ***namelist"
+.Fa "int \*(lp*select\*(rp\*(lpconst struct dirent *\*(rp"
+.Fa "int \*(lp*compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp"
+.Fc
+.Ft
+.Fo scandirat
+.Fa int dirfd
+.Fa "const char *dirname"
+.Fa "struct dirent ***namelist"
+.Fa "int \*(lp*select\*(rp\*(lpconst struct dirent *\*(rp"
+.Fa "int \*(lp*compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp"
+.Fc
.Ft int
-.Fn scandir_b "const char *dirname" "struct dirent ***namelist" "int \*(lp*select\^(rp\*(lpconst struct dirent *\*(rp" "int \*(lp^compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp"
+.Fo scandir_b
+.Fa "const char *dirname"
+.Fa "struct dirent ***namelist"
+.Fa "int \*(lp*select\^(rp\*(lpconst struct dirent *\*(rp"
+.Fa "int \*(lp^compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp"
+.Fc
.Ft int
.Fn alphasort "const struct dirent **d1" "const struct dirent **d2"
+.Ft int
+.Fn versionsort "const struct dirent **d1" "const struct dirent **d2"
.Sh DESCRIPTION
The
.Fn scandir
@@ -86,11 +109,51 @@ is a routine which can be used for the
argument to sort the array alphabetically using
.Xr strcoll 3 .
.Pp
+The
+.Fn versionsort
+function is a routine which can be used for the
+.Fa compar
+argument to sort the array naturally using
+.Xr strverscmp 3 .
+.Pp
The memory allocated for the array can be deallocated with
.Xr free 3 ,
by freeing each pointer in the array and then the array itself.
.Pp
The
+.Fn scandirat
+function is similar to
+.Fn scandir ,
+but takes an additional
+.Fa dirfd
+argument.
+If the supplied
+.Fa dirname
+is absolute, the function's behavior is identical to that of
+.Fn scandir ,
+the
+.Fa dirfd
+argument is unused.
+If
+.Fa dirname
+is relative,
+.Fa dirfd
+must be a valid file descriptor referencing a directory, in
+which case the
+.Fa dirname
+lookup is performed relative to the directory referenced by
+.Fa dirfd .
+If
+.Fa dirfd
+has the special value
+.Va AT_FDCWD ,
+then the current process directory is used as the base for
+relative lookups.
+See
+.Xr openat 2
+for additional details.
+.Pp
+The
.Fn scandir_b
function behaves in the same way as
.Fn scandir ,
@@ -103,11 +166,17 @@ Returns \-1 if the directory cannot be opened for reading or if
.Xr malloc 3
cannot allocate enough memory to hold all the data structures.
.Sh SEE ALSO
+.Xr openat 2 ,
.Xr directory 3 ,
.Xr malloc 3 ,
.Xr qsort 3 ,
.Xr strcoll 3 ,
+.Xr strverscmp 3 ,
.Xr dir 5
+.Sh STANDARDS
+The
+.Fn versionsort
+function is a GNU extension and conforms to no standard.
.Sh HISTORY
The
.Fn scandir
@@ -115,3 +184,10 @@ and
.Fn alphasort
functions appeared in
.Bx 4.2 .
+The
+.Fn scandirat
+and
+.Fn
+versionsort
+functions were added in
+.Fx 14.0 .
diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c
index 10cd7633dac1..4f40678513dd 100644
--- a/lib/libc/gen/scandir.c
+++ b/lib/libc/gen/scandir.c
@@ -42,8 +42,10 @@ __FBSDID("$FreeBSD$");
#include "namespace.h"
#include <dirent.h>
+#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "un-namespace.h"
#ifdef I_AM_SCANDIR_B
@@ -61,25 +63,21 @@ typedef DECLARE_BLOCK(int, select_block, const struct dirent *);
typedef DECLARE_BLOCK(int, dcomp_block, const struct dirent **,
const struct dirent **);
#else
-static int alphasort_thunk(void *thunk, const void *p1, const void *p2);
+static int scandir_thunk_cmp(const void *p1, const void *p2, void *thunk);
#endif
-int
+static int
#ifdef I_AM_SCANDIR_B
-scandir_b(const char *dirname, struct dirent ***namelist, select_block select,
+scandir_b_dirp(DIR *dirp, struct dirent ***namelist, select_block select,
dcomp_block dcomp)
#else
-scandir(const char *dirname, struct dirent ***namelist,
+scandir_dirp(DIR *dirp, struct dirent ***namelist,
int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **,
- const struct dirent **))
+ const struct dirent **))
#endif
{
struct dirent *d, *p, **names = NULL;
size_t arraysz, numitems;
- DIR *dirp;
-
- if ((dirp = opendir(dirname)) == NULL)
- return(-1);
numitems = 0;
arraysz = 32; /* initial estimate of the array size */
@@ -125,7 +123,7 @@ scandir(const char *dirname, struct dirent ***namelist,
qsort_b(names, numitems, sizeof(struct dirent *), (void*)dcomp);
#else
qsort_r(names, numitems, sizeof(struct dirent *),
- &dcomp, alphasort_thunk);
+ scandir_thunk_cmp, &dcomp);
#endif
*namelist = names;
return (numitems);
@@ -138,7 +136,50 @@ fail:
return (-1);
}
+int
+#ifdef I_AM_SCANDIR_B
+scandir_b(const char *dirname, struct dirent ***namelist, select_block select,
+ dcomp_block dcomp)
+#else
+scandir(const char *dirname, struct dirent ***namelist,
+ int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **,
+ const struct dirent **))
+#endif
+{
+ DIR *dirp;
+
+ dirp = opendir(dirname);
+ if (dirp == NULL)
+ return (-1);
+ return (
+#ifdef I_AM_SCANDIR_B
+ scandir_b_dirp
+#else
+ scandir_dirp
+#endif
+ (dirp, namelist, select, dcomp));
+}
+
#ifndef I_AM_SCANDIR_B
+int
+scandirat(int dirfd, const char *dirname, struct dirent ***namelist,
+ int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **,
+ const struct dirent **))
+{
+ DIR *dirp;
+ int fd;
+
+ fd = _openat(dirfd, dirname, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
+ if (fd == -1)
+ return (-1);
+ dirp = fdopendir(fd);
+ if (dirp == NULL) {
+ _close(fd);
+ return (-1);
+ }
+ return (scandir_dirp(dirp, namelist, select, dcomp));
+}
+
/*
* Alphabetic order comparison routine for those who want it.
* POSIX 2008 requires that alphasort() uses strcoll().
@@ -150,8 +191,15 @@ alphasort(const struct dirent **d1, const struct dirent **d2)
return (strcoll((*d1)->d_name, (*d2)->d_name));
}
+int
+versionsort(const struct dirent **d1, const struct dirent **d2)
+{
+
+ return (strverscmp((*d1)->d_name, (*d2)->d_name));
+}
+
static int
-alphasort_thunk(void *thunk, const void *p1, const void *p2)
+scandir_thunk_cmp(const void *p1, const void *p2, void *thunk)
{
int (*dc)(const struct dirent **, const struct dirent **);
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c
index a466b4cbc49e..8d48f7f32836 100644
--- a/lib/libc/gen/syslog.c
+++ b/lib/libc/gen/syslog.c
@@ -65,7 +65,9 @@ static int LogFile = -1; /* fd for log */
static bool connected; /* have done connect */
static int opened; /* have done openlog() */
static int LogStat = 0; /* status bits, set by openlog() */
+static pid_t LogPid = -1; /* process id to tag the entry with */
static const char *LogTag = NULL; /* string to tag the entry with */
+static int LogTagLength = -1; /* usable part of LogTag */
static int LogFacility = LOG_USER; /* default facility code */
static int LogMask = 0xff; /* mask of priorities to be logged */
static pthread_mutex_t syslog_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -85,6 +87,7 @@ static pthread_mutex_t syslog_mutex = PTHREAD_MUTEX_INITIALIZER;
static void disconnectlog(void); /* disconnect from syslogd */
static void connectlog(void); /* (re)connect to syslogd */
static void openlog_unlocked(const char *, int, int);
+static void parse_tag(void); /* parse ident[NNN] if needed */
/*
* Format of the magic cookie passed through the stdio hook
@@ -204,13 +207,20 @@ vsyslog1(int pri, const char *fmt, va_list ap)
/* Application name. */
if (LogTag == NULL)
LogTag = _getprogname();
- (void)fprintf(fp, "%s ", LogTag == NULL ? NILVALUE : LogTag);
+ else if (LogTagLength == -1)
+ parse_tag();
+ if (LogTagLength > 0)
+ (void)fprintf(fp, "%.*s ", LogTagLength, LogTag);
+ else
+ (void)fprintf(fp, "%s ", LogTag == NULL ? NILVALUE : LogTag);
/*
* Provide the process ID regardless of whether LOG_PID has been
* specified, as it provides valuable information. Many
* applications tend not to use this, even though they should.
*/
- (void)fprintf(fp, "%d ", getpid());
+ if (LogPid == -1)
+ LogPid = getpid();
+ (void)fprintf(fp, "%d ", (int)LogPid);
/* Message ID. */
(void)fputs(NILVALUE " ", fp);
/* Structured data. */
@@ -398,9 +408,12 @@ connectlog(void)
static void
openlog_unlocked(const char *ident, int logstat, int logfac)
{
- if (ident != NULL)
+ if (ident != NULL) {
LogTag = ident;
+ LogTagLength = -1;
+ }
LogStat = logstat;
+ parse_tag();
if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0)
LogFacility = logfac;
@@ -430,6 +443,7 @@ closelog(void)
LogFile = -1;
}
LogTag = NULL;
+ LogTagLength = -1;
connected = false;
THREAD_UNLOCK();
}
@@ -447,3 +461,37 @@ setlogmask(int pmask)
THREAD_UNLOCK();
return (omask);
}
+
+/*
+ * Obtain LogPid from LogTag formatted as following: ident[NNN]
+ */
+static void
+parse_tag(void)
+{
+ char *begin, *end, *p;
+ pid_t pid;
+
+ if (LogTag == NULL || (LogStat & LOG_PID) != 0)
+ return;
+ /*
+ * LogTagLength is -1 if LogTag was not parsed yet.
+ * Avoid multiple passes over same LogTag.
+ */
+ LogTagLength = 0;
+
+ /* Check for presence of opening [ and non-empty ident. */
+ if ((begin = strchr(LogTag, '[')) == NULL || begin == LogTag)
+ return;
+ /* Check for presence of closing ] at the very end and non-empty pid. */
+ if ((end = strchr(begin + 1, ']')) == NULL || end[1] != 0 ||
+ (end - begin) < 2)
+ return;
+
+ /* Check for pid to contain digits only. */
+ pid = (pid_t)strtol(begin + 1, &p, 10);
+ if (p != end)
+ return;
+
+ LogPid = pid;
+ LogTagLength = begin - LogTag;
+}
diff --git a/lib/libc/iconv/bsd_iconv.c b/lib/libc/iconv/bsd_iconv.c
index 0fcff0e2d1b8..5a0f523b9d15 100644
--- a/lib/libc/iconv/bsd_iconv.c
+++ b/lib/libc/iconv/bsd_iconv.c
@@ -56,8 +56,6 @@
static iconv_t
__bsd___iconv_open(const char *out, const char *in, struct _citrus_iconv *handle)
{
- const char *out_slashes;
- char *out_noslashes;
int ret;
/*
@@ -66,19 +64,7 @@ __bsd___iconv_open(const char *out, const char *in, struct _citrus_iconv *handle
* This is for compatibility with software that uses these
* blindly.
*/
- out_slashes = strstr(out, "//");
- if (out_slashes != NULL) {
- out_noslashes = strndup(out, out_slashes - out);
- if (out_noslashes == NULL) {
- errno = ENOMEM;
- return ((iconv_t)-1);
- }
- ret = _citrus_iconv_open(&handle, in, out_noslashes);
- free(out_noslashes);
- } else {
- ret = _citrus_iconv_open(&handle, in, out);
- }
-
+ ret = _citrus_iconv_open(&handle, in, out);
if (ret) {
errno = ret == ENOENT ? EINVAL : ret;
return ((iconv_t)-1);
diff --git a/lib/libc/iconv/citrus_iconv.c b/lib/libc/iconv/citrus_iconv.c
index fbabf6524399..88dfc2deca33 100644
--- a/lib/libc/iconv/citrus_iconv.c
+++ b/lib/libc/iconv/citrus_iconv.c
@@ -126,7 +126,12 @@ open_shared(struct _citrus_iconv_shared * __restrict * __restrict rci,
* See gettext-0.18.3+ NEWS:
* msgfmt now checks PO file headers more strictly with less
* false-positives.
- * NetBSD don't do this either.
+ * NetBSD, also, doesn't do the below pass-through.
+ *
+ * Also note that this currently falls short if dst options have been
+ * specified. It may be the case that we want to ignore EILSEQ, in which
+ * case we should also select iconv_std anyways. This trick, while
+ * clever, may not be worth it.
*/
module = (strcmp(src, dst) != 0) ? "iconv_std" : "iconv_none";
#else
@@ -279,7 +284,7 @@ _citrus_iconv_open(struct _citrus_iconv * __restrict * __restrict rcv,
{
struct _citrus_iconv *cv = NULL;
struct _citrus_iconv_shared *ci = NULL;
- char realdst[PATH_MAX], realsrc[PATH_MAX];
+ char realdst[PATH_MAX], realsrc[PATH_MAX], *slashes;
#ifdef _PATH_ICONV
char buf[PATH_MAX], path[PATH_MAX];
#endif
@@ -293,16 +298,25 @@ _citrus_iconv_open(struct _citrus_iconv * __restrict * __restrict rcv,
if ((strcmp(dst, "") == 0) || (strcmp(dst, "char") == 0))
dst = nl_langinfo(CODESET);
+ strlcpy(realsrc, src, (size_t)PATH_MAX);
+ if ((slashes = strstr(realsrc, "//")) != NULL)
+ *slashes = '\0';
+ strlcpy(realdst, dst, (size_t)PATH_MAX);
+ if ((slashes = strstr(realdst, "//")) != NULL)
+ *slashes = '\0';
+
/* resolve codeset name aliases */
#ifdef _PATH_ICONV
+ /*
+ * Note that the below reads from realsrc and realdst while it's
+ * repopulating (writing to) realsrc and realdst, but it's done so with
+ * a trip through `buf`.
+ */
snprintf(path, sizeof(path), "%s/%s", _PATH_ICONV, _CITRUS_ICONV_ALIAS);
- strlcpy(realsrc, _lookup_alias(path, src, buf, (size_t)PATH_MAX,
+ strlcpy(realsrc, _lookup_alias(path, realsrc, buf, (size_t)PATH_MAX,
_LOOKUP_CASE_IGNORE), (size_t)PATH_MAX);
- strlcpy(realdst, _lookup_alias(path, dst, buf, (size_t)PATH_MAX,
+ strlcpy(realdst, _lookup_alias(path, realdst, buf, (size_t)PATH_MAX,
_LOOKUP_CASE_IGNORE), (size_t)PATH_MAX);
-#else
- strlcpy(realsrc, src, (size_t)PATH_MAX);
- strlcpy(realdst, dst, (size_t)PATH_MAX);
#endif
/* sanity check */
diff --git a/lib/libc/iconv/citrus_module.c b/lib/libc/iconv/citrus_module.c
index 64ef0271ea18..bd173b41bb04 100644
--- a/lib/libc/iconv/citrus_module.c
+++ b/lib/libc/iconv/citrus_module.c
@@ -106,7 +106,7 @@
#include <string.h>
#include <unistd.h>
-#define I18NMODULE_MAJOR 4
+#define I18NMODULE_MAJOR 5
#include "citrus_namespace.h"
#include "citrus_bcs.h"
diff --git a/lib/libc/iconv/citrus_namespace.h b/lib/libc/iconv/citrus_namespace.h
index 4244c70d701e..ef2c01b97f06 100644
--- a/lib/libc/iconv/citrus_namespace.h
+++ b/lib/libc/iconv/citrus_namespace.h
@@ -223,6 +223,7 @@
#define _stdenc_wctomb _citrus_stdenc_wctomb
#define _stdenc_put_state_reset _citrus_stdenc_put_state_reset
#define _stdenc_get_state_size _citrus_stdenc_get_state_size
+#define _stdenc_get_mb_cur_min _citrus_stdenc_get_mb_cur_min
#define _stdenc_get_mb_cur_max _citrus_stdenc_get_mb_cur_max
#define _stdenc_get_state_desc _citrus_stdenc_get_state_desc
#define _STDENC_SDID_GENERIC _CITRUS_STDENC_SDID_GENERIC
diff --git a/lib/libc/iconv/citrus_stdenc.h b/lib/libc/iconv/citrus_stdenc.h
index a643b77a27aa..da48093c15da 100644
--- a/lib/libc/iconv/citrus_stdenc.h
+++ b/lib/libc/iconv/citrus_stdenc.h
@@ -115,6 +115,20 @@ _citrus_stdenc_get_state_size(struct _citrus_stdenc *ce)
return (ce->ce_traits->et_state_size);
}
+static __inline size_t
+_citrus_stdenc_get_mb_cur_min(struct _citrus_stdenc *ce)
+{
+
+ return (ce->ce_traits->et_mb_cur_min);
+}
+
+static __inline size_t
+_citrus_stdenc_get_mb_cur_max(struct _citrus_stdenc *ce)
+{
+
+ return (ce->ce_traits->et_mb_cur_max);
+}
+
static __inline int
_citrus_stdenc_get_state_desc(struct _citrus_stdenc * __restrict ce,
void * __restrict ps, int id,
diff --git a/lib/libc/iconv/citrus_stdenc_local.h b/lib/libc/iconv/citrus_stdenc_local.h
index 2af3b8a992b7..9e4b827e830b 100644
--- a/lib/libc/iconv/citrus_stdenc_local.h
+++ b/lib/libc/iconv/citrus_stdenc_local.h
@@ -149,6 +149,8 @@ struct _citrus_stdenc_traits {
/* version 0x00000001 */
size_t et_state_size;
size_t et_mb_cur_max;
+ /* version 0x00000005 */
+ size_t et_mb_cur_min;
};
struct _citrus_stdenc {
diff --git a/lib/libc/iconv/citrus_stdenc_template.h b/lib/libc/iconv/citrus_stdenc_template.h
index 06fca844392f..ad19787bc1bc 100644
--- a/lib/libc/iconv/citrus_stdenc_template.h
+++ b/lib/libc/iconv/citrus_stdenc_template.h
@@ -49,6 +49,11 @@
#define _CE_TO_EI(_ce_) (_TO_EI((_ce_)->ce_closure))
#define _TO_STATE(_ps_) ((_ENCODING_STATE*)(_ps_))
+#ifndef _ENCODING_MB_CUR_MIN
+/* Assume one byte minimum unless otherwise specified. */
+#define _ENCODING_MB_CUR_MIN(_ei_) 1
+#endif
+
/* ----------------------------------------------------------------------
* templates for public functions
*/
@@ -87,6 +92,7 @@ _FUNCNAME(stdenc_init)(struct _citrus_stdenc * __restrict ce,
ce->ce_closure = ei;
et->et_state_size = sizeof(_ENCODING_STATE);
et->et_mb_cur_max = _ENCODING_MB_CUR_MAX(_CE_TO_EI(ce));
+ et->et_mb_cur_min = _ENCODING_MB_CUR_MIN(_CE_TO_EI(ce));
return (0);
}
diff --git a/lib/libc/locale/ascii.c b/lib/libc/locale/ascii.c
index 99bf94108c89..01ca53c512f0 100644
--- a/lib/libc/locale/ascii.c
+++ b/lib/libc/locale/ascii.c
@@ -9,7 +9,7 @@
* Paul Borman at Krystal Technologies.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/big5.c b/lib/libc/locale/big5.c
index c1f94d39c7da..7ff3c024dd32 100644
--- a/lib/libc/locale/big5.c
+++ b/lib/libc/locale/big5.c
@@ -9,7 +9,7 @@
* Paul Borman at Krystal Technologies.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/btowc.c b/lib/libc/locale/btowc.c
index a695da477d58..b3d762c1bbf7 100644
--- a/lib/libc/locale/btowc.c
+++ b/lib/libc/locale/btowc.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c
index 2f0e2003aa45..4a5512998438 100644
--- a/lib/libc/locale/collate.c
+++ b/lib/libc/locale/collate.c
@@ -8,7 +8,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/collate.h b/lib/libc/locale/collate.h
index 9983cdbd969d..6d92056597de 100644
--- a/lib/libc/locale/collate.h
+++ b/lib/libc/locale/collate.h
@@ -7,7 +7,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/collcmp.c b/lib/libc/locale/collcmp.c
index b444ea0652ac..043f9be9dd47 100644
--- a/lib/libc/locale/collcmp.c
+++ b/lib/libc/locale/collcmp.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/ctype.c b/lib/libc/locale/ctype.c
index 8a88b8d6512e..d396dad1f4bf 100644
--- a/lib/libc/locale/ctype.c
+++ b/lib/libc/locale/ctype.c
@@ -2,7 +2,6 @@
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by David Chisnall under sponsorship from
* the FreeBSD Foundation.
diff --git a/lib/libc/locale/ctype_l.3 b/lib/libc/locale/ctype_l.3
index 5f427de06394..7680803667d2 100644
--- a/lib/libc/locale/ctype_l.3
+++ b/lib/libc/locale/ctype_l.3
@@ -1,5 +1,4 @@
.\" Copyright (c) 2011 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by David Chisnall under sponsorship from
.\" the FreeBSD Foundation.
diff --git a/lib/libc/locale/duplocale.3 b/lib/libc/locale/duplocale.3
index bc0c4bced812..a4064c25140e 100644
--- a/lib/libc/locale/duplocale.3
+++ b/lib/libc/locale/duplocale.3
@@ -1,5 +1,4 @@
.\" Copyright (c) 2011 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by David Chisnall under sponsorship from
.\" the FreeBSD Foundation.
diff --git a/lib/libc/locale/euc.c b/lib/libc/locale/euc.c
index 55055965ab4e..0b3118f83ebb 100644
--- a/lib/libc/locale/euc.c
+++ b/lib/libc/locale/euc.c
@@ -11,7 +11,7 @@
* Paul Borman at Krystal Technologies.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/freelocale.3 b/lib/libc/locale/freelocale.3
index d3e2d4498226..4b7d0dae6c8e 100644
--- a/lib/libc/locale/freelocale.3
+++ b/lib/libc/locale/freelocale.3
@@ -1,5 +1,4 @@
.\" Copyright (c) 2011 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by David Chisnall under sponsorship from
.\" the FreeBSD Foundation.
diff --git a/lib/libc/locale/gb18030.c b/lib/libc/locale/gb18030.c
index b4f80678d840..62b96ceade49 100644
--- a/lib/libc/locale/gb18030.c
+++ b/lib/libc/locale/gb18030.c
@@ -7,7 +7,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/gb2312.c b/lib/libc/locale/gb2312.c
index 07a6c4764bb3..6ae8ba5462f2 100644
--- a/lib/libc/locale/gb2312.c
+++ b/lib/libc/locale/gb2312.c
@@ -8,7 +8,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/gbk.c b/lib/libc/locale/gbk.c
index 78ff623be379..22095b6e5128 100644
--- a/lib/libc/locale/gbk.c
+++ b/lib/libc/locale/gbk.c
@@ -11,7 +11,7 @@
* Paul Borman at Krystal Technologies.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/lmessages.c b/lib/libc/locale/lmessages.c
index 70de30650346..dc32908d981a 100644
--- a/lib/libc/locale/lmessages.c
+++ b/lib/libc/locale/lmessages.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/lmessages.h b/lib/libc/locale/lmessages.h
index 0e8278f4a650..869af8d522c4 100644
--- a/lib/libc/locale/lmessages.h
+++ b/lib/libc/locale/lmessages.h
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/lmonetary.c b/lib/libc/locale/lmonetary.c
index ff11f26e890b..8630e9744d71 100644
--- a/lib/libc/locale/lmonetary.c
+++ b/lib/libc/locale/lmonetary.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/lmonetary.h b/lib/libc/locale/lmonetary.h
index 69facf9f88dd..9360f6b6d27c 100644
--- a/lib/libc/locale/lmonetary.h
+++ b/lib/libc/locale/lmonetary.h
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/lnumeric.c b/lib/libc/locale/lnumeric.c
index 253fb955f485..26ce931cc2b1 100644
--- a/lib/libc/locale/lnumeric.c
+++ b/lib/libc/locale/lnumeric.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/lnumeric.h b/lib/libc/locale/lnumeric.h
index 43ff16127862..f2a0aabd27b7 100644
--- a/lib/libc/locale/lnumeric.h
+++ b/lib/libc/locale/lnumeric.h
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/localeconv.c b/lib/libc/locale/localeconv.c
index 130f93c178f4..ced3f52f0a73 100644
--- a/lib/libc/locale/localeconv.c
+++ b/lib/libc/locale/localeconv.c
@@ -6,7 +6,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/mblen.c b/lib/libc/locale/mblen.c
index 77d9745da198..7e0cd68373d6 100644
--- a/lib/libc/locale/mblen.c
+++ b/lib/libc/locale/mblen.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/mblocal.h b/lib/libc/locale/mblocal.h
index 1fb5902a8d11..a497f9de6945 100644
--- a/lib/libc/locale/mblocal.h
+++ b/lib/libc/locale/mblocal.h
@@ -7,7 +7,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/mbrlen.c b/lib/libc/locale/mbrlen.c
index 4f687e98628f..1c3463e6f80c 100644
--- a/lib/libc/locale/mbrlen.c
+++ b/lib/libc/locale/mbrlen.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/mbrtowc.c b/lib/libc/locale/mbrtowc.c
index 7585ef16bca2..bff2f051b550 100644
--- a/lib/libc/locale/mbrtowc.c
+++ b/lib/libc/locale/mbrtowc.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/mbsinit.c b/lib/libc/locale/mbsinit.c
index a7df81911b26..680ff21a57e0 100644
--- a/lib/libc/locale/mbsinit.c
+++ b/lib/libc/locale/mbsinit.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/mbsnrtowcs.c b/lib/libc/locale/mbsnrtowcs.c
index 69e48eafdc57..30a6eece93be 100644
--- a/lib/libc/locale/mbsnrtowcs.c
+++ b/lib/libc/locale/mbsnrtowcs.c
@@ -6,10 +6,9 @@
* Copyright (c) 2002-2004 Tim J. Robbins.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
- * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/lib/libc/locale/mbsrtowcs.c b/lib/libc/locale/mbsrtowcs.c
index e85b22b492bf..7ec621d35d21 100644
--- a/lib/libc/locale/mbsrtowcs.c
+++ b/lib/libc/locale/mbsrtowcs.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/mbstowcs.c b/lib/libc/locale/mbstowcs.c
index 3226d22ea254..d48879df0dfa 100644
--- a/lib/libc/locale/mbstowcs.c
+++ b/lib/libc/locale/mbstowcs.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/mbtowc.c b/lib/libc/locale/mbtowc.c
index ec634807560d..edd80d1a693f 100644
--- a/lib/libc/locale/mbtowc.c
+++ b/lib/libc/locale/mbtowc.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/mskanji.c b/lib/libc/locale/mskanji.c
index 1585886cea31..9b27b579d031 100644
--- a/lib/libc/locale/mskanji.c
+++ b/lib/libc/locale/mskanji.c
@@ -11,7 +11,7 @@
* May 12, 1995
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/newlocale.3 b/lib/libc/locale/newlocale.3
index cc5043df8eb1..0b135c04de60 100644
--- a/lib/libc/locale/newlocale.3
+++ b/lib/libc/locale/newlocale.3
@@ -1,5 +1,4 @@
.\" Copyright (c) 2011 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by David Chisnall under sponsorship from
.\" the FreeBSD Foundation.
diff --git a/lib/libc/locale/nextwctype.c b/lib/libc/locale/nextwctype.c
index 3ef73ddec7b6..08e95c628cc8 100644
--- a/lib/libc/locale/nextwctype.c
+++ b/lib/libc/locale/nextwctype.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/nl_langinfo.c b/lib/libc/locale/nl_langinfo.c
index b51b0425515b..675ba2b683aa 100644
--- a/lib/libc/locale/nl_langinfo.c
+++ b/lib/libc/locale/nl_langinfo.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/none.c b/lib/libc/locale/none.c
index d95bb0087c09..b2d1d24ac3fc 100644
--- a/lib/libc/locale/none.c
+++ b/lib/libc/locale/none.c
@@ -11,7 +11,7 @@
* Paul Borman at Krystal Technologies.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/querylocale.3 b/lib/libc/locale/querylocale.3
index ecafee49a712..92ac3ecd05d9 100644
--- a/lib/libc/locale/querylocale.3
+++ b/lib/libc/locale/querylocale.3
@@ -1,5 +1,4 @@
.\" Copyright (c) 2011 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by David Chisnall under sponsorship from
.\" the FreeBSD Foundation.
diff --git a/lib/libc/locale/runetype.c b/lib/libc/locale/runetype.c
index 8fe656aded05..8a070d4c4dc1 100644
--- a/lib/libc/locale/runetype.c
+++ b/lib/libc/locale/runetype.c
@@ -8,7 +8,7 @@
* Paul Borman at Krystal Technologies.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c
index 41c82e637529..9b4b65f166e8 100644
--- a/lib/libc/locale/setrunelocale.c
+++ b/lib/libc/locale/setrunelocale.c
@@ -8,7 +8,7 @@
* Paul Borman at Krystal Technologies.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/table.c b/lib/libc/locale/table.c
index 2f790afd4dd8..4f1b7d51d414 100644
--- a/lib/libc/locale/table.c
+++ b/lib/libc/locale/table.c
@@ -8,7 +8,7 @@
* Paul Borman at Krystal Technologies.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/tolower.c b/lib/libc/locale/tolower.c
index 00ac7279fbb4..021e5c10b5b9 100644
--- a/lib/libc/locale/tolower.c
+++ b/lib/libc/locale/tolower.c
@@ -8,7 +8,7 @@
* Paul Borman at Krystal Technologies.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/toupper.c b/lib/libc/locale/toupper.c
index 26bb93f3f2da..2441cc2c595e 100644
--- a/lib/libc/locale/toupper.c
+++ b/lib/libc/locale/toupper.c
@@ -8,7 +8,7 @@
* Paul Borman at Krystal Technologies.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/uselocale.3 b/lib/libc/locale/uselocale.3
index 96d0008f7837..b1e75ecd7bba 100644
--- a/lib/libc/locale/uselocale.3
+++ b/lib/libc/locale/uselocale.3
@@ -1,5 +1,4 @@
.\" Copyright (c) 2011 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by David Chisnall under sponsorship from
.\" the FreeBSD Foundation.
diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c
index 13f957989fa2..323940055c8c 100644
--- a/lib/libc/locale/utf8.c
+++ b/lib/libc/locale/utf8.c
@@ -7,7 +7,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcrtomb.c b/lib/libc/locale/wcrtomb.c
index fa5c08474475..cd6cc907af60 100644
--- a/lib/libc/locale/wcrtomb.c
+++ b/lib/libc/locale/wcrtomb.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcsftime.c b/lib/libc/locale/wcsftime.c
index 772c96c2f9f4..aabb632a7417 100644
--- a/lib/libc/locale/wcsftime.c
+++ b/lib/libc/locale/wcsftime.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcsnrtombs.c b/lib/libc/locale/wcsnrtombs.c
index 7fdbfc75156d..68c93122a065 100644
--- a/lib/libc/locale/wcsnrtombs.c
+++ b/lib/libc/locale/wcsnrtombs.c
@@ -7,7 +7,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcsrtombs.c b/lib/libc/locale/wcsrtombs.c
index 1466eab7046d..74274382b0fc 100644
--- a/lib/libc/locale/wcsrtombs.c
+++ b/lib/libc/locale/wcsrtombs.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcstod.c b/lib/libc/locale/wcstod.c
index 42d8acdafcdb..c73dc8082916 100644
--- a/lib/libc/locale/wcstod.c
+++ b/lib/libc/locale/wcstod.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcstof.c b/lib/libc/locale/wcstof.c
index 34117557ee0f..7933f7d5fecf 100644
--- a/lib/libc/locale/wcstof.c
+++ b/lib/libc/locale/wcstof.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcstoimax.c b/lib/libc/locale/wcstoimax.c
index 5e4d9af26a80..5fa406784f15 100644
--- a/lib/libc/locale/wcstoimax.c
+++ b/lib/libc/locale/wcstoimax.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcstol.c b/lib/libc/locale/wcstol.c
index 98bd5f85a4d1..0921782e49ff 100644
--- a/lib/libc/locale/wcstol.c
+++ b/lib/libc/locale/wcstol.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcstold.c b/lib/libc/locale/wcstold.c
index c31f84118a2f..1bf55425e39d 100644
--- a/lib/libc/locale/wcstold.c
+++ b/lib/libc/locale/wcstold.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcstoll.c b/lib/libc/locale/wcstoll.c
index 6c3184a0de34..f28a0015485a 100644
--- a/lib/libc/locale/wcstoll.c
+++ b/lib/libc/locale/wcstoll.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcstombs.c b/lib/libc/locale/wcstombs.c
index a34b58ecdb05..81d62c85b88a 100644
--- a/lib/libc/locale/wcstombs.c
+++ b/lib/libc/locale/wcstombs.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcstoul.c b/lib/libc/locale/wcstoul.c
index b550e869f7c5..12f65c577605 100644
--- a/lib/libc/locale/wcstoul.c
+++ b/lib/libc/locale/wcstoul.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcstoull.c b/lib/libc/locale/wcstoull.c
index 6a04d213ff9b..bf968e272bfb 100644
--- a/lib/libc/locale/wcstoull.c
+++ b/lib/libc/locale/wcstoull.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcstoumax.c b/lib/libc/locale/wcstoumax.c
index 0c1cd0b4b8dc..9d5b220797a4 100644
--- a/lib/libc/locale/wcstoumax.c
+++ b/lib/libc/locale/wcstoumax.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wctob.c b/lib/libc/locale/wctob.c
index b43761c48d45..c68efb99b03d 100644
--- a/lib/libc/locale/wctob.c
+++ b/lib/libc/locale/wctob.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wctomb.c b/lib/libc/locale/wctomb.c
index 820021a3e0ab..9dbe4d2c7560 100644
--- a/lib/libc/locale/wctomb.c
+++ b/lib/libc/locale/wctomb.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wctrans.c b/lib/libc/locale/wctrans.c
index 36cb25e45549..235e1315904a 100644
--- a/lib/libc/locale/wctrans.c
+++ b/lib/libc/locale/wctrans.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wctype.c b/lib/libc/locale/wctype.c
index dd8f218306b2..59b439db42e0 100644
--- a/lib/libc/locale/wctype.c
+++ b/lib/libc/locale/wctype.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/wcwidth.c b/lib/libc/locale/wcwidth.c
index 53145e9b8254..957681fcb0e6 100644
--- a/lib/libc/locale/wcwidth.c
+++ b/lib/libc/locale/wcwidth.c
@@ -13,7 +13,7 @@
* Paul Borman at Krystal Technologies.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/locale/xlocale.3 b/lib/libc/locale/xlocale.3
index da217c601100..d1d424feba41 100644
--- a/lib/libc/locale/xlocale.3
+++ b/lib/libc/locale/xlocale.3
@@ -1,5 +1,4 @@
.\" Copyright (c) 2011 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by David Chisnall under sponsorship from
.\" the FreeBSD Foundation.
diff --git a/lib/libc/locale/xlocale.c b/lib/libc/locale/xlocale.c
index 4bddc43c086b..c53963b2812f 100644
--- a/lib/libc/locale/xlocale.c
+++ b/lib/libc/locale/xlocale.c
@@ -2,7 +2,6 @@
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by David Chisnall under sponsorship from
* the FreeBSD Foundation.
diff --git a/lib/libc/locale/xlocale_private.h b/lib/libc/locale/xlocale_private.h
index bc40f28fc9eb..ed1733ba6798 100644
--- a/lib/libc/locale/xlocale_private.h
+++ b/lib/libc/locale/xlocale_private.h
@@ -2,7 +2,6 @@
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by David Chisnall under sponsorship from
* the FreeBSD Foundation.
diff --git a/lib/libc/net/getaddrinfo.3 b/lib/libc/net/getaddrinfo.3
index a91a26973ecb..af68f808b059 100644
--- a/lib/libc/net/getaddrinfo.3
+++ b/lib/libc/net/getaddrinfo.3
@@ -353,7 +353,7 @@ structure created by a call to
.Fn getaddrinfo .
.Sh IMPLEMENTATION NOTES
The behavior of
-.Li freeadrinfo(NULL)
+.Li freeaddrinfo(NULL)
is left unspecified by both
.St -susv4
and
diff --git a/lib/libc/net/resolver.3 b/lib/libc/net/resolver.3
index 98778f746a03..419aed603c83 100644
--- a/lib/libc/net/resolver.3
+++ b/lib/libc/net/resolver.3
@@ -28,7 +28,7 @@
.\" @(#)resolver.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 27, 2022
+.Dd September 15, 2022
.Dt RESOLVER 3
.Os
.Sh NAME
@@ -450,9 +450,6 @@ see
.%T RFC1034 ,
.%T RFC1035 ,
.%T RFC974
-.Rs
-.%T "Name Server Operations Guide for BIND"
-.Re
.Sh HISTORY
The
.Nm
diff --git a/lib/libc/quad/qdivrem.c b/lib/libc/quad/qdivrem.c
index ea09e7f43f16..7dd7632d39ed 100644
--- a/lib/libc/quad/qdivrem.c
+++ b/lib/libc/quad/qdivrem.c
@@ -94,7 +94,7 @@ __qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq)
/*
* Take care of special cases: divide by zero, and u < v.
*/
- if (vq == 0) {
+ if (__predict_false(vq == 0)) {
/* divide by zero. */
static volatile const unsigned int zero = 0;
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index 970a448b649a..6b7ddf5d0b88 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -6,7 +6,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/rpc/netnamer.c b/lib/libc/rpc/netnamer.c
index 591f6d5c91e5..8062c446dffe 100644
--- a/lib/libc/rpc/netnamer.c
+++ b/lib/libc/rpc/netnamer.c
@@ -64,7 +64,7 @@ static char *NETID = "netid.byname";
static char *NETIDFILE = "/etc/netid";
static int getnetid( char *, char * );
-static int _getgroups( char *, gid_t * );
+static int _getgroups( char *, gid_t [NGRPS] );
/*
* Convert network-name into unix credential
diff --git a/lib/libc/stdio/asprintf.c b/lib/libc/stdio/asprintf.c
index 1d9034b653d5..8e77aae6f64b 100644
--- a/lib/libc/stdio/asprintf.c
+++ b/lib/libc/stdio/asprintf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/fflush.c b/lib/libc/stdio/fflush.c
index decc974907f4..f59565abd369 100644
--- a/lib/libc/stdio/fflush.c
+++ b/lib/libc/stdio/fflush.c
@@ -136,7 +136,8 @@ __sflush(FILE *fp)
fp->_p += n;
if ((fp->_flags & (__SLBF | __SNBF)) == 0)
fp->_w -= n;
- } else if (p == fp->_p) { /* cond. to handle setvbuf */
+ /* conditional to handle setvbuf */
+ } else if (p == fp->_p && errno == EINTR) {
fp->_p = old_p;
fp->_w = old_w;
}
diff --git a/lib/libc/stdio/fgetwc.c b/lib/libc/stdio/fgetwc.c
index edad907fe806..d1dd48eade8a 100644
--- a/lib/libc/stdio/fgetwc.c
+++ b/lib/libc/stdio/fgetwc.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/fgetwln.c b/lib/libc/stdio/fgetwln.c
index b9077d68fc21..bfaffed71390 100644
--- a/lib/libc/stdio/fgetwln.c
+++ b/lib/libc/stdio/fgetwln.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/fgetws.c b/lib/libc/stdio/fgetws.c
index 84fc387ecae4..e850731eaf74 100644
--- a/lib/libc/stdio/fgetws.c
+++ b/lib/libc/stdio/fgetws.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/fprintf.c b/lib/libc/stdio/fprintf.c
index 95b71cc065c7..c03db17c8bb9 100644
--- a/lib/libc/stdio/fprintf.c
+++ b/lib/libc/stdio/fprintf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/fputwc.c b/lib/libc/stdio/fputwc.c
index 666dd8bcc9d1..a15eec7061ec 100644
--- a/lib/libc/stdio/fputwc.c
+++ b/lib/libc/stdio/fputwc.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/fputws.c b/lib/libc/stdio/fputws.c
index 56357b650979..54a267f5e98e 100644
--- a/lib/libc/stdio/fputws.c
+++ b/lib/libc/stdio/fputws.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/fscanf.c b/lib/libc/stdio/fscanf.c
index 6d2cfe9b5a3f..8946b5b84184 100644
--- a/lib/libc/stdio/fscanf.c
+++ b/lib/libc/stdio/fscanf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/fvwrite.c b/lib/libc/stdio/fvwrite.c
index 2a161859afa9..b1b363e6f80d 100644
--- a/lib/libc/stdio/fvwrite.c
+++ b/lib/libc/stdio/fvwrite.c
@@ -38,6 +38,7 @@ static char sccsid[] = "@(#)fvwrite.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -140,7 +141,7 @@ __sfvwrite(FILE *fp, struct __suio *uio)
fp->_p += w;
old_p = fp->_p;
if (__fflush(fp) == EOF) {
- if (old_p == fp->_p)
+ if (old_p == fp->_p && errno == EINTR)
fp->_p -= w;
goto err;
}
@@ -184,7 +185,7 @@ __sfvwrite(FILE *fp, struct __suio *uio)
fp->_p += w;
old_p = fp->_p;
if (__fflush(fp) == EOF) {
- if (old_p == fp->_p)
+ if (old_p == fp->_p && errno == EINTR)
fp->_p -= w;
goto err;
}
diff --git a/lib/libc/stdio/fwprintf.c b/lib/libc/stdio/fwprintf.c
index fb00c2e4b20d..c9d7c1fde445 100644
--- a/lib/libc/stdio/fwprintf.c
+++ b/lib/libc/stdio/fwprintf.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/fwscanf.c b/lib/libc/stdio/fwscanf.c
index df31be7b5bf1..f104cd2d9c59 100644
--- a/lib/libc/stdio/fwscanf.c
+++ b/lib/libc/stdio/fwscanf.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/getwc.c b/lib/libc/stdio/getwc.c
index d27988ba3163..3f57d9e1bb75 100644
--- a/lib/libc/stdio/getwc.c
+++ b/lib/libc/stdio/getwc.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/getwchar.c b/lib/libc/stdio/getwchar.c
index 2828075520a6..61b428449fe3 100644
--- a/lib/libc/stdio/getwchar.c
+++ b/lib/libc/stdio/getwchar.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/local.h b/lib/libc/stdio/local.h
index 336d00dfd8cc..64156336f5e3 100644
--- a/lib/libc/stdio/local.h
+++ b/lib/libc/stdio/local.h
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/printf.c b/lib/libc/stdio/printf.c
index 7e7e5c8c128b..53a31ca23346 100644
--- a/lib/libc/stdio/printf.c
+++ b/lib/libc/stdio/printf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/printfcommon.h b/lib/libc/stdio/printfcommon.h
index c120f1eba766..36e7aa67f139 100644
--- a/lib/libc/stdio/printfcommon.h
+++ b/lib/libc/stdio/printfcommon.h
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/putwc.c b/lib/libc/stdio/putwc.c
index 510a3af70eda..7f7b026e4398 100644
--- a/lib/libc/stdio/putwc.c
+++ b/lib/libc/stdio/putwc.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/putwchar.c b/lib/libc/stdio/putwchar.c
index a042e449e03a..f07f933e325f 100644
--- a/lib/libc/stdio/putwchar.c
+++ b/lib/libc/stdio/putwchar.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/scanf.c b/lib/libc/stdio/scanf.c
index baffba9f9018..775bf3b1bb64 100644
--- a/lib/libc/stdio/scanf.c
+++ b/lib/libc/stdio/scanf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/setvbuf.c b/lib/libc/stdio/setvbuf.c
index 03a3c7263125..8947e61e7c29 100644
--- a/lib/libc/stdio/setvbuf.c
+++ b/lib/libc/stdio/setvbuf.c
@@ -39,6 +39,7 @@ static char sccsid[] = "@(#)setvbuf.c 8.2 (Berkeley) 11/16/93";
__FBSDID("$FreeBSD$");
#include "namespace.h"
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include "un-namespace.h"
@@ -62,7 +63,7 @@ setvbuf(FILE * __restrict fp, char * __restrict buf, int mode, size_t size)
* when setting _IONBF.
*/
if (mode != _IONBF)
- if ((mode != _IOFBF && mode != _IOLBF) || (int)size < 0)
+ if ((mode != _IOFBF && mode != _IOLBF) || size > INT_MAX)
return (EOF);
FLOCKFILE_CANCELSAFE(fp);
diff --git a/lib/libc/stdio/snprintf.c b/lib/libc/stdio/snprintf.c
index 8ee0b4429340..bfa43ef4e17e 100644
--- a/lib/libc/stdio/snprintf.c
+++ b/lib/libc/stdio/snprintf.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/sprintf.c b/lib/libc/stdio/sprintf.c
index 8a7611f384a2..5601b96a3853 100644
--- a/lib/libc/stdio/sprintf.c
+++ b/lib/libc/stdio/sprintf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/sscanf.c b/lib/libc/stdio/sscanf.c
index cab6408535a8..4272328d1f38 100644
--- a/lib/libc/stdio/sscanf.c
+++ b/lib/libc/stdio/sscanf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/swprintf.c b/lib/libc/stdio/swprintf.c
index 39bb7346099c..000983e3c0ec 100644
--- a/lib/libc/stdio/swprintf.c
+++ b/lib/libc/stdio/swprintf.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/swscanf.c b/lib/libc/stdio/swscanf.c
index e45449c16d53..d0c0e44bfae2 100644
--- a/lib/libc/stdio/swscanf.c
+++ b/lib/libc/stdio/swscanf.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/ungetwc.c b/lib/libc/stdio/ungetwc.c
index d7705c8199a2..795cc778d9f6 100644
--- a/lib/libc/stdio/ungetwc.c
+++ b/lib/libc/stdio/ungetwc.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vasprintf.c b/lib/libc/stdio/vasprintf.c
index f3545f149a73..1260349afe97 100644
--- a/lib/libc/stdio/vasprintf.c
+++ b/lib/libc/stdio/vasprintf.c
@@ -7,7 +7,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vdprintf.c b/lib/libc/stdio/vdprintf.c
index 73f87b0f0cfa..979a3bf6e8e1 100644
--- a/lib/libc/stdio/vdprintf.c
+++ b/lib/libc/stdio/vdprintf.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index 70f5074e2f72..d7848a9a7078 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index bd3830c19907..dde22cb5b235 100644
--- a/lib/libc/stdio/vfscanf.c
+++ b/lib/libc/stdio/vfscanf.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vfwprintf.c b/lib/libc/stdio/vfwprintf.c
index 91238fed138a..0561dc06164c 100644
--- a/lib/libc/stdio/vfwprintf.c
+++ b/lib/libc/stdio/vfwprintf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vfwscanf.c b/lib/libc/stdio/vfwscanf.c
index 34488912171a..ab9bce4c295a 100644
--- a/lib/libc/stdio/vfwscanf.c
+++ b/lib/libc/stdio/vfwscanf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vprintf.c b/lib/libc/stdio/vprintf.c
index 7a4cc69dec98..31b52bcf31cd 100644
--- a/lib/libc/stdio/vprintf.c
+++ b/lib/libc/stdio/vprintf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vscanf.c b/lib/libc/stdio/vscanf.c
index 15024fdfc09c..84419dd054c5 100644
--- a/lib/libc/stdio/vscanf.c
+++ b/lib/libc/stdio/vscanf.c
@@ -8,7 +8,7 @@
* Donn Seeley at UUNET Technologies, Inc.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vsnprintf.c b/lib/libc/stdio/vsnprintf.c
index f108a6d7871a..bc8ec287ee84 100644
--- a/lib/libc/stdio/vsnprintf.c
+++ b/lib/libc/stdio/vsnprintf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vsprintf.c b/lib/libc/stdio/vsprintf.c
index 9e03e7126d4a..6992f9610e91 100644
--- a/lib/libc/stdio/vsprintf.c
+++ b/lib/libc/stdio/vsprintf.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vsscanf.c b/lib/libc/stdio/vsscanf.c
index 771dee0c1c42..5b0be5429cdf 100644
--- a/lib/libc/stdio/vsscanf.c
+++ b/lib/libc/stdio/vsscanf.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vswprintf.c b/lib/libc/stdio/vswprintf.c
index 9bd31abe992c..4807fd20d67c 100644
--- a/lib/libc/stdio/vswprintf.c
+++ b/lib/libc/stdio/vswprintf.c
@@ -7,7 +7,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vswscanf.c b/lib/libc/stdio/vswscanf.c
index d3f96774a71c..d320da82101b 100644
--- a/lib/libc/stdio/vswscanf.c
+++ b/lib/libc/stdio/vswscanf.c
@@ -8,7 +8,7 @@
* Donn Seeley at UUNET Technologies, Inc.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vwprintf.c b/lib/libc/stdio/vwprintf.c
index f0aca08ac65a..73f64778af23 100644
--- a/lib/libc/stdio/vwprintf.c
+++ b/lib/libc/stdio/vwprintf.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/vwscanf.c b/lib/libc/stdio/vwscanf.c
index 6f80c249d2d5..663991f60911 100644
--- a/lib/libc/stdio/vwscanf.c
+++ b/lib/libc/stdio/vwscanf.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/wbuf.c b/lib/libc/stdio/wbuf.c
index 6cd75145a271..666bbf87aadd 100644
--- a/lib/libc/stdio/wbuf.c
+++ b/lib/libc/stdio/wbuf.c
@@ -82,7 +82,7 @@ __swbuf(int c, FILE *fp)
*/
n = fp->_p - fp->_bf._base;
if (n >= fp->_bf._size) {
- if (__fflush(fp))
+ if (__fflush(fp) != 0)
return (EOF);
n = 0;
}
@@ -90,8 +90,8 @@ __swbuf(int c, FILE *fp)
*fp->_p++ = c;
old_p = fp->_p;
if (++n == fp->_bf._size || (fp->_flags & __SLBF && c == '\n')) {
- if (__fflush(fp)) {
- if (fp->_p == old_p) {
+ if (__fflush(fp) != 0) {
+ if (fp->_p == old_p && errno == EINTR) {
fp->_p--;
fp->_w++;
}
diff --git a/lib/libc/stdio/wprintf.c b/lib/libc/stdio/wprintf.c
index c1d1f2656b7a..469802498ee9 100644
--- a/lib/libc/stdio/wprintf.c
+++ b/lib/libc/stdio/wprintf.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdio/wscanf.c b/lib/libc/stdio/wscanf.c
index 33e0f3805d1c..6415cbf9301a 100644
--- a/lib/libc/stdio/wscanf.c
+++ b/lib/libc/stdio/wscanf.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc
index a658fd78e862..8ace2c051b82 100644
--- a/lib/libc/stdlib/Makefile.inc
+++ b/lib/libc/stdlib/Makefile.inc
@@ -11,8 +11,8 @@ MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
getsubopt.c hcreate.c hcreate_r.c hdestroy_r.c heapsort.c heapsort_b.c \
hsearch_r.c imaxabs.c imaxdiv.c \
insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \
- merge.c mergesort_b.c ptsname.c qsort.c qsort_r.c qsort_s.c \
- quick_exit.c radixsort.c rand.c \
+ merge.c mergesort_b.c ptsname.c qsort.c qsort_r.c qsort_r_compat.c \
+ qsort_s.c quick_exit.c radixsort.c rand.c \
random.c reallocarray.c reallocf.c realpath.c remque.c \
set_constraint_handler_s.c strfmon.c strtoimax.c \
strtol.c strtold.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \
diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map
index 6524c6097b96..7e0b141a21b6 100644
--- a/lib/libc/stdlib/Symbol.map
+++ b/lib/libc/stdlib/Symbol.map
@@ -49,7 +49,6 @@ FBSD_1.0 {
lfind;
mergesort;
putenv;
- qsort_r;
qsort;
radixsort;
sradixsort;
@@ -130,6 +129,7 @@ FBSD_1.6 {
FBSD_1.7 {
clearenv;
+ qsort_r;
};
FBSDprivate_1.0 {
diff --git a/lib/libc/stdlib/atof.c b/lib/libc/stdlib/atof.c
index c7e0676188ea..5e0a0ddd050d 100644
--- a/lib/libc/stdlib/atof.c
+++ b/lib/libc/stdlib/atof.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdlib/atoi.c b/lib/libc/stdlib/atoi.c
index 700c498029d7..2d6fe88ef74a 100644
--- a/lib/libc/stdlib/atoi.c
+++ b/lib/libc/stdlib/atoi.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdlib/atol.c b/lib/libc/stdlib/atol.c
index 35e83fbf6181..88aa9a990ae7 100644
--- a/lib/libc/stdlib/atol.c
+++ b/lib/libc/stdlib/atol.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdlib/atoll.c b/lib/libc/stdlib/atoll.c
index bfbdb976501a..fb3b76524be1 100644
--- a/lib/libc/stdlib/atoll.c
+++ b/lib/libc/stdlib/atoll.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdlib/cxa_thread_atexit.c b/lib/libc/stdlib/cxa_thread_atexit.c
index 6f03ef0d3235..06fcc3c87c26 100644
--- a/lib/libc/stdlib/cxa_thread_atexit.c
+++ b/lib/libc/stdlib/cxa_thread_atexit.c
@@ -1,6 +1,5 @@
/*-
* Copyright (c) 2017 The FreeBSD Foundation
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/stdlib/div.c b/lib/libc/stdlib/div.c
index b7efb1dfc595..82a3b02b6df1 100644
--- a/lib/libc/stdlib/div.c
+++ b/lib/libc/stdlib/div.c
@@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h> /* div_t */
div_t
-div(num, denom)
- int num, denom;
+div(int num, int denom)
{
div_t r;
diff --git a/lib/libc/stdlib/ldiv.c b/lib/libc/stdlib/ldiv.c
index f55ad6de4faf..954626a0c835 100644
--- a/lib/libc/stdlib/ldiv.c
+++ b/lib/libc/stdlib/ldiv.c
@@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h> /* ldiv_t */
ldiv_t
-ldiv(num, denom)
- long num, denom;
+ldiv(long num, long denom)
{
ldiv_t r;
diff --git a/lib/libc/stdlib/qsort.3 b/lib/libc/stdlib/qsort.3
index 606185f9baee..6449849fc490 100644
--- a/lib/libc/stdlib/qsort.3
+++ b/lib/libc/stdlib/qsort.3
@@ -32,7 +32,7 @@
.\" @(#)qsort.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd January 20, 2020
+.Dd September 30, 2022
.Dt QSORT 3
.Os
.Sh NAME
@@ -67,8 +67,8 @@
.Fa "void *base"
.Fa "size_t nmemb"
.Fa "size_t size"
+.Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *, void *\*[rp]"
.Fa "void *thunk"
-.Fa "int \*[lp]*compar\*[rp]\*[lp]void *, const void *, const void *\*[rp]"
.Fc
.Ft int
.Fo heapsort
@@ -157,7 +157,7 @@ function behaves identically to
.Fn qsort ,
except that it takes an additional argument,
.Fa thunk ,
-which is passed unchanged as the first argument to function pointed to
+which is passed unchanged as the last argument to function pointed to
.Fa compar .
This allows the comparison function to access additional
data without using global variables, and thus
@@ -436,3 +436,9 @@ K.3.6.3.2.
The variants of these functions that take blocks as arguments first appeared in
Mac OS X.
This implementation was created by David Chisnall.
+.Pp
+In
+.Fx 14.0 ,
+the prototype of
+.Fn qsort_r
+was updated to match POSIX.
diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c
index 0b99c04507d3..11a3c5508143 100644
--- a/lib/libc/stdlib/qsort.c
+++ b/lib/libc/stdlib/qsort.c
@@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
#if defined(I_AM_QSORT_R)
+typedef int cmp_t(const void *, const void *, void *);
+#elif defined(I_AM_QSORT_R_COMPAT)
typedef int cmp_t(void *, const void *, const void *);
#elif defined(I_AM_QSORT_S)
typedef int cmp_t(const void *, const void *, void *);
@@ -72,6 +74,8 @@ swapfunc(char *a, char *b, size_t es)
if ((n) > 0) swapfunc(a, b, n)
#if defined(I_AM_QSORT_R)
+#define CMP(t, x, y) (cmp((x), (y), (t)))
+#elif defined(I_AM_QSORT_R_COMPAT)
#define CMP(t, x, y) (cmp((t), (x), (y)))
#elif defined(I_AM_QSORT_S)
#define CMP(t, x, y) (cmp((x), (y), (t)))
@@ -81,7 +85,7 @@ swapfunc(char *a, char *b, size_t es)
static inline char *
med3(char *a, char *b, char *c, cmp_t *cmp, void *thunk
-#if !defined(I_AM_QSORT_R) && !defined(I_AM_QSORT_S)
+#if !defined(I_AM_QSORT_R) && !defined(I_AM_QSORT_R_COMPAT) && !defined(I_AM_QSORT_S)
__unused
#endif
)
@@ -97,6 +101,8 @@ __unused
*/
#if defined(I_AM_QSORT_R)
#define local_qsort local_qsort_r
+#elif defined(I_AM_QSORT_R_COMPAT)
+#define local_qsort local_qsort_r_compat
#elif defined(I_AM_QSORT_S)
#define local_qsort local_qsort_s
#endif
@@ -211,10 +217,16 @@ loop:
#if defined(I_AM_QSORT_R)
void
-qsort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp)
+(qsort_r)(void *a, size_t n, size_t es, cmp_t *cmp, void *thunk)
{
local_qsort_r(a, n, es, cmp, thunk);
}
+#elif defined(I_AM_QSORT_R_COMPAT)
+void
+__qsort_r_compat(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp)
+{
+ local_qsort_r_compat(a, n, es, cmp, thunk);
+}
#elif defined(I_AM_QSORT_S)
errno_t
qsort_s(void *a, rsize_t n, rsize_t es, cmp_t *cmp, void *thunk)
diff --git a/lib/libc/stdlib/qsort_r.c b/lib/libc/stdlib/qsort_r.c
index f489d31c2335..d86873604f59 100644
--- a/lib/libc/stdlib/qsort_r.c
+++ b/lib/libc/stdlib/qsort_r.c
@@ -4,16 +4,5 @@
*
* $FreeBSD$
*/
-#include "block_abi.h"
#define I_AM_QSORT_R
#include "qsort.c"
-
-typedef DECLARE_BLOCK(int, qsort_block, const void *, const void *);
-
-void
-qsort_b(void *base, size_t nel, size_t width, qsort_block compar)
-{
- qsort_r(base, nel, width, compar,
- (int (*)(void *, const void *, const void *))
- GET_BLOCK_FUNCTION(compar));
-}
diff --git a/lib/libc/stdlib/qsort_r_compat.c b/lib/libc/stdlib/qsort_r_compat.c
new file mode 100644
index 000000000000..239a5f307ceb
--- /dev/null
+++ b/lib/libc/stdlib/qsort_r_compat.c
@@ -0,0 +1,21 @@
+/*
+ * This file is in the public domain. Originally written by Garrett
+ * A. Wollman.
+ *
+ * $FreeBSD$
+ */
+#include "block_abi.h"
+#define I_AM_QSORT_R_COMPAT
+#include "qsort.c"
+
+typedef DECLARE_BLOCK(int, qsort_block, const void *, const void *);
+
+void
+qsort_b(void *base, size_t nel, size_t width, qsort_block compar)
+{
+ __qsort_r_compat(base, nel, width, compar,
+ (int (*)(void *, const void *, const void *))
+ GET_BLOCK_FUNCTION(compar));
+}
+
+__sym_compat(qsort_r, __qsort_r_compat, FBSD_1.0);
diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c
index d646ec0b001a..5829dd2d801c 100644
--- a/lib/libc/stdlib/strfmon.c
+++ b/lib/libc/stdlib/strfmon.c
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdlib/strtoimax.c b/lib/libc/stdlib/strtoimax.c
index b26451232170..425ce6d921f3 100644
--- a/lib/libc/stdlib/strtoimax.c
+++ b/lib/libc/stdlib/strtoimax.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdlib/strtol.c b/lib/libc/stdlib/strtol.c
index 25212d8930ad..bdbd38ab861f 100644
--- a/lib/libc/stdlib/strtol.c
+++ b/lib/libc/stdlib/strtol.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdlib/strtold.c b/lib/libc/stdlib/strtold.c
index 250b8558acb9..469e43818be6 100644
--- a/lib/libc/stdlib/strtold.c
+++ b/lib/libc/stdlib/strtold.c
@@ -2,7 +2,6 @@
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (C) 2011 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by David Chisnall under sponsorship from the
* FreeBSD Foundation.
diff --git a/lib/libc/stdlib/strtoll.c b/lib/libc/stdlib/strtoll.c
index c87aefb1cd22..fe316420516c 100644
--- a/lib/libc/stdlib/strtoll.c
+++ b/lib/libc/stdlib/strtoll.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdlib/strtoul.c b/lib/libc/stdlib/strtoul.c
index 50ce1cbf07a8..89571962f8fc 100644
--- a/lib/libc/stdlib/strtoul.c
+++ b/lib/libc/stdlib/strtoul.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdlib/strtoull.c b/lib/libc/stdlib/strtoull.c
index 58a9b23b566d..03bd9f8ab7f9 100644
--- a/lib/libc/stdlib/strtoull.c
+++ b/lib/libc/stdlib/strtoull.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdlib/strtoumax.c b/lib/libc/stdlib/strtoumax.c
index 80937036de75..8243451d0ce6 100644
--- a/lib/libc/stdlib/strtoumax.c
+++ b/lib/libc/stdlib/strtoumax.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdtime/strftime.c b/lib/libc/stdtime/strftime.c
index 838ebdde3e5b..50fbc41de24e 100644
--- a/lib/libc/stdtime/strftime.c
+++ b/lib/libc/stdtime/strftime.c
@@ -3,7 +3,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c
index 1bd7d4e8367d..5691f61b6d84 100644
--- a/lib/libc/stdtime/strptime.c
+++ b/lib/libc/stdtime/strptime.c
@@ -6,7 +6,7 @@
* Copyright (c) 1994 Powerdog Industries. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdtime/timelocal.c b/lib/libc/stdtime/timelocal.c
index f9d33eb8d927..684a5bdddf9f 100644
--- a/lib/libc/stdtime/timelocal.c
+++ b/lib/libc/stdtime/timelocal.c
@@ -6,7 +6,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/stdtime/timelocal.h b/lib/libc/stdtime/timelocal.h
index f65fb179fc3f..ce31d9ac664b 100644
--- a/lib/libc/stdtime/timelocal.h
+++ b/lib/libc/stdtime/timelocal.h
@@ -5,7 +5,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc
index 1df3d40e329f..afc113eeb867 100644
--- a/lib/libc/string/Makefile.inc
+++ b/lib/libc/string/Makefile.inc
@@ -16,7 +16,7 @@ MISRCS+=bcmp.c bcopy.c bzero.c explicit_bzero.c \
strcspn.c strdup.c strerror.c strlcat.c strlcpy.c strlen.c strmode.c \
strncat.c strncmp.c strncpy.c strndup.c strnlen.c strnstr.c \
strpbrk.c strrchr.c strsep.c strsignal.c strspn.c strstr.c strtok.c \
- strxfrm.c swab.c \
+ strverscmp.c strxfrm.c swab.c \
timingsafe_bcmp.c \
timingsafe_memcmp.c \
wcpcpy.c wcpncpy.c wcscasecmp.c wcscat.c \
@@ -46,7 +46,7 @@ MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \
memcmp.3 memcpy.3 memmem.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \
strchr.3 strcmp.3 strcoll.3 strcpy.3 strdup.3 strerror.3 \
string.3 strlcpy.3 strlen.3 strmode.3 strpbrk.3 strsep.3 \
- strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 \
+ strspn.3 strstr.3 strtok.3 strverscmp.3 strxfrm.3 swab.3 \
timingsafe_bcmp.3 \
wcscoll.3 wcstok.3 \
wcswidth.3 wcsxfrm.3 wmemchr.3
diff --git a/lib/libc/string/Symbol.map b/lib/libc/string/Symbol.map
index ec45d7fd7ddb..4fcd194bafd8 100644
--- a/lib/libc/string/Symbol.map
+++ b/lib/libc/string/Symbol.map
@@ -116,6 +116,7 @@ FBSD_1.6 {
FBSD_1.7 {
mempcpy;
+ strverscmp;
wmempcpy;
};
diff --git a/lib/libc/string/mempcpy.c b/lib/libc/string/mempcpy.c
index 12c0d791e9d3..520f1839f981 100644
--- a/lib/libc/string/mempcpy.c
+++ b/lib/libc/string/mempcpy.c
@@ -2,7 +2,6 @@
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2021 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Konstantin Belousov <kib@FreeBSD.org>
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/string/strcasecmp.c b/lib/libc/string/strcasecmp.c
index 60b5bb4f0c4c..efe36f8c012d 100644
--- a/lib/libc/string/strcasecmp.c
+++ b/lib/libc/string/strcasecmp.c
@@ -5,7 +5,7 @@
* The Regents of the University of California. All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/string/strcasestr.c b/lib/libc/string/strcasestr.c
index b70c2195a94e..be6c55df2f5f 100644
--- a/lib/libc/string/strcasestr.c
+++ b/lib/libc/string/strcasestr.c
@@ -8,7 +8,7 @@
* Chris Torek.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/string/strcoll.c b/lib/libc/string/strcoll.c
index 7aa2c2a642c4..c16c09bb0826 100644
--- a/lib/libc/string/strcoll.c
+++ b/lib/libc/string/strcoll.c
@@ -7,7 +7,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/string/strverscmp.3 b/lib/libc/string/strverscmp.3
new file mode 100644
index 000000000000..e4413fb96e36
--- /dev/null
+++ b/lib/libc/string/strverscmp.3
@@ -0,0 +1,56 @@
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\" Copyright (c) 2022 Aymeric Wibo <obiwac@gmail.com>
+.Dd July 11, 2022
+.Dt STRVERSCMP 3
+.Os
+.Sh NAME
+.Nm strverscmp
+.Nd compare strings according to natural order
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In string.h
+.Ft int
+.Fn strverscmp "const char *s1" "const char *s2"
+.Sh DESCRIPTION
+The
+.Fn strverscmp
+function
+compares the null-terminated strings
+.Fa s1
+and
+.Fa s2
+according to their natural order
+and returns an integer greater than, equal to, or less than 0,
+depending on whether
+.Fa s1
+is greater than, equal to, or less than
+.Fa s2 .
+.Pp
+More specifically, this natural order is found by iterating over both
+strings until a difference is found.
+If the difference is between non-decimal characters,
+.Fn strverscmp
+acts like
+.Xr strcmp 3
+(thus, the ordering would be "a", "b", "train").
+If a decimal digit is found, the whole number is read and compared
+(thus, the ordering would be "9", "10", "420" which is different to lexicographic order,
+what
+.Xr strcmp 3
+would have done).
+Numbers with leading zeroes are interpreted as fractional parts (even without a decimal point),
+and numbers with more leading zeroes are placed before numbers with fewer leading zeroes
+(thus, the ordering would be "000", "00", "01", "010", "09", "0", "1", "9", "10").
+.Sh SEE ALSO
+.Xr strcmp 3 ,
+.Xr versionsort 3
+.Sh STANDARDS
+The
+.Fn strverscmp
+function is a GNU extension and conforms to no standard.
+.Sh HISTORY
+The
+.Fn strverscmp
+function was added in
+.Fx 14.0 .
diff --git a/lib/libc/string/strverscmp.c b/lib/libc/string/strverscmp.c
new file mode 100644
index 000000000000..6051adb35499
--- /dev/null
+++ b/lib/libc/string/strverscmp.c
@@ -0,0 +1,91 @@
+/*-
+* SPDX-License-Identifier: BSD-2-Clause
+* Copyright (c) 2022 Aymeric Wibo <obiwac@gmail.com>
+*/
+
+#include <ctype.h>
+#include <stddef.h>
+
+int
+strverscmp(const char *s1, const char *s2)
+{
+ size_t digit_count_1, digit_count_2;
+ size_t zeros_count_1, zeros_count_2;
+ const unsigned char *num_1, *num_2;
+ const unsigned char *u1 = __DECONST(const unsigned char *, s1);
+ const unsigned char *u2 = __DECONST(const unsigned char *, s2);
+
+ /*
+ * If pointers are the same, no need to go through to process of
+ * comparing them.
+ */
+ if (s1 == s2)
+ return (0);
+
+ while (*u1 != '\0' && *u2 != '\0') {
+ /* If either character is not a digit, act like strcmp(3). */
+
+ if (!isdigit(*u1) || !isdigit(*u2)) {
+ if (*u1 != *u2)
+ return (*u1 - *u2);
+ u1++;
+ u2++;
+ continue;
+ }
+ if (*u1 == '0' || *u2 == '0') {
+ /*
+ * Treat leading zeros as if they were the fractional
+ * part of a number, i.e. as if they had a decimal point
+ * in front. First, count the leading zeros (more zeros
+ * == smaller number).
+ */
+ zeros_count_1 = 0;
+ zeros_count_2 = 0;
+ for (; *u1 == '0'; u1++)
+ zeros_count_1++;
+ for (; *u2 == '0'; u2++)
+ zeros_count_2++;
+ if (zeros_count_1 != zeros_count_2)
+ return (zeros_count_2 - zeros_count_1);
+
+ /* Handle the case where 0 < 09. */
+ if (!isdigit(*u1) && isdigit(*u2))
+ return (1);
+ if (!isdigit(*u2) && isdigit(*u1))
+ return (-1);
+ } else {
+ /*
+ * No leading zeros; we're simply comparing two numbers.
+ * It is necessary to first count how many digits there
+ * are before going back to compare each digit, so that
+ * e.g. 7 is not considered larger than 60.
+ */
+ num_1 = u1;
+ num_2 = u2;
+
+ /* Count digits (more digits == larger number). */
+ for (; isdigit(*u1); u1++)
+ ;
+ for (; isdigit(*u2); u2++)
+ ;
+ digit_count_1 = u1 - num_1;
+ digit_count_2 = u2 - num_2;
+ if (digit_count_1 != digit_count_2)
+ return (digit_count_1 - digit_count_2);
+
+ /*
+ * If there are the same number of digits, go back to
+ * the start of the number.
+ */
+ u1 = num_1;
+ u2 = num_2;
+ }
+
+ /* Compare each digit until there are none left. */
+ for (; isdigit(*u1) && isdigit(*u2); u1++, u2++) {
+ if (*u1 != *u2)
+ return (*u1 - *u2);
+ }
+ }
+ return (*u1 - *u2);
+}
diff --git a/lib/libc/string/strxfrm.c b/lib/libc/string/strxfrm.c
index 3252173430f2..5842f7c781f0 100644
--- a/lib/libc/string/strxfrm.c
+++ b/lib/libc/string/strxfrm.c
@@ -7,7 +7,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/string/wcscoll.c b/lib/libc/string/wcscoll.c
index d8ef9320f8df..f68de0de1bbf 100644
--- a/lib/libc/string/wcscoll.c
+++ b/lib/libc/string/wcscoll.c
@@ -6,7 +6,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/string/wcswidth.c b/lib/libc/string/wcswidth.c
index 3a8805f1b754..d5bf7ce5fe41 100644
--- a/lib/libc/string/wcswidth.c
+++ b/lib/libc/string/wcswidth.c
@@ -13,7 +13,7 @@
* Paul Borman at Krystal Technologies.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/string/wcsxfrm.c b/lib/libc/string/wcsxfrm.c
index c9603d1881fe..c9fbaf3e70a5 100644
--- a/lib/libc/string/wcsxfrm.c
+++ b/lib/libc/string/wcsxfrm.c
@@ -7,7 +7,7 @@
* All rights reserved.
*
* Copyright (c) 2011 The FreeBSD Foundation
- * All rights reserved.
+ *
* Portions of this software were developed by David Chisnall
* under sponsorship from the FreeBSD Foundation.
*
diff --git a/lib/libc/string/wmempcpy.c b/lib/libc/string/wmempcpy.c
index 208d62a26849..21bf34503396 100644
--- a/lib/libc/string/wmempcpy.c
+++ b/lib/libc/string/wmempcpy.c
@@ -2,7 +2,6 @@
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2021 The FreeBSD Foundation
- * All rights reserved.
*
* This software was developed by Konstantin Belousov <kib@FreeBSD.org>
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/POSIX2x_Fork.c b/lib/libc/sys/POSIX2x_Fork.c
index a7aaf82429bb..62ea5c90fe9b 100644
--- a/lib/libc/sys/POSIX2x_Fork.c
+++ b/lib/libc/sys/POSIX2x_Fork.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2021 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/_umtx_op.2 b/lib/libc/sys/_umtx_op.2
index ecd46b7d0247..f4a908b85017 100644
--- a/lib/libc/sys/_umtx_op.2
+++ b/lib/libc/sys/_umtx_op.2
@@ -1,5 +1,4 @@
.\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
-.\" All rights reserved.
.\"
.\" This documentation was written by
.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
diff --git a/lib/libc/sys/accept.c b/lib/libc/sys/accept.c
index 38e32f2c836d..10007ec61a69 100644
--- a/lib/libc/sys/accept.c
+++ b/lib/libc/sys/accept.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/accept4.c b/lib/libc/sys/accept4.c
index 2907b047efdc..0440c79a034b 100644
--- a/lib/libc/sys/accept4.c
+++ b/lib/libc/sys/accept4.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/aio_suspend.c b/lib/libc/sys/aio_suspend.c
index 020edf8a74fa..35a050e1fd0d 100644
--- a/lib/libc/sys/aio_suspend.c
+++ b/lib/libc/sys/aio_suspend.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/bindat.2 b/lib/libc/sys/bindat.2
index 12c9b3767689..174f82c56160 100644
--- a/lib/libc/sys/bindat.2
+++ b/lib/libc/sys/bindat.2
@@ -1,5 +1,4 @@
.\" Copyright (c) 2013 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by Pawel Jakub Dawidek under sponsorship from
.\" the FreeBSD Foundation.
diff --git a/lib/libc/sys/cap_fcntls_limit.2 b/lib/libc/sys/cap_fcntls_limit.2
index b09aebbe78f0..eb223ac5d512 100644
--- a/lib/libc/sys/cap_fcntls_limit.2
+++ b/lib/libc/sys/cap_fcntls_limit.2
@@ -1,6 +1,5 @@
.\"
.\" Copyright (c) 2012 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by Pawel Jakub Dawidek under sponsorship
.\" the FreeBSD Foundation.
diff --git a/lib/libc/sys/cap_ioctls_limit.2 b/lib/libc/sys/cap_ioctls_limit.2
index 0cf5ea8ca038..6014db6fb485 100644
--- a/lib/libc/sys/cap_ioctls_limit.2
+++ b/lib/libc/sys/cap_ioctls_limit.2
@@ -1,6 +1,5 @@
.\"
.\" Copyright (c) 2012 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by Pawel Jakub Dawidek under sponsorship
.\" the FreeBSD Foundation.
diff --git a/lib/libc/sys/clock_gettime.2 b/lib/libc/sys/clock_gettime.2
index d620ed0f03f2..21526a98bd40 100644
--- a/lib/libc/sys/clock_gettime.2
+++ b/lib/libc/sys/clock_gettime.2
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 1, 2021
+.Dd July 8, 2022
.Dt CLOCK_GETTIME 2
.Os
.Sh NAME
@@ -96,19 +96,28 @@ Returns the execution time of the calling thread.
.El
.Pp
The clock IDs
+.Fa CLOCK_REALTIME ,
+.Fa CLOCK_MONOTONIC ,
+and
+.Fa CLOCK_UPTIME
+perform a full time counter query.
+The clock IDs with the _FAST suffix, i.e.,
.Fa CLOCK_REALTIME_FAST ,
.Fa CLOCK_MONOTONIC_FAST ,
-.Fa CLOCK_UPTIME_FAST
-are analogs of corresponding IDs without _FAST suffix but do not perform
+and
+.Fa CLOCK_UPTIME_FAST ,
+do not perform
a full time counter query, so their accuracy is one timer tick.
Similarly,
.Fa CLOCK_REALTIME_PRECISE ,
.Fa CLOCK_MONOTONIC_PRECISE ,
+and
.Fa CLOCK_UPTIME_PRECISE
are used to get the most exact value as possible, at the expense of
execution time.
The clock IDs
-.Fa CLOCK_REALTIME_COARSE ,
+.Fa CLOCK_REALTIME_COARSE
+and
.Fa CLOCK_MONOTONIC_COARSE
are aliases of corresponding IDs with _FAST suffix for compatibility with other
systems.
@@ -132,7 +141,9 @@ struct timespec {
.Pp
Only the super-user may set the time of day, using only
.Fa CLOCK_REALTIME .
-If the system securelevel is greater than 1 (see
+If the system
+.Xr securelevel 7
+is greater than 1 (see
.Xr init 8 ) ,
the time may only be advanced.
This limitation is imposed to prevent a malicious super-user
@@ -185,7 +196,9 @@ The clock IDs
.Fa CLOCK_UPTIME_FAST ,
.Fa CLOCK_UPTIME_PRECISE ,
.Fa CLOCK_SECOND
-are FreeBSD extensions to the POSIX interface.
+are
+.Fx
+extensions to the POSIX interface.
.Sh HISTORY
The
.Fn clock_gettime ,
diff --git a/lib/libc/sys/close.c b/lib/libc/sys/close.c
index f7b36f85ddd5..fa1a6f01f0ae 100644
--- a/lib/libc/sys/close.c
+++ b/lib/libc/sys/close.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/connect.c b/lib/libc/sys/connect.c
index 7969142ad072..d2863857ac8a 100644
--- a/lib/libc/sys/connect.c
+++ b/lib/libc/sys/connect.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/connectat.2 b/lib/libc/sys/connectat.2
index 3b90baa0b6f2..db3a15600b82 100644
--- a/lib/libc/sys/connectat.2
+++ b/lib/libc/sys/connectat.2
@@ -1,5 +1,4 @@
.\" Copyright (c) 2013 The FreeBSD Foundation
-.\" All rights reserved.
.\"
.\" This documentation was written by Pawel Jakub Dawidek under sponsorship from
.\" the FreeBSD Foundation.
diff --git a/lib/libc/sys/fcntl.c b/lib/libc/sys/fcntl.c
index f61cf426cc30..a94fa4980df4 100644
--- a/lib/libc/sys/fcntl.c
+++ b/lib/libc/sys/fcntl.c
@@ -6,7 +6,6 @@
* Developed with Red Inc: Alfred Perlstein <alfred@freebsd.org>
*
* Copyright (c) 2014-2015 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/fdatasync.c b/lib/libc/sys/fdatasync.c
index fed97913d31e..504f39a14df2 100644
--- a/lib/libc/sys/fdatasync.c
+++ b/lib/libc/sys/fdatasync.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2016 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/fork.c b/lib/libc/sys/fork.c
index 695540a7264f..04ff1edd4857 100644
--- a/lib/libc/sys/fork.c
+++ b/lib/libc/sys/fork.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/fsync.2 b/lib/libc/sys/fsync.2
index 540e02b78493..4690fa0a4ebe 100644
--- a/lib/libc/sys/fsync.2
+++ b/lib/libc/sys/fsync.2
@@ -1,7 +1,6 @@
.\" Copyright (c) 1983, 1993
.\" The Regents of the University of California. All rights reserved.
.\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
-.\" All rights reserved.
.\"
.\" Parts of this documentation were written by
.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
diff --git a/lib/libc/sys/fsync.c b/lib/libc/sys/fsync.c
index 5f1512932baa..2e2d10e91df9 100644
--- a/lib/libc/sys/fsync.c
+++ b/lib/libc/sys/fsync.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/interposing_table.c b/lib/libc/sys/interposing_table.c
index b2cfb3250cd9..adbfe9daa05b 100644
--- a/lib/libc/sys/interposing_table.c
+++ b/lib/libc/sys/interposing_table.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/kevent.c b/lib/libc/sys/kevent.c
index 5f84ef8b10a6..b3bf2b6f6592 100644
--- a/lib/libc/sys/kevent.c
+++ b/lib/libc/sys/kevent.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2015 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/ktrace.2 b/lib/libc/sys/ktrace.2
index ffe967e35ed8..543f6f6ebba2 100644
--- a/lib/libc/sys/ktrace.2
+++ b/lib/libc/sys/ktrace.2
@@ -109,7 +109,7 @@ struct ktr_header {
pid_t ktr_pid; /* process id */
char ktr_comm[MAXCOMLEN+1]; /* command name */
struct timeval ktr_time; /* timestamp */
- intptr_t ktr_tid; /* was ktr_buffer */
+ long ktr_tid; /* thread id */
};
.Ed
.Pp
diff --git a/lib/libc/sys/msync.c b/lib/libc/sys/msync.c
index d86cc0462dd8..e7a1a4a9629a 100644
--- a/lib/libc/sys/msync.c
+++ b/lib/libc/sys/msync.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/nanosleep.c b/lib/libc/sys/nanosleep.c
index 412b05e778b0..89cbd5e06e36 100644
--- a/lib/libc/sys/nanosleep.c
+++ b/lib/libc/sys/nanosleep.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/open.c b/lib/libc/sys/open.c
index e0273c68a34c..740d1da53598 100644
--- a/lib/libc/sys/open.c
+++ b/lib/libc/sys/open.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/openat.c b/lib/libc/sys/openat.c
index 1bd12ea2a8d8..62188fbc3e48 100644
--- a/lib/libc/sys/openat.c
+++ b/lib/libc/sys/openat.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/pdfork.c b/lib/libc/sys/pdfork.c
index d98f9b2f7d26..f58d36736d7c 100644
--- a/lib/libc/sys/pdfork.c
+++ b/lib/libc/sys/pdfork.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2021 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/poll.c b/lib/libc/sys/poll.c
index 43c17d2f65ce..5b48e4b1bcab 100644
--- a/lib/libc/sys/poll.c
+++ b/lib/libc/sys/poll.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/ppoll.c b/lib/libc/sys/ppoll.c
index f62fd19cafe1..4f346fb19b39 100644
--- a/lib/libc/sys/ppoll.c
+++ b/lib/libc/sys/ppoll.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2015 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/pselect.c b/lib/libc/sys/pselect.c
index a623a7d5cc74..0839f48dfd37 100644
--- a/lib/libc/sys/pselect.c
+++ b/lib/libc/sys/pselect.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/ptrace.c b/lib/libc/sys/ptrace.c
index 2bb615fe563e..69160762c6c8 100644
--- a/lib/libc/sys/ptrace.c
+++ b/lib/libc/sys/ptrace.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2016 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/read.c b/lib/libc/sys/read.c
index ab30189026e3..fd9ee37bf1e5 100644
--- a/lib/libc/sys/read.c
+++ b/lib/libc/sys/read.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/readv.c b/lib/libc/sys/readv.c
index 567292750da0..b02274cb00a0 100644
--- a/lib/libc/sys/readv.c
+++ b/lib/libc/sys/readv.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2
index 1f3bf531c3e7..b35d0729f5e5 100644
--- a/lib/libc/sys/recv.2
+++ b/lib/libc/sys/recv.2
@@ -28,7 +28,7 @@
.\" @(#)recv.2 8.3 (Berkeley) 2/21/94
.\" $FreeBSD$
.\"
-.Dd June 29, 2022
+.Dd July 30, 2022
.Dt RECV 2
.Os
.Sh NAME
@@ -163,6 +163,7 @@ one or more of the values:
.Bl -column ".Dv MSG_CMSG_CLOEXEC" -offset indent
.It Dv MSG_OOB Ta process out-of-band data
.It Dv MSG_PEEK Ta peek at incoming message
+.It Dv MSG_TRUNC Ta return real packet or datagram length
.It Dv MSG_WAITALL Ta wait for full request or error
.It Dv MSG_DONTWAIT Ta do not block
.It Dv MSG_CMSG_CLOEXEC Ta set received fds close-on-exec
@@ -185,6 +186,17 @@ from the beginning of the receive queue without removing that
data from the queue.
Thus, a subsequent receive call will return the same data.
The
+.Dv MSG_TRUNC
+flag causes the receive operation to return the full length of the packet
+or datagram even if larger than provided buffer. The flag is supported
+on SOCK_DGRAM sockets for
+.Dv AF_INET
+,
+.Dv AF_INET6
+and
+.Dv AF_UNIX
+families.
+The
.Dv MSG_WAITALL
flag requests that the operation block until
the full request is satisfied.
diff --git a/lib/libc/sys/recvfrom.c b/lib/libc/sys/recvfrom.c
index aa6ef3fb7be2..c7b815a53d8b 100644
--- a/lib/libc/sys/recvfrom.c
+++ b/lib/libc/sys/recvfrom.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/recvmsg.c b/lib/libc/sys/recvmsg.c
index 282ede9995ff..afb15fa673ea 100644
--- a/lib/libc/sys/recvmsg.c
+++ b/lib/libc/sys/recvmsg.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/select.c b/lib/libc/sys/select.c
index 3990496ec412..e607921da72c 100644
--- a/lib/libc/sys/select.c
+++ b/lib/libc/sys/select.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/sendmsg.c b/lib/libc/sys/sendmsg.c
index 794464339043..8b1505a796ac 100644
--- a/lib/libc/sys/sendmsg.c
+++ b/lib/libc/sys/sendmsg.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/sendto.c b/lib/libc/sys/sendto.c
index ecf98ee05b19..d3914c7472a0 100644
--- a/lib/libc/sys/sendto.c
+++ b/lib/libc/sys/sendto.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/setcontext.c b/lib/libc/sys/setcontext.c
index 31b888f2bcff..2b1d5aba0e63 100644
--- a/lib/libc/sys/setcontext.c
+++ b/lib/libc/sys/setcontext.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/sigaction.c b/lib/libc/sys/sigaction.c
index b4d65639b816..e050832f4705 100644
--- a/lib/libc/sys/sigaction.c
+++ b/lib/libc/sys/sigaction.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/sigprocmask.c b/lib/libc/sys/sigprocmask.c
index d24bb89c1f79..76ecd9fd98ac 100644
--- a/lib/libc/sys/sigprocmask.c
+++ b/lib/libc/sys/sigprocmask.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/sigsuspend.c b/lib/libc/sys/sigsuspend.c
index 1f980a117a1b..5b20b743114e 100644
--- a/lib/libc/sys/sigsuspend.c
+++ b/lib/libc/sys/sigsuspend.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/sigtimedwait.c b/lib/libc/sys/sigtimedwait.c
index 4e067192ca4b..5c81927a526d 100644
--- a/lib/libc/sys/sigtimedwait.c
+++ b/lib/libc/sys/sigtimedwait.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/sigwaitinfo.c b/lib/libc/sys/sigwaitinfo.c
index b9cdc79bc224..6849a1d7c1b9 100644
--- a/lib/libc/sys/sigwaitinfo.c
+++ b/lib/libc/sys/sigwaitinfo.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/socket.2 b/lib/libc/sys/socket.2
index b23d207c9730..1eceabbf6fd4 100644
--- a/lib/libc/sys/socket.2
+++ b/lib/libc/sys/socket.2
@@ -28,7 +28,7 @@
.\" From: @(#)socket.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd August 19, 2018
+.Dd August 30, 2022
.Dt SOCKET 2
.Os
.Sh NAME
@@ -60,15 +60,13 @@ PF_LOCAL Host-internal protocols (alias for PF_UNIX),
PF_UNIX Host-internal protocols,
PF_INET Internet version 4 protocols,
PF_INET6 Internet version 6 protocols,
+PF_DIVERT Firewall packet diversion/re-injection,
PF_ROUTE Internal routing protocol,
-PF_LINK Link layer interface,
PF_KEY Internal key-management function,
-PF_NATM Asynchronous transfer mode protocols,
PF_NETGRAPH Netgraph sockets,
-PF_IEEE80211 IEEE 802.11 wireless link-layer protocols (WiFi),
PF_BLUETOOTH Bluetooth protocols,
PF_INET_SDP OFED socket direct protocol (IPv4),
-PF_INET6_SDP OFED socket direct protocol (IPv6)
+AF_HYPERV HyperV sockets
.Ed
.Pp
Each protocol family is connected to an address family, which has the
@@ -90,7 +88,6 @@ defined types are:
SOCK_STREAM Stream socket,
SOCK_DGRAM Datagram socket,
SOCK_RAW Raw-protocol interface,
-SOCK_RDM Reliably-delivered packet,
SOCK_SEQPACKET Sequenced packet stream
.Ed
.Pp
@@ -113,12 +110,12 @@ an entire packet with each read system call.
This facility may have protocol-specific properties.
.Dv SOCK_RAW
sockets provide access to internal network protocols and interfaces.
-The types
-.Dv SOCK_RAW ,
-which is available only to the super-user, and
-.Dv SOCK_RDM ,
-which is planned,
-but not yet implemented, are not described here.
+The
+.Dv SOCK_RAW
+type is available only to the super-user and is described in
+.Xr ip 4
+and
+.Xr ip6 4 .
.Pp
Additionally, the following flags are allowed in the
.Fa type
@@ -287,10 +284,13 @@ The socket type is not supported by the protocol.
.Xr accept 2 ,
.Xr bind 2 ,
.Xr connect 2 ,
+.Xr divert 4 ,
.Xr getpeername 2 ,
.Xr getsockname 2 ,
.Xr getsockopt 2 ,
.Xr ioctl 2 ,
+.Xr ip 4 ,
+.Xr ip6 4 ,
.Xr listen 2 ,
.Xr read 2 ,
.Xr recv 2 ,
diff --git a/lib/libc/sys/thr_exit.2 b/lib/libc/sys/thr_exit.2
index 8040e0ccbf63..af5d171546ad 100644
--- a/lib/libc/sys/thr_exit.2
+++ b/lib/libc/sys/thr_exit.2
@@ -1,5 +1,4 @@
.\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
-.\" All rights reserved.
.\"
.\" This documentation was written by
.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
diff --git a/lib/libc/sys/thr_kill.2 b/lib/libc/sys/thr_kill.2
index 2378cb60fc88..b13aba8b458c 100644
--- a/lib/libc/sys/thr_kill.2
+++ b/lib/libc/sys/thr_kill.2
@@ -1,5 +1,4 @@
.\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
-.\" All rights reserved.
.\"
.\" This documentation was written by
.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
diff --git a/lib/libc/sys/thr_new.2 b/lib/libc/sys/thr_new.2
index 408ec2a27747..ef6722b54e58 100644
--- a/lib/libc/sys/thr_new.2
+++ b/lib/libc/sys/thr_new.2
@@ -1,5 +1,4 @@
.\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
-.\" All rights reserved.
.\"
.\" This documentation was written by
.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
@@ -214,11 +213,11 @@ scheduling policy.
Creation of the new thread would exceed the
.Dv RACCT_NTHR
limit, see
-.Xr racct 2 .
+.Xr rctl_get_racct 2 .
.It Bq Er EPROCLIM
Creation of the new thread would exceed the
.Dv kern.threads.max_threads_per_proc
-.Xr sysctl 2
+.Xr sysctl 3
limit.
.It Bq Er ENOMEM
There was not enough kernel memory to allocate the new thread structures.
@@ -227,7 +226,7 @@ There was not enough kernel memory to allocate the new thread structures.
.Xr ps 1 ,
.Xr _umtx_op 2 ,
.Xr execve 2 ,
-.Xr racct 2 ,
+.Xr rctl_get_racct 2 ,
.Xr thr_exit 2 ,
.Xr thr_kill 2 ,
.Xr thr_kill2 2 ,
diff --git a/lib/libc/sys/thr_self.2 b/lib/libc/sys/thr_self.2
index 423efa4beca1..d172673e602f 100644
--- a/lib/libc/sys/thr_self.2
+++ b/lib/libc/sys/thr_self.2
@@ -1,5 +1,4 @@
.\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
-.\" All rights reserved.
.\"
.\" This documentation was written by
.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
diff --git a/lib/libc/sys/thr_set_name.2 b/lib/libc/sys/thr_set_name.2
index f63cc4d467ed..0318dc95e845 100644
--- a/lib/libc/sys/thr_set_name.2
+++ b/lib/libc/sys/thr_set_name.2
@@ -1,5 +1,4 @@
.\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
-.\" All rights reserved.
.\"
.\" This documentation was written by
.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
diff --git a/lib/libc/sys/thr_suspend.2 b/lib/libc/sys/thr_suspend.2
index da981bcb36ef..adc994b6d7ba 100644
--- a/lib/libc/sys/thr_suspend.2
+++ b/lib/libc/sys/thr_suspend.2
@@ -1,5 +1,4 @@
.\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
-.\" All rights reserved.
.\"
.\" This documentation was written by
.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
diff --git a/lib/libc/sys/thr_wake.2 b/lib/libc/sys/thr_wake.2
index b8862b4a3f9c..339dfc1f84ff 100644
--- a/lib/libc/sys/thr_wake.2
+++ b/lib/libc/sys/thr_wake.2
@@ -1,5 +1,4 @@
.\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
-.\" All rights reserved.
.\"
.\" This documentation was written by
.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
diff --git a/lib/libc/sys/wait4.c b/lib/libc/sys/wait4.c
index a5dbd0fcb1aa..0b14c363ed32 100644
--- a/lib/libc/sys/wait4.c
+++ b/lib/libc/sys/wait4.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/wait6.c b/lib/libc/sys/wait6.c
index d280a7698747..af6a1b219a54 100644
--- a/lib/libc/sys/wait6.c
+++ b/lib/libc/sys/wait6.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2015 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/write.c b/lib/libc/sys/write.c
index ffb1aa5ffba7..d38f7dfa9294 100644
--- a/lib/libc/sys/write.c
+++ b/lib/libc/sys/write.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/sys/writev.c b/lib/libc/sys/writev.c
index 20b10053dc59..0ea5576b5b04 100644
--- a/lib/libc/sys/writev.c
+++ b/lib/libc/sys/writev.c
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2014 The FreeBSD Foundation.
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libc/tests/locale/c16rtomb_test.c b/lib/libc/tests/locale/c16rtomb_test.c
index ea1f64f7d308..7356e69f82f6 100644
--- a/lib/libc/tests/locale/c16rtomb_test.c
+++ b/lib/libc/tests/locale/c16rtomb_test.c
@@ -127,6 +127,9 @@ ATF_TC_WITHOUT_HEAD(c16rtomb_utf_8_test);
ATF_TC_BODY(c16rtomb_utf_8_test, tc)
{
+ if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
+ atf_tc_skip("https://bugs.freebsd.org/265871");
+
require_lc_ctype("en_US.UTF-8");
/* Unicode character 'Pile of poo'. */
diff --git a/lib/libc/tests/stdlib/Makefile b/lib/libc/tests/stdlib/Makefile
index ffba83443a9e..e4c0cfea73fe 100644
--- a/lib/libc/tests/stdlib/Makefile
+++ b/lib/libc/tests/stdlib/Makefile
@@ -7,6 +7,10 @@ ATF_TESTS_C+= dynthr_test
ATF_TESTS_C+= heapsort_test
ATF_TESTS_C+= mergesort_test
ATF_TESTS_C+= qsort_test
+.if ${COMPILER_TYPE} == "clang"
+ATF_TESTS_C+= qsort_b_test
+.endif
+ATF_TESTS_C+= qsort_r_compat_test
ATF_TESTS_C+= qsort_r_test
ATF_TESTS_C+= qsort_s_test
ATF_TESTS_C+= set_constraint_handler_s_test
@@ -59,6 +63,12 @@ CXXSTD.cxa_thread_atexit_test= c++11
CXXSTD.cxa_thread_atexit_nothr_test= c++11
LIBADD.cxa_thread_atexit_test+= pthread
+# Tests that requires Blocks feature
+.for t in qsort_b_test
+CFLAGS.${t}.c+= -fblocks
+LIBADD.${t}+= BlocksRuntime
+.endfor
+
.for t in h_getopt h_getopt_long
CFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests
LDFLAGS.$t+= -L${LIBNETBSD_OBJDIR}
diff --git a/lib/libc/tests/stdlib/qsort_b_test.c b/lib/libc/tests/stdlib/qsort_b_test.c
new file mode 100644
index 000000000000..60cd30ac222a
--- /dev/null
+++ b/lib/libc/tests/stdlib/qsort_b_test.c
@@ -0,0 +1,76 @@
+/*-
+ * Copyright (C) 2004 Maxim Sobolev <sobomax@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.
+ */
+
+/*
+ * Test for qsort_b() routine.
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "test-sort.h"
+
+ATF_TC_WITHOUT_HEAD(qsort_b_test);
+ATF_TC_BODY(qsort_b_test, tc)
+{
+ int testvector[IVEC_LEN];
+ int sresvector[IVEC_LEN];
+ int i, j;
+
+ for (j = 2; j < IVEC_LEN; j++) {
+ /* Populate test vectors */
+ for (i = 0; i < j; i++)
+ testvector[i] = sresvector[i] = initvector[i];
+
+ /* Sort using qsort_b(3) */
+ qsort_b(testvector, j, sizeof(testvector[0]),
+ ^(const void* a, const void* b) {
+ if (*(int *)a > *(int *)b)
+ return (1);
+ else if (*(int *)a < *(int *)b)
+ return (-1);
+ else
+ return (0);
+ });
+ /* Sort using reference slow sorting routine */
+ ssort(sresvector, j);
+
+ /* Compare results */
+ for (i = 0; i < j; i++)
+ ATF_CHECK_MSG(testvector[i] == sresvector[i],
+ "item at index %d didn't match: %d != %d",
+ i, testvector[i], sresvector[i]);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, qsort_b_test);
+
+ return (atf_no_error());
+}
diff --git a/lib/libc/tests/stdlib/qsort_r_compat_test.c b/lib/libc/tests/stdlib/qsort_r_compat_test.c
new file mode 100644
index 000000000000..84fd1b116b82
--- /dev/null
+++ b/lib/libc/tests/stdlib/qsort_r_compat_test.c
@@ -0,0 +1,92 @@
+/*-
+ * Copyright (C) 2020 Edward Tomasz Napierala <trasz@FreeBSD.org>
+ * Copyright (C) 2004 Maxim Sobolev <sobomax@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.
+ */
+
+/*
+ * Test for historical qsort_r(3) routine.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "test-sort.h"
+
+#define THUNK 42
+
+static int
+sorthelp_r(void *thunk, const void *a, const void *b)
+{
+ const int *oa, *ob;
+
+ ATF_REQUIRE_EQ(*(int *)thunk, THUNK);
+
+ oa = a;
+ ob = b;
+ /* Don't use "return *oa - *ob" since it's easy to cause overflow! */
+ if (*oa > *ob)
+ return (1);
+ if (*oa < *ob)
+ return (-1);
+ return (0);
+}
+
+ATF_TC_WITHOUT_HEAD(qsort_r_compat_test);
+ATF_TC_BODY(qsort_r_compat_test, tc)
+{
+ int testvector[IVEC_LEN];
+ int sresvector[IVEC_LEN];
+ int i, j;
+ int thunk = THUNK;
+
+ for (j = 2; j < IVEC_LEN; j++) {
+ /* Populate test vectors */
+ for (i = 0; i < j; i++)
+ testvector[i] = sresvector[i] = initvector[i];
+
+ /* Sort using qsort_r(3) */
+ qsort_r(testvector, j, sizeof(testvector[0]), &thunk,
+ sorthelp_r);
+ /* Sort using reference slow sorting routine */
+ ssort(sresvector, j);
+
+ /* Compare results */
+ for (i = 0; i < j; i++)
+ ATF_CHECK_MSG(testvector[i] == sresvector[i],
+ "item at index %d didn't match: %d != %d",
+ i, testvector[i], sresvector[i]);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, qsort_r_compat_test);
+
+ return (atf_no_error());
+}
diff --git a/lib/libc/tests/stdlib/qsort_r_test.c b/lib/libc/tests/stdlib/qsort_r_test.c
index c27e6d92d587..c55563eaea8a 100644
--- a/lib/libc/tests/stdlib/qsort_r_test.c
+++ b/lib/libc/tests/stdlib/qsort_r_test.c
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
#define THUNK 42
static int
-sorthelp_r(void *thunk, const void *a, const void *b)
+sorthelp_r(const void *a, const void *b, void *thunk)
{
const int *oa, *ob;
@@ -70,8 +70,8 @@ ATF_TC_BODY(qsort_r_test, tc)
testvector[i] = sresvector[i] = initvector[i];
/* Sort using qsort_r(3) */
- qsort_r(testvector, j, sizeof(testvector[0]), &thunk,
- sorthelp_r);
+ qsort_r(testvector, j, sizeof(testvector[0]), sorthelp_r,
+ &thunk);
/* Sort using reference slow sorting routine */
ssort(sresvector, j);
diff --git a/lib/libc/tests/string/Makefile b/lib/libc/tests/string/Makefile
index c6a98572564d..eacf7e15c27c 100644
--- a/lib/libc/tests/string/Makefile
+++ b/lib/libc/tests/string/Makefile
@@ -4,10 +4,11 @@ ATF_TESTS_C+= memcmp_test
ATF_TESTS_C+= memset_s_test
ATF_TESTS_C+= stpncpy_test
ATF_TESTS_C+= strerror2_test
-ATF_TESTS_C+= wcscasecmp_test
-ATF_TESTS_C+= wcsnlen_test
+ATF_TESTS_C+= strverscmp_test
ATF_TESTS_C+= strxfrm_test
+ATF_TESTS_C+= wcscasecmp_test
ATF_TESTS_C+= wcscoll_test
+ATF_TESTS_C+= wcsnlen_test
# TODO: popcount, stresep
diff --git a/lib/libc/tests/string/strverscmp_test.c b/lib/libc/tests/string/strverscmp_test.c
new file mode 100644
index 000000000000..fd6a2620cb48
--- /dev/null
+++ b/lib/libc/tests/string/strverscmp_test.c
@@ -0,0 +1,93 @@
+/*-
+* SPDX-License-Identifier: BSD-2-Clause
+* Copyright (c) 2022 Aymeric Wibo <obiwac@gmail.com>
+*/
+
+#include <atf-c.h>
+#include <string.h>
+
+static void
+check_all(size_t len, const char *ordered[len])
+{
+ const char *a, *b;
+
+ for (size_t i = 0; i < len; i++) {
+ for (size_t j = 0; j < len; j++) {
+ a = ordered[i];
+ b = ordered[j];
+
+ if (i == j)
+ ATF_CHECK_MSG(
+ strverscmp(a, b) == 0,
+ "strverscmp(\"%s\", \"%s\") == 0",
+ a, b
+ );
+ else if (i < j)
+ ATF_CHECK_MSG(
+ strverscmp(a, b) < 0,
+ "strverscmp(\"%s\", \"%s\") < 0",
+ a, b
+ );
+ else if (i > j)
+ ATF_CHECK_MSG(
+ strverscmp(a, b) > 0,
+ "strverscmp(\"%s\", \"%s\") > 0",
+ a, b
+ );
+ }
+ }
+}
+
+#define CHECK_ALL(...) do { \
+ const char *ordered[] = { __VA_ARGS__ }; \
+ check_all(sizeof(ordered) / sizeof(*ordered), ordered); \
+} while (0)
+
+ATF_TC_WITHOUT_HEAD(strcmp_functionality);
+ATF_TC_BODY(strcmp_functionality, tc)
+{
+ CHECK_ALL("", "a", "b");
+}
+
+/* from Linux man page strverscmp(3) */
+
+ATF_TC_WITHOUT_HEAD(vers_ordering);
+ATF_TC_BODY(vers_ordering, tc)
+{
+ CHECK_ALL("000", "00", "01", "010", "09", "0", "1", "9", "10");
+}
+
+ATF_TC_WITHOUT_HEAD(natural_ordering);
+ATF_TC_BODY(natural_ordering, tc)
+{
+ CHECK_ALL("jan1", "jan2", "jan9", "jan10", "jan11", "jan19", "jan20");
+}
+
+/* https://sourceware.org/bugzilla/show_bug.cgi?id=9913 */
+
+ATF_TC_WITHOUT_HEAD(glibc_bug_9913);
+ATF_TC_BODY(glibc_bug_9913, tc)
+{
+ CHECK_ALL(
+ "B0075022800016.gbp.corp.com",
+ "B007502280067.gbp.corp.com",
+ "B007502357019.GBP.CORP.COM"
+ );
+}
+
+ATF_TC_WITHOUT_HEAD(semver_ordering);
+ATF_TC_BODY(semver_ordering, tc)
+{
+ CHECK_ALL("2.6.20", "2.6.21");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, strcmp_functionality);
+ ATF_TP_ADD_TC(tp, vers_ordering);
+ ATF_TP_ADD_TC(tp, natural_ordering);
+ ATF_TP_ADD_TC(tp, glibc_bug_9913);
+ ATF_TP_ADD_TC(tp, semver_ordering);
+
+ return (atf_no_error());
+}
diff --git a/lib/libc/x86/sys/pkru.3 b/lib/libc/x86/sys/pkru.3
index fc9a7ba8ca86..41cbf465b452 100644
--- a/lib/libc/x86/sys/pkru.3
+++ b/lib/libc/x86/sys/pkru.3
@@ -1,5 +1,4 @@
.\" Copyright (c) 2019 The FreeBSD Foundation, Inc.
-.\" All rights reserved.
.\"
.\" This documentation was written by
.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
diff --git a/lib/libc/x86/sys/pkru.c b/lib/libc/x86/sys/pkru.c
index 28ce93389fd0..a5fc16ca4a47 100644
--- a/lib/libc/x86/sys/pkru.c
+++ b/lib/libc/x86/sys/pkru.c
@@ -1,6 +1,5 @@
/*-
* Copyright (c) 2019 The FreeBSD Foundation
- * All rights reserved.
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
diff --git a/lib/libcasper/libcasper/libcasper.3 b/lib/libcasper/libcasper/libcasper.3
index 2151131e29ec..a53ebed0dff1 100644
--- a/lib/libcasper/libcasper/libcasper.3
+++ b/lib/libcasper/libcasper/libcasper.3
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 15, 2021
+.Dd September 29, 2022
.Dt LIBCASPER 3
.Os
.Sh NAME
@@ -219,6 +219,8 @@ provides a
compatible API
.It system.net
provides a libc compatible network API
+.It system.netdb
+provides libc compatible network proto API
.It system.pwd
provides a
.Xr getpwent 3
@@ -273,6 +275,7 @@ functions always succeed.
.Xr cap_dns 3 ,
.Xr cap_grp 3 ,
.Xr cap_net 3 ,
+.Xr cap_netdb 3 ,
.Xr cap_pwd 3 ,
.Xr cap_sysctl 3 ,
.Xr cap_syslog 3 ,
diff --git a/lib/libcasper/libcasper/libcasper_service.3 b/lib/libcasper/libcasper/libcasper_service.3
index 8ddc41f3d617..885852d9af8e 100644
--- a/lib/libcasper/libcasper/libcasper_service.3
+++ b/lib/libcasper/libcasper/libcasper_service.3
@@ -95,7 +95,7 @@ from the process it was spawned from.
The whole casper communication is using an
.Xr nvlist 9
with the
-.Xr NVLIST_NO_UNIQ 9
+.Dv NV_FLAG_NO_UNIQUE
flag.
.El
.Sh SEE ALSO
diff --git a/lib/libcasper/services/cap_netdb/cap_netdb.3 b/lib/libcasper/services/cap_netdb/cap_netdb.3
index 6df34559224c..cfbfc17da1ac 100644
--- a/lib/libcasper/services/cap_netdb/cap_netdb.3
+++ b/lib/libcasper/services/cap_netdb/cap_netdb.3
@@ -23,7 +23,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 12, 2020
+.Dd September 29, 2022
.Dt CAP_NETDB 3
.Os
.Sh NAME
@@ -38,7 +38,6 @@
.Ft "struct protoent *"
.Fn cap_getprotobyname "const cap_channel_t *chan" "const char *name"
.Sh DESCRIPTION
-.Bf -symbolic
The function
.Fn cap_getprotobyname
is equivalent to
diff --git a/lib/libcuse/cuse.3 b/lib/libcuse/cuse.3
index 74888a687be8..52f9ca4d225a 100644
--- a/lib/libcuse/cuse.3
+++ b/lib/libcuse/cuse.3
@@ -1,6 +1,6 @@
.\" $FreeBSD$
.\"
-.\" Copyright (c) 2010-2013 Hans Petter Selasky
+.\" Copyright (c) 2010-2022 Hans Petter Selasky
.\"
.\" All rights reserved.
.\"
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 17, 2019
+.Dd July 18, 2022
.Dt CUSE 3
.Os
.Sh NAME
@@ -114,7 +114,7 @@ See
for known error codes.
.Sh LIBRARY USAGE
.Ft "void *"
-.Fn "cuse_vmalloc" "int size"
+.Fn "cuse_vmalloc" "unsigned size"
This function allocates
.Ar size
bytes of memory.
@@ -124,6 +124,11 @@ mapped by
This function returns a valid data pointer on success or
.Dv NULL
on failure.
+The returned pointer is always aligned to the system page size.
+The number and size of allocations is limited by the
+.Xr mmap 2
+offset having to fit into a 32-bit variable typically for 32-bit
+applications.
.Pp
.Ft "int"
.Fn "cuse_is_vmalloc_addr" "void *"
@@ -136,16 +141,13 @@ Else this function returns zero.
.Fn "cuse_vmfree" "void *"
This function frees memory allocated by
.Fn cuse_vmalloc .
-Note that the
-cuse library will internally not free the memory until the
-.Fn cuse_uninit
-function is called and that the number of unique
-allocations is limited.
+This function is NULL safe.
.Pp
.Ft "unsigned long"
.Fn "cuse_vmoffset" "void *"
-This function returns the mmap offset that the client must use to
+This function returns the mmap offset the client must use to
access the allocated memory.
+The passed pointer must be aligned to the system page size.
.Pp
.Ft "struct cuse_dev *"
.Fn "cuse_dev_create" "const struct cuse_methods *mtod" "void *priv0" "void *priv1" "uid_t" "gid_t" "int permission" "const char *fmt" "..."
diff --git a/lib/libcuse/cuse.h b/lib/libcuse/cuse.h
index d502c5bd5415..f82401b98bf3 100644
--- a/lib/libcuse/cuse.h
+++ b/lib/libcuse/cuse.h
@@ -54,7 +54,7 @@ struct cuse_methods {
int cuse_init(void);
int cuse_uninit(void);
-void *cuse_vmalloc(int);
+void *cuse_vmalloc(unsigned);
int cuse_is_vmalloc_addr(void *);
void cuse_vmfree(void *);
unsigned long cuse_vmoffset(void *ptr);
diff --git a/lib/libcuse/cuse_lib.c b/lib/libcuse/cuse_lib.c
index fda0c96d0d70..2653ed3067d5 100644
--- a/lib/libcuse/cuse_lib.c
+++ b/lib/libcuse/cuse_lib.c
@@ -145,7 +145,7 @@ cuse_vmoffset(void *_ptr)
unsigned long n;
CUSE_LOCK();
- for (n = 0; n != CUSE_ALLOC_UNIT_MAX; n++) {
+ for (n = remainder = 0; n != CUSE_ALLOC_UNIT_MAX; n++) {
if (a_cuse[n].ptr == NULL)
continue;
@@ -153,91 +153,84 @@ cuse_vmoffset(void *_ptr)
ptr_max = a_cuse[n].ptr + a_cuse[n].size - 1;
if ((ptr >= ptr_min) && (ptr <= ptr_max)) {
-
- CUSE_UNLOCK();
-
remainder = (ptr - ptr_min);
-
- remainder -= remainder %
- (unsigned long)getpagesize();
-
- return ((n * CUSE_ALLOC_BYTES_MAX) + remainder);
+ break;
}
}
CUSE_UNLOCK();
- return (0x80000000UL); /* failure */
+ return ((n << CUSE_ALLOC_UNIT_SHIFT) + remainder);
}
void *
-cuse_vmalloc(int size)
+cuse_vmalloc(unsigned size)
{
struct cuse_alloc_info info;
unsigned long pgsize;
+ unsigned long x;
+ unsigned long m;
unsigned long n;
void *ptr;
int error;
- if (f_cuse < 0)
+ /* some sanity checks */
+ if (f_cuse < 0 || size < 1 || size > CUSE_ALLOC_BYTES_MAX)
return (NULL);
memset(&info, 0, sizeof(info));
- if (size < 1)
- return (NULL);
-
pgsize = getpagesize();
info.page_count = howmany(size, pgsize);
- CUSE_LOCK();
- for (n = 0; n != CUSE_ALLOC_UNIT_MAX; n++) {
+ /* compute how many units the allocation needs */
+ m = howmany(size, 1 << CUSE_ALLOC_UNIT_SHIFT);
+ if (m == 0 || m > CUSE_ALLOC_UNIT_MAX)
+ return (NULL);
- if (a_cuse[n].ptr != NULL)
+ CUSE_LOCK();
+ for (n = 0; n <= CUSE_ALLOC_UNIT_MAX - m; ) {
+ if (a_cuse[n].size != 0) {
+ /* skip to next available unit, depending on allocation size */
+ n += howmany(a_cuse[n].size, 1 << CUSE_ALLOC_UNIT_SHIFT);
continue;
-
- a_cuse[n].ptr = ((uint8_t *)1); /* reserve */
- a_cuse[n].size = 0;
-
+ }
+ /* check if there are "m" free units ahead */
+ for (x = 1; x != m; x++) {
+ if (a_cuse[n + x].size != 0)
+ break;
+ }
+ if (x != m) {
+ /* skip to next available unit, if any */
+ n += x + 1;
+ continue;
+ }
+ /* reserve this unit by setting the size to a non-zero value */
+ a_cuse[n].size = size;
CUSE_UNLOCK();
info.alloc_nr = n;
error = ioctl(f_cuse, CUSE_IOCTL_ALLOC_MEMORY, &info);
- if (error) {
-
- CUSE_LOCK();
-
- a_cuse[n].ptr = NULL;
-
- if (errno == EBUSY)
- continue;
- else
- break;
- }
- ptr = mmap(NULL, info.page_count * pgsize,
- PROT_READ | PROT_WRITE,
- MAP_SHARED, f_cuse, CUSE_ALLOC_BYTES_MAX * n);
-
- if (ptr == MAP_FAILED) {
+ if (error == 0) {
+ ptr = mmap(NULL, info.page_count * pgsize,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED, f_cuse, n << CUSE_ALLOC_UNIT_SHIFT);
- error = ioctl(f_cuse, CUSE_IOCTL_FREE_MEMORY, &info);
+ if (ptr != MAP_FAILED) {
+ CUSE_LOCK();
+ a_cuse[n].ptr = ptr;
+ CUSE_UNLOCK();
- if (error) {
- /* ignore */
+ return (ptr); /* success */
}
- CUSE_LOCK();
-
- a_cuse[n].ptr = NULL;
- break;
+ (void) ioctl(f_cuse, CUSE_IOCTL_FREE_MEMORY, &info);
}
- CUSE_LOCK();
- a_cuse[n].ptr = ptr;
- a_cuse[n].size = size;
- CUSE_UNLOCK();
- return (ptr); /* success */
+ CUSE_LOCK();
+ a_cuse[n].size = 0;
+ n++;
}
CUSE_UNLOCK();
return (NULL); /* failure */
@@ -269,7 +262,7 @@ cuse_vmfree(void *ptr)
int error;
int n;
- if (f_cuse < 0)
+ if (f_cuse < 0 || ptr == NULL)
return;
CUSE_LOCK();
diff --git a/lib/libdpv/dpv.3 b/lib/libdpv/dpv.3
index a2f99b2f7af1..62dd2e94d736 100644
--- a/lib/libdpv/dpv.3
+++ b/lib/libdpv/dpv.3
@@ -55,8 +55,7 @@ library can display progress with one of
.Xr dialog 3 ,
.Xr dialog 1 ,
or
-.Xr Xdialog 1
-.Pq x11/xdialog from the ports tree .
+.Xr Xdialog 1 Pq Pa ports/x11/xdialog .
.Pp
The
.Fn dpv
@@ -152,7 +151,7 @@ argument will bump the width of the gauge widget.
Prompts wider than the maximum width will wrap
.Po
unless using
-.Xr Xdialog 1 ;
+.Xr Xdialog 1 Pq Pa ports/x11/xdialog ;
see BUGS section below
.Pc .
.It Dv DPV_NO_LABELS
@@ -405,7 +404,7 @@ Override command string used to launch
.Xr dialog 1
.Pq requires Dv DPV_DISPLAY_DIALOG
or
-.Xr Xdialog 1
+.Xr Xdialog 1 Pq Pa ports/x11/xdialog
.Pq requires Dv DPV_DISPLAY_XDIALOG ;
default is either
.Ql dialog
@@ -428,8 +427,9 @@ used as a prefix to
.It Ev USE_COLOR
If set and NULL,
disables the use of color when using
-.Xr dialog 1
-.Pq does not apply to Xr Xdialog 1 .
+.Xr dialog 1 .
+Does not apply to
+.Xr Xdialog 1 Pq Pa ports/x11/xdialog .
.It Ev msg_done Ev msg_fail Ev msg_pending
Internationalization strings for overriding the default English strings
.Ql Done ,
@@ -456,7 +456,7 @@ or desired values.
.El
.Sh SEE ALSO
.Xr dialog 1 ,
-.Xr Xdialog 1 ,
+.Xr Xdialog 1 Pq Pa ports/x11/xdialog ,
.Xr dialog 3
.Sh HISTORY
The
@@ -466,7 +466,7 @@ library first appeared in
.Sh AUTHORS
.An Devin Teske Aq dteske@FreeBSD.org
.Sh BUGS
-.Xr Xdialog 1 ,
+.Xr Xdialog 1 Pq Pa ports/x11/xdialog ,
when given both
.Ql Fl -title Ar title
.Po
@@ -485,12 +485,12 @@ member of
.Pc ,
displays the backtitle in place of the title and vice-versa.
.Pp
-.Xr Xdialog 1
+.Xr Xdialog 1 Pq Pa ports/x11/xdialog
does not wrap long prompt texts received after initial launch.
This is a known issue with the
.Ql --gauge
widget in
-.Xr Xdialog 1 .
+.Xr Xdialog 1 Pq Pa ports/x11/xdialog .
Embed escaped newlines within prompt text to force line breaks.
.Pp
.Xr dialog 1
@@ -501,7 +501,7 @@ This is a known issue with
and does not affect
.Xr dialog 3
or
-.Xr Xdialog 1 .
+.Xr Xdialog 1 Pq Pa ports/x11/xdialog .
.Pp
If an application ignores
.Ev USE_COLOR
@@ -520,7 +520,7 @@ to unset
.Ev USE_COLOR ,
forcing interpretation of color sequences.
This does not effect
-.Xr Xdialog 1 ,
+.Xr Xdialog 1 Pq Pa ports/x11/xdialog ,
which renders the color escape sequences as plain text.
See
.Do
diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile
index 28014feafab7..4e33320cab70 100644
--- a/lib/libedit/Makefile
+++ b/lib/libedit/Makefile
@@ -97,3 +97,5 @@ test: tc1.o libedit.a ${DPADD} ${LIBTERMCAP}
${CC} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} libedit.a ${LDADD}
.include <bsd.lib.mk>
+
+CWARNFLAGS.chartype.c= ${NO_WUSE_AFTER_FREE}
diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c
index 9003b156f7fe..186f1cd5f103 100644
--- a/lib/libefivar/efivar-dp-format.c
+++ b/lib/libefivar/efivar-dp-format.c
@@ -1049,8 +1049,9 @@ DevPathToTextUsbWWID (
//
// In case no NULL terminator in SerialNumber, create a new one with NULL terminator
//
- NewStr = AllocateCopyPool ((Length + 1) * sizeof (CHAR16), SerialNumberStr);
+ NewStr = AllocatePool ((Length + 1) * sizeof (CHAR16));
ASSERT (NewStr != NULL);
+ CopyMem (NewStr, SerialNumberStr, Length * sizeof (CHAR16));
NewStr[Length] = 0;
SerialNumberStr = NewStr;
}
diff --git a/lib/libexpat/expat_config.h b/lib/libexpat/expat_config.h
index e2ffcb15c7ef..bebee0d28d62 100644
--- a/lib/libexpat/expat_config.h
+++ b/lib/libexpat/expat_config.h
@@ -83,7 +83,7 @@
#define PACKAGE_NAME "expat"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "expat 2.4.3"
+#define PACKAGE_STRING "expat 2.4.9"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "expat"
@@ -92,7 +92,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "2.4.3"
+#define PACKAGE_VERSION "2.4.9"
/* 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
@@ -100,7 +100,7 @@
#define STDC_HEADERS 1
/* Version number of package */
-#define VERSION "2.4.3"
+#define VERSION "2.4.9"
/* 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/libexpat/libbsdxml.3 b/lib/libexpat/libbsdxml.3
index 87de2adf2854..d50d552e3edb 100644
--- a/lib/libexpat/libbsdxml.3
+++ b/lib/libexpat/libbsdxml.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"/
-.Dd November 25, 2019
+.Dd September 20, 2022
.Dt LIBBSDXML 3
.Os
.Sh NAME
@@ -36,7 +36,7 @@
.Sh DESCRIPTION
The
.Nm
-library is a verbatim copy of the eXpat XML library version 2.2.9.
+library is a verbatim copy of the eXpat XML library version 2.4.9.
.Pp
The
.Nm
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index 628ab69612f7..47545e5178c3 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -456,7 +456,7 @@ fetch_socks5_init(conn_t *conn, const char *host, int port, int verbose)
goto fail;
}
*ptr++ = strlen(host);
- strncpy(ptr, host, strlen(host));
+ memcpy(ptr, host, strlen(host));
ptr = ptr + strlen(host);
port = htons(port);
diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3
index cb37c08593d6..81db72529c4c 100644
--- a/lib/libfetch/fetch.3
+++ b/lib/libfetch/fetch.3
@@ -457,8 +457,7 @@ the environment variable
.Ev SSL_CLIENT_KEY_FILE
can be set to point to the key file.
In case the key uses a password, the user will be prompted on standard
-input (see
-.Xr PEM 3 ) .
+input.
.Pp
By default
.Nm libfetch
diff --git a/lib/libgeom/geom_ctl.c b/lib/libgeom/geom_ctl.c
index b60c4c297257..b1d738333b3f 100644
--- a/lib/libgeom/geom_ctl.c
+++ b/lib/libgeom/geom_ctl.c
@@ -194,7 +194,7 @@ gctl_rw_param(struct gctl_req *req, const char *name, int len, void *value)
const char *
gctl_issue(struct gctl_req *req)
{
- int fd, error;
+ int fd;
if (req == NULL)
return ("NULL request pointer");
@@ -212,11 +212,11 @@ gctl_issue(struct gctl_req *req)
fd = open(_PATH_DEV PATH_GEOM_CTL, O_RDONLY);
if (fd < 0)
return(strerror(errno));
- error = ioctl(fd, GEOM_CTL, req);
+ req->nerror = ioctl(fd, GEOM_CTL, req);
close(fd);
if (req->error[0] != '\0')
return (req->error);
- if (error != 0)
+ if (req->nerror == -1)
return(strerror(errno));
return (NULL);
}
diff --git a/lib/libgeom/libgeom.3 b/lib/libgeom/libgeom.3
index e1a3a35b7062..79977630c90d 100644
--- a/lib/libgeom/libgeom.3
+++ b/lib/libgeom/libgeom.3
@@ -298,7 +298,7 @@ that fetches the
.Ar kern.geom.confxml
OID, and returns it's value.
The allocated memory should be released with
-.Xr free 2
+.Xr free 3
after use.
.Pp
The
diff --git a/lib/libgssapi/Makefile b/lib/libgssapi/Makefile
index 3094631e8536..0982b88ab59c 100644
--- a/lib/libgssapi/Makefile
+++ b/lib/libgssapi/Makefile
@@ -1,5 +1,6 @@
# $FreeBSD$
+PACKAGE= runtime
LIB= gssapi
SHLIB_MAJOR= 10
VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def
diff --git a/lib/libiconv_modules/Makefile.inc b/lib/libiconv_modules/Makefile.inc
index 556997404f99..364e78c9bf85 100644
--- a/lib/libiconv_modules/Makefile.inc
+++ b/lib/libiconv_modules/Makefile.inc
@@ -2,7 +2,7 @@
.PATH: ${SRCTOP}/lib/libc/iconv
-SHLIB_MAJOR= 4
+SHLIB_MAJOR= 5
CFLAGS+= -I${SRCTOP}/lib/libc/iconv
CFLAGS+= -Dbool=_Bool
diff --git a/lib/libiconv_modules/UTF1632/citrus_utf1632.c b/lib/libiconv_modules/UTF1632/citrus_utf1632.c
index b9625165051c..27a810597c7f 100644
--- a/lib/libiconv_modules/UTF1632/citrus_utf1632.c
+++ b/lib/libiconv_modules/UTF1632/citrus_utf1632.c
@@ -77,6 +77,7 @@ typedef struct {
typedef struct {
int preffered_endian;
unsigned int cur_max;
+ unsigned int cur_min;
uint32_t mode;
} _UTF1632EncodingInfo;
@@ -84,6 +85,7 @@ typedef struct {
#define _ENCODING_INFO _UTF1632EncodingInfo
#define _ENCODING_STATE _UTF1632State
#define _ENCODING_MB_CUR_MAX(_ei_) ((_ei_)->cur_max)
+#define _ENCODING_MB_CUR_MIN(_ei_) ((_ei_)->cur_min)
#define _ENCODING_IS_STATE_DEPENDENT 0
#define _STATE_NEEDS_EXPLICIT_INIT(_ps_) 0
@@ -390,6 +392,7 @@ _citrus_UTF1632_encoding_module_init(_UTF1632EncodingInfo * __restrict ei,
parse_variable(ei, var, lenvar);
+ ei->cur_min = ((ei->mode&_MODE_UTF32) == 0) ? 2 : 4;
ei->cur_max = ((ei->mode&_MODE_UTF32) == 0) ? 6 : 8;
/* 6: endian + surrogate */
/* 8: endian + normal */
diff --git a/lib/libiconv_modules/VIQR/citrus_viqr.c b/lib/libiconv_modules/VIQR/citrus_viqr.c
index 8a81a7d12b01..f40910d8edf3 100644
--- a/lib/libiconv_modules/VIQR/citrus_viqr.c
+++ b/lib/libiconv_modules/VIQR/citrus_viqr.c
@@ -195,9 +195,9 @@ mnemonic_append_child(mnemonic_t *m, const char *s,
static void
mnemonic_destroy(mnemonic_t *m)
{
- mnemonic_t *m0;
+ mnemonic_t *m0, *n;
- TAILQ_FOREACH(m0, &m->child, entry)
+ TAILQ_FOREACH_SAFE(m0, &m->child, entry, n)
mnemonic_destroy(m0);
free(m);
}
diff --git a/lib/libiconv_modules/iconv_std/citrus_iconv_std.c b/lib/libiconv_modules/iconv_std/citrus_iconv_std.c
index ec9f21de541e..73dc75abacbb 100644
--- a/lib/libiconv_modules/iconv_std/citrus_iconv_std.c
+++ b/lib/libiconv_modules/iconv_std/citrus_iconv_std.c
@@ -472,7 +472,7 @@ _citrus_iconv_std_iconv_convert(struct _citrus_iconv * __restrict cv,
_csid_t csid;
_index_t idx;
char *tmpin;
- size_t inval, szrin, szrout;
+ size_t inval, in_mb_cur_min, szrin, szrout;
int ret, state = 0;
inval = 0;
@@ -504,6 +504,8 @@ _citrus_iconv_std_iconv_convert(struct _citrus_iconv * __restrict cv,
return (0);
}
+ in_mb_cur_min = _stdenc_get_mb_cur_min(is->is_src_encoding);
+
/* normal case */
for (;;) {
if (*inbytes == 0) {
@@ -522,8 +524,20 @@ _citrus_iconv_std_iconv_convert(struct _citrus_iconv * __restrict cv,
szrin = szrout = 0;
ret = mbtocsx(&sc->sc_src_encoding, &csid, &idx, &tmpin,
*inbytes, &szrin, cv->cv_shared->ci_hooks);
- if (ret)
+ if (ret != 0 && (ret != EILSEQ ||
+ !cv->cv_shared->ci_discard_ilseq)) {
goto err;
+ } else if (ret == EILSEQ) {
+ /*
+ * If //IGNORE was specified, we'll just keep crunching
+ * through invalid characters.
+ */
+ *in += in_mb_cur_min;
+ *inbytes -= in_mb_cur_min;
+ restore_encoding_state(&sc->sc_src_encoding);
+ restore_encoding_state(&sc->sc_dst_encoding);
+ continue;
+ }
if (szrin == (size_t)-2) {
/* incompleted character */
diff --git a/lib/libifconfig/libifconfig.h b/lib/libifconfig/libifconfig.h
index e1cd6d1821a5..c8bbb5edd3bb 100644
--- a/lib/libifconfig/libifconfig.h
+++ b/lib/libifconfig/libifconfig.h
@@ -129,7 +129,7 @@ ifconfig_handle_t *ifconfig_open(void);
*/
void ifconfig_close(ifconfig_handle_t *h);
-/** Identifies what kind of error occured. */
+/** Identifies what kind of error occurred. */
ifconfig_errtype ifconfig_err_errtype(ifconfig_handle_t *h);
/** Retrieves the errno associated with the error, if any. */
@@ -285,7 +285,7 @@ int ifconfig_carp_get_info(ifconfig_handle_t *h, const char *name,
/** Retrieve additional information about an inet address
* @param h An open ifconfig state object
* @param name The interface name
- * @param ifa Pointer to the the address structure of interest
+ * @param ifa Pointer to the address structure of interest
* @param addr Return argument. It will be filled with additional information
* about the address.
* @return 0 on success, nonzero on failure.
@@ -296,7 +296,7 @@ int ifconfig_inet_get_addrinfo(ifconfig_handle_t *h,
/** Retrieve additional information about an inet6 address
* @param h An open ifconfig state object
* @param name The interface name
- * @param ifa Pointer to the the address structure of interest
+ * @param ifa Pointer to the address structure of interest
* @param addr Return argument. It will be filled with additional information
* about the address.
* @return 0 on success, nonzero on failure.
diff --git a/lib/libifconfig/libifconfig_internal.h b/lib/libifconfig/libifconfig_internal.h
index d9803a05c675..77add7574fa8 100644
--- a/lib/libifconfig/libifconfig_internal.h
+++ b/lib/libifconfig/libifconfig_internal.h
@@ -38,13 +38,13 @@ struct errstate {
ifconfig_errtype errtype;
/**
- * The error occured in this ioctl() request.
+ * The error occurred in this ioctl() request.
* Populated if errtype = IOCTL
*/
unsigned long ioctl_request;
/**
- * The value of the global errno variable when the error occured.
+ * The value of the global errno variable when the error occurred.
*/
int errcode;
};
diff --git a/lib/libldns/Makefile b/lib/libldns/Makefile
index 34ffe7d2ed73..40efe0ff0fda 100644
--- a/lib/libldns/Makefile
+++ b/lib/libldns/Makefile
@@ -23,4 +23,6 @@ LIBADD= ssl crypto
WARNS ?= 3
+CWARNFLAGS.sha2.c= ${NO_WARRAY_PARAMETER}
+
.include <bsd.lib.mk>
diff --git a/lib/liblzma/Makefile b/lib/liblzma/Makefile
index 4f38ef391e4a..0bdcc6af5ddc 100644
--- a/lib/liblzma/Makefile
+++ b/lib/liblzma/Makefile
@@ -159,8 +159,9 @@ PCFILES= liblzma.pc
liblzma.pc: liblzma.pc.in
sed -e 's,@prefix@,/usr,g ; \
s,@exec_prefix@,/usr,g ; \
- s,@libdir@,/usr/lib,g ; \
- s,@includedir@,/usr/include,g ; \
+ s,@libdir@,${LIBDIR},g ; \
+ s,@sharedlibdir@,${SHLIBDIR},g ; \
+ s,@includedir@,${INCLUDEDIR},g ; \
s,@LIBS@,-pthread -lmd,g ; \
s,@PACKAGE_URL@,https://tukaani.org/xz/,g ; \
s,@PACKAGE_VERSION@,${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH},g ; \
diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile
index 5f967102fe02..3ddbf506eb81 100644
--- a/lib/libmagic/Makefile
+++ b/lib/libmagic/Makefile
@@ -42,9 +42,9 @@ PACKAGE_VERSION!= sed -n '/define.*PACKAGE_VERSION/{s,[^0-9.],,gp;q;}' ${.CURDIR
libmagic.pc: libmagic.pc.in
sed -e 's,@prefix@,/usr,g ; \
s,@exec_prefix@,$${prefix},g ; \
- s,@libdir@,$${exec_prefix}/lib,g ; \
- s,@sharedlibdir@,$${libdir},g ; \
- s,@includedir@,$${prefix}/include,g ; \
+ s,@libdir@,${LIBDIR},g ; \
+ s,@sharedlibdir@,${SHLIBDIR},g ; \
+ s,@includedir@,${INCLUDEDIR},g ; \
s,@VERSION@,${PACKAGE_VERSION},g ; \
s,@LIBS@,,g ;' \
${.ALLSRC} > ${.TARGET}
diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h
index 2dc6ad7fb3fa..220321c64af7 100644
--- a/lib/libmagic/config.h
+++ b/lib/libmagic/config.h
@@ -114,8 +114,8 @@
/* Define to 1 if you have the `memmem' function. */
#define HAVE_MEMMEM 1
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
+/* Define to 1 if you have the <minix/config.h> header file. */
+/* #undef HAVE_MINIX_CONFIG_H */
/* Define to 1 if you have the `mkostemp' function. */
#define HAVE_MKOSTEMP 1
@@ -149,6 +149,9 @@
/* 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
@@ -299,7 +302,7 @@
#define PACKAGE_NAME "file"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "file 5.42"
+#define PACKAGE_STRING "file 5.43"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "file"
@@ -308,9 +311,11 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "5.42"
+#define PACKAGE_VERSION "5.43"
-/* 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
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
@@ -320,26 +325,92 @@
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
+/* Enable general extensions on macOS. */
+#ifndef _DARWIN_C_SOURCE
+# define _DARWIN_C_SOURCE 1
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
-/* Enable threading extensions on Solaris. */
+/* Enable X/Open compliant socket functions that do not require linking
+ with -lxnet on HP-UX 11.11. */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+# define _HPUX_ALT_XOPEN_SOCKET_API 1
+#endif
+/* Identify the host operating system as Minix.
+ This macro does not affect the system headers' behavior.
+ A future release of Autoconf may stop defining this macro. */
+#ifndef _MINIX
+/* # undef _MINIX */
+#endif
+/* Enable general extensions on NetBSD.
+ Enable NetBSD compatibility extensions on Minix. */
+#ifndef _NETBSD_SOURCE
+# define _NETBSD_SOURCE 1
+#endif
+/* Enable OpenBSD compatibility extensions on NetBSD.
+ Oddly enough, this does nothing on OpenBSD. */
+#ifndef _OPENBSD_SOURCE
+# define _OPENBSD_SOURCE 1
+#endif
+/* Define to 1 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_SOURCE
+/* # undef _POSIX_SOURCE */
+#endif
+/* Define to 2 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_1_SOURCE
+/* # undef _POSIX_1_SOURCE */
+#endif
+/* Enable POSIX-compatible threading on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
+/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+# define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+# define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
+# define __STDC_WANT_IEC_60559_DFP_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
+# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
+# define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
+#endif
+/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
+#ifndef __STDC_WANT_LIB_EXT2__
+# define __STDC_WANT_LIB_EXT2__ 1
+#endif
+/* Enable extensions specified by ISO/IEC 24747:2009. */
+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
+# define __STDC_WANT_MATH_SPEC_FUNCS__ 1
+#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# define __EXTENSIONS__ 1
+/* Enable X/Open extensions. Define to 500 only if necessary
+ to make mbstate_t available. */
+#ifndef _XOPEN_SOURCE
+/* # undef _XOPEN_SOURCE */
#endif
/* Version number of package */
-#define VERSION "5.42"
+#define VERSION "5.43"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
@@ -359,11 +430,6 @@
/* Enable zlib compression support */
#define ZLIBSUPPORT 1
-/* Enable large inode numbers on Mac OS X 10.5. */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
@@ -373,16 +439,6 @@
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
-/* Define to 1 if on MINIX. */
-/* #undef _MINIX */
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
- this defined. */
-/* #undef _POSIX_1_SOURCE */
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-/* #undef _POSIX_SOURCE */
-
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
@@ -416,7 +472,7 @@
/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */
-/* Define to `int' if <sys/types.h> does not define. */
+/* Define as a signed integer type capable of holding a process identifier. */
/* #undef pid_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile
index c98c33bae3f5..8d3a05279004 100644
--- a/lib/libmd/Makefile
+++ b/lib/libmd/Makefile
@@ -103,7 +103,7 @@ CFLAGS.skein_block.c+= -DSKEIN_LOOP=995
.PATH: ${SRCTOP}/sys/crypto/skein ${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH}
USE_ASM_SOURCES?=1
-.if defined(BOOTSTRAPPING)
+.if defined(BOOTSTRAPPING) || ${MK_MACHDEP_OPTIMIZATIONS} == no
# Don't build ASM sources when bootstrapping to avoid toolchain dependencies
USE_ASM_SOURCES:=0
.endif
diff --git a/lib/libmd/mdX.3 b/lib/libmd/mdX.3
index 30e6f367c662..5631e2d7a1fc 100644
--- a/lib/libmd/mdX.3
+++ b/lib/libmd/mdX.3
@@ -162,7 +162,7 @@ may return NULL when underlying
.Xr fstat 2 ,
.Xr lseek 2 ,
or
-.Xr MDXEnd 2
+.Xr MDXEnd 3
fail.
.Sh SEE ALSO
.Xr md4 3 ,
diff --git a/lib/libmd/ripemd.3 b/lib/libmd/ripemd.3
index d868ae12827b..5b1ba8d62e5c 100644
--- a/lib/libmd/ripemd.3
+++ b/lib/libmd/ripemd.3
@@ -142,7 +142,7 @@ may return NULL when underlying
.Xr fstat 2 ,
.Xr lseek 2 ,
or
-.Xr RIPEMD160_End 2
+.Xr RIPEMD160_End 3
fail.
.Sh SEE ALSO
.Xr md4 3 ,
diff --git a/lib/libmd/sha.3 b/lib/libmd/sha.3
index 20a1e5639dde..c629de77f692 100644
--- a/lib/libmd/sha.3
+++ b/lib/libmd/sha.3
@@ -173,7 +173,7 @@ may return NULL when underlying
.Xr fstat 2 ,
.Xr lseek 2 ,
or
-.Xr SHA1_End 2
+.Xr SHA1_End 3
fail.
.Sh SEE ALSO
.Xr md4 3 ,
diff --git a/lib/libmd/sha256.3 b/lib/libmd/sha256.3
index d11f2f783557..defe2ec45151 100644
--- a/lib/libmd/sha256.3
+++ b/lib/libmd/sha256.3
@@ -164,7 +164,7 @@ may return NULL when underlying
.Xr fstat 2 ,
.Xr lseek 2 ,
or
-.Xr SHA256_End 2
+.Xr SHA256_End 3
fail.
.Sh SEE ALSO
.Xr md4 3 ,
diff --git a/lib/libmd/sha512.3 b/lib/libmd/sha512.3
index 6a5ed6f887d9..30ea2a0b5eb2 100644
--- a/lib/libmd/sha512.3
+++ b/lib/libmd/sha512.3
@@ -208,7 +208,7 @@ may return NULL when underlying
.Xr fstat 2 ,
.Xr lseek 2 ,
or
-.Xr SHA512_End 2
+.Xr SHA512_End 3
fail.
.Sh SEE ALSO
.Xr md4 3 ,
diff --git a/lib/libmd/skein.3 b/lib/libmd/skein.3
index 325a1ab4874b..dd8cedb15027 100644
--- a/lib/libmd/skein.3
+++ b/lib/libmd/skein.3
@@ -206,7 +206,7 @@ may return NULL when underlying
.Xr fstat 2 ,
.Xr lseek 2 ,
or
-.Xr SKEIN256_End 2
+.Xr SKEIN256_End 3
fail.
.Sh SEE ALSO
.Xr md4 3 ,
diff --git a/lib/libnv/Makefile b/lib/libnv/Makefile
index b13758931c4e..7d04486e88bf 100644
--- a/lib/libnv/Makefile
+++ b/lib/libnv/Makefile
@@ -6,7 +6,10 @@ SHLIBDIR?= /lib
PACKAGE= runtime
LIB= nv
-SHLIB_MAJOR= 0
+SHLIB_MAJOR= 1
+
+VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def
+VERSION_MAP= ${.CURDIR}/Version.map
.PATH: ${SRCTOP}/sys/contrib/libnv ${SRCTOP}/sys/sys
CFLAGS+=-I${.CURDIR}
diff --git a/lib/libnv/Version.map b/lib/libnv/Version.map
new file mode 100644
index 000000000000..55dd6e1a5116
--- /dev/null
+++ b/lib/libnv/Version.map
@@ -0,0 +1,256 @@
+# $FreeBSD$
+
+FBSD_1.7 {
+ global:
+ FreeBSD_cnvlist_free_binary;
+ FreeBSD_cnvlist_free_bool;
+ FreeBSD_cnvlist_free_bool_array;
+ FreeBSD_cnvlist_free_descriptor;
+ FreeBSD_cnvlist_free_descriptor_array;
+ FreeBSD_cnvlist_free_number;
+ FreeBSD_cnvlist_free_number_array;
+ FreeBSD_cnvlist_free_nvlist;
+ FreeBSD_cnvlist_free_nvlist_array;
+ FreeBSD_cnvlist_free_string;
+ FreeBSD_cnvlist_free_string_array;
+ FreeBSD_cnvlist_get_binary;
+ FreeBSD_cnvlist_get_bool;
+ FreeBSD_cnvlist_get_bool_array;
+ FreeBSD_cnvlist_get_descriptor;
+ FreeBSD_cnvlist_get_descriptor_array;
+ FreeBSD_cnvlist_get_number;
+ FreeBSD_cnvlist_get_number_array;
+ FreeBSD_cnvlist_get_nvlist;
+ FreeBSD_cnvlist_get_nvlist_array;
+ FreeBSD_cnvlist_get_string;
+ FreeBSD_cnvlist_get_string_array;
+ FreeBSD_cnvlist_name;
+ FreeBSD_cnvlist_take_binary;
+ FreeBSD_cnvlist_take_bool;
+ FreeBSD_cnvlist_take_bool_array;
+ FreeBSD_cnvlist_take_descriptor;
+ FreeBSD_cnvlist_take_descriptor_array;
+ FreeBSD_cnvlist_take_number;
+ FreeBSD_cnvlist_take_number_array;
+ FreeBSD_cnvlist_take_nvlist;
+ FreeBSD_cnvlist_take_nvlist_array;
+ FreeBSD_cnvlist_take_string;
+ FreeBSD_cnvlist_take_string_array;
+ FreeBSD_cnvlist_type;
+ FreeBSD_dnvlist_get_binary;
+ FreeBSD_dnvlist_get_bool;
+ FreeBSD_dnvlist_get_descriptor;
+ FreeBSD_dnvlist_get_number;
+ FreeBSD_dnvlist_get_nvlist;
+ FreeBSD_dnvlist_get_string;
+ FreeBSD_dnvlist_take_binary;
+ FreeBSD_dnvlist_take_bool;
+ FreeBSD_dnvlist_take_descriptor;
+ FreeBSD_dnvlist_take_number;
+ FreeBSD_dnvlist_take_nvlist;
+ FreeBSD_dnvlist_take_string;
+ FreeBSD_nvlist_add_binary;
+ FreeBSD_nvlist_add_bool;
+ FreeBSD_nvlist_add_bool_array;
+ FreeBSD_nvlist_add_descriptor;
+ FreeBSD_nvlist_add_descriptor_array;
+ FreeBSD_nvlist_add_null;
+ FreeBSD_nvlist_add_number;
+ FreeBSD_nvlist_add_number_array;
+ FreeBSD_nvlist_add_nvlist;
+ FreeBSD_nvlist_add_nvlist_array;
+ FreeBSD_nvlist_add_nvpair;
+ FreeBSD_nvlist_add_string;
+ FreeBSD_nvlist_add_string_array;
+ FreeBSD_nvlist_add_stringf;
+ FreeBSD_nvlist_add_stringv;
+ FreeBSD_nvlist_append_bool_array;
+ FreeBSD_nvlist_append_descriptor_array;
+ FreeBSD_nvlist_append_number_array;
+ FreeBSD_nvlist_append_nvlist_array;
+ FreeBSD_nvlist_append_string_array;
+ FreeBSD_nvlist_clone;
+ FreeBSD_nvlist_create;
+ FreeBSD_nvlist_descriptors;
+ FreeBSD_nvlist_destroy;
+ FreeBSD_nvlist_dump;
+ FreeBSD_nvlist_empty;
+ FreeBSD_nvlist_error;
+ FreeBSD_nvlist_exists;
+ FreeBSD_nvlist_exists_binary;
+ FreeBSD_nvlist_exists_bool;
+ FreeBSD_nvlist_exists_bool_array;
+ FreeBSD_nvlist_exists_descriptor;
+ FreeBSD_nvlist_exists_descriptor_array;
+ FreeBSD_nvlist_exists_null;
+ FreeBSD_nvlist_exists_number;
+ FreeBSD_nvlist_exists_number_array;
+ FreeBSD_nvlist_exists_nvlist;
+ FreeBSD_nvlist_exists_nvlist_array;
+ FreeBSD_nvlist_exists_string;
+ FreeBSD_nvlist_exists_string_array;
+ FreeBSD_nvlist_exists_type;
+ FreeBSD_nvlist_fdump;
+ FreeBSD_nvlist_first_nvpair;
+ FreeBSD_nvlist_flags;
+ FreeBSD_nvlist_free;
+ FreeBSD_nvlist_free_binary;
+ FreeBSD_nvlist_free_bool;
+ FreeBSD_nvlist_free_bool_array;
+ FreeBSD_nvlist_free_descriptor;
+ FreeBSD_nvlist_free_descriptor_array;
+ FreeBSD_nvlist_free_null;
+ FreeBSD_nvlist_free_number;
+ FreeBSD_nvlist_free_number_array;
+ FreeBSD_nvlist_free_nvlist;
+ FreeBSD_nvlist_free_nvlist_array;
+ FreeBSD_nvlist_free_nvpair;
+ FreeBSD_nvlist_free_string;
+ FreeBSD_nvlist_free_string_array;
+ FreeBSD_nvlist_free_type;
+ FreeBSD_nvlist_get_array_next;
+ FreeBSD_nvlist_get_array_next_nvpair;
+ FreeBSD_nvlist_get_binary;
+ FreeBSD_nvlist_get_bool;
+ FreeBSD_nvlist_get_bool_array;
+ FreeBSD_nvlist_get_descriptor;
+ FreeBSD_nvlist_get_descriptor_array;
+ FreeBSD_nvlist_get_number;
+ FreeBSD_nvlist_get_number_array;
+ FreeBSD_nvlist_get_nvlist;
+ FreeBSD_nvlist_get_nvlist_array;
+ FreeBSD_nvlist_get_nvpair;
+ FreeBSD_nvlist_get_nvpair_parent;
+ FreeBSD_nvlist_get_pararr;
+ FreeBSD_nvlist_get_parent;
+ FreeBSD_nvlist_get_string;
+ FreeBSD_nvlist_get_string_array;
+ FreeBSD_nvlist_in_array;
+ FreeBSD_nvlist_move_binary;
+ FreeBSD_nvlist_move_bool_array;
+ FreeBSD_nvlist_move_descriptor;
+ FreeBSD_nvlist_move_descriptor_array;
+ FreeBSD_nvlist_move_number_array;
+ FreeBSD_nvlist_move_nvlist;
+ FreeBSD_nvlist_move_nvlist_array;
+ FreeBSD_nvlist_move_nvpair;
+ FreeBSD_nvlist_move_string;
+ FreeBSD_nvlist_move_string_array;
+ FreeBSD_nvlist_ndescriptors;
+ FreeBSD_nvlist_next;
+ FreeBSD_nvlist_next_nvpair;
+ FreeBSD_nvlist_pack;
+ FreeBSD_nvlist_prev_nvpair;
+ FreeBSD_nvlist_recv;
+ FreeBSD_nvlist_remove_nvpair;
+ FreeBSD_nvlist_report_missing;
+ FreeBSD_nvlist_send;
+ FreeBSD_nvlist_set_array_next;
+ FreeBSD_nvlist_set_error;
+ FreeBSD_nvlist_set_flags;
+ FreeBSD_nvlist_set_parent;
+ FreeBSD_nvlist_size;
+ FreeBSD_nvlist_take_binary;
+ FreeBSD_nvlist_take_bool;
+ FreeBSD_nvlist_take_bool_array;
+ FreeBSD_nvlist_take_descriptor;
+ FreeBSD_nvlist_take_descriptor_array;
+ FreeBSD_nvlist_take_number;
+ FreeBSD_nvlist_take_number_array;
+ FreeBSD_nvlist_take_nvlist;
+ FreeBSD_nvlist_take_nvlist_array;
+ FreeBSD_nvlist_take_string;
+ FreeBSD_nvlist_take_string_array;
+ FreeBSD_nvlist_unpack;
+ FreeBSD_nvlist_unpack_header;
+ FreeBSD_nvlist_xfer;
+ FreeBSD_nvpair_append_bool_array;
+ FreeBSD_nvpair_append_descriptor_array;
+ FreeBSD_nvpair_append_number_array;
+ FreeBSD_nvpair_append_nvlist_array;
+ FreeBSD_nvpair_append_string_array;
+ FreeBSD_nvpair_assert;
+ FreeBSD_nvpair_clone;
+ FreeBSD_nvpair_create_binary;
+ FreeBSD_nvpair_create_bool;
+ FreeBSD_nvpair_create_bool_array;
+ FreeBSD_nvpair_create_descriptor;
+ FreeBSD_nvpair_create_descriptor_array;
+ FreeBSD_nvpair_create_null;
+ FreeBSD_nvpair_create_number;
+ FreeBSD_nvpair_create_number_array;
+ FreeBSD_nvpair_create_nvlist;
+ FreeBSD_nvpair_create_nvlist_array;
+ FreeBSD_nvpair_create_string;
+ FreeBSD_nvpair_create_string_array;
+ FreeBSD_nvpair_create_stringf;
+ FreeBSD_nvpair_create_stringv;
+ FreeBSD_nvpair_free;
+ FreeBSD_nvpair_free_structure;
+ FreeBSD_nvpair_get_binary;
+ FreeBSD_nvpair_get_bool;
+ FreeBSD_nvpair_get_bool_array;
+ FreeBSD_nvpair_get_descriptor;
+ FreeBSD_nvpair_get_descriptor_array;
+ FreeBSD_nvpair_get_number;
+ FreeBSD_nvpair_get_number_array;
+ FreeBSD_nvpair_get_nvlist;
+ FreeBSD_nvpair_get_nvlist_array;
+ FreeBSD_nvpair_get_string;
+ FreeBSD_nvpair_get_string_array;
+ FreeBSD_nvpair_header_size;
+ FreeBSD_nvpair_init_datasize;
+ FreeBSD_nvpair_insert;
+ FreeBSD_nvpair_move_binary;
+ FreeBSD_nvpair_move_bool_array;
+ FreeBSD_nvpair_move_descriptor;
+ FreeBSD_nvpair_move_descriptor_array;
+ FreeBSD_nvpair_move_number_array;
+ FreeBSD_nvpair_move_nvlist;
+ FreeBSD_nvpair_move_nvlist_array;
+ FreeBSD_nvpair_move_string;
+ FreeBSD_nvpair_move_string_array;
+ FreeBSD_nvpair_name;
+ FreeBSD_nvpair_next;
+ FreeBSD_nvpair_nvlist;
+ FreeBSD_nvpair_pack_binary;
+ FreeBSD_nvpair_pack_bool;
+ FreeBSD_nvpair_pack_bool_array;
+ FreeBSD_nvpair_pack_descriptor;
+ FreeBSD_nvpair_pack_descriptor_array;
+ FreeBSD_nvpair_pack_header;
+ FreeBSD_nvpair_pack_null;
+ FreeBSD_nvpair_pack_number;
+ FreeBSD_nvpair_pack_number_array;
+ FreeBSD_nvpair_pack_nvlist_array_next;
+ FreeBSD_nvpair_pack_nvlist_up;
+ FreeBSD_nvpair_pack_string;
+ FreeBSD_nvpair_pack_string_array;
+ FreeBSD_nvpair_prev;
+ FreeBSD_nvpair_remove;
+ FreeBSD_nvpair_size;
+ FreeBSD_nvpair_type;
+ FreeBSD_nvpair_type_string;
+ FreeBSD_nvpair_unpack;
+ FreeBSD_nvpair_unpack_binary;
+ FreeBSD_nvpair_unpack_bool;
+ FreeBSD_nvpair_unpack_bool_array;
+ FreeBSD_nvpair_unpack_descriptor;
+ FreeBSD_nvpair_unpack_descriptor_array;
+ FreeBSD_nvpair_unpack_header;
+ FreeBSD_nvpair_unpack_null;
+ FreeBSD_nvpair_unpack_number;
+ FreeBSD_nvpair_unpack_number_array;
+ FreeBSD_nvpair_unpack_nvlist;
+ FreeBSD_nvpair_unpack_nvlist_array;
+ FreeBSD_nvpair_unpack_string;
+ FreeBSD_nvpair_unpack_string_array;
+
+ local:
+ buf_recv;
+ buf_send;
+ cred_recv;
+ cred_send;
+ fd_recv;
+ fd_send;
+};
diff --git a/lib/libopie/Makefile b/lib/libopie/Makefile
deleted file mode 100644
index 2dda575e94ef..000000000000
--- a/lib/libopie/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-# Makefile for libopie
-#
-# $FreeBSD$
-#
-
-CONFS= opieaccess
-CONFSMODE= 600
-PACKAGE=lib${LIB}
-OPIE_DIST?= ${SRCTOP}/contrib/opie
-DIST_DIR= ${OPIE_DIST}/${.CURDIR:T}
-SHLIB_MAJOR= 8
-
-KEYFILE?= \"/etc/opiekeys\"
-
-.PATH: ${DIST_DIR}
-
-LIB= opie
-SRCS= atob8.c btoa8.c btoh.c challenge.c getsequence.c hash.c hashlen.c \
- keycrunch.c lock.c lookup.c newseed.c parsechallenge.c passcheck.c \
- passwd.c randomchallenge.c readpass.c unlock.c verify.c version.c \
- btoe.c accessfile.c generator.c insecure.c getutmpentry.c \
- readrec.c writerec.c open.c
-SRCS+= opieextra.c
-INCS= ${OPIE_DIST}/opie.h
-
-CFLAGS+=-I${.CURDIR} -I${OPIE_DIST} -I${DIST_DIR} \
- -DKEY_FILE=${KEYFILE}
-
-ACCESSFILE?= \"/etc/opieaccess\"
-CFLAGS+= -DINSECURE_OVERRIDE -DPATH_ACCESS_FILE=${ACCESSFILE}
-
-WARNS?= 0
-
-LIBADD= md
-
-MAN= ${OPIE_DIST}/opie.4 ${OPIE_DIST}/opiekeys.5 ${OPIE_DIST}/opieaccess.5
-
-MLINKS= opie.4 skey.4
-
-.include <bsd.lib.mk>
diff --git a/lib/libopie/Makefile.depend b/lib/libopie/Makefile.depend
deleted file mode 100644
index 96d46f623269..000000000000
--- a/lib/libopie/Makefile.depend
+++ /dev/null
@@ -1,18 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- include \
- include/arpa \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
- lib/libcompiler_rt \
- lib/libmd \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/lib/libopie/config.h b/lib/libopie/config.h
deleted file mode 100644
index b9bc40c06627..000000000000
--- a/lib/libopie/config.h
+++ /dev/null
@@ -1,381 +0,0 @@
-/* $FreeBSD$ */
-/* config.h. Generated automatically by configure. */
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if on MINIX. */
-/* #undef _MINIX */
-
-/* Define if the system does not provide POSIX.1 features except
- with this defined. */
-/* #undef _POSIX_1_SOURCE */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if you want the FTP daemon to support anonymous logins. */
-/* #undef DOANONYMOUS */
-
-/* The default value of the PATH environment variable */
-#define DEFAULT_PATH "/usr/bin:/bin:/usr/sbin:/sbin"
-
-/* Defined if the file /etc/default/login exists
- (and, presumably, should be looked at by login) */
-/* #undef HAVE_ETC_DEFAULT_LOGIN */
-
-/* Defined to the name of a file that contains a list of files whose
- permissions and ownerships should be changed on login. */
-/* #undef HAVE_LOGIN_PERMFILE */
-
-/* Defined to the name of a file that contains a list of environment
- values that should be set on login. */
-/* #undef HAVE_LOGIN_ENVFILE */
-
-/* Defined if the file /etc/securetty exists
- (and, presumably, should be looked at by login) */
-/* #undef HAVE_SECURETTY */
-
-/* Defined if the file /etc/shadow exists
- (and, presumably, should be looked at for shadow passwords) */
-/* #undef HAVE_ETC_SHADOW */
-
-/* The path to the access file, if we're going to use it */
-/* #undef PATH_ACCESS_FILE */
-
-/* The path to the mail spool, if we know it */
-#define PATH_MAIL "/var/mail"
-
-/* The path to the utmp file, if we know it */
-#define PATH_UTMP_AC "/var/run/utmp"
-
-/* The path to the wtmp file, if we know it */
-#define PATH_WTMP_AC "/var/log/wtmp"
-
-/* The path to the wtmpx file, if we know it */
-/* #undef PATH_WTMPX_AC */
-
-/* Defined if the system's profile (/etc/profile) displays
- the motd file */
-/* #undef HAVE_MOTD_IN_PROFILE */
-
-/* Defined if the system's profile (/etc/profile) informs the
- user of new mail */
-/* #undef HAVE_MAILCHECK_IN_PROFILE */
-
-/* Define if you have a nonstandard gettimeofday() that takes one argument
- instead of two. */
-/* #undef HAVE_ONE_ARG_GETTIMEOFDAY */
-
-/* Define if the system has the getenv function */
-#define HAVE_GETENV 1
-
-/* Define if the system has the setenv function */
-#define HAVE_SETENV 1
-
-/* Define if the system has the /var/adm/sulog file */
-/* #undef HAVE_SULOG */
-
-/* Define if the system has the unsetenv function */
-#define HAVE_UNSETENV 1
-
-/* Define if the compiler can handle ANSI-style argument lists */
-#define HAVE_ANSIDECL 1
-
-/* Define if the compiler can handle ANSI-style prototypes */
-#define HAVE_ANSIPROTO 1
-
-/* Define if the system has an ANSI-style printf (returns int instead of char *) */
-#define HAVE_ANSISPRINTF 1
-
-/* Define if the compiler can handle ANSI-style variable argument lists */
-#define HAVE_ANSISTDARG 1
-
-/* Define if the compiler can handle void argument lists to functions */
-#define HAVE_VOIDARG 1
-
-/* Define if the compiler can handle void return "values" from functions */
-#define HAVE_VOIDRET 1
-
-/* Define if the compiler can handle void pointers to our liking */
-#define HAVE_VOIDPTR 1
-
-/* Define if the /bin/ls command seems to support the -g flag */
-/* #undef HAVE_LS_G_FLAG */
-
-/* Define if there is a ut_pid field in struct utmp */
-/* #undef HAVE_UT_PID */
-
-/* Define if there is a ut_type field in struct utmp */
-/* #undef HAVE_UT_TYPE */
-
-/* Define if there is a ut_name field in struct utmp */
-#define HAVE_UT_NAME 1
-
-/* Define if there is a ut_host field in struct utmp */
-#define HAVE_UT_HOST 1
-
-/* Define if the system has getutline() */
-/* #undef HAVE_GETUTLINE */
-
-/* Defined if the system has SunOS C2 security shadow passwords */
-/* #undef HAVE_SUNOS_C2_SHADOW */
-
-/* Defined if you want to disable utmp support */
-/* #undef DISABLE_UTMP */
-
-/* Defined if you want to allow users to override the insecure checks */
-/* #undef INSECURE_OVERRIDE */
-
-/* Defined to the default hash value, always defined */
-#define MDX 5
-
-/* Defined if new-style prompts are to be used */
-#define NEW_PROMPTS 1
-
-/* Defined to the path of the OPIE lock directory */
-#define OPIE_LOCK_DIR "/var/spool/opielocks"
-
-/* Defined if users are to be asked to re-type secret pass phrases */
-/* #undef RETYPE */
-
-/* Defined if su should not switch to disabled accounts */
-/* #undef SU_STAR_CHECK */
-
-/* Don't turn it on! It allows intruder easily disable whole OPIE for user */
-/* Defined if user locking is to be used */
-/* #undef USER_LOCKING */
-
-/* Define if you have the bcopy function. */
-/* #undef HAVE_BCOPY */
-
-/* Define if you have the bzero function. */
-/* #undef HAVE_BZERO */
-
-/* Define if you have the endspent function. */
-/* #undef HAVE_ENDSPENT */
-
-/* Define if you have the fpurge function. */
-#define HAVE_FPURGE 1
-
-/* Define if you have the getdtablesize function. */
-/* #undef HAVE_GETDTABLESIZE */
-
-/* Define if you have the getgroups function. */
-#define HAVE_GETGROUPS 1
-
-/* Define if you have the gethostname function. */
-/* #undef HAVE_GETHOSTNAME */
-
-/* Define if you have the getspnam function. */
-/* #undef HAVE_GETSPNAM */
-
-/* Define if you have the gettimeofday function. */
-#define HAVE_GETTIMEOFDAY 1
-
-/* Define if you have the getttynam function. */
-#define HAVE_GETTTYNAM 1
-
-/* Define if you have the getusershell function. */
-#define HAVE_GETUSERSHELL 1
-
-/* Define if you have the getutxline function. */
-#define HAVE_GETUTXLINE 1
-
-/* Define if you have the getwd function. */
-/* #undef HAVE_GETWD */
-
-/* Define if you have the index function. */
-/* #undef HAVE_INDEX */
-
-/* Define if you have the lstat function. */
-#define HAVE_LSTAT 1
-
-/* Define if you have the on_exit function. */
-/* #undef HAVE_ON_EXIT */
-
-/* Define if you have the pututxline function. */
-#define HAVE_PUTUTXLINE 1
-
-/* Define if you have the rindex function. */
-/* #undef HAVE_RINDEX */
-
-/* Define if you have the setgroups function. */
-#define HAVE_SETGROUPS 1
-
-/* Define if you have the setlogin function. */
-#define HAVE_SETLOGIN 1
-
-/* Define if you have the setpriority function. */
-#define HAVE_SETPRIORITY 1
-
-/* Define if you have the setregid function. */
-/* #undef HAVE_SETREGID */
-
-/* Define if you have the setresgid function. */
-/* #undef HAVE_SETRESGID */
-
-/* Define if you have the setresuid function. */
-/* #undef HAVE_SETRESUID */
-
-/* Define if you have the setreuid function. */
-/* #undef HAVE_SETREUID */
-
-/* Define if you have the setvbuf function. */
-#define HAVE_SETVBUF 1
-
-/* Define if you have the sigaddset function. */
-#define HAVE_SIGADDSET 1
-
-/* Define if you have the sigblock function. */
-/* #undef HAVE_SIGBLOCK */
-
-/* Define if you have the sigemptyset function. */
-#define HAVE_SIGEMPTYSET 1
-
-/* Define if you have the sigsetmask function. */
-/* #undef HAVE_SIGSETMASK */
-
-/* Define if you have the socket function. */
-#define HAVE_SOCKET 1
-
-/* Define if you have the strerror function. */
-#define HAVE_STRERROR 1
-
-/* Define if you have the strftime function. */
-#define HAVE_STRFTIME 1
-
-/* Define if you have the strncasecmp function. */
-#define HAVE_STRNCASECMP 1
-
-/* Define if you have the strstr function. */
-#define HAVE_STRSTR 1
-
-/* Define if you have the ttyslot function. */
-#define HAVE_TTYSLOT 1
-
-/* Define if you have the usleep function. */
-#define HAVE_USLEEP 1
-
-/* Define if you have the <crypt.h> header file. */
-/* #undef HAVE_CRYPT_H */
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define if you have the <lastlog.h> header file. */
-/* #undef HAVE_LASTLOG_H */
-
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <paths.h> header file. */
-#define HAVE_PATHS_H 1
-
-/* Define if you have the <pwd.h> header file. */
-#define HAVE_PWD_H 1
-
-/* Define if you have the <shadow.h> header file. */
-/* #undef HAVE_SHADOW_H */
-
-/* Define if you have the <signal.h> header file. */
-#define HAVE_SIGNAL_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <sys/dir.h> header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/signal.h> header file. */
-#define HAVE_SYS_SIGNAL_H 1
-
-/* Define if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define if you have the <sys/utsname.h> header file. */
-#define HAVE_SYS_UTSNAME_H 1
-
-/* Define if you have the <syslog.h> header file. */
-#define HAVE_SYSLOG_H 1
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <utmpx.h> header file. */
-#define HAVE_UTMPX_H 1
-
-/* Define if you have the crypt library (-lcrypt). */
-#define HAVE_LIBCRYPT 1
-
-/* Define if you have the nsl library (-lnsl). */
-/* #undef HAVE_LIBNSL */
-
-/* Define if you have the posix library (-lposix). */
-/* #undef HAVE_LIBPOSIX */
-
-/* Define if you have the socket library (-lsocket). */
-/* #undef HAVE_LIBSOCKET */
diff --git a/lib/libopie/opieaccess b/lib/libopie/opieaccess
deleted file mode 100644
index ed57ef13a33a..000000000000
--- a/lib/libopie/opieaccess
+++ /dev/null
@@ -1,13 +0,0 @@
-# $FreeBSD$
-#
-# This file controls whether UNIX passwords are to be permitted. Rules
-# are matched in order, and the search terminates when the first matching
-# rule has been found. Default action is "deny". See opieaccess(5) for
-# more information.
-#
-# Each rule has the form:
-#
-# permit address netmask
-# deny address netmask
-#
-#permit 127.0.0.1 255.255.255.255
diff --git a/lib/libopie/opieextra.c b/lib/libopie/opieextra.c
deleted file mode 100644
index 6e2b6b88328c..000000000000
--- a/lib/libopie/opieextra.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * This file contains routines modified from OpenBSD. Parts are contributed
- * by Todd Miller <millert@openbsd.org>, Theo De Raadt <deraadt@openbsd.org>
- * and possibly others.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <opie.h>
-
-/*
- * opie_haopie()
- *
- * Returns: 1 user doesnt exist, -1 file error, 0 user exists.
- *
- */
-int
-opie_haskey(username)
-char *username;
-{
- struct opie opie;
-
- return opielookup(&opie, username);
-}
-
-/*
- * opie_keyinfo()
- *
- * Returns the current sequence number and
- * seed for the passed user.
- *
- */
-char *
-opie_keyinfo(username)
-char *username;
-{
- int i;
- static char str[OPIE_CHALLENGE_MAX];
- struct opie opie;
-
- i = opiechallenge(&opie, username, str);
- if (i == -1)
- return(0);
-
- return(str);
-}
-
-/*
- * opie_passverify()
- *
- * Check to see if answer is the correct one to the current
- * challenge.
- *
- * Returns: 0 success, -1 failure
- *
- */
-int
-opie_passverify(username, passwd)
-char *username;
-char *passwd;
-{
- int i;
- struct opie opie;
-
- i = opielookup(&opie, username);
- if (i == -1 || i == 1)
- return(-1);
-
- if (opieverify(&opie, passwd) == 0)
- return(opie.opie_n);
-
- return(-1);
-}
-
-#define OPIE_HASH_DEFAULT 1
-
-/* Current hash type (index into opie_hash_types array) */
-static int opie_hash_type = OPIE_HASH_DEFAULT;
-
-struct opie_algorithm_table {
- const char *name;
-};
-
-static struct opie_algorithm_table opie_algorithm_table[] = {
- "md4", "md5"
-};
-
-/* Get current hash type */
-const char *
-opie_get_algorithm()
-{
- return(opie_algorithm_table[opie_hash_type].name);
-}
-
-
diff --git a/lib/libpam/modules/modules.inc b/lib/libpam/modules/modules.inc
index 02debf7a4330..c7040211a590 100644
--- a/lib/libpam/modules/modules.inc
+++ b/lib/libpam/modules/modules.inc
@@ -17,8 +17,6 @@ MODULES += pam_ksu
MODULES += pam_lastlog
MODULES += pam_login_access
MODULES += pam_nologin
-MODULES += pam_opie
-MODULES += pam_opieaccess
MODULES += pam_passwdqc
MODULES += pam_permit
.if ${MK_RADIUS_SUPPORT} != "no"
diff --git a/lib/libpam/modules/pam_chroot/pam_chroot.8 b/lib/libpam/modules/pam_chroot/pam_chroot.8
index 1bb48008d781..990932413dd3 100644
--- a/lib/libpam/modules/pam_chroot/pam_chroot.8
+++ b/lib/libpam/modules/pam_chroot/pam_chroot.8
@@ -81,7 +81,7 @@ the user's home directory.
.El
.Sh SEE ALSO
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
.Sh AUTHORS
The
.Nm
diff --git a/lib/libpam/modules/pam_deny/pam_deny.8 b/lib/libpam/modules/pam_deny/pam_deny.8
index d9544be9b09f..29bd7e1361fd 100644
--- a/lib/libpam/modules/pam_deny/pam_deny.8
+++ b/lib/libpam/modules/pam_deny/pam_deny.8
@@ -77,4 +77,4 @@ authentication attempt was declined.
.Sh SEE ALSO
.Xr syslog 3 ,
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
diff --git a/lib/libpam/modules/pam_echo/pam_echo.8 b/lib/libpam/modules/pam_echo/pam_echo.8
index 3066007dca74..c1811181674a 100644
--- a/lib/libpam/modules/pam_echo/pam_echo.8
+++ b/lib/libpam/modules/pam_echo/pam_echo.8
@@ -80,7 +80,7 @@ expands to the character following the
character.
.Sh SEE ALSO
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
.Sh AUTHORS
The
.Nm
diff --git a/lib/libpam/modules/pam_exec/pam_exec.8 b/lib/libpam/modules/pam_exec/pam_exec.8
index dbd7c1e17007..c31031fd4aa8 100644
--- a/lib/libpam/modules/pam_exec/pam_exec.8
+++ b/lib/libpam/modules/pam_exec/pam_exec.8
@@ -152,13 +152,13 @@ This is useful in shell scripts for instance.
.Sh SEE ALSO
.Xr pam_get_item 3 ,
.Xr pam.conf 5 ,
-.Xr pam 8 ,
-.Xr pam_sm_acct_mgmt 8 ,
-.Xr pam_sm_authenticate 8 ,
-.Xr pam_sm_chauthtok 8 ,
-.Xr pam_sm_close_session 8 ,
-.Xr pam_sm_open_session 8 ,
-.Xr pam_sm_setcred 8
+.Xr pam 3 ,
+.Xr pam_sm_acct_mgmt 3 ,
+.Xr pam_sm_authenticate 3 ,
+.Xr pam_sm_chauthtok 3 ,
+.Xr pam_sm_close_session 3 ,
+.Xr pam_sm_open_session 3 ,
+.Xr pam_sm_setcred 3
.Sh AUTHORS
The
.Nm
diff --git a/lib/libpam/modules/pam_ftpusers/pam_ftpusers.8 b/lib/libpam/modules/pam_ftpusers/pam_ftpusers.8
index 380e3b026c70..80bbf493c41a 100644
--- a/lib/libpam/modules/pam_ftpusers/pam_ftpusers.8
+++ b/lib/libpam/modules/pam_ftpusers/pam_ftpusers.8
@@ -86,7 +86,7 @@ will succeed if and only if the user is not listed in
.Sh SEE ALSO
.Xr ftpusers 5 ,
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
.Sh AUTHORS
The
.Nm
diff --git a/lib/libpam/modules/pam_group/pam_group.8 b/lib/libpam/modules/pam_group/pam_group.8
index 4f368e577c22..477c509201a9 100644
--- a/lib/libpam/modules/pam_group/pam_group.8
+++ b/lib/libpam/modules/pam_group/pam_group.8
@@ -89,7 +89,7 @@ options are mutually exclusive, and that
will fail if both are specified.
.Sh SEE ALSO
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
.Sh AUTHORS
The
.Nm
diff --git a/lib/libpam/modules/pam_guest/pam_guest.8 b/lib/libpam/modules/pam_guest/pam_guest.8
index 0b858d673d56..51332492e7f3 100644
--- a/lib/libpam/modules/pam_guest/pam_guest.8
+++ b/lib/libpam/modules/pam_guest/pam_guest.8
@@ -85,7 +85,7 @@ Requires the guest user to type in the guest account name as password.
.Xr pam_get_item 3 ,
.Xr pam_getenv 3 ,
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
.Sh AUTHORS
The
.Nm
diff --git a/lib/libpam/modules/pam_krb5/pam_krb5.8 b/lib/libpam/modules/pam_krb5/pam_krb5.8
index bd7ac5b9ca0c..d3617aec6e51 100644
--- a/lib/libpam/modules/pam_krb5/pam_krb5.8
+++ b/lib/libpam/modules/pam_krb5/pam_krb5.8
@@ -210,7 +210,7 @@ file containing Kerberos principals that are allowed access.
.Xr passwd 1 ,
.Xr syslog 3 ,
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
.Sh NOTES
Applications should not call
.Fn pam_authenticate
diff --git a/lib/libpam/modules/pam_ksu/pam_ksu.8 b/lib/libpam/modules/pam_ksu/pam_ksu.8
index 614dc9ef78f8..8204fe992495 100644
--- a/lib/libpam/modules/pam_ksu/pam_ksu.8
+++ b/lib/libpam/modules/pam_ksu/pam_ksu.8
@@ -119,4 +119,4 @@ the user is prompted for another password.
.Xr su 1 ,
.Xr syslog 3 ,
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
diff --git a/lib/libpam/modules/pam_lastlog/pam_lastlog.8 b/lib/libpam/modules/pam_lastlog/pam_lastlog.8
index cd75fff05df7..a28b4dc1f4e4 100644
--- a/lib/libpam/modules/pam_lastlog/pam_lastlog.8
+++ b/lib/libpam/modules/pam_lastlog/pam_lastlog.8
@@ -86,11 +86,11 @@ Ignore I/O failures.
.Xr last 1 ,
.Xr w 1 ,
.Xr getutxent 3 ,
-.Xr login 3 ,
-.Xr logout 3 ,
+.Xr ulog_login 3 ,
+.Xr ulog_logout 3 ,
.Xr pam.conf 5 ,
.Xr lastlogin 8 ,
-.Xr pam 8
+.Xr pam 3
.Sh AUTHORS
The
.Nm
diff --git a/lib/libpam/modules/pam_nologin/pam_nologin.8 b/lib/libpam/modules/pam_nologin/pam_nologin.8
index cc94be555d68..544428412a20 100644
--- a/lib/libpam/modules/pam_nologin/pam_nologin.8
+++ b/lib/libpam/modules/pam_nologin/pam_nologin.8
@@ -87,4 +87,4 @@ login attempt was declined.
.Xr login.conf 5 ,
.Xr nologin 5 ,
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
diff --git a/lib/libpam/modules/pam_opie/Makefile b/lib/libpam/modules/pam_opie/Makefile
deleted file mode 100644
index 5df10af706ec..000000000000
--- a/lib/libpam/modules/pam_opie/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 2000 James Bloom
-# All rights reserved.
-# Based upon code Copyright 1998 Juniper Networks, Inc.
-#
-# 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$
-
-PACKAGE= runtime
-
-LIB= pam_opie
-SRCS= pam_opie.c
-MAN= pam_opie.8
-
-LIBADD+= opie
-
-.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_opie/Makefile.depend b/lib/libpam/modules/pam_opie/Makefile.depend
deleted file mode 100644
index da2957f739ba..000000000000
--- a/lib/libpam/modules/pam_opie/Makefile.depend
+++ /dev/null
@@ -1,19 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/csu \
- include \
- include/xlocale \
- lib/${CSU_DIR} \
- lib/libc \
- lib/libcompiler_rt \
- lib/libopie \
- lib/libpam/libpam \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/lib/libpam/modules/pam_opie/pam_opie.8 b/lib/libpam/modules/pam_opie/pam_opie.8
deleted file mode 100644
index 968985a6c9f6..000000000000
--- a/lib/libpam/modules/pam_opie/pam_opie.8
+++ /dev/null
@@ -1,123 +0,0 @@
-.\" Copyright (c) 2001 Mark R V Murray
-.\" All rights reserved.
-.\" Copyright (c) 2002 Networks Associates Technology, Inc.
-.\" All rights reserved.
-.\"
-.\" Portions of this software were developed for the FreeBSD Project by
-.\" ThinkSec AS and NAI Labs, the Security Research Division of Network
-.\" Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
-.\" ("CBOSS"), as part of the DARPA CHATS research program.
-.\"
-.\" 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. 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 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$
-.\"
-.Dd July 7, 2001
-.Dt PAM_OPIE 8
-.Os
-.Sh NAME
-.Nm pam_opie
-.Nd OPIE PAM module
-.Sh SYNOPSIS
-.Op Ar service-name
-.Ar module-type
-.Ar control-flag
-.Pa pam_opie
-.Op Ar options
-.Sh DESCRIPTION
-The OPIE authentication service module for PAM,
-.Nm
-provides functionality for only one PAM category:
-that of authentication.
-In terms of the
-.Ar module-type
-parameter, this is the
-.Dq Li auth
-feature.
-It also provides a null function for session management.
-.Pp
-Note that this module does not enforce
-.Xr opieaccess 5
-checks.
-There is a separate module,
-.Xr pam_opieaccess 8 ,
-for this purpose.
-.Ss OPIE Authentication Module
-The OPIE authentication component
-provides functions to verify the identity of a user
-.Pq Fn pam_sm_authenticate ,
-which obtains the relevant
-.Xr opie 4
-credentials.
-It provides the user with an OPIE challenge,
-and verifies that this is correct with
-.Xr opiechallenge 3 .
-.Pp
-The following options may be passed to the authentication module:
-.Bl -tag -width ".Cm auth_as_self"
-.It Cm debug
-.Xr syslog 3
-debugging information at
-.Dv LOG_DEBUG
-level.
-.It Cm auth_as_self
-This option will require the user
-to authenticate himself as the user
-given by
-.Xr getlogin 2 ,
-not as the account they are attempting to access.
-This is primarily for services like
-.Xr su 1 ,
-where the user's ability to retype
-their own password
-might be deemed sufficient.
-.It Cm no_fake_prompts
-Do not generate fake challenges for users who do not have an OPIE key.
-Note that this can leak information to a hypothetical attacker about
-who uses OPIE and who does not, but it can be useful on systems where
-some users want to use OPIE but most do not.
-.El
-.Pp
-Note that
-.Nm
-ignores the standard options
-.Cm try_first_pass
-and
-.Cm use_first_pass ,
-since a challenge must be generated before the user can submit a valid
-response.
-.Sh FILES
-.Bl -tag -width ".Pa /etc/opiekeys" -compact
-.It Pa /etc/opiekeys
-default OPIE password database.
-.El
-.Sh SEE ALSO
-.Xr passwd 1 ,
-.Xr getlogin 2 ,
-.Xr opiechallenge 3 ,
-.Xr syslog 3 ,
-.Xr opie 4 ,
-.Xr pam.conf 5 ,
-.Xr pam 8
diff --git a/lib/libpam/modules/pam_opie/pam_opie.c b/lib/libpam/modules/pam_opie/pam_opie.c
deleted file mode 100644
index 41ad84b751bc..000000000000
--- a/lib/libpam/modules/pam_opie/pam_opie.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-3-Clause
- *
- * Copyright 2000 James Bloom
- * All rights reserved.
- * Based upon code Copyright 1998 Juniper Networks, Inc.
- * Copyright (c) 2001-2003 Networks Associates Technology, Inc.
- * All rights reserved.
- *
- * Portions of this software were developed for the FreeBSD Project by
- * ThinkSec AS and NAI Labs, the Security Research Division of Network
- * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
- * ("CBOSS"), as part of the DARPA CHATS research program.
- *
- * 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. 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 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 <opie.h>
-#include <pwd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define PAM_SM_AUTH
-
-#include <security/pam_appl.h>
-#include <security/pam_modules.h>
-#include <security/pam_mod_misc.h>
-
-#define PAM_OPT_NO_FAKE_PROMPTS "no_fake_prompts"
-
-PAM_EXTERN int
-pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
- int argc __unused, const char *argv[] __unused)
-{
- struct opie opie;
- struct passwd *pwd;
- int retval, i;
- const char *(promptstr[]) = { "%s\nPassword: ", "%s\nPassword [echo on]: "};
- char challenge[OPIE_CHALLENGE_MAX + 1];
- char principal[OPIE_PRINCIPAL_MAX];
- const char *user;
- char *response;
- int style;
-
- user = NULL;
- if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF)) {
- if ((pwd = getpwnam(getlogin())) == NULL)
- return (PAM_AUTH_ERR);
- user = pwd->pw_name;
- }
- else {
- retval = pam_get_user(pamh, &user, NULL);
- if (retval != PAM_SUCCESS)
- return (retval);
- }
-
- PAM_LOG("Got user: %s", user);
-
- /*
- * Watch out: libopie feels entitled to truncate the user name
- * passed to it if it's longer than OPIE_PRINCIPAL_MAX, which is
- * not uncommon in Windows environments.
- */
- if (strlen(user) >= sizeof(principal))
- return (PAM_AUTH_ERR);
- strlcpy(principal, user, sizeof(principal));
-
- /*
- * Don't call the OPIE atexit() handler when our program exits,
- * since the module has been unloaded and we will SEGV.
- */
- opiedisableaeh();
-
- /*
- * If the no_fake_prompts option was given, and the user
- * doesn't have an OPIE key, just fail rather than present the
- * user with a bogus OPIE challenge.
- */
- if (opiechallenge(&opie, principal, challenge) != 0 &&
- openpam_get_option(pamh, PAM_OPT_NO_FAKE_PROMPTS))
- return (PAM_AUTH_ERR);
-
- /*
- * It doesn't make sense to use a password that has already been
- * typed in, since we haven't presented the challenge to the user
- * yet, so clear the stored password.
- */
- pam_set_item(pamh, PAM_AUTHTOK, NULL);
-
- style = PAM_PROMPT_ECHO_OFF;
- for (i = 0; i < 2; i++) {
- retval = pam_prompt(pamh, style, &response,
- promptstr[i], challenge);
- if (retval != PAM_SUCCESS) {
- opieunlock();
- return (retval);
- }
-
- PAM_LOG("Completed challenge %d: %s", i, response);
-
- if (response[0] != '\0')
- break;
-
- /* Second time round, echo the password */
- style = PAM_PROMPT_ECHO_ON;
- }
-
- pam_set_item(pamh, PAM_AUTHTOK, response);
-
- /*
- * Opieverify is supposed to return -1 only if an error occurs.
- * But it returns -1 even if the response string isn't in the form
- * it expects. Thus we can't log an error and can only check for
- * success or lack thereof.
- */
- retval = opieverify(&opie, response);
- free(response);
- return (retval == 0 ? PAM_SUCCESS : PAM_AUTH_ERR);
-}
-
-PAM_EXTERN int
-pam_sm_setcred(pam_handle_t *pamh __unused, int flags __unused,
- int argc __unused, const char *argv[] __unused)
-{
-
- return (PAM_SUCCESS);
-}
-
-PAM_MODULE_ENTRY("pam_opie");
diff --git a/lib/libpam/modules/pam_opieaccess/Makefile b/lib/libpam/modules/pam_opieaccess/Makefile
deleted file mode 100644
index 426bd8216ce4..000000000000
--- a/lib/libpam/modules/pam_opieaccess/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# $FreeBSD$
-
-PACKAGE= runtime
-
-LIB= pam_opieaccess
-SRCS= ${LIB}.c
-MAN= pam_opieaccess.8
-
-LIBADD+= opie
-
-.include <bsd.lib.mk>
diff --git a/lib/libpam/modules/pam_opieaccess/Makefile.depend b/lib/libpam/modules/pam_opieaccess/Makefile.depend
deleted file mode 100644
index 81514fa091b5..000000000000
--- a/lib/libpam/modules/pam_opieaccess/Makefile.depend
+++ /dev/null
@@ -1,18 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/lib/csu \
- include \
- lib/${CSU_DIR} \
- lib/libc \
- lib/libcompiler_rt \
- lib/libopie \
- lib/libpam/libpam \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/lib/libpam/modules/pam_opieaccess/pam_opieaccess.8 b/lib/libpam/modules/pam_opieaccess/pam_opieaccess.8
deleted file mode 100644
index 5521a85d1d44..000000000000
--- a/lib/libpam/modules/pam_opieaccess/pam_opieaccess.8
+++ /dev/null
@@ -1,142 +0,0 @@
-.\" Copyright (c) 2001 Mark R V Murray
-.\" All rights reserved.
-.\" Copyright (c) 2002 Networks Associates Technology, Inc.
-.\" All rights reserved.
-.\"
-.\" Portions of this software were developed for the FreeBSD Project by
-.\" ThinkSec AS and NAI Labs, the Security Research Division of Network
-.\" Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
-.\" ("CBOSS"), as part of the DARPA CHATS research program.
-.\"
-.\" 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. 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 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$
-.\"
-.Dd October 26, 2007
-.Dt PAM_OPIEACCESS 8
-.Os
-.Sh NAME
-.Nm pam_opieaccess
-.Nd OPIEAccess PAM module
-.Sh SYNOPSIS
-.Op Ar service-name
-.Ar module-type
-.Ar control-flag
-.Pa pam_opieaccess
-.Op Ar options
-.Sh DESCRIPTION
-The
-.Nm
-module is used in conjunction with the
-.Xr pam_opie 8
-PAM module to ascertain that authentication can proceed by other means
-(such as the
-.Xr pam_unix 8
-module) even if OPIE authentication failed.
-To properly use this module,
-.Xr pam_opie 8
-should be marked
-.Dq Li sufficient ,
-and
-.Nm
-should be listed right below it and marked
-.Dq Li requisite .
-.Pp
-The
-.Nm
-module provides functionality for only one PAM category:
-authentication.
-In terms of the
-.Ar module-type
-parameter, this is the
-.Dq Li auth
-feature.
-It also provides null functions for the remaining module types.
-.Ss OPIEAccess Authentication Module
-The authentication component
-.Pq Fn pam_sm_authenticate ,
-returns
-.Dv PAM_SUCCESS
-in two cases:
-.Bl -enum
-.It
-The user does not have OPIE enabled.
-.It
-The user has OPIE enabled, and the remote host is listed as a trusted
-host in
-.Pa /etc/opieaccess ,
-and the user does not have a file named
-.Pa \&.opiealways
-in his home directory.
-.El
-.Pp
-Otherwise, it returns
-.Dv PAM_AUTH_ERR .
-.Pp
-The following options may be passed to the authentication module:
-.Bl -tag -width ".Cm allow_local"
-.It Cm allow_local
-Normally, local logins are subjected to the same restrictions as
-remote logins from
-.Dq localhost .
-This option causes
-.Nm
-to always allow local logins.
-.It Cm debug
-.Xr syslog 3
-debugging information at
-.Dv LOG_DEBUG
-level.
-.It Cm no_warn
-suppress warning messages to the user.
-These messages include reasons why the user's authentication attempt
-was declined.
-.El
-.Sh FILES
-.Bl -tag -width ".Pa $HOME/.opiealways"
-.It Pa /etc/opieaccess
-List of trusted hosts or networks.
-See
-.Xr opieaccess 5
-for a description of its syntax.
-.It Pa $HOME/.opiealways
-The presence of this file makes OPIE mandatory for the user.
-.El
-.Sh SEE ALSO
-.Xr opie 4 ,
-.Xr opieaccess 5 ,
-.Xr pam.conf 5 ,
-.Xr pam 8 ,
-.Xr pam_opie 8
-.Sh AUTHORS
-The
-.Nm
-module and this manual page were developed for the
-.Fx
-Project by
-ThinkSec AS and NAI Labs, the Security Research Division of Network
-Associates, Inc.\& under DARPA/SPAWAR contract N66001-01-C-8035
-.Pq Dq CBOSS ,
-as part of the DARPA CHATS research program.
diff --git a/lib/libpam/modules/pam_opieaccess/pam_opieaccess.c b/lib/libpam/modules/pam_opieaccess/pam_opieaccess.c
deleted file mode 100644
index 090d98e5f2a6..000000000000
--- a/lib/libpam/modules/pam_opieaccess/pam_opieaccess.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-3-Clause
- *
- * Copyright (c) 2002 Networks Associates Technology, Inc.
- * All rights reserved.
- *
- * This software was developed for the FreeBSD Project by ThinkSec AS and
- * NAI Labs, the Security Research Division of Network Associates, Inc.
- * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
- * DARPA CHATS research program.
- *
- * 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. 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 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$");
-
-#define _BSD_SOURCE
-
-#include <sys/types.h>
-#include <opie.h>
-#include <pwd.h>
-#include <unistd.h>
-#include <syslog.h>
-
-#define PAM_SM_AUTH
-
-#include <security/pam_appl.h>
-#include <security/pam_modules.h>
-#include <security/pam_mod_misc.h>
-
-PAM_EXTERN int
-pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
- int argc __unused, const char *argv[] __unused)
-{
- struct opie opie;
- struct passwd *pwent;
- const void *luser, *rhost;
- int r;
-
- r = pam_get_item(pamh, PAM_USER, &luser);
- if (r != PAM_SUCCESS)
- return (r);
- if (luser == NULL)
- return (PAM_SERVICE_ERR);
-
- pwent = getpwnam(luser);
- if (pwent == NULL || opielookup(&opie, __DECONST(char *, luser)) != 0)
- return (PAM_SUCCESS);
-
- r = pam_get_item(pamh, PAM_RHOST, &rhost);
- if (r != PAM_SUCCESS)
- return (r);
- if (rhost == NULL || *(const char *)rhost == '\0')
- rhost = openpam_get_option(pamh, "allow_local") ?
- "" : "localhost";
-
- if (opieaccessfile(__DECONST(char *, rhost)) != 0 &&
- opiealways(pwent->pw_dir) != 0)
- return (PAM_SUCCESS);
-
- PAM_VERBOSE_ERROR("Refused; remote host is not in opieaccess");
-
- return (PAM_AUTH_ERR);
-}
-
-PAM_EXTERN int
-pam_sm_setcred(pam_handle_t *pamh __unused, int flags __unused,
- int argc __unused, const char *argv[] __unused)
-{
-
- return (PAM_SUCCESS);
-}
-
-PAM_MODULE_ENTRY("pam_opieaccess");
diff --git a/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8 b/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8
index abdd3907e972..21dd87a5f55f 100644
--- a/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8
+++ b/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8
@@ -251,7 +251,7 @@ is that the former is incompatible with
.Sh SEE ALSO
.Xr getpwnam 3 ,
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
.Sh AUTHORS
The
.Nm
diff --git a/lib/libpam/modules/pam_permit/pam_permit.8 b/lib/libpam/modules/pam_permit/pam_permit.8
index c7d98ab48e16..f71693b88bbd 100644
--- a/lib/libpam/modules/pam_permit/pam_permit.8
+++ b/lib/libpam/modules/pam_permit/pam_permit.8
@@ -72,4 +72,4 @@ level.
.Sh SEE ALSO
.Xr syslog 3 ,
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
diff --git a/lib/libpam/modules/pam_radius/pam_radius.8 b/lib/libpam/modules/pam_radius/pam_radius.8
index 9d12c0b0b6ce..3cf0f173150b 100644
--- a/lib/libpam/modules/pam_radius/pam_radius.8
+++ b/lib/libpam/modules/pam_radius/pam_radius.8
@@ -127,7 +127,7 @@ The standard RADIUS client configuration file for
.Sh SEE ALSO
.Xr passwd 5 ,
.Xr radius.conf 5 ,
-.Xr pam 8
+.Xr pam 3
.Sh HISTORY
The
.Nm
diff --git a/lib/libpam/modules/pam_rhosts/pam_rhosts.8 b/lib/libpam/modules/pam_rhosts/pam_rhosts.8
index 8adfcc6ed5ae..864c8e579d73 100644
--- a/lib/libpam/modules/pam_rhosts/pam_rhosts.8
+++ b/lib/libpam/modules/pam_rhosts/pam_rhosts.8
@@ -82,7 +82,7 @@ do not automatically fail if the target user's UID is 0.
.Sh SEE ALSO
.Xr hosts.equiv 5 ,
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
.Sh AUTHORS
The
.Nm
diff --git a/lib/libpam/modules/pam_rootok/pam_rootok.8 b/lib/libpam/modules/pam_rootok/pam_rootok.8
index 4203fbd246b7..9c42152353f6 100644
--- a/lib/libpam/modules/pam_rootok/pam_rootok.8
+++ b/lib/libpam/modules/pam_rootok/pam_rootok.8
@@ -72,4 +72,4 @@ authentication attempt was declined.
.Sh SEE ALSO
.Xr getuid 2 ,
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
diff --git a/lib/libpam/modules/pam_securetty/pam_securetty.8 b/lib/libpam/modules/pam_securetty/pam_securetty.8
index 5825fb452a7a..99a6277455ca 100644
--- a/lib/libpam/modules/pam_securetty/pam_securetty.8
+++ b/lib/libpam/modules/pam_securetty/pam_securetty.8
@@ -89,4 +89,4 @@ authentication attempt was declined.
.Xr syslog 3 ,
.Xr pam.conf 5 ,
.Xr ttys 5 ,
-.Xr pam 8
+.Xr pam 3
diff --git a/lib/libpam/modules/pam_self/pam_self.8 b/lib/libpam/modules/pam_self/pam_self.8
index d021434770c6..937ff6ef67ea 100644
--- a/lib/libpam/modules/pam_self/pam_self.8
+++ b/lib/libpam/modules/pam_self/pam_self.8
@@ -83,7 +83,7 @@ do not automatically fail if the current real user ID is 0.
.Sh SEE ALSO
.Xr getuid 2 ,
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
.Sh AUTHORS
The
.Nm
diff --git a/lib/libpam/modules/pam_ssh/pam_ssh.8 b/lib/libpam/modules/pam_ssh/pam_ssh.8
index 1afcfc77e6c1..b847c366517d 100644
--- a/lib/libpam/modules/pam_ssh/pam_ssh.8
+++ b/lib/libpam/modules/pam_ssh/pam_ssh.8
@@ -141,7 +141,7 @@ SSH2 Ed25519 key
.Sh SEE ALSO
.Xr ssh-agent 1 ,
.Xr pam.conf 5 ,
-.Xr pam 8
+.Xr pam 3
.Sh AUTHORS
The
.Nm
diff --git a/lib/libpam/modules/pam_tacplus/pam_tacplus.8 b/lib/libpam/modules/pam_tacplus/pam_tacplus.8
index ee8cc78e0d9f..92534aafb925 100644
--- a/lib/libpam/modules/pam_tacplus/pam_tacplus.8
+++ b/lib/libpam/modules/pam_tacplus/pam_tacplus.8
@@ -105,7 +105,7 @@ The standard TACACS+ client configuration file for
.Sh SEE ALSO
.Xr passwd 5 ,
.Xr tacplus.conf 5 ,
-.Xr pam 8
+.Xr pam 3
.Sh HISTORY
The
.Nm
diff --git a/lib/libpam/modules/pam_unix/pam_unix.8 b/lib/libpam/modules/pam_unix/pam_unix.8
index 03f8feaf4ba9..11643df1072d 100644
--- a/lib/libpam/modules/pam_unix/pam_unix.8
+++ b/lib/libpam/modules/pam_unix/pam_unix.8
@@ -206,7 +206,7 @@ password database.
.Xr syslog 3 ,
.Xr nsswitch.conf 5 ,
.Xr passwd 5 ,
-.Xr pam 8 ,
+.Xr pam 3 ,
.Xr pw 8 ,
.Xr yp 8
.Sh BUGS
diff --git a/lib/libpam/modules/pam_unix/pam_unix.c b/lib/libpam/modules/pam_unix/pam_unix.c
index 29588f0af1ea..2e9e272eaa77 100644
--- a/lib/libpam/modules/pam_unix/pam_unix.c
+++ b/lib/libpam/modules/pam_unix/pam_unix.c
@@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$");
#define LOCKED_PREFIX "*LOCKED*"
#define LOCKED_PREFIX_LEN (sizeof(LOCKED_PREFIX) - 1)
-static void makesalt(char []);
+static void makesalt(char [SALTSIZE + 1]);
static char password_hash[] = PASSWORD_HASH;
@@ -87,7 +87,7 @@ static char password_hash[] = PASSWORD_HASH;
* authentication management
*/
PAM_EXTERN int
-pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
+pam_sm_authenticate(pam_handle_t *pamh, int flags,
int argc __unused, const char *argv[] __unused)
{
login_cap_t *lc;
diff --git a/lib/libpam/pam.d/Makefile b/lib/libpam/pam.d/Makefile
index 1499f916cb17..da30a4682f53 100644
--- a/lib/libpam/pam.d/Makefile
+++ b/lib/libpam/pam.d/Makefile
@@ -34,10 +34,4 @@ afterinstallconfig:
${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}${CONFDIR}/ftpd ${DESTDIR}${CONFDIR}/ftp
.endif
-.if ${MK_TELNET} != "no"
-CONFGROUPS+= TELNET
-TELNET+= telnetd
-TELNETPACKAGE= telnet
-.endif
-
.include <bsd.prog.mk>
diff --git a/lib/libpam/pam.d/ftpd b/lib/libpam/pam.d/ftpd
index 0d0b0766cc21..a18809abbc6c 100644
--- a/lib/libpam/pam.d/ftpd
+++ b/lib/libpam/pam.d/ftpd
@@ -5,8 +5,6 @@
#
# auth
-auth sufficient pam_opie.so no_warn no_fake_prompts
-auth requisite pam_opieaccess.so no_warn allow_local
#auth sufficient pam_krb5.so no_warn
#auth sufficient pam_ssh.so no_warn try_first_pass
auth required pam_unix.so no_warn try_first_pass
diff --git a/lib/libpam/pam.d/other b/lib/libpam/pam.d/other
index 110aa00e74df..a157337dc2a3 100644
--- a/lib/libpam/pam.d/other
+++ b/lib/libpam/pam.d/other
@@ -5,8 +5,6 @@
#
# auth
-auth sufficient pam_opie.so no_warn no_fake_prompts
-auth requisite pam_opieaccess.so no_warn allow_local
#auth sufficient pam_krb5.so no_warn try_first_pass
#auth sufficient pam_ssh.so no_warn try_first_pass
auth required pam_unix.so no_warn try_first_pass
diff --git a/lib/libpam/pam.d/sshd b/lib/libpam/pam.d/sshd
index b4707c009f49..04b728dd0f89 100644
--- a/lib/libpam/pam.d/sshd
+++ b/lib/libpam/pam.d/sshd
@@ -5,8 +5,6 @@
#
# auth
-auth sufficient pam_opie.so no_warn no_fake_prompts
-auth requisite pam_opieaccess.so no_warn allow_local
#auth sufficient pam_krb5.so no_warn try_first_pass
#auth sufficient pam_ssh.so no_warn try_first_pass
auth required pam_unix.so no_warn try_first_pass
diff --git a/lib/libpam/pam.d/system b/lib/libpam/pam.d/system
index b8b7101e6b85..afaaef33636f 100644
--- a/lib/libpam/pam.d/system
+++ b/lib/libpam/pam.d/system
@@ -5,8 +5,6 @@
#
# auth
-auth sufficient pam_opie.so no_warn no_fake_prompts
-auth requisite pam_opieaccess.so no_warn allow_local
#auth sufficient pam_krb5.so no_warn try_first_pass
#auth sufficient pam_ssh.so no_warn try_first_pass
auth required pam_unix.so no_warn try_first_pass nullok
diff --git a/lib/libpam/pam.d/telnetd b/lib/libpam/pam.d/telnetd
deleted file mode 100644
index fb2f523d4ad1..000000000000
--- a/lib/libpam/pam.d/telnetd
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# $FreeBSD$
-#
-# PAM configuration for the "telnetd" service
-#
-
-# auth
-auth sufficient pam_opie.so no_warn no_fake_prompts
-auth requisite pam_opieaccess.so no_warn allow_local
-#auth sufficient pam_krb5.so no_warn try_first_pass
-#auth sufficient pam_ssh.so no_warn try_first_pass
-auth required pam_unix.so no_warn try_first_pass
-
-# account
-account required pam_nologin.so
-#account required pam_krb5.so
-account required pam_login_access.so
-account required pam_unix.so
-
-# session
-#session optional pam_ssh.so want_agent
-session required pam_lastlog.so no_fail
-
-# password
-#password sufficient pam_krb5.so no_warn try_first_pass
-password required pam_unix.so no_warn try_first_pass
diff --git a/lib/libpam/static_libpam/Makefile.depend b/lib/libpam/static_libpam/Makefile.depend
index c628f1cdc23a..0279c55e6023 100644
--- a/lib/libpam/static_libpam/Makefile.depend
+++ b/lib/libpam/static_libpam/Makefile.depend
@@ -16,8 +16,6 @@ DIRDEPS = \
lib/libpam/modules/pam_lastlog \
lib/libpam/modules/pam_login_access \
lib/libpam/modules/pam_nologin \
- lib/libpam/modules/pam_opie \
- lib/libpam/modules/pam_opieaccess \
lib/libpam/modules/pam_passwdqc \
lib/libpam/modules/pam_permit \
lib/libpam/modules/pam_radius \
diff --git a/lib/libpathconv/abs2rel.3 b/lib/libpathconv/abs2rel.3
index 984b2530e1b0..a1aaa83a83dd 100644
--- a/lib/libpathconv/abs2rel.3
+++ b/lib/libpathconv/abs2rel.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd Dec 15, 1997"
+.Dd August 7, 2022
.Dt ABS2REL 3
.Os
.Sh NAME
@@ -60,6 +60,23 @@ function returns relative path name on success.
If an error occurs,
it returns
.Dv NULL .
+.Sh EXAMPLES
+ char result[MAXPATHLEN];
+ char *path = abs2rel("/usr/src/sys", "/usr/local/lib", result, MAXPATHLEN);
+
+yields:
+
+ path == "../../src/sys"
+
+Similarly,
+
+ path1 = abs2rel("/usr/src/sys", "/usr", result, MAXPATHLEN);
+ path2 = abs2rel("/usr/src/sys", "/usr/src/sys", result, MAXPATHLEN);
+
+yields:
+
+ path1 == "src/sys"
+ path2 == "."
.Sh ERRORS
The
.Fn abs2rel
@@ -77,24 +94,11 @@ argument is zero.
The
.Fa size
argument is greater than zero but smaller than the length of the pathname plus 1.
-.Sh EXAMPLE
- char result[MAXPATHLEN];
- char *path = abs2rel("/usr/src/sys", "/usr/local/lib", result, MAXPATHLEN);
-
-yields:
-
- path == "../../src/sys"
-
-Similarly,
-
- path1 = abs2rel("/usr/src/sys", "/usr", result, MAXPATHLEN);
- path2 = abs2rel("/usr/src/sys", "/usr/src/sys", result, MAXPATHLEN);
-
-yields:
-
- path1 == "src/sys"
- path2 == "."
+.Sh SEE ALSO
+.Xr rel2abs 3
+.Sh AUTHORS
+.An Shigio Yamaguchi (shigio@tamacom.com)
.Sh BUGS
If the
.Fa base
@@ -130,7 +134,3 @@ The
function assures correct result, but don't forget that
.Fn realpath
requires that all but the last component of the path exist.
-.Sh "SEE ALSO"
-.Xr rel2abs 3
-.Sh AUTHORS
-Shigio Yamaguchi (shigio@tamacom.com)
diff --git a/lib/libpathconv/rel2abs.3 b/lib/libpathconv/rel2abs.3
index aee8039cf914..64dd2fa166ce 100644
--- a/lib/libpathconv/rel2abs.3
+++ b/lib/libpathconv/rel2abs.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd Dec 3, 1997"
+.Dd August 7, 2022
.Dt REL2ABS 3
.Os
.Sh NAME
@@ -58,6 +58,23 @@ The
function returns absolute path name on success.
If an error occurs, it returns
.Dv NULL .
+.Sh EXAMPLES
+ char result[MAXPATHLEN];
+ char *path = rel2abs("../../src/sys", "/usr/local/lib", result, MAXPATHLEN);
+
+yields:
+
+ path == "/usr/src/sys"
+
+Similarly,
+
+ path1 = rel2abs("src/sys", "/usr", result, MAXPATHLEN);
+ path2 = rel2abs(".", "/usr/src/sys", result, MAXPATHLEN);
+
+yields:
+
+ path1 == "/usr/src/sys"
+ path2 == "/usr/src/sys"
.Sh ERRORS
The
.Fn rel2abs
@@ -75,24 +92,7 @@ argument is zero.
The
.Fa size
argument is greater than zero but smaller than the length of the pathname plus 1
-.Sh EXAMPLE
- char result[MAXPATHLEN];
- char *path = rel2abs("../../src/sys", "/usr/local/lib", result, MAXPATHLEN);
-
-yields:
-
- path == "/usr/src/sys"
-
-Similarly,
-
- path1 = rel2abs("src/sys", "/usr", result, MAXPATHLEN);
- path2 = rel2abs(".", "/usr/src/sys", result, MAXPATHLEN);
-
-yields:
-
- path1 == "/usr/src/sys"
- path2 == "/usr/src/sys"
-.Sh "SEE ALSO"
+.Sh SEE ALSO
.Xr abs2rel 3
.Sh AUTHORS
-Shigio Yamaguchi (shigio@tamacom.com)
+.An Shigio Yamaguchi (shigio@tamacom.com)
diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
index 3adfb7b94af3..5b93fd1043d6 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -1335,17 +1335,25 @@ pfctl_set_syncookies(int dev, const struct pfctl_syncookies *s)
nvlist_t *nvl;
int ret;
uint state_limit;
+ uint64_t lim, hi, lo;
ret = pfctl_get_limit(dev, PF_LIMIT_STATES, &state_limit);
if (ret != 0)
return (ret);
+ lim = state_limit;
+ hi = lim * s->highwater / 100;
+ lo = lim * s->lowwater / 100;
+
+ if (lo == hi)
+ hi++;
+
nvl = nvlist_create(0);
nvlist_add_bool(nvl, "enabled", s->mode != PFCTL_SYNCOOKIES_NEVER);
nvlist_add_bool(nvl, "adaptive", s->mode == PFCTL_SYNCOOKIES_ADAPTIVE);
- nvlist_add_number(nvl, "highwater", state_limit * s->highwater / 100);
- nvlist_add_number(nvl, "lowwater", state_limit * s->lowwater / 100);
+ nvlist_add_number(nvl, "highwater", hi);
+ nvlist_add_number(nvl, "lowwater", lo);
nv.data = nvlist_pack(nvl, &nv.len);
nv.size = nv.len;
diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h
index 261913e1873d..faccabd227a3 100644
--- a/lib/libpfctl/libpfctl.h
+++ b/lib/libpfctl/libpfctl.h
@@ -102,7 +102,7 @@ struct pfctl_eth_rule {
uint64_t evaluations;
uint64_t packets[2];
uint64_t bytes[2];
- uint32_t last_active_timestamp;
+ time_t last_active_timestamp;
/* Action */
char qname[PF_QNAME_SIZE];
@@ -175,7 +175,7 @@ struct pfctl_rule {
uint64_t evaluations;
uint64_t packets[2];
uint64_t bytes[2];
- uint32_t last_active_timestamp;
+ time_t last_active_timestamp;
struct pfi_kif *kif;
struct pfctl_anchor *anchor;
diff --git a/lib/libpmc/Makefile b/lib/libpmc/Makefile
index 8d884366eed7..d33567e5b3f8 100644
--- a/lib/libpmc/Makefile
+++ b/lib/libpmc/Makefile
@@ -43,7 +43,7 @@ SRCS+= libpmc_events.c
WARNS?= 3
-CFLAGS+= -I${.CURDIR}
+CFLAGS+= -I${.CURDIR} -I${SRCTOP}/sys
CWARNFLAGS.gcc+= -Wno-shadow -Wno-cast-align
# Silence warnings about usage of deprecated std::auto_ptr
@@ -69,10 +69,12 @@ MAN+= pmc.soft.3
# PMC-dependent manual pages
MAN+= pmc.atom.3
MAN+= pmc.atomsilvermont.3
+MAN+= pmc.cmn-600.3
MAN+= pmc.core.3
MAN+= pmc.core2.3
MAN+= pmc.corei7.3
MAN+= pmc.corei7uc.3
+MAN+= pmc.dmc-620.3
MAN+= pmc.haswell.3
MAN+= pmc.haswelluc.3
MAN+= pmc.haswellxeon.3
diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c
index 581c05e0f8ef..d5b5c115a38f 100644
--- a/lib/libpmc/libpmc.c
+++ b/lib/libpmc/libpmc.c
@@ -1440,15 +1440,12 @@ pmc_init(void)
memcpy(&cpu_info.pm_classes[n], &op_cpu_info.pm_classes[n],
sizeof(cpu_info.pm_classes[n]));
- pmc_class_table = malloc(PMC_CLASS_TABLE_SIZE *
+ pmc_class_table = calloc(PMC_CLASS_TABLE_SIZE,
sizeof(struct pmc_class_descr *));
if (pmc_class_table == NULL)
return (-1);
- for (n = 0; n < PMC_CLASS_TABLE_SIZE; n++)
- pmc_class_table[n] = NULL;
-
/*
* Get soft events list.
*/
@@ -1472,20 +1469,98 @@ pmc_init(void)
* Fill in the class table.
*/
n = 0;
+ for (unsigned i = 0; i < PMC_CLASS_TABLE_SIZE; i++) {
+ switch (cpu_info.pm_classes[i].pm_class) {
+#if defined(__amd64__) || defined(__i386__)
+ case PMC_CLASS_TSC:
+ pmc_class_table[n++] = &tsc_class_table_descr;
+ break;
+
+ case PMC_CLASS_K8:
+ pmc_class_table[n++] = &k8_class_table_descr;
+ break;
+#endif
+
+ case PMC_CLASS_SOFT:
+ pmc_class_table[n++] = &soft_class_table_descr;
+ break;
- /* Fill soft events information. */
- pmc_class_table[n++] = &soft_class_table_descr;
+#if defined(__arm__)
+ case PMC_CLASS_ARMV7:
+ switch (cpu_info.pm_cputype) {
+ case PMC_CPU_ARMV7_CORTEX_A8:
+ pmc_class_table[n++] =
+ &cortex_a8_class_table_descr;
+ break;
+ case PMC_CPU_ARMV7_CORTEX_A9:
+ pmc_class_table[n++] =
+ &cortex_a9_class_table_descr;
+ break;
+ default:
+ errno = ENXIO;
+ return (pmc_syscall = -1);
+ }
+ break;
+#endif
#if defined(__aarch64__)
- pmc_class_table[n++] = &cmn600_pmu_class_table_descr;
- pmc_class_table[n++] = &dmc620_pmu_cd2_class_table_descr;
- pmc_class_table[n++] = &dmc620_pmu_c_class_table_descr;
+ case PMC_CLASS_ARMV8:
+ switch (cpu_info.pm_cputype) {
+ case PMC_CPU_ARMV8_CORTEX_A53:
+ pmc_class_table[n++] =
+ &cortex_a53_class_table_descr;
+ break;
+ case PMC_CPU_ARMV8_CORTEX_A57:
+ pmc_class_table[n++] =
+ &cortex_a57_class_table_descr;
+ break;
+ case PMC_CPU_ARMV8_CORTEX_A76:
+ pmc_class_table[n++] =
+ &cortex_a76_class_table_descr;
+ break;
+ default:
+ errno = ENXIO;
+ return (pmc_syscall = -1);
+ }
+ break;
+
+ case PMC_CLASS_DMC620_PMU_CD2:
+ pmc_class_table[n++] =
+ &dmc620_pmu_cd2_class_table_descr;
+ break;
+
+ case PMC_CLASS_DMC620_PMU_C:
+ pmc_class_table[n++] = &dmc620_pmu_c_class_table_descr;
+ break;
+
+ case PMC_CLASS_CMN600_PMU:
+ pmc_class_table[n++] = &cmn600_pmu_class_table_descr;
+ break;
#endif
-#if defined(__amd64__) || defined(__i386__)
- if (cpu_info.pm_cputype != PMC_CPU_GENERIC)
- pmc_class_table[n++] = &tsc_class_table_descr;
+
+#if defined(__powerpc__)
+ case PMC_CLASS_PPC7450:
+ pmc_class_table[n++] = &ppc7450_class_table_descr;
+ break;
+
+ case PMC_CLASS_PPC970:
+ pmc_class_table[n++] = &ppc970_class_table_descr;
+ break;
+
+ case PMC_CLASS_E500:
+ pmc_class_table[n++] = &e500_class_table_descr;
+ break;
#endif
+ default:
+#if defined(DEBUG)
+ printf("pm_class: 0x%x\n",
+ cpu_info.pm_classes[i].pm_class);
+#endif
+ break;
+ }
+ }
+
#define PMC_MDEP_INIT(C) pmc_mdep_event_aliases = C##_aliases
/* Configure the event name parser. */
@@ -1493,7 +1568,6 @@ pmc_init(void)
#if defined(__amd64__) || defined(__i386__)
case PMC_CPU_AMD_K8:
PMC_MDEP_INIT(k8);
- pmc_class_table[n] = &k8_class_table_descr;
break;
#endif
case PMC_CPU_GENERIC:
@@ -1502,39 +1576,31 @@ pmc_init(void)
#if defined(__arm__)
case PMC_CPU_ARMV7_CORTEX_A8:
PMC_MDEP_INIT(cortex_a8);
- pmc_class_table[n] = &cortex_a8_class_table_descr;
break;
case PMC_CPU_ARMV7_CORTEX_A9:
PMC_MDEP_INIT(cortex_a9);
- pmc_class_table[n] = &cortex_a9_class_table_descr;
break;
#endif
#if defined(__aarch64__)
case PMC_CPU_ARMV8_CORTEX_A53:
PMC_MDEP_INIT(cortex_a53);
- pmc_class_table[n] = &cortex_a53_class_table_descr;
break;
case PMC_CPU_ARMV8_CORTEX_A57:
PMC_MDEP_INIT(cortex_a57);
- pmc_class_table[n] = &cortex_a57_class_table_descr;
break;
case PMC_CPU_ARMV8_CORTEX_A76:
PMC_MDEP_INIT(cortex_a76);
- pmc_class_table[n] = &cortex_a76_class_table_descr;
break;
#endif
#if defined(__powerpc__)
case PMC_CPU_PPC_7450:
PMC_MDEP_INIT(ppc7450);
- pmc_class_table[n] = &ppc7450_class_table_descr;
break;
case PMC_CPU_PPC_970:
PMC_MDEP_INIT(ppc970);
- pmc_class_table[n] = &ppc970_class_table_descr;
break;
case PMC_CPU_PPC_E500:
PMC_MDEP_INIT(e500);
- pmc_class_table[n] = &e500_class_table_descr;
break;
#endif
default:
diff --git a/lib/libpmc/libpmc_pmu_util.c b/lib/libpmc/libpmc_pmu_util.c
index 7af6d813ada6..1ae0c573d157 100644
--- a/lib/libpmc/libpmc_pmu_util.c
+++ b/lib/libpmc/libpmc_pmu_util.c
@@ -165,6 +165,21 @@ pmu_alias_get(const char *name)
#elif defined(__aarch64__)
static struct pmu_alias pmu_armv8_alias_table[] = {
+ {"UNHALTED_CORE_CYCLES", "CPU_CYCLES"},
+ {"UNHALTED-CORE-CYCLES", "CPU_CYCLES"},
+ {"LLC_MISSES", "LL_CACHE_MISS_RD"},
+ {"LLC-MISSES", "LL_CACHE_MISS_RD"},
+ {"LLC_REFERENCE", "LL_CACHE_RD"},
+ {"LLC-REFERENCE", "LL_CACHE_RD"},
+ {"BRANCH_INSTRUCTION_RETIRED", "BR_RETIRED"},
+ {"BRANCH-INSTRUCTION-RETIRED", "BR_RETIRED"},
+ {"BRANCH_MISSES_RETIRED", "BR_MIS_PRED_RETIRED"},
+ {"BRANCH-MISSES-RETIRED", "BR_MIS_PRED_RETIRED"},
+ {"unhalted-cycles", "CPU_CYCLES"},
+ {"instructions", "INST_RETIRED",},
+ {"branch-mispredicts", "BR_MIS_PRED_RETIRED"},
+ {"branches", "BR_RETIRED"},
+ {"interrupts", "EXC_IRQ"},
{NULL, NULL},
};
diff --git a/lib/libpmc/pmc.cmn-600.3 b/lib/libpmc/pmc.cmn-600.3
new file mode 100644
index 000000000000..55a0b5fba88b
--- /dev/null
+++ b/lib/libpmc/pmc.cmn-600.3
@@ -0,0 +1,597 @@
+.\" Copyright (c) 2021 ARM Ltd. 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$
+.\"
+.Dd December 19, 2021
+.Dt PMC.CMN-600 3
+.Os
+.Sh NAME
+.Nm pmc.cmn-600
+.Nd Library for accessing the Arm CoreLink CMN-600 Coherent Mesh Network
+Controller performance counter events
+.Sh LIBRARY
+.Lb libpmc
+.Sh SYNOPSIS
+.In pmc.h
+.Sh DESCRIPTION
+CMN-600 PMU counters may be configured to count any one of a defined set of
+hardware events.
+Unlike other performance counters, counters for the CMN-600 require the
+node ID to set up.
+.Pp
+Node ID information currently can be obtained one of two ways.
+Using bootverbose, for example set sysctl debug.bootverbose=1 and then load the
+.Xr hwpmc 4
+KLD module.
+The cmn600 module will be loaded automatically as a dependency:
+.Dl $ sysctl debug.bootverbose=1
+.Dl $ kldload hwpmc
+Another way is to use sysctl to trigger
+dump of nodes tree to system console:
+.Dl $ sysctl dev.cmn600.0.dump_nodes=1
+.Pp
+Some BIOS versions of dual-socket machines have no NUMA domain information in
+ACPI.
+In such cases, to get more accurate events statistics, set the kernel
+environment variable hint.cmn600.{unit}.domain={value}.
+Where {unit} is a cmn600 device unit number and {value} is the NUMA domain of
+the CPU package containing that CMN-600 controller.
+Example:
+.Dl $ kenv hint.cmn600.0.domain=0
+.Dl $ kenv hint.cmn600.1.domain=1
+.Dl $ kldunload hwpmc cmn600
+.Dl $ kldload hwpmc
+.Pp
+Arm CoreLink CMN-600 Coherent Mesh Network Controller performance counters are
+documented in
+.Rs
+.%B "Arm CoreLink CMN-600 Coherent Mesh Network Technical Reference Manual"
+.%T "Revision: r3p2"
+.%D 2020
+.%Q "ARM Limited"
+.Re
+.Ss PMC Capabilities
+CMN-600 PMU counters support the following capabilities:
+.Bl -column "PMC_CAP_INTERRUPT" "Support"
+.It Sy Capability Ta Em Support
+.It PMC_CAP_CASCADE Ta \&No
+.It PMC_CAP_EDGE Ta \&No
+.It PMC_CAP_INTERRUPT Ta Yes
+.It PMC_CAP_INVERT Ta \&No
+.It PMC_CAP_READ Ta Yes
+.It PMC_CAP_PRECISE Ta \&No
+.It PMC_CAP_SYSTEM Ta Yes
+.It PMC_CAP_TAGGING Ta \&No
+.It PMC_CAP_THRESHOLD Ta Yes
+.It PMC_CAP_USER Ta \&No
+.It PMC_CAP_WRITE Ta Yes
+.El
+.Ss Event Qualifiers
+Event specifiers for these PMCs support the following common
+qualifiers:
+.Bl -tag -width indent
+.It Li nodeid= Ns Ar nodeid
+Request counting for specific event at node
+.Ar nodeid .
+.It Li occupancy= Ns Ar value
+Filtering by occupancy type.
+.It Li xpport= Ns Ar port
+Count only events matched by
+.Ar port .
+(East, West, North, South, devport0, devport1 or numeric 0 to 5)
+.It Li xpchannel= Ns Ar channel
+Filter events by XP node channel.
+(REQ, RSP, SNP, DAT or 0, 1, 2, 3)
+.El
+.Ss Class Name Prefix
+These PMCs are named using a class name prefix of
+.Dq Li CMN600_PMU_ .
+.Ss Event Specifiers
+The following list of PMC events are available:
+.Ss DVM node events
+.Bl -tag -width indent
+.It Sy dn_rxreq_dvmop
+Number of DVMOP requests received.
+This includes all the sub-types include TLB invalidate, Branch predictor
+invalidate, instruction cache (physical and virtual) invalidate.
+.It Sy dn_rxreq_dvmsync
+Number of DVM Sync requests received.
+.It Sy dn_rxreq_dvmop_vmid_filtered
+Number of incoming DVMOP requests that are subject to VMID based filtering.
+This is a measure of the effectiveness of VMID based filtering and potential
+reduction in DVM snoops.
+.It Sy dn_rxreq_retried
+Number of incoming requests that are retried.
+This is a measure of the retry rate.
+.It Sy dn_rxreq_trk_occupancy
+Counts the tracker occupancy in DN. "occupancy": All, dvmop, dvmsync
+.It Sy dn_rxreq_tlbi_dvmop
+Number of DVMOP TLB invalidate requests received.
+.It Sy dn_rxreq_bpi_dvmop
+Number of DVMOP Branch predictor invalidate requests received.
+.It Sy dn_rxreq_pici_dvmop
+Number of DVMOP physical instruction cache invalidate requests received.
+.It Sy dn_rxreq_vivi_dvmop
+Number of DVMOP virtual instruction cache invalidate requests received.
+.It Sy dn_rxreq_dvmop_other_filtered
+Number of DVM op requests to RNDs, BPI or PICI/VICI, that were filtered
+.It Sy dn_rxreq_snp_sent
+Number of SNPs sent to RNs
+.It Sy dn_rxreq_snp_stalled
+Number of SNPs stalled to RNs due to lack of Crds
+.It Sy dn_rxreq_trk_full
+DVM tracker full counter
+.El
+.Ss HN-F node events
+.Bl -tag -width indent
+.It Sy hnf_cache_miss
+Counts total cache misses in first lookup result (high priority)
+.It Sy hnf_slc_sf_cache_access
+Counts number of cache accesses in first access (high priority)
+.It Sy hnf_cache_fill
+Counts total allocations in HN SLC (all cache line allocations to SLC)
+.It Sy hnf_pocq_retry
+Counts number of retried requests
+.It Sy hnf_pocq_reqs_recvd
+Counts number of requests received by HN
+.It Sy hnf_sf_hit
+Counts number of SF hits
+.It Sy hnf_sf_evictions
+Counts number of SF eviction cache invalidations initiated
+.It Sy hnf_dir_snoops_sent
+Counts number of directed snoops sent (not including SF back invalidation)
+.It Sy hnf_brd_snoops_sent
+Counts number of multicast snoops sent (not including SF back invalidation)
+.It Sy hnf_slc_eviction
+Counts number of SLC evictions (dirty only)
+.It Sy hnf_slc_fill_invalid_way
+Counts number of SLC fills to an invalid way
+.It Sy hnf_mc_retries
+Counts number of retried transactions by the MC
+.It Sy hnf_mc_reqs
+Counts number of requests sent to MC
+.It Sy hnf_qos_hh_retry
+Counts number of times a HighHigh priority request is protocol-retried at the
+HN-F
+.It Sy hnf_qos_pocq
+Counts the POCQ occupancy in HN-F.
+Support argument "occupancy". Accept: All, Read, Write, Atomic, Stash.
+Default: All.
+.It Sy hnf_pocq_addrhaz
+Counts number of POCQ address hazards upon allocation
+.It Sy hnf_pocq_atomic_addrhaz
+Counts number of POCQ address hazards upon allocation for atomic operations
+.It Sy hnf_ld_st_swp_adq_full
+Counts number of times ADQ is full for Ld/St/SWP type atomic operations while
+POCQ has pending operations
+.It Sy hnf_cmp_adq_full
+Counts number of times ADQ is full for CMP type atomic operations while POCQ
+has pending operations
+.It Sy hnf_txdat_stall
+Counts number of times HN-F has a pending TXDAT flit but no credits to upload
+.It Sy hnf_txrsp_stall
+Counts number of times HN-F has a pending TXRSP flit but no credits to upload
+.It Sy hnf_seq_full
+Counts number of times requests are replayed in SLC pipe due to SEQ being full
+.It Sy hnf_seq_hit
+Counts number of times a request in SLC hit a pending SF eviction in SEQ
+.It Sy hnf_snp_sent
+Counts number of snoops sent including directed, multicast, and SF back
+invalidation
+.It Sy hnf_sfbi_dir_snp_sent
+Counts number of times directed snoops were sent due to SF back invalidation
+.It Sy hnf_sfbi_brd_snp_sent
+Counts number of times multicast snoops were sent due to SF back invalidation
+.It Sy hnf_snp_sent_untrk
+Counts number of times snooped were sent due to untracked RNF's
+.It Sy hnf_intv_dirty
+Counts number of times SF back invalidation resulted in dirty line intervention
+from the RN
+.It Sy hnf_stash_snp_sent
+Counts number of times stash snoops were sent
+.It Sy hnf_stash_data_pull
+Counts number of times stash snoops resulted in data pull from the RN
+.It Sy hnf_snp_fwded
+Counts number of times data forward snoops were sent
+.El
+.Ss HN-I node events
+.Bl -tag -width indent
+.It Sy hni_rrt_rd_occ_cnt_ovfl
+RRT read occupancy count overflow
+.It Sy hni_rrt_wr_occ_cnt_ovfl
+RRT write occupancy count overflow
+.It Sy hni_rdt_rd_occ_cnt_ovfl
+RDT read occupancy count overflow
+.It Sy hni_rdt_wr_occ_cnt_ovfl
+RDT write occupancy count overflow
+.It Sy hni_wdb_occ_cnt_ovfl
+WDB occupancy count overflow
+.It Sy hni_rrt_rd_alloc
+RRT read allocation
+.It Sy hni_rrt_wr_alloc
+RRT write allocation
+.It Sy hni_rdt_rd_alloc
+RDT read allocation
+.It Sy hni_rdt_wr_alloc
+RDT write allocation
+.It Sy hni_wdb_alloc
+WDB allocation
+.It Sy hni_txrsp_retryack
+RETRYACK TXRSP flit sent
+.It Sy hni_arvalid_no_arready
+ARVALID set without ARREADY event
+.It Sy hni_arready_no_arvalid
+ARREADY set without ARVALID event
+.It Sy hni_awvalid_no_awready
+AWVALID set without AWREADY event
+.It Sy hni_awready_no_awvalid
+AWREADY set without AWVALID event
+.It Sy hni_wvalid_no_wready
+WVALID set without WREADY event
+.It Sy hni_txdat_stall
+TXDAT stall (TXDAT valid but no link credit available)
+.It Sy hni_nonpcie_serialization
+Non-PCIe serialization event
+.It Sy hni_pcie_serialization
+PCIe serialization event
+.El
+.Ss XP node events
+.Bl -tag -width indent
+.It Sy xp_txflit_valid
+Number of flits transmitted on a specified port and CHI channel.
+This is a measure of the flit transfer bandwidth from an XP.
+Note: On device ports, this event also includes link flit transfers.
+.It Sy xp_txflit_stall
+Number of cycles when a flit is stalled at an XP waiting for link credits at a
+specified port and CHI channel.
+This is a measure of the flit traffic congestion on the mesh and at the flit
+download ports.
+.It Sy xp_partial_dat_flit
+Number of times when a partial DAT flit is uploaded onto the mesh from a
+RN-F_CHIA port.
+Partial DAT flit transmission occurs when XP is not able to combine two 128b
+DAT flits and send them over the 256b DAT channel.
+This can happen under 2 circumstances:
+1. Only one 128b DAT flit is received within a transmission time window.
+2. Two 128b DAT flits are received but they are not two halves of a
+ single 256b word.
+.El
+.Ss SBSX node events
+.Bl -tag -width indent
+.It Sy sbsx_rd_req
+Read request
+.It Sy sbsx_wr_req
+Write request
+.It Sy sbsx_cmo_req
+CMO request
+.It Sy sbsx_txrsp_retryack
+RETRYACK TXRSP flit sent
+.It Sy sbsx_txdat_flitv
+TXDAT flit seen
+.It Sy sbsx_txrsp_flitv
+TXRSP flit seen
+.It Sy sbsx_rd_req_trkr_occ_cnt_ovfl
+Read request tracker occupancy count overflow
+.It Sy sbsx_wr_req_trkr_occ_cnt_ovfl
+Write request tracker occupancy count overflow
+.It Sy sbsx_cmo_req_trkr_occ_cnt_ovfl
+CMO request tracker occupancy count overflow
+.It Sy sbsx_wdb_occ_cnt_ovfl
+WDB occupancy count overflow
+.It Sy sbsx_rd_axi_trkr_occ_cnt_ovfl
+Read AXI pending tracker occupancy count overflow
+.It Sy sbsx_cmo_axi_trkr_occ_cnt_ovfl
+CMO AXI pending tracker occupancy count overflow
+.It Sy sbsx_arvalid_no_arready
+ARVALID set without ARREADY
+.It Sy sbsx_awvalid_no_awready
+AWVALID set without AWREADY
+.It Sy sbsx_wvalid_no_wready
+WVALID set without WREADY
+.It Sy sbsx_txdat_stall
+TXDAT stall (TXDAT valid but no link credit available)
+.It Sy sbsx_txrsp_stall
+TXRSP stall (TXRSP valid but no link credit available)
+.El
+.Ss RN-D node events
+.Bl -tag -width indent
+.It Sy rnd_s0_rdata_beats
+Number of RData beats, RVALID and RREADY, dispatched on port 0.
+This is a measure of the read bandwidth, including CMO responses.
+.It Sy rnd_s1_rdata_beats
+Number of RData beats, RVALID and RREADY, dispatched on port 1.
+This is a measure of the read bandwidth, including CMO responses.
+.It Sy rnd_s2_rdata_beats
+Number of RData beats, RVALID and RREADY, dispatched on port 2.
+This is a measure of the read bandwidth, including CMO responses.
+.It Sy rnd_rxdat_flits
+Number of RXDAT flits received.
+This is a measure of the true read data bandwidth, excluding CMOs.
+.It Sy rnd_txdat_flits
+Number of TXDAT flits dispatched.
+This is a measure of the write bandwidth.
+.It Sy rnd_txreq_flits_total
+Number of TXREQ flits dispatched.
+This is a measure of the total request
+bandwidth.
+.It Sy rnd_txreq_flits_retried
+Number of retried TXREQ flits dispatched.
+This is a measure of the retry rate.
+.It Sy rnd_rrt_occ_ovfl
+All entries in the read request tracker are occupied.
+This is a measure of oversubscription in the read request tracker.
+.It Sy rnd_wrt_occ_ovfl
+All entries in the write request tracker are occupied.
+This is a measure of oversubscription in the write request tracker.
+.It Sy rnd_txreq_flits_replayed
+Number of replayed TXREQ flits.
+This is the measure of replay rate.
+.It Sy rnd_wrcancel_sent
+Number of write data cancels sent.
+This is the measure of write cancel rate.
+.It Sy rnd_s0_wdata_beats
+Number of WData beats, WVALID and WREADY, dispatched on port 0.
+This is a measure of write bandwidth on AXI port 0.
+.It Sy rnd_s1_wdata_beats
+Number of WData beats, WVALID and WREADY, dispatched on port 1.
+This is a measure of write bandwidth on AXI port 1.
+.It Sy rnd_s2_wdata_beats
+Number of WData beats, WVALID and WREADY, dispatched on port 2.
+This is a measure of write bandwidth on AXI port 2.
+.It Sy rnd_rrt_alloc
+Number of allocations in the read request tracker.
+This is a measure of read transaction count.
+.It Sy rnd_wrt_alloc
+Number of allocations in the write request tracker.
+This is a measure of write transaction count.
+.It Sy rnd_rdb_unord
+Number of cycles for which Read Data Buffer state machine is in Unordered Mode.
+.It Sy rnd_rdb_replay
+Number of cycles for which Read Data Buffer state machine is in Replay mode
+.It Sy rnd_rdb_hybrid
+Number of cycles for which Read Data Buffer state machine is in hybrid mode.
+Hybrid mode is where there is mix of ordered/unordered traffic.
+.It Sy rnd_rdb_ord
+Number of cycles for which Read Data Buffer state machine is in ordered Mode.
+.El
+.Ss RN-I node events
+.Bl -tag -width indent
+.It Sy rni_s0_rdata_beats
+Number of RData beats, RVALID and RREADY, dispatched on port 0.
+This is a measure of the read bandwidth, including CMO responses.
+.It Sy rni_s1_rdata_beats
+Number of RData beats, RVALID and RREADY, dispatched on port 1.
+This is a measure of the read bandwidth, including CMO responses.
+.It Sy rni_s2_rdata_beats
+Number of RData beats, RVALID and RREADY, dispatched on port 2.
+This is a measure of the read bandwidth, including CMO responses.
+.It Sy rni_rxdat_flits
+Number of RXDAT flits received.
+This is a measure of the true read data bandwidth, excluding CMOs.
+.It Sy rni_txdat_flits
+Number of TXDAT flits dispatched.
+This is a measure of the write bandwidth.
+.It Sy rni_txreq_flits_total
+Number of TXREQ flits dispatched.
+This is a measure of the total request bandwidth.
+.It Sy rni_txreq_flits_retried
+Number of retried TXREQ flits dispatched.
+This is a measure of the retry rate.
+.It Sy rni_rrt_occ_ovfl
+All entries in the read request tracker are occupied.
+This is a measure of oversubscription in the read request tracker.
+.It Sy rni_wrt_occ_ovfl
+All entries in the write request tracker are occupied.
+This is a measure of oversubscription in the write request tracker.
+.It Sy rni_txreq_flits_replayed
+Number of replayed TXREQ flits.
+This is the measure of replay rate.
+.It Sy rni_wrcancel_sent
+Number of write data cancels sent.
+This is the measure of write cancel rate
+.It Sy rni_s0_wdata_beats
+Number of WData beats, WVALID and WREADY, dispatched on port 0.
+This is a measure of write bandwidth on AXI port 0.
+.It Sy rni_s1_wdata_beats
+Number of WData beats, WVALID and WREADY, dispatched on port 1.
+This is a measure of write bandwidth on AXI port 1.
+.It Sy rni_s2_wdata_beats
+Number of WData beats, WVALID and WREADY, dispatched on port 2.
+This is a measure of write bandwidth on AXI port 2.
+.It Sy rni_rrt_alloc
+Number of allocations in the read request tracker.
+This is a measure of read transaction count.
+.It Sy rni_wrt_alloc
+Number of allocations in the write request tracker.
+This is a measure of write transaction count
+.It Sy rni_rdb_unord
+Number of cycles for which Read Data Buffer state machine is in Unordered Mode.
+.It Sy rni_rdb_replay
+Number of cycles for which Read Data Buffer state machine is in Replay mode
+.It Sy rni_rdb_hybrid
+Number of cycles for which Read Data Buffer state machine is in hybrid mode.
+Hybrid mode is where there is mix of ordered/unordered traffic.
+.It Sy rni_rdb_ord
+Number of cycles for which Read Data Buffer state machine is in ordered Mode.
+.El
+.Ss CXHA node events
+.Pq Note: CXHA events descriptions are guessed
+.Bl -tag -width indent
+.It Sy cxha_rddatbyp
+Number of Read DAT Bypass
+.It Sy cxha_chirsp_up_stall
+Number of CHI RSP up Stall
+.It Sy cxha_chidat_up_stall
+Number of CHI DAT up Stall
+.It Sy cxha_snppcrd_lnk0_stall
+Number of Snoop Pcrd Stall on Link 0
+.It Sy cxha_snppcrd_lnk1_stall
+Number of Snoop Pcrd Stall on Link 1
+.It Sy cxha_snppcrd_lnk2_stall
+Number of Snoop Pcrd Stall on Link 2
+.It Sy cxha_reqtrk_occ
+Request Tracker Occupancy
+.It Sy cxha_rdb_occ
+Read Data Buffer Occupancy
+.It Sy cxha_rdbbyp_occ
+Read Data Buffer Bypass Occupancy
+.It Sy cxha_wdb_occ
+Write Data Buffer Occupancy
+.It Sy cxha_snptrk_occ
+Snoop Tracker Occupancy
+.It Sy cxha_sdb_occ
+SDB Occupancy
+.It Sy cxha_snphaz_occ
+Snoop Hazard Occupancy
+.El
+.Ss CXRA node events
+.Bl -tag -width indent
+.It Sy cxra_req_trk_occ
+Request tracker occupancy
+.It Sy cxra_snp_trk_occ
+Snoop tracker occupancy
+.It Sy cxra_rd_dat_buf_occ
+Read data buffer occupancy
+.It Sy cxra_wr_dat_buf_occ
+Write data buffer occupancy
+.It Sy cxra_snp_sink_buf_occ
+Snoop sink buffer occupancy
+.It Sy cxra_snp_bcasts
+Snoop broadcasts
+.It Sy cxra_req_chains
+Number of request chains formed larger than one
+.It Sy cxra_req_chain_avg_len
+Average size of request chains, only for chain sizes larger than one
+.It Sy cxra_chi_rsp_upload_stalls
+Local RA upload stalls to CHI because of contention with HA
+.It Sy cxra_chi_dat_upload_stalls
+Local RA upload stalls to CHI because of contention with HA
+.It Sy cxra_dat_pcrd_stalls_lnk0
+Memory Data Request available, but no DAT Pcrd to send over CCIX per LinkEnd 0
+.It Sy cxra_dat_pcrd_stalls_lnk1
+Memory Data Request available, but no DAT Pcrd to send over CCIX per LinkEnd 1
+.It Sy cxra_dat_pcrd_stalls_lnk2
+Memory Data Request available, but no DAT Pcrd to send over CCIX per LinkEnd 2
+.It Sy cxra_req_pcrd_stalls_lnk0
+Memory Data Request available but no Req Pcrd to send over CCIX per LinkEnd 0
+.It Sy cxra_req_pcrd_stalls_lnk1
+Memory Data Request available but no Req Pcrd to send over CCIX per LinkEnd 1
+.It Sy cxra_req_pcrd_stalls_lnk2
+Memory Data Request available but no Req Pcrd to send over CCIX per LinkEnd 2
+.It Sy cxra_ext_rsp_stall
+CHI external RSP stall
+.It Sy cxra_ext_dat_stall
+CHI external DAT stall
+.El
+.Ss CXLA node events
+.Bl -tag -width indent
+.It Sy cxla_rx_tlp_link0
+RX TLP for Link 0
+.It Sy cxla_rx_tlp_link1
+RX TLP for Link 1
+.It Sy cxla_rx_tlp_link2
+RX TLP for Link 2
+.It Sy cxla_tx_tlp_link0
+TX TLP for Link 0
+.It Sy cxla_tx_tlp_link1
+TX TLP for Link 1
+.It Sy cxla_tx_tlp_link2
+TX TLP for Link 2
+.It Sy cxla_rx_cxs_link0
+RX CXS for Link 0
+.It Sy cxla_rx_cxs_link1
+RX CXS for Link 1
+.It Sy cxla_rx_cxs_link2
+RX CXS for Link 2
+.It Sy cxla_tx_cxs_link0
+TX CXS for Link 0
+.It Sy cxla_tx_cxs_link1
+TX CXS for Link 1
+.It Sy cxla_tx_cxs_link2
+TX CXS for Link 2
+.It Sy cxla_avg_rx_tlp_sz_dws
+Average RX TLP size in DWs
+.It Sy cxla_avg_tx_tlp_sz_dws
+Average TX TLP size in DWs
+.It Sy cxla_avg_rx_tlp_sz_ccix_msg
+Average RX TLP size in CCIX messages
+.It Sy cxla_avg_tx_tlp_sz_ccix_msg
+Average TX TLP size in CCIX messages
+.It Sy cxla_avg_sz_rx_cxs_dw_beat
+Average size of RX CXS in DWs within a beat
+.It Sy cxla_avg_sz_tx_cxs_dw_beat
+Average size of TX CXS in DWs within a beat
+.It Sy cxla_tx_cxs_link_credit_backpressure
+TX CXS link credit backpressure
+.It Sy cxla_rx_tlp_buffer_full
+RX TLP buffer full and backpressured
+.It Sy cxla_tx_tlp_buffer_full
+TX TLP buffer full and backpressured
+.It Sy cxla_avg_latency_process_rx_tlp
+Average latency to process an RX TLP
+.It Sy cxla_avg_latency_form_tx_tlp
+Average latency to form a TX TLP
+.El
+.Sh SEE ALSO
+.Xr pmc 3 ,
+.Xr pmc.atom 3 ,
+.Xr pmc.core 3 ,
+.Xr pmc.core2 3 ,
+.Xr pmc.corei7 3 ,
+.Xr pmc.corei7uc 3 ,
+.Xr pmc.iaf 3 ,
+.Xr pmc.iaf 3 ,
+.Xr pmc.k7 3 ,
+.Xr pmc.k8 3 ,
+.Xr pmc.p4 3 ,
+.Xr pmc.p5 3 ,
+.Xr pmc.p6 3 ,
+.Xr pmc.soft 3 ,
+.Xr pmc.tsc 3 ,
+.Xr pmc.westmere 3 ,
+.Xr pmc.westmereuc 3 ,
+.Xr pmc_cpuinfo 3 ,
+.Xr pmclog 3 ,
+.Xr hwpmc 4
+.Sh HISTORY
+The
+.Nm pmc
+library first appeared in
+.Fx 6.0 .
+.br
+The
+.Nm pmc.cmn-600
+driver was added in
+.Fx 14.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Lb libpmc
+library was written by
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org ,
+.An Oleksandr Rybalko Aq Mt ray@FreeBSD.org .
+.br
+The CMN-600 PMU driver was sponsored by ARM Ltd.
+This manual page was written by
+.An Oleksandr Rybalko Aq Mt ray@FreeBSD.org .
diff --git a/lib/libpmc/pmc.dmc-620.3 b/lib/libpmc/pmc.dmc-620.3
new file mode 100644
index 000000000000..606d92f7b8ea
--- /dev/null
+++ b/lib/libpmc/pmc.dmc-620.3
@@ -0,0 +1,165 @@
+.\" Copyright (c) 2022 Ampere Computing.
+.\"
+.\" 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.
+.\"
+.Dd Jul 22, 2022
+.Dt PMC.DMC-620 3
+.Os
+.Sh NAME
+.Nm pmc.dmc-620
+.Nd measure the
+.Tn Arm
+.Tn DMC-620
+Dynamic Memory Controller performance counter events.
+.Sh LIBRARY
+.Lb libpmc
+.Sh SYNOPSIS
+.In pmc.h
+.Sh DESCRIPTION
+.Tn DMC-620
+PMU counters may be configured to count any one of a defined set of hardware
+events.
+.Pp
+.Tn Arm
+.Tn CoreLink
+.Tn DMC-620 Dynamic Memory Controller performance counters are documented in
+.Rs
+.%B "ARM CoreLink DMC-620 Dynamic Memory Controller Technical Reference Manual"
+.%T "Revision: r0p0"
+.%D 2017
+.%Q "ARM Limited"
+.Re
+.Ss PMC Capabilities
+.Tn DMC-620
+PMU counters support the following capabilities:
+.Bl -column "PMC_CAP_INTERRUPT" "Support"
+.It Sy Capability Ta Em Support
+.It PMC_CAP_CASCADE Ta \&No
+.It PMC_CAP_EDGE Ta \&No
+.It PMC_CAP_INTERRUPT Ta Yes
+.It PMC_CAP_INVERT Ta Yes
+.It PMC_CAP_READ Ta Yes
+.It PMC_CAP_PRECISE Ta \&No
+.It PMC_CAP_SYSTEM Ta Yes
+.It PMC_CAP_TAGGING Ta \&No
+.It PMC_CAP_THRESHOLD Ta Yes
+.It PMC_CAP_USER Ta \&No
+.It PMC_CAP_WRITE Ta Yes
+.El
+.Ss Event Qualifiers
+Event specifiers for these PMCs support the following common
+qualifiers:
+.Bl -tag -width indent
+.It Li inc= Ns Ar value
+Two-bit value that controls direction of count for PMC.
+Behavior depend on selected event.
+.It Li inv
+Invert the sense of comparison.
+.It Li match= Ns Ar value
+Count only events matched by
+.Ar value.
+.It Li mask= Ns Ar qualifier
+Allow to apply
+.Ar qualifier
+mask to compared
+.Ar value .
+.El
+.Ss Class Name Prefix
+These PMCs use a class name prefix of
+.Dq Li DMC620_CD2_
+or
+.Dq Li DMC620_C_ .
+.Ss Event Specifiers
+The following PMC events are available:
+.Bl -column
+.It Sy clkdiv2_cycle_count
+.It Sy clkdiv2_allocate
+.It Sy clkdiv2_queue_depth
+.It Sy clkdiv2_waiting_for_wr_data
+.It Sy clkdiv2_read_backlog
+.It Sy clkdiv2_waiting_for_mi
+.It Sy clkdiv2_hazard_resolution
+.It Sy clkdiv2_enqueue
+.It Sy clkdiv2_arbitrate
+.It Sy clkdiv2_lrank_turnaround_activate
+.It Sy clkdiv2_prank_turnaround_activate
+.It Sy clkdiv2_read_depth
+.It Sy clkdiv2_write_depth
+.It Sy clkdiv2_highhigh_qos_depth
+.It Sy clkdiv2_high_qos_depth
+.It Sy clkdiv2_medium_qos_depth
+.It Sy clkdiv2_low_qos_depth
+.It Sy clkdiv2_activate
+.It Sy clkdiv2_rdwr
+.It Sy clkdiv2_refresh
+.It Sy clkdiv2_training_request
+.It Sy clkdiv2_t_mac_tracker
+.It Sy clkdiv2_bk_fsm_tracker
+.It Sy clkdiv2_bk_open_tracker
+.It Sy clkdiv2_ranks_in_pwr_down
+.It Sy clkdiv2_ranks_in_sref
+.It Sy clk_cycle_count
+.It Sy clk_request
+.It Sy clk_upload_stall
+.El
+.Sh SEE ALSO
+.Xr pmc 3 ,
+.Xr pmc.atom 3 ,
+.Xr pmc.core 3 ,
+.Xr pmc.core2 3 ,
+.Xr pmc.corei7 3 ,
+.Xr pmc.corei7uc 3 ,
+.Xr pmc.iaf 3 ,
+.Xr pmc.iaf 3 ,
+.Xr pmc.k7 3 ,
+.Xr pmc.k8 3 ,
+.Xr pmc.p4 3 ,
+.Xr pmc.p5 3 ,
+.Xr pmc.p6 3 ,
+.Xr pmc.soft 3 ,
+.Xr pmc.tsc 3 ,
+.Xr pmc.westmere 3 ,
+.Xr pmc.westmereuc 3 ,
+.Xr pmc_cpuinfo 3 ,
+.Xr pmclog 3 ,
+.Xr hwpmc 4
+.Sh HISTORY
+The
+.Nm pmc
+library first appeared in
+.Fx 6.0 .
+.br
+The
+.Nm pmc.dmc-620
+driver was added in
+.Fx 14.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Lb libpmc
+library was written by
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
+.An Oleksandr Rybalko Aq Mt ray@FreeBSD.org .
+.br
+The DMC-620 PMU driver was sponsored by Ampere Computing LLC.
+This manual page was written by
+.An Oleksandr Rybalko Aq Mt ray@FreeBSD.org .
diff --git a/lib/libpmc/pmu-events/arch/arm64/ampere/emag/branch.json b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/branch.json
new file mode 100644
index 000000000000..5c69c1e82ef8
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/branch.json
@@ -0,0 +1,19 @@
+[
+ {
+ "ArchStdEvent": "BR_IMMED_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_INDIRECT_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_MIS_PRED",
+ "BriefDescription": "Branch mispredicted"
+ },
+ {
+ "ArchStdEvent": "BR_PRED",
+ "BriefDescription": "Predictable branch"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/ampere/emag/bus.json b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/bus.json
new file mode 100644
index 000000000000..cf48d0dfc759
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/bus.json
@@ -0,0 +1,23 @@
+[
+ {
+ "ArchStdEvent": "BUS_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_WR"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_SHARED"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_NOT_SHARED"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_NORMAL"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_PERIPH"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/ampere/emag/cache.json b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/cache.json
new file mode 100644
index 000000000000..4cc50b7da526
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/cache.json
@@ -0,0 +1,161 @@
+[
+ {
+ "ArchStdEvent": "L1D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_INVAL"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB_VICTIM"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB_CLEAN"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_INVAL"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB"
+ },
+ {
+ "PublicDescription": "This event counts any load or store operation which accesses the data L1 TLB",
+ "ArchStdEvent": "L1D_TLB",
+ "BriefDescription": "L1D TLB access"
+ },
+ {
+ "PublicDescription": "This event counts any instruction fetch which accesses the instruction L1 TLB",
+ "ArchStdEvent": "L1I_TLB"
+ },
+ {
+ "PublicDescription": "Level 2 access to data TLB that caused a page table walk. This event counts on any data access which causes L2D_TLB_REFILL to count",
+ "EventCode": "0x34",
+ "EventName": "L2D_TLB_ACCESS",
+ "BriefDescription": "L2D TLB access"
+ },
+ {
+ "PublicDescription": "Level 2 access to instruciton TLB that caused a page table walk. This event counts on any instruciton access which causes L2I_TLB_REFILL to count",
+ "EventCode": "0x35",
+ "EventName": "L2I_TLB_ACCESS",
+ "BriefDescription": "L2I TLB access"
+ },
+ {
+ "PublicDescription": "Branch target buffer misprediction",
+ "EventCode": "0x102",
+ "EventName": "BTB_MIS_PRED",
+ "BriefDescription": "BTB misprediction"
+ },
+ {
+ "PublicDescription": "ITB miss",
+ "EventCode": "0x103",
+ "EventName": "ITB_MISS",
+ "BriefDescription": "ITB miss"
+ },
+ {
+ "PublicDescription": "DTB miss",
+ "EventCode": "0x104",
+ "EventName": "DTB_MISS",
+ "BriefDescription": "DTB miss"
+ },
+ {
+ "PublicDescription": "Level 1 data cache late miss",
+ "EventCode": "0x105",
+ "EventName": "L1D_CACHE_LATE_MISS",
+ "BriefDescription": "L1D cache late miss"
+ },
+ {
+ "PublicDescription": "Level 1 data cache prefetch request",
+ "EventCode": "0x106",
+ "EventName": "L1D_CACHE_PREFETCH",
+ "BriefDescription": "L1D cache prefetch"
+ },
+ {
+ "PublicDescription": "Level 2 data cache prefetch request",
+ "EventCode": "0x107",
+ "EventName": "L2D_CACHE_PREFETCH",
+ "BriefDescription": "L2D cache prefetch"
+ },
+ {
+ "PublicDescription": "Level 1 stage 2 TLB refill",
+ "EventCode": "0x111",
+ "EventName": "L1_STAGE2_TLB_REFILL",
+ "BriefDescription": "L1 stage 2 TLB refill"
+ },
+ {
+ "PublicDescription": "Page walk cache level-0 stage-1 hit",
+ "EventCode": "0x112",
+ "EventName": "PAGE_WALK_L0_STAGE1_HIT",
+ "BriefDescription": "Page walk, L0 stage-1 hit"
+ },
+ {
+ "PublicDescription": "Page walk cache level-1 stage-1 hit",
+ "EventCode": "0x113",
+ "EventName": "PAGE_WALK_L1_STAGE1_HIT",
+ "BriefDescription": "Page walk, L1 stage-1 hit"
+ },
+ {
+ "PublicDescription": "Page walk cache level-2 stage-1 hit",
+ "EventCode": "0x114",
+ "EventName": "PAGE_WALK_L2_STAGE1_HIT",
+ "BriefDescription": "Page walk, L2 stage-1 hit"
+ },
+ {
+ "PublicDescription": "Page walk cache level-1 stage-2 hit",
+ "EventCode": "0x115",
+ "EventName": "PAGE_WALK_L1_STAGE2_HIT",
+ "BriefDescription": "Page walk, L1 stage-2 hit"
+ },
+ {
+ "PublicDescription": "Page walk cache level-2 stage-2 hit",
+ "EventCode": "0x116",
+ "EventName": "PAGE_WALK_L2_STAGE2_HIT",
+ "BriefDescription": "Page walk, L2 stage-2 hit"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/ampere/emag/clock.json b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/clock.json
new file mode 100644
index 000000000000..927a6f629a03
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/clock.json
@@ -0,0 +1,18 @@
+[
+ {
+ "PublicDescription": "The number of core clock cycles",
+ "ArchStdEvent": "CPU_CYCLES"
+ },
+ {
+ "PublicDescription": "FSU clocking gated off cycle",
+ "EventCode": "0x101",
+ "EventName": "FSU_CLOCK_OFF_CYCLES",
+ "BriefDescription": "FSU clocking gated off cycle"
+ },
+ {
+ "PublicDescription": "Wait state cycle",
+ "EventCode": "0x110",
+ "EventName": "Wait_CYCLES",
+ "BriefDescription": "Wait state cycle"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/ampere/emag/exception.json b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/exception.json
new file mode 100644
index 000000000000..ada052e19632
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/exception.json
@@ -0,0 +1,44 @@
+[
+ {
+ "ArchStdEvent": "EXC_UNDEF"
+ },
+ {
+ "ArchStdEvent": "EXC_SVC"
+ },
+ {
+ "ArchStdEvent": "EXC_PABORT"
+ },
+ {
+ "ArchStdEvent": "EXC_DABORT"
+ },
+ {
+ "ArchStdEvent": "EXC_IRQ"
+ },
+ {
+ "ArchStdEvent": "EXC_FIQ"
+ },
+ {
+ "ArchStdEvent": "EXC_HVC"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_PABORT"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_DABORT"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_OTHER"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_IRQ"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_FIQ"
+ },
+ {
+ "ArchStdEvent": "EXC_TAKEN"
+ },
+ {
+ "ArchStdEvent": "EXC_RETURN"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/ampere/emag/instruction.json b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/instruction.json
new file mode 100644
index 000000000000..62f6276e3016
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/instruction.json
@@ -0,0 +1,73 @@
+[
+ {
+ "ArchStdEvent": "LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "LDST_SPEC"
+ },
+ {
+ "ArchStdEvent": "DP_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SPEC"
+ },
+ {
+ "ArchStdEvent": "VFP_SPEC"
+ },
+ {
+ "ArchStdEvent": "PC_WRITE_SPEC"
+ },
+ {
+ "ArchStdEvent": "CRYPTO_SPEC"
+ },
+ {
+ "ArchStdEvent": "ISB_SPEC"
+ },
+ {
+ "ArchStdEvent": "DSB_SPEC"
+ },
+ {
+ "ArchStdEvent": "DMB_SPEC"
+ },
+ {
+ "ArchStdEvent": "RC_LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "RC_ST_SPEC"
+ },
+ {
+ "PublicDescription": "Instruction architecturally executed, software increment",
+ "ArchStdEvent": "SW_INCR",
+ "BriefDescription": "Software increment"
+ },
+ {
+ "ArchStdEvent": "INST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "CID_WRITE_RETIRED",
+ "BriefDescription": "Write to CONTEXTIDR"
+ },
+ {
+ "ArchStdEvent": "INST_SPEC"
+ },
+ {
+ "ArchStdEvent": "TTBR_WRITE_RETIRED"
+ },
+ {
+ "PublicDescription": "This event counts all branches, taken or not. This excludes exception entries, debug entries and CCFAIL branches",
+ "ArchStdEvent": "BR_RETIRED"
+ },
+ {
+ "PublicDescription": "This event counts any branch counted by BR_RETIRED which is not correctly predicted and causes a pipeline flush",
+ "ArchStdEvent": "BR_MIS_PRED_RETIRED"
+ },
+ {
+ "PublicDescription": "Operation speculatively executed, NOP",
+ "EventCode": "0x100",
+ "EventName": "NOP_SPEC",
+ "BriefDescription": "Speculatively executed, NOP"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/ampere/emag/intrinsic.json b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/intrinsic.json
new file mode 100644
index 000000000000..7ecffb989ae0
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/intrinsic.json
@@ -0,0 +1,14 @@
+[
+ {
+ "ArchStdEvent": "LDREX_SPEC"
+ },
+ {
+ "ArchStdEvent": "STREX_PASS_SPEC"
+ },
+ {
+ "ArchStdEvent": "STREX_FAIL_SPEC"
+ },
+ {
+ "ArchStdEvent": "STREX_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/ampere/emag/memory.json b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/memory.json
new file mode 100644
index 000000000000..50157e8c2005
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/memory.json
@@ -0,0 +1,24 @@
+[
+ {
+ "ArchStdEvent": "MEM_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_WR"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_LDST_SPEC"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS"
+ },
+ {
+ "PublicDescription": "This event counts any correctable or uncorrectable memory error (ECC or parity) in the protected core RAMs",
+ "ArchStdEvent": "MEMORY_ERROR"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/ampere/emag/pipeline.json b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/pipeline.json
new file mode 100644
index 000000000000..17c71aba6612
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/ampere/emag/pipeline.json
@@ -0,0 +1,50 @@
+[
+ {
+ "PublicDescription": "Decode starved for instruction cycle",
+ "EventCode": "0x108",
+ "EventName": "DECODE_STALL",
+ "BriefDescription": "Decode starved"
+ },
+ {
+ "PublicDescription": "Op dispatch stalled cycle",
+ "EventCode": "0x109",
+ "EventName": "DISPATCH_STALL",
+ "BriefDescription": "Dispatch stalled"
+ },
+ {
+ "PublicDescription": "IXA Op non-issue",
+ "EventCode": "0x10a",
+ "EventName": "IXA_STALL",
+ "BriefDescription": "IXA stalled"
+ },
+ {
+ "PublicDescription": "IXB Op non-issue",
+ "EventCode": "0x10b",
+ "EventName": "IXB_STALL",
+ "BriefDescription": "IXB stalled"
+ },
+ {
+ "PublicDescription": "BX Op non-issue",
+ "EventCode": "0x10c",
+ "EventName": "BX_STALL",
+ "BriefDescription": "BX stalled"
+ },
+ {
+ "PublicDescription": "LX Op non-issue",
+ "EventCode": "0x10d",
+ "EventName": "LX_STALL",
+ "BriefDescription": "LX stalled"
+ },
+ {
+ "PublicDescription": "SX Op non-issue",
+ "EventCode": "0x10e",
+ "EventName": "SX_STALL",
+ "BriefDescription": "SX stalled"
+ },
+ {
+ "PublicDescription": "FX Op non-issue",
+ "EventCode": "0x10f",
+ "EventName": "FX_STALL",
+ "BriefDescription": "FX stalled"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/branch.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/branch.json
new file mode 100644
index 000000000000..ece201718284
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/branch.json
@@ -0,0 +1,11 @@
+[
+ {
+ "ArchStdEvent": "BR_MIS_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_INDIRECT_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/bus.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/bus.json
new file mode 100644
index 000000000000..75d850b781ac
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/bus.json
@@ -0,0 +1,17 @@
+[
+ {
+ "ArchStdEvent": "CPU_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS"
+ },
+ {
+ "ArchStdEvent": "BUS_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_WR"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/cache.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/cache.json
new file mode 100644
index 000000000000..8a9a95e05c32
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/cache.json
@@ -0,0 +1,32 @@
+[
+ {
+ "ArchStdEvent": "L1I_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/exception.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/exception.json
new file mode 100644
index 000000000000..27c3fe9c831a
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/exception.json
@@ -0,0 +1,14 @@
+[
+ {
+ "ArchStdEvent": "EXC_TAKEN"
+ },
+ {
+ "ArchStdEvent": "MEMORY_ERROR"
+ },
+ {
+ "ArchStdEvent": "EXC_IRQ"
+ },
+ {
+ "ArchStdEvent": "EXC_FIQ"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/instruction.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/instruction.json
new file mode 100644
index 000000000000..7c018f439206
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/instruction.json
@@ -0,0 +1,29 @@
+[
+ {
+ "ArchStdEvent": "SW_INCR"
+ },
+ {
+ "ArchStdEvent": "LD_RETIRED"
+ },
+ {
+ "ArchStdEvent": "ST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "EXC_RETURN"
+ },
+ {
+ "ArchStdEvent": "CID_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "PC_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_IMMED_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_RETIRED"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/memory.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/memory.json
new file mode 100644
index 000000000000..2c319f936957
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a34/memory.json
@@ -0,0 +1,8 @@
+[
+ {
+ "ArchStdEvent": "UNALIGNED_LDST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/branch.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/branch.json
new file mode 100644
index 000000000000..ece201718284
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/branch.json
@@ -0,0 +1,11 @@
+[
+ {
+ "ArchStdEvent": "BR_MIS_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_INDIRECT_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/bus.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/bus.json
new file mode 100644
index 000000000000..75d850b781ac
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/bus.json
@@ -0,0 +1,17 @@
+[
+ {
+ "ArchStdEvent": "CPU_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS"
+ },
+ {
+ "ArchStdEvent": "BUS_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_WR"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/cache.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/cache.json
new file mode 100644
index 000000000000..8a9a95e05c32
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/cache.json
@@ -0,0 +1,32 @@
+[
+ {
+ "ArchStdEvent": "L1I_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/exception.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/exception.json
new file mode 100644
index 000000000000..27c3fe9c831a
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/exception.json
@@ -0,0 +1,14 @@
+[
+ {
+ "ArchStdEvent": "EXC_TAKEN"
+ },
+ {
+ "ArchStdEvent": "MEMORY_ERROR"
+ },
+ {
+ "ArchStdEvent": "EXC_IRQ"
+ },
+ {
+ "ArchStdEvent": "EXC_FIQ"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/instruction.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/instruction.json
new file mode 100644
index 000000000000..df9f94cfc8d5
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/instruction.json
@@ -0,0 +1,44 @@
+[
+ {
+ "ArchStdEvent": "SW_INCR"
+ },
+ {
+ "ArchStdEvent": "LD_RETIRED"
+ },
+ {
+ "ArchStdEvent": "ST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "EXC_RETURN"
+ },
+ {
+ "ArchStdEvent": "CID_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "PC_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_IMMED_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_SPEC"
+ },
+ {
+ "ArchStdEvent": "DP_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SPEC"
+ },
+ {
+ "ArchStdEvent": "VFP_SPEC"
+ },
+ {
+ "ArchStdEvent": "CRYPTO_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/memory.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/memory.json
new file mode 100644
index 000000000000..2c319f936957
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a35/memory.json
@@ -0,0 +1,8 @@
+[
+ {
+ "ArchStdEvent": "UNALIGNED_LDST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/branch.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/branch.json
new file mode 100644
index 000000000000..411fcbdbd7e6
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/branch.json
@@ -0,0 +1,59 @@
+[
+ {
+ "ArchStdEvent": "BR_MIS_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_IMMED_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_INDIRECT_SPEC"
+ },
+ {
+ "PublicDescription": "Predicted conditional branch executed. This event counts when any branch that the conditional predictor can predict is retired. This event still counts when branch prediction is disabled due to the Memory Management Unit (MMU) being off",
+ "EventCode": "0xC9",
+ "EventName": "BR_COND_PRED",
+ "BriefDescription": "Predicted conditional branch executed. This event counts when any branch that the conditional predictor can predict is retired. This event still counts when branch prediction is disabled due to the Memory Management Unit (MMU) being off"
+ },
+ {
+ "PublicDescription": "Indirect branch mispredicted. This event counts when any indirect branch that the Branch Target Address Cache (BTAC) can predict is retired and has mispredicted either the condition or the address. This event still counts when branch prediction is disabled due to the MMU being off",
+ "EventCode": "0xCA",
+ "EventName": "BR_INDIRECT_MIS_PRED",
+ "BriefDescription": "Indirect branch mispredicted. This event counts when any indirect branch that the Branch Target Address Cache (BTAC) can predict is retired and has mispredicted either the condition or the address. This event still counts when branch prediction is disabled due to the MMU being off"
+ },
+ {
+ "PublicDescription": "Indirect branch mispredicted due to address miscompare. This event counts when any indirect branch that the BTAC can predict is retired, was taken, correctly predicted the condition, and has mispredicted the address. This event still counts when branch prediction is disabled due to the MMU being off",
+ "EventCode": "0xCB",
+ "EventName": "BR_INDIRECT_ADDR_MIS_PRED",
+ "BriefDescription": "Indirect branch mispredicted due to address miscompare. This event counts when any indirect branch that the BTAC can predict is retired, was taken, correctly predicted the condition, and has mispredicted the address. This event still counts when branch prediction is disabled due to the MMU being off"
+ },
+ {
+ "PublicDescription": "Conditional branch mispredicted. This event counts when any branch that the conditional predictor can predict is retired and has mispredicted the condition. This event still counts when branch prediction is disabled due to the MMU being off. Conditional indirect branches that correctly predict the condition but mispredict the address do not count",
+ "EventCode": "0xCC",
+ "EventName": "BR_COND_MIS_PRED",
+ "BriefDescription": "Conditional branch mispredicted. This event counts when any branch that the conditional predictor can predict is retired and has mispredicted the condition. This event still counts when branch prediction is disabled due to the MMU being off. Conditional indirect branches that correctly predict the condition but mispredict the address do not count"
+ },
+ {
+ "PublicDescription": "Indirect branch with predicted address executed. This event counts when any indirect branch that the BTAC can predict is retired, was taken, and correctly predicted the condition. This event still counts when branch prediction is disabled due to the MMU being off",
+ "EventCode": "0xCD",
+ "EventName": "BR_INDIRECT_ADDR_PRED",
+ "BriefDescription": "Indirect branch with predicted address executed. This event counts when any indirect branch that the BTAC can predict is retired, was taken, and correctly predicted the condition. This event still counts when branch prediction is disabled due to the MMU being off"
+ },
+ {
+ "PublicDescription": "Procedure return with predicted address executed. This event counts when any procedure return that the call-return stack can predict is retired, was taken, and correctly predicted the condition. This event still counts when branch prediction is disabled due to the MMU being off",
+ "EventCode": "0xCE",
+ "EventName": "BR_RETURN_ADDR_PRED",
+ "BriefDescription": "Procedure return with predicted address executed. This event counts when any procedure return that the call-return stack can predict is retired, was taken, and correctly predicted the condition. This event still counts when branch prediction is disabled due to the MMU being off"
+ },
+ {
+ "PublicDescription": "Procedure return mispredicted due to address miscompare. This event counts when any procedure return that the call-return stack can predict is retired, was taken, correctly predicted the condition, and has mispredicted the address. This event still counts when branch prediction is disabled due to the MMU being off",
+ "EventCode": "0xCF",
+ "EventName": "BR_RETURN_ADDR_MIS_PRED",
+ "BriefDescription": "Procedure return mispredicted due to address miscompare. This event counts when any procedure return that the call-return stack can predict is retired, was taken, correctly predicted the condition, and has mispredicted the address. This event still counts when branch prediction is disabled due to the MMU being off"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/bus.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/bus.json
new file mode 100644
index 000000000000..75d850b781ac
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/bus.json
@@ -0,0 +1,17 @@
+[
+ {
+ "ArchStdEvent": "CPU_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS"
+ },
+ {
+ "ArchStdEvent": "BUS_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_WR"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/cache.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/cache.json
new file mode 100644
index 000000000000..27cd913e186b
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/cache.json
@@ -0,0 +1,182 @@
+[
+ {
+ "ArchStdEvent": "L1I_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_ALLOCATE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB"
+ },
+ {
+ "ArchStdEvent": "DTLB_WALK"
+ },
+ {
+ "ArchStdEvent": "ITLB_WALK"
+ },
+ {
+ "ArchStdEvent": "LL_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "LL_CACHE_MISS_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_LMISS_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_INNER"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_OUTER"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_REFILL_RD"
+ },
+ {
+ "PublicDescription": "L2 cache refill due to prefetch. If the complex is configured with a per-complex L2 cache, this event does not count. If the complex is configured without a per-complex L2 cache, this event counts the cluster cache event, as defined by L3D_CACHE_REFILL_PREFETCH. If neither a per-complex cache or a cluster cache is configured, this event is not implemented",
+ "EventCode": "0xC1",
+ "EventName": "L2D_CACHE_REFILL_PREFETCH",
+ "BriefDescription": "L2 cache refill due to prefetch. If the complex is configured with a per-complex L2 cache, this event does not count. If the complex is configured without a per-complex L2 cache, this event counts the cluster cache event, as defined by L3D_CACHE_REFILL_PREFETCH. If neither a per-complex cache or a cluster cache is configured, this event is not implemented"
+ },
+ {
+ "PublicDescription": "L1 data cache refill due to prefetch. This event counts any linefills from the prefetcher that cause an allocation into the L1 data cache",
+ "EventCode": "0xC2",
+ "EventName": "L1D_CACHE_REFILL_PREFETCH",
+ "BriefDescription": "L1 data cache refill due to prefetch. This event counts any linefills from the prefetcher that cause an allocation into the L1 data cache"
+ },
+ {
+ "PublicDescription": "L2 cache write streaming mode. This event counts for each cycle where the core is in write streaming mode and is not allocating writes into the L2 cache",
+ "EventCode": "0xC3",
+ "EventName": "L2D_WS_MODE",
+ "BriefDescription": "L2 cache write streaming mode. This event counts for each cycle where the core is in write streaming mode and is not allocating writes into the L2 cache"
+ },
+ {
+ "PublicDescription": "L1 data cache entering write streaming mode. This event counts for each entry into write streaming mode",
+ "EventCode": "0xC4",
+ "EventName": "L1D_WS_MODE_ENTRY",
+ "BriefDescription": "L1 data cache entering write streaming mode. This event counts for each entry into write streaming mode"
+ },
+ {
+ "PublicDescription": "L1 data cache write streaming mode. This event counts for each cycle where the core is in write streaming mode and is not allocating writes into the L1 data cache",
+ "EventCode": "0xC5",
+ "EventName": "L1D_WS_MODE",
+ "BriefDescription": "L1 data cache write streaming mode. This event counts for each cycle where the core is in write streaming mode and is not allocating writes into the L1 data cache"
+ },
+ {
+ "PublicDescription": "L3 cache write streaming mode. This event counts for each cycle where the core is in write streaming mode and is not allocating writes into the L3 cache",
+ "EventCode": "0xC7",
+ "EventName": "L3D_WS_MODE",
+ "BriefDescription": "L3 cache write streaming mode. This event counts for each cycle where the core is in write streaming mode and is not allocating writes into the L3 cache"
+ },
+ {
+ "PublicDescription": "Last level cache write streaming mode. This event counts for each cycle where the core is in write streaming mode and is not allocating writes into the system cache",
+ "EventCode": "0xC8",
+ "EventName": "LL_WS_MODE",
+ "BriefDescription": "Last level cache write streaming mode. This event counts for each cycle where the core is in write streaming mode and is not allocating writes into the system cache"
+ },
+ {
+ "PublicDescription": "L2 TLB walk cache access. This event does not count if the MMU is disabled",
+ "EventCode": "0xD0",
+ "EventName": "L2D_WALK_TLB",
+ "BriefDescription": "L2 TLB walk cache access. This event does not count if the MMU is disabled"
+ },
+ {
+ "PublicDescription": "L2 TLB walk cache refill. This event does not count if the MMU is disabled",
+ "EventCode": "0xD1",
+ "EventName": "L2D_WALK_TLB_REFILL",
+ "BriefDescription": "L2 TLB walk cache refill. This event does not count if the MMU is disabled"
+ },
+ {
+ "PublicDescription": "L2 TLB IPA cache access. This event counts on each access to the IPA cache. If a single translation table walk needs to make multiple accesses to the IPA cache, each access is counted. If stage 2 translation is disabled, this event does not count",
+ "EventCode": "0xD4",
+ "EventName": "L2D_S2_TLB",
+ "BriefDescription": "L2 TLB IPA cache access. This event counts on each access to the IPA cache. If a single translation table walk needs to make multiple accesses to the IPA cache, each access is counted. If stage 2 translation is disabled, this event does not count"
+ },
+ {
+ "PublicDescription": "L2 TLB IPA cache refill. This event counts on each refill of the IPA cache. If a single translation table walk needs to make multiple accesses to the IPA cache, each access that causes a refill is counted. If stage 2 translation is disabled, this event does not count",
+ "EventCode": "0xD5",
+ "EventName": "L2D_S2_TLB_REFILL",
+ "BriefDescription": "L2 TLB IPA cache refill. This event counts on each refill of the IPA cache. If a single translation table walk needs to make multiple accesses to the IPA cache, each access that causes a refill is counted. If stage 2 translation is disabled, this event does not count"
+ },
+ {
+ "PublicDescription": "L2 cache stash dropped. This event counts on each stash request that is received from the interconnect or the Accelerator Coherency Port (ACP), that targets L2 cache and is dropped due to lack of buffer space to hold the request",
+ "EventCode": "0xD6",
+ "EventName": "L2D_CACHE_STASH_DROPPED",
+ "BriefDescription": "L2 cache stash dropped. This event counts on each stash request that is received from the interconnect or the Accelerator Coherency Port (ACP), that targets L2 cache and is dropped due to lack of buffer space to hold the request"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE_LMISS"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_LMISS_RD"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_LMISS_RD"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/exception.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/exception.json
new file mode 100644
index 000000000000..27c3fe9c831a
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/exception.json
@@ -0,0 +1,14 @@
+[
+ {
+ "ArchStdEvent": "EXC_TAKEN"
+ },
+ {
+ "ArchStdEvent": "MEMORY_ERROR"
+ },
+ {
+ "ArchStdEvent": "EXC_IRQ"
+ },
+ {
+ "ArchStdEvent": "EXC_FIQ"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/instruction.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/instruction.json
new file mode 100644
index 000000000000..3039d03412df
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/instruction.json
@@ -0,0 +1,95 @@
+[
+ {
+ "ArchStdEvent": "LD_RETIRED"
+ },
+ {
+ "ArchStdEvent": "ST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "EXC_RETURN"
+ },
+ {
+ "ArchStdEvent": "CID_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "PC_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_IMMED_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_SPEC"
+ },
+ {
+ "ArchStdEvent": "TTBR_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_MIS_PRED_RETIRED"
+ },
+ {
+ "ArchStdEvent": "OP_RETIRED"
+ },
+ {
+ "ArchStdEvent": "OP_SPEC"
+ },
+ {
+ "ArchStdEvent": "LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "LDST_SPEC"
+ },
+ {
+ "ArchStdEvent": "DP_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SPEC"
+ },
+ {
+ "ArchStdEvent": "VFP_SPEC"
+ },
+ {
+ "ArchStdEvent": "PC_WRITE_SPEC"
+ },
+ {
+ "ArchStdEvent": "CRYPTO_SPEC"
+ },
+ {
+ "ArchStdEvent": "SVE_INST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "SVE_INST_SPEC"
+ },
+ {
+ "ArchStdEvent": "FP_HP_SPEC"
+ },
+ {
+ "ArchStdEvent": "FP_SP_SPEC"
+ },
+ {
+ "ArchStdEvent": "FP_DP_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SVE_INT8_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SVE_INT16_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SVE_INT32_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SVE_INT64_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/memory.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/memory.json
new file mode 100644
index 000000000000..38f459502514
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/memory.json
@@ -0,0 +1,32 @@
+[
+ {
+ "ArchStdEvent": "MEM_ACCESS"
+ },
+ {
+ "ArchStdEvent": "REMOTE_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_WR"
+ },
+ {
+ "ArchStdEvent": "LDST_ALIGN_LAT"
+ },
+ {
+ "ArchStdEvent": "LD_ALIGN_LAT"
+ },
+ {
+ "ArchStdEvent": "ST_ALIGN_LAT"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_CHECKED"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_CHECKED_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_CHECKED_WR"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/pipeline.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/pipeline.json
new file mode 100644
index 000000000000..325daaa7b809
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/pipeline.json
@@ -0,0 +1,107 @@
+[
+ {
+ "ArchStdEvent": "STALL_FRONTEND"
+ },
+ {
+ "ArchStdEvent": "STALL_BACKEND"
+ },
+ {
+ "ArchStdEvent": "STALL"
+ },
+ {
+ "ArchStdEvent": "STALL_SLOT_BACKEND"
+ },
+ {
+ "ArchStdEvent": "STALL_SLOT_FRONTEND"
+ },
+ {
+ "ArchStdEvent": "STALL_SLOT"
+ },
+ {
+ "PublicDescription": "No operation issued due to the frontend, cache miss. This event counts every cycle that the Data Processing Unit (DPU) instruction queue is empty and there is an instruction cache miss being processed",
+ "EventCode": "0xE1",
+ "EventName": "STALL_FRONTEND_CACHE",
+ "BriefDescription": "No operation issued due to the frontend, cache miss. This event counts every cycle that the Data Processing Unit (DPU) instruction queue is empty and there is an instruction cache miss being processed"
+ },
+ {
+ "PublicDescription": "No operation issued due to the frontend, TLB miss. This event counts every cycle that the DPU instruction queue is empty and there is an instruction L1 TLB miss being processed",
+ "EventCode": "0xE2",
+ "EventName": "STALL_FRONTEND_TLB",
+ "BriefDescription": "No operation issued due to the frontend, TLB miss. This event counts every cycle that the DPU instruction queue is empty and there is an instruction L1 TLB miss being processed"
+ },
+ {
+ "PublicDescription": "No operation issued due to the frontend, pre-decode error",
+ "EventCode": "0xE3",
+ "EventName": "STALL_FRONTEND_PDERR",
+ "BriefDescription": "No operation issued due to the frontend, pre-decode error"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend interlock. This event counts every cycle where the issue of an operation is stalled and there is an interlock. Stall cycles due to a stall in the Wr stage are excluded",
+ "EventCode": "0xE4",
+ "EventName": "STALL_BACKEND_ILOCK",
+ "BriefDescription": "No operation issued due to the backend interlock. This event counts every cycle where the issue of an operation is stalled and there is an interlock. Stall cycles due to a stall in the Wr stage are excluded"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, address interlock. This event counts every cycle where the issue of an operation is stalled and there is an interlock on an address operand. This type of interlock is caused by a load/store instruction waiting for data to calculate the address. Stall cycles due to a stall in the Wr stage are excluded",
+ "EventCode": "0xE5",
+ "EventName": "STALL_BACKEND_ILOCK_ADDR",
+ "BriefDescription": "No operation issued due to the backend, address interlock. This event counts every cycle where the issue of an operation is stalled and there is an interlock on an address operand. This type of interlock is caused by a load/store instruction waiting for data to calculate the address. Stall cycles due to a stall in the Wr stage are excluded"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, interlock, or the Vector Processing Unit (VPU). This event counts every cycle where there is a stall or an interlock that is caused by a VPU instruction. Stall cycles due to a stall in the Wr stage are excluded",
+ "EventCode": "0xE6",
+ "EventName": "STALL_BACKEND_ILOCK_VPU",
+ "BriefDescription": "No operation issued due to the backend, interlock, or the Vector Processing Unit (VPU). This event counts every cycle where there is a stall or an interlock that is caused by a VPU instruction. Stall cycles due to a stall in the Wr stage are excluded"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, load. This event counts every cycle where there is a stall in the Wr stage due to a load",
+ "EventCode": "0xE7",
+ "EventName": "STALL_BACKEND_LD",
+ "BriefDescription": "No operation issued due to the backend, load. This event counts every cycle where there is a stall in the Wr stage due to a load"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, store. This event counts every cycle where there is a stall in the Wr stage due to a store",
+ "EventCode": "0xE8",
+ "EventName": "STALL_BACKEND_ST",
+ "BriefDescription": "No operation issued due to the backend, store. This event counts every cycle where there is a stall in the Wr stage due to a store"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, load, cache miss. This event counts every cycle where there is a stall in the Wr stage due to a load that is waiting on data. The event counts for stalls that are caused by missing the cache or where the data is Non-cacheable",
+ "EventCode": "0xE9",
+ "EventName": "STALL_BACKEND_LD_CACHE",
+ "BriefDescription": "No operation issued due to the backend, load, cache miss. This event counts every cycle where there is a stall in the Wr stage due to a load that is waiting on data. The event counts for stalls that are caused by missing the cache or where the data is Non-cacheable"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, load, TLB miss. This event counts every cycle where there is a stall in the Wr stage due to a load that misses in the L1 TLB",
+ "EventCode": "0xEA",
+ "EventName": "STALL_BACKEND_LD_TLB",
+ "BriefDescription": "No operation issued due to the backend, load, TLB miss. This event counts every cycle where there is a stall in the Wr stage due to a load that misses in the L1 TLB"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, store, Store Buffer (STB) full. This event counts every cycle where there is a stall in the Wr stage because of a store operation that is waiting due to the STB being full",
+ "EventCode": "0xEB",
+ "EventName": "STALL_BACKEND_ST_STB",
+ "BriefDescription": "No operation issued due to the backend, store, Store Buffer (STB) full. This event counts every cycle where there is a stall in the Wr stage because of a store operation that is waiting due to the STB being full"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, store, TLB miss. This event counts every cycle where there is a stall in the Wr stage because of a store operation that has missed in the L1 TLB",
+ "EventCode": "0xEC",
+ "EventName": "STALL_BACKEND_ST_TLB",
+ "BriefDescription": "No operation issued due to the backend, store, TLB miss. This event counts every cycle where there is a stall in the Wr stage because of a store operation that has missed in the L1 TLB"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, VPU hazard. This event counts every cycle where the core stalls due to contention for the VPU with the other core",
+ "EventCode": "0xED",
+ "EventName": "STALL_BACKEND_VPU_HAZARD",
+ "BriefDescription": "No operation issued due to the backend, VPU hazard. This event counts every cycle where the core stalls due to contention for the VPU with the other core"
+ },
+ {
+ "PublicDescription": "Issue slot not issued due to interlock. For each cycle, this event counts each dispatch slot that does not issue due to an interlock",
+ "EventCode": "0xEE",
+ "EventName": "STALL_SLOT_BACKEND_ILOCK",
+ "BriefDescription": "Issue slot not issued due to interlock. For each cycle, this event counts each dispatch slot that does not issue due to an interlock"
+ },
+ {
+ "ArchStdEvent": "STALL_BACKEND_MEM"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/pmu.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/pmu.json
new file mode 100644
index 000000000000..d8b7b9f9e5fa
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/pmu.json
@@ -0,0 +1,8 @@
+[
+ {
+ "ArchStdEvent": "PMU_OVFS"
+ },
+ {
+ "ArchStdEvent": "PMU_HOVFS"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/trace.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/trace.json
new file mode 100644
index 000000000000..33672a8711d4
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a510/trace.json
@@ -0,0 +1,32 @@
+[
+ {
+ "ArchStdEvent": "TRB_WRAP"
+ },
+ {
+ "ArchStdEvent": "TRB_TRIG"
+ },
+ {
+ "ArchStdEvent": "TRCEXTOUT0"
+ },
+ {
+ "ArchStdEvent": "TRCEXTOUT1"
+ },
+ {
+ "ArchStdEvent": "TRCEXTOUT2"
+ },
+ {
+ "ArchStdEvent": "TRCEXTOUT3"
+ },
+ {
+ "ArchStdEvent": "CTI_TRIGOUT4"
+ },
+ {
+ "ArchStdEvent": "CTI_TRIGOUT5"
+ },
+ {
+ "ArchStdEvent": "CTI_TRIGOUT6"
+ },
+ {
+ "ArchStdEvent": "CTI_TRIGOUT7"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/branch.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/branch.json
new file mode 100644
index 000000000000..8633d5db42a0
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/branch.json
@@ -0,0 +1,59 @@
+[
+ {
+ "ArchStdEvent": "BR_MIS_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_IMMED_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_INDIRECT_SPEC"
+ },
+ {
+ "PublicDescription": "Predicted conditional branch executed.This event counts when any branch which can be predicted by the conditional predictor is retired. This event still counts when branch prediction is disabled due to the MMU being off",
+ "EventCode": "0xC9",
+ "EventName": "BR_COND_PRED",
+ "BriefDescription": "Predicted conditional branch executed.This event counts when any branch which can be predicted by the conditional predictor is retired. This event still counts when branch prediction is disabled due to the MMU being off"
+ },
+ {
+ "PublicDescription": "Indirect branch mis-predicted.This event counts when any indirect branch which can be predicted by the BTAC is retired, and has mispredicted for either the condition or the address. This event still counts when branch prediction is disabled due to the MMU being off",
+ "EventCode": "0xCA",
+ "EventName": "BR_INDIRECT_MIS_PRED",
+ "BriefDescription": "Indirect branch mis-predicted.This event counts when any indirect branch which can be predicted by the BTAC is retired, and has mispredicted for either the condition or the address. This event still counts when branch prediction is disabled due to the MMU being off"
+ },
+ {
+ "PublicDescription": "Indirect branch mis-predicted due to address mis-compare.This event counts when any indirect branch which can be predicted by the BTAC is retired, was taken and correctly predicted the condition, and has mispredicted the address. This event still counts when branch prediction is disabled due to the MMU being off",
+ "EventCode": "0xCB",
+ "EventName": "BR_INDIRECT_ADDR_MIS_PRED",
+ "BriefDescription": "Indirect branch mis-predicted due to address mis-compare.This event counts when any indirect branch which can be predicted by the BTAC is retired, was taken and correctly predicted the condition, and has mispredicted the address. This event still counts when branch prediction is disabled due to the MMU being off"
+ },
+ {
+ "PublicDescription": "Conditional branch mis-predicted.This event counts when any branch which can be predicted by the conditional predictor is retired, and has mis-predicted the condition. This event still counts when branch prediction is disabled due to the MMU being off. Conditional indirect branches which correctly predicted the condition but mis-predicted on the address do not count this event",
+ "EventCode": "0xCC",
+ "EventName": "BR_COND_MIS_PRED",
+ "BriefDescription": "Conditional branch mis-predicted.This event counts when any branch which can be predicted by the conditional predictor is retired, and has mis-predicted the condition. This event still counts when branch prediction is disabled due to the MMU being off. Conditional indirect branches which correctly predicted the condition but mis-predicted on the address do not count this event"
+ },
+ {
+ "PublicDescription": "Indirect branch with predicted address executed.This event counts when any indirect branch which can be predicted by the BTAC is retired, was taken and correctly predicted the condition. This event still counts when branch prediction is disabled due to the MMU being off",
+ "EventCode": "0xCD",
+ "EventName": "BR_INDIRECT_ADDR_PRED",
+ "BriefDescription": "Indirect branch with predicted address executed.This event counts when any indirect branch which can be predicted by the BTAC is retired, was taken and correctly predicted the condition. This event still counts when branch prediction is disabled due to the MMU being off"
+ },
+ {
+ "PublicDescription": "Procedure return with predicted address executed.This event counts when any procedure return which can be predicted by the CRS is retired, was taken and correctly predicted the condition. This event still counts when branch prediction is disabled due to the MMU being off",
+ "EventCode": "0xCE",
+ "EventName": "BR_RETURN_ADDR_PRED",
+ "BriefDescription": "Procedure return with predicted address executed.This event counts when any procedure return which can be predicted by the CRS is retired, was taken and correctly predicted the condition. This event still counts when branch prediction is disabled due to the MMU being off"
+ },
+ {
+ "PublicDescription": "Procedure return mis-predicted due to address mis-compare.This event counts when any procedure return which can be predicted by the CRS is retired, was taken and correctly predicted the condition, and has mispredicted the address. This event still counts when branch prediction is disabled due to the MMU being off",
+ "EventCode": "0xCF",
+ "EventName": "BR_RETURN_ADDR_MIS_PRED",
+ "BriefDescription": "Procedure return mis-predicted due to address mis-compare.This event counts when any procedure return which can be predicted by the CRS is retired, was taken and correctly predicted the condition, and has mispredicted the address. This event still counts when branch prediction is disabled due to the MMU being off"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/bus.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/bus.json
new file mode 100644
index 000000000000..75d850b781ac
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/bus.json
@@ -0,0 +1,17 @@
+[
+ {
+ "ArchStdEvent": "CPU_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS"
+ },
+ {
+ "ArchStdEvent": "BUS_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_WR"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/cache.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/cache.json
new file mode 100644
index 000000000000..cd684c7ae026
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/cache.json
@@ -0,0 +1,188 @@
+[
+ {
+ "ArchStdEvent": "L1I_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_ALLOCATE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_ALLOCATE"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB"
+ },
+ {
+ "ArchStdEvent": "DTLB_WALK"
+ },
+ {
+ "ArchStdEvent": "ITLB_WALK"
+ },
+ {
+ "ArchStdEvent": "LL_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "LL_CACHE_MISS_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_INNER"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_OUTER"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_REFILL_RD"
+ },
+ {
+ "PublicDescription": "Level 3 cache refill due to prefetch. This event counts any linefills from the hardware prefetcher which cause an allocation into the L3 cache. Note It might not be possible to both distinguish hardware vs software prefetches and also which prefetches cause an allocation. If so, only hardware prefetches should be counted, regardless of whether they allocate. If either the core is configured without a per-core L2 or the cluster is configured without an L3 cache, this event is not implemented",
+ "EventCode": "0xC0",
+ "EventName": "L3D_CACHE_REFILL_PREFETCH",
+ "BriefDescription": "Level 3 cache refill due to prefetch. This event counts any linefills from the hardware prefetcher which cause an allocation into the L3 cache. Note It might not be possible to both distinguish hardware vs software prefetches and also which prefetches cause an allocation. If so, only hardware prefetches should be counted, regardless of whether they allocate. If either the core is configured without a per-core L2 or the cluster is configured without an L3 cache, this event is not implemented"
+ },
+ {
+ "PublicDescription": "Level 2 cache refill due to prefetch. +//0 If the core is configured with a per-core L2 cache: This event does not count. +//0 If the core is configured without a per-core L2 cache: This event counts the cluster cache event, as defined by L3D_CACHE_REFILL_PREFETCH. +//0 If there is neither a per-core cache nor a cluster cache configured, this event is not implemented",
+ "EventCode": "0xC1",
+ "EventName": "L2D_CACHE_REFILL_PREFETCH",
+ "BriefDescription": "Level 2 cache refill due to prefetch. +//0 If the core is configured with a per-core L2 cache: This event does not count. +//0 If the core is configured without a per-core L2 cache: This event counts the cluster cache event, as defined by L3D_CACHE_REFILL_PREFETCH. +//0 If there is neither a per-core cache nor a cluster cache configured, this event is not implemented"
+ },
+ {
+ "PublicDescription": "Level 1 data cache refill due to prefetch. This event counts any linefills from the prefetcher which cause an allocation into the L1 D-cache",
+ "EventCode": "0xC2",
+ "EventName": "L1D_CACHE_REFILL_PREFETCH",
+ "BriefDescription": "Level 1 data cache refill due to prefetch. This event counts any linefills from the prefetcher which cause an allocation into the L1 D-cache"
+ },
+ {
+ "PublicDescription": "Level 2 cache write streaming mode. This event counts for each cycle where the core is in write-streaming mode and not allocating writes into the L2 cache",
+ "EventCode": "0xC3",
+ "EventName": "L2D_WS_MODE",
+ "BriefDescription": "Level 2 cache write streaming mode. This event counts for each cycle where the core is in write-streaming mode and not allocating writes into the L2 cache"
+ },
+ {
+ "PublicDescription": "Level 1 data cache entering write streaming mode.This event counts for each entry into write-streaming mode",
+ "EventCode": "0xC4",
+ "EventName": "L1D_WS_MODE_ENTRY",
+ "BriefDescription": "Level 1 data cache entering write streaming mode.This event counts for each entry into write-streaming mode"
+ },
+ {
+ "PublicDescription": "Level 1 data cache write streaming mode.This event counts for each cycle where the core is in write-streaming mode and not allocating writes into the L1 D-cache",
+ "EventCode": "0xC5",
+ "EventName": "L1D_WS_MODE",
+ "BriefDescription": "Level 1 data cache write streaming mode.This event counts for each cycle where the core is in write-streaming mode and not allocating writes into the L1 D-cache"
+ },
+ {
+ "PublicDescription": "Level 3 cache write streaming mode.This event counts for each cycle where the core is in write-streaming mode and not allocating writes into the L3 cache",
+ "EventCode": "0xC7",
+ "EventName": "L3D_WS_MODE",
+ "BriefDescription": "Level 3 cache write streaming mode.This event counts for each cycle where the core is in write-streaming mode and not allocating writes into the L3 cache"
+ },
+ {
+ "PublicDescription": "Level 2 TLB last-level walk cache access.This event does not count if the MMU is disabled",
+ "EventCode": "0xD0",
+ "EventName": "L2D_LLWALK_TLB",
+ "BriefDescription": "Level 2 TLB last-level walk cache access.This event does not count if the MMU is disabled"
+ },
+ {
+ "PublicDescription": "Level 2 TLB last-level walk cache refill.This event does not count if the MMU is disabled",
+ "EventCode": "0xD1",
+ "EventName": "L2D_LLWALK_TLB_REFILL",
+ "BriefDescription": "Level 2 TLB last-level walk cache refill.This event does not count if the MMU is disabled"
+ },
+ {
+ "PublicDescription": "Level 2 TLB level-2 walk cache access.This event counts accesses to the level-2 walk cache where the last-level walk cache has missed. The event only counts when the translation regime of the pagewalk uses level 2 descriptors. This event does not count if the MMU is disabled",
+ "EventCode": "0xD2",
+ "EventName": "L2D_L2WALK_TLB",
+ "BriefDescription": "Level 2 TLB level-2 walk cache access.This event counts accesses to the level-2 walk cache where the last-level walk cache has missed. The event only counts when the translation regime of the pagewalk uses level 2 descriptors. This event does not count if the MMU is disabled"
+ },
+ {
+ "PublicDescription": "Level 2 TLB level-2 walk cache refill.This event does not count if the MMU is disabled",
+ "EventCode": "0xD3",
+ "EventName": "L2D_L2WALK_TLB_REFILL",
+ "BriefDescription": "Level 2 TLB level-2 walk cache refill.This event does not count if the MMU is disabled"
+ },
+ {
+ "PublicDescription": "Level 2 TLB IPA cache access. This event counts on each access to the IPA cache. +//0 If a single pagewalk needs to make multiple accesses to the IPA cache, each access is counted. +//0 If stage 2 translation is disabled, this event does not count",
+ "EventCode": "0xD4",
+ "EventName": "L2D_S2_TLB",
+ "BriefDescription": "Level 2 TLB IPA cache access. This event counts on each access to the IPA cache. +//0 If a single pagewalk needs to make multiple accesses to the IPA cache, each access is counted. +//0 If stage 2 translation is disabled, this event does not count"
+ },
+ {
+ "PublicDescription": "Level 2 TLB IPA cache refill. This event counts on each refill of the IPA cache. +//0 If a single pagewalk needs to make multiple accesses to the IPA cache, each access which causes a refill is counted. +//0 If stage 2 translation is disabled, this event does not count",
+ "EventCode": "0xD5",
+ "EventName": "L2D_S2_TLB_REFILL",
+ "BriefDescription": "Level 2 TLB IPA cache refill. This event counts on each refill of the IPA cache. +//0 If a single pagewalk needs to make multiple accesses to the IPA cache, each access which causes a refill is counted. +//0 If stage 2 translation is disabled, this event does not count"
+ },
+ {
+ "PublicDescription": "Level 2 cache stash dropped.This event counts on each stash request received from the interconnect or ACP, that is targeting L2 and gets dropped due to lack of buffer space to hold the request",
+ "EventCode": "0xD6",
+ "EventName": "L2D_CACHE_STASH_DROPPED",
+ "BriefDescription": "Level 2 cache stash dropped.This event counts on each stash request received from the interconnect or ACP, that is targeting L2 and gets dropped due to lack of buffer space to hold the request"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/exception.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/exception.json
new file mode 100644
index 000000000000..99f1ab987709
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/exception.json
@@ -0,0 +1,20 @@
+[
+ {
+ "ArchStdEvent": "EXC_TAKEN"
+ },
+ {
+ "ArchStdEvent": "MEMORY_ERROR"
+ },
+ {
+ "ArchStdEvent": "EXC_IRQ"
+ },
+ {
+ "ArchStdEvent": "EXC_FIQ"
+ },
+ {
+ "PublicDescription": "Predecode error",
+ "EventCode": "0xC6",
+ "EventName": "PREDECODE_ERROR",
+ "BriefDescription": "Predecode error"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/instruction.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/instruction.json
new file mode 100644
index 000000000000..e762fab9e2d8
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/instruction.json
@@ -0,0 +1,65 @@
+[
+ {
+ "ArchStdEvent": "SW_INCR"
+ },
+ {
+ "ArchStdEvent": "LD_RETIRED"
+ },
+ {
+ "ArchStdEvent": "ST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "EXC_RETURN"
+ },
+ {
+ "ArchStdEvent": "CID_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "PC_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_IMMED_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_SPEC"
+ },
+ {
+ "ArchStdEvent": "TTBR_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_MIS_PRED_RETIRED"
+ },
+ {
+ "ArchStdEvent": "LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "LDST_SPEC"
+ },
+ {
+ "ArchStdEvent": "DP_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SPEC"
+ },
+ {
+ "ArchStdEvent": "VFP_SPEC"
+ },
+ {
+ "ArchStdEvent": "PC_WRITE_SPEC"
+ },
+ {
+ "ArchStdEvent": "CRYPTO_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/memory.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/memory.json
new file mode 100644
index 000000000000..d9229173d189
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/memory.json
@@ -0,0 +1,17 @@
+[
+ {
+ "ArchStdEvent": "UNALIGNED_LDST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS"
+ },
+ {
+ "ArchStdEvent": "REMOTE_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_WR"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/pipeline.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/pipeline.json
new file mode 100644
index 000000000000..6c6b5869cf70
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a55/pipeline.json
@@ -0,0 +1,80 @@
+[
+ {
+ "ArchStdEvent": "STALL_FRONTEND"
+ },
+ {
+ "ArchStdEvent": "STALL_BACKEND"
+ },
+ {
+ "PublicDescription": "No operation issued due to the frontend, cache miss.This event counts every cycle the DPU IQ is empty and there is an instruction cache miss being processed",
+ "EventCode": "0xE1",
+ "EventName": "STALL_FRONTEND_CACHE",
+ "BriefDescription": "No operation issued due to the frontend, cache miss.This event counts every cycle the DPU IQ is empty and there is an instruction cache miss being processed"
+ },
+ {
+ "PublicDescription": "No operation issued due to the frontend, TLB miss.This event counts every cycle the DPU IQ is empty and there is an instruction L1 TLB miss being processed",
+ "EventCode": "0xE2",
+ "EventName": "STALL_FRONTEND_TLB",
+ "BriefDescription": "No operation issued due to the frontend, TLB miss.This event counts every cycle the DPU IQ is empty and there is an instruction L1 TLB miss being processed"
+ },
+ {
+ "PublicDescription": "No operation issued due to the frontend, pre-decode error.This event counts every cycle the DPU IQ is empty and there is a pre-decode error being processed",
+ "EventCode": "0xE3",
+ "EventName": "STALL_FRONTEND_PDERR",
+ "BriefDescription": "No operation issued due to the frontend, pre-decode error.This event counts every cycle the DPU IQ is empty and there is a pre-decode error being processed"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend interlock.This event counts every cycle that issue is stalled and there is an interlock. Stall cycles due to a stall in Wr (typically awaiting load data) are excluded",
+ "EventCode": "0xE4",
+ "EventName": "STALL_BACKEND_ILOCK",
+ "BriefDescription": "No operation issued due to the backend interlock.This event counts every cycle that issue is stalled and there is an interlock. Stall cycles due to a stall in Wr (typically awaiting load data) are excluded"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, interlock, AGU.This event counts every cycle that issue is stalled and there is an interlock that is due to a load/store instruction waiting for data to calculate the address in the AGU. Stall cycles due to a stall in Wr (typically awaiting load data) are excluded",
+ "EventCode": "0xE5",
+ "EventName": "STALL_BACKEND_ILOCK_AGU",
+ "BriefDescription": "No operation issued due to the backend, interlock, AGU.This event counts every cycle that issue is stalled and there is an interlock that is due to a load/store instruction waiting for data to calculate the address in the AGU. Stall cycles due to a stall in Wr (typically awaiting load data) are excluded"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, interlock, FPU.This event counts every cycle that issue is stalled and there is an interlock that is due to an FPU/NEON instruction. Stall cycles due to a stall in the Wr stage (typically awaiting load data) are excluded",
+ "EventCode": "0xE6",
+ "EventName": "STALL_BACKEND_ILOCK_FPU",
+ "BriefDescription": "No operation issued due to the backend, interlock, FPU.This event counts every cycle that issue is stalled and there is an interlock that is due to an FPU/NEON instruction. Stall cycles due to a stall in the Wr stage (typically awaiting load data) are excluded"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, load.This event counts every cycle there is a stall in the Wr stage due to a load",
+ "EventCode": "0xE7",
+ "EventName": "STALL_BACKEND_LD",
+ "BriefDescription": "No operation issued due to the backend, load.This event counts every cycle there is a stall in the Wr stage due to a load"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, store.This event counts every cycle there is a stall in the Wr stage due to a store",
+ "EventCode": "0xE8",
+ "EventName": "STALL_BACKEND_ST",
+ "BriefDescription": "No operation issued due to the backend, store.This event counts every cycle there is a stall in the Wr stage due to a store"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, load, cache miss.This event counts every cycle there is a stall in the Wr stage due to a load which is waiting on data (due to missing the cache or being non-cacheable)",
+ "EventCode": "0xE9",
+ "EventName": "STALL_BACKEND_LD_CACHE",
+ "BriefDescription": "No operation issued due to the backend, load, cache miss.This event counts every cycle there is a stall in the Wr stage due to a load which is waiting on data (due to missing the cache or being non-cacheable)"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, load, TLB miss.This event counts every cycle there is a stall in the Wr stage due to a load which has missed in the L1 TLB",
+ "EventCode": "0xEA",
+ "EventName": "STALL_BACKEND_LD_TLB",
+ "BriefDescription": "No operation issued due to the backend, load, TLB miss.This event counts every cycle there is a stall in the Wr stage due to a load which has missed in the L1 TLB"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, store, STB full.This event counts every cycle there is a stall in the Wr stage due to a store which is waiting due to the STB being full",
+ "EventCode": "0xEB",
+ "EventName": "STALL_BACKEND_ST_STB",
+ "BriefDescription": "No operation issued due to the backend, store, STB full.This event counts every cycle there is a stall in the Wr stage due to a store which is waiting due to the STB being full"
+ },
+ {
+ "PublicDescription": "No operation issued due to the backend, store, TLB miss.This event counts every cycle there is a stall in the Wr stage due to a store which has missed in the L1 TLB",
+ "EventCode": "0xEC",
+ "EventName": "STALL_BACKEND_ST_TLB",
+ "BriefDescription": "No operation issued due to the backend, store, TLB miss.This event counts every cycle there is a stall in the Wr stage due to a store which has missed in the L1 TLB"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/branch.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/branch.json
new file mode 100644
index 000000000000..2f2d137f5f55
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/branch.json
@@ -0,0 +1,17 @@
+[
+ {
+ "ArchStdEvent": "BR_MIS_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_IMMED_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_INDIRECT_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/bus.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/bus.json
new file mode 100644
index 000000000000..31505994c06c
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/bus.json
@@ -0,0 +1,29 @@
+[
+ {
+ "ArchStdEvent": "CPU_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS"
+ },
+ {
+ "ArchStdEvent": "BUS_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_WR"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_SHARED"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_NOT_SHARED"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_NORMAL"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_PERIPH"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/cache.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/cache.json
new file mode 100644
index 000000000000..1bd59e7d982b
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/cache.json
@@ -0,0 +1,80 @@
+[
+ {
+ "ArchStdEvent": "L1I_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB_VICTIM"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB_CLEAN"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_INVAL"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB_VICTIM"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB_CLEAN"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_INVAL"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/exception.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/exception.json
new file mode 100644
index 000000000000..344a2d552ad5
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/exception.json
@@ -0,0 +1,47 @@
+[
+ {
+ "ArchStdEvent": "EXC_TAKEN"
+ },
+ {
+ "ArchStdEvent": "MEMORY_ERROR"
+ },
+ {
+ "ArchStdEvent": "EXC_UNDEF"
+ },
+ {
+ "ArchStdEvent": "EXC_SVC"
+ },
+ {
+ "ArchStdEvent": "EXC_PABORT"
+ },
+ {
+ "ArchStdEvent": "EXC_DABORT"
+ },
+ {
+ "ArchStdEvent": "EXC_IRQ"
+ },
+ {
+ "ArchStdEvent": "EXC_FIQ"
+ },
+ {
+ "ArchStdEvent": "EXC_SMC"
+ },
+ {
+ "ArchStdEvent": "EXC_HVC"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_PABORT"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_DABORT"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_OTHER"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_IRQ"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_FIQ"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/instruction.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/instruction.json
new file mode 100644
index 000000000000..e42486d406b3
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/instruction.json
@@ -0,0 +1,68 @@
+[
+ {
+ "ArchStdEvent": "SW_INCR"
+ },
+ {
+ "ArchStdEvent": "INST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "EXC_RETURN"
+ },
+ {
+ "ArchStdEvent": "CID_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_SPEC"
+ },
+ {
+ "ArchStdEvent": "TTBR_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "LDREX_SPEC"
+ },
+ {
+ "ArchStdEvent": "STREX_PASS_SPEC"
+ },
+ {
+ "ArchStdEvent": "STREX_FAIL_SPEC"
+ },
+ {
+ "ArchStdEvent": "LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "LDST_SPEC"
+ },
+ {
+ "ArchStdEvent": "DP_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SPEC"
+ },
+ {
+ "ArchStdEvent": "VFP_SPEC"
+ },
+ {
+ "ArchStdEvent": "PC_WRITE_SPEC"
+ },
+ {
+ "ArchStdEvent": "CRYPTO_SPEC"
+ },
+ {
+ "ArchStdEvent": "ISB_SPEC"
+ },
+ {
+ "ArchStdEvent": "DSB_SPEC"
+ },
+ {
+ "ArchStdEvent": "DMB_SPEC"
+ },
+ {
+ "ArchStdEvent": "RC_LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "RC_ST_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/memory.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/memory.json
new file mode 100644
index 000000000000..e3d08f1f7c92
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a57-a72/memory.json
@@ -0,0 +1,20 @@
+[
+ {
+ "ArchStdEvent": "MEM_ACCESS"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_WR"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_LDST_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/branch.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/branch.json
new file mode 100644
index 000000000000..2f2d137f5f55
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/branch.json
@@ -0,0 +1,17 @@
+[
+ {
+ "ArchStdEvent": "BR_MIS_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_IMMED_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_INDIRECT_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/bus.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/bus.json
new file mode 100644
index 000000000000..75d850b781ac
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/bus.json
@@ -0,0 +1,17 @@
+[
+ {
+ "ArchStdEvent": "CPU_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS"
+ },
+ {
+ "ArchStdEvent": "BUS_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_WR"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/cache.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/cache.json
new file mode 100644
index 000000000000..118c5cb0674b
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/cache.json
@@ -0,0 +1,236 @@
+[
+ {
+ "ArchStdEvent": "L1I_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_ALLOCATE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_ALLOCATE"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB"
+ },
+ {
+ "ArchStdEvent": "DTLB_WALK"
+ },
+ {
+ "ArchStdEvent": "ITLB_WALK"
+ },
+ {
+ "ArchStdEvent": "LL_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "LL_CACHE_MISS_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_INNER"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_OUTER"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_REFILL_RD"
+ },
+ {
+ "PublicDescription": "Merge in the store buffer",
+ "EventCode": "0xC0",
+ "EventName": "STB_STALL",
+ "BriefDescription": "Merge in the store buffer"
+ },
+ {
+ "PublicDescription": "Level 1 data cache refill started due to prefetch. Counts any linefills from the prefetcher which cause an allocation into the L1 D-cache",
+ "EventCode": "0xC3",
+ "EventName": "L1D_PREF_LINE_FILL",
+ "BriefDescription": "Level 1 data cache refill started due to prefetch. Counts any linefills from the prefetcher which cause an allocation into the L1 D-cache"
+ },
+ {
+ "PublicDescription": "Level 2 cache refill due to prefetch. +//0 If the core is configured with a per-core L2 cache: This event does not count. +//0 If the core is configured without a per-core L2 cache: This event counts the cluster cache event, as defined by L3_PREF_LINE_FILL. +//0 If there is neither a per-core cache nor a cluster cache configured, this event is not implemented",
+ "EventCode": "0xC4",
+ "EventName": "L2D_PREF_LINE_FILL",
+ "BriefDescription": "Level 2 cache refill due to prefetch. +//0 If the core is configured with a per-core L2 cache: This event does not count. +//0 If the core is configured without a per-core L2 cache: This event counts the cluster cache event, as defined by L3_PREF_LINE_FILL. +//0 If there is neither a per-core cache nor a cluster cache configured, this event is not implemented"
+ },
+ {
+ "PublicDescription": "Level 3 cache refill due to prefetch. This event counts any linefills from the hardware prefetcher which cause an allocation into the L3 cache. Note It might not be possible to distinguish between both hardware and software prefetches and also which prefetches cause an allocation. If so, only hardware prefetches should be counted, regardless of whether they allocate. If either the core is configured without a per-core L2 or the cluster is configured without an L3 cache, this event is not implemented",
+ "EventCode": "0xC5",
+ "EventName": "L3_PREF_LINE_FILL",
+ "BriefDescription": "Level 3 cache refill due to prefetch. This event counts any linefills from the hardware prefetcher which cause an allocation into the L3 cache. Note It might not be possible to distinguish between both hardware and software prefetches and also which prefetches cause an allocation. If so, only hardware prefetches should be counted, regardless of whether they allocate. If either the core is configured without a per-core L2 or the cluster is configured without an L3 cache, this event is not implemented"
+ },
+ {
+ "PublicDescription": "L1D entering write stream mode",
+ "EventCode": "0xC6",
+ "EventName": "L1D_WS_MODE_ENTER",
+ "BriefDescription": "L1D entering write stream mode"
+ },
+ {
+ "PublicDescription": "L1D is in write stream mode",
+ "EventCode": "0xC7",
+ "EventName": "L1D_WS_MODE",
+ "BriefDescription": "L1D is in write stream mode"
+ },
+ {
+ "PublicDescription": "Level 2 cache write streaming mode. This event counts for each cycle where the core is in write-streaming mode and not allocating writes into the L2 cache",
+ "EventCode": "0xC8",
+ "EventName": "L2D_WS_MODE",
+ "BriefDescription": "Level 2 cache write streaming mode. This event counts for each cycle where the core is in write-streaming mode and not allocating writes into the L2 cache"
+ },
+ {
+ "PublicDescription": "Level 3 cache write streaming mode. This event counts for each cycle where the core is in write-streaming mode and not allocating writes into the L3 cache",
+ "EventCode": "0xC9",
+ "EventName": "L3D_WS_MODE",
+ "BriefDescription": "Level 3 cache write streaming mode. This event counts for each cycle where the core is in write-streaming mode and not allocating writes into the L3 cache"
+ },
+ {
+ "PublicDescription": "Level 2 TLB last-level walk cache access. This event does not count if the MMU is disabled",
+ "EventCode": "0xCA",
+ "EventName": "TLB_L2TLB_LLWALK_ACCESS",
+ "BriefDescription": "Level 2 TLB last-level walk cache access. This event does not count if the MMU is disabled"
+ },
+ {
+ "PublicDescription": "Level 2 TLB last-level walk cache refill. This event does not count if the MMU is disabled",
+ "EventCode": "0xCB",
+ "EventName": "TLB_L2TLB_LLWALK_REFILL",
+ "BriefDescription": "Level 2 TLB last-level walk cache refill. This event does not count if the MMU is disabled"
+ },
+ {
+ "PublicDescription": "Level 2 TLB level-2 walk cache access. This event counts accesses to the level-2 walk cache where the last-level walk cache has missed. The event only counts when the translation regime of the pagewalk uses level 2 descriptors. This event does not count if the MMU is disabled",
+ "EventCode": "0xCC",
+ "EventName": "TLB_L2TLB_L2WALK_ACCESS",
+ "BriefDescription": "Level 2 TLB level-2 walk cache access. This event counts accesses to the level-2 walk cache where the last-level walk cache has missed. The event only counts when the translation regime of the pagewalk uses level 2 descriptors. This event does not count if the MMU is disabled"
+ },
+ {
+ "PublicDescription": "Level 2 TLB level-2 walk cache refill. This event does not count if the MMU is disabled",
+ "EventCode": "0xCD",
+ "EventName": "TLB_L2TLB_L2WALK_REFILL",
+ "BriefDescription": "Level 2 TLB level-2 walk cache refill. This event does not count if the MMU is disabled"
+ },
+ {
+ "PublicDescription": "Level 2 TLB IPA cache access. This event counts on each access to the IPA cache. +//0 If a single pagewalk needs to make multiple accesses to the IPA cache, each access is counted. +//0 If stage 2 translation is disabled, this event does not count",
+ "EventCode": "0xCE",
+ "EventName": "TLB_L2TLB_S2_ACCESS",
+ "BriefDescription": "Level 2 TLB IPA cache access. This event counts on each access to the IPA cache. +//0 If a single pagewalk needs to make multiple accesses to the IPA cache, each access is counted. +//0 If stage 2 translation is disabled, this event does not count"
+ },
+ {
+ "PublicDescription": "Level 2 TLB IPA cache refill. This event counts on each refill of the IPA cache. +//0 If a single pagewalk needs to make multiple accesses to the IPA cache, each access which causes a refill is counted. +//0 If stage 2 translation is disabled, this event does not count",
+ "EventCode": "0xCF",
+ "EventName": "TLB_L2TLB_S2_REFILL",
+ "BriefDescription": "Level 2 TLB IPA cache refill. This event counts on each refill of the IPA cache. +//0 If a single pagewalk needs to make multiple accesses to the IPA cache, each access which causes a refill is counted. +//0 If stage 2 translation is disabled, this event does not count"
+ },
+ {
+ "PublicDescription": "Unattributable Level 1 data cache write-back. This event occurs when a requestor outside the PE makes a coherency request that results in writeback",
+ "EventCode": "0xF0",
+ "EventName": "L2_L1D_CACHE_WB_UNATT",
+ "BriefDescription": "Unattributable Level 1 data cache write-back. This event occurs when a requestor outside the PE makes a coherency request that results in writeback"
+ },
+ {
+ "PublicDescription": "Unattributable Level 2 data cache access. This event occurs when a requestor outside the PE makes a coherency request that results in level 2 data cache access",
+ "EventCode": "0xF1",
+ "EventName": "L2_L2D_CACHE_UNATT",
+ "BriefDescription": "Unattributable Level 2 data cache access. This event occurs when a requestor outside the PE makes a coherency request that results in level 2 data cache access"
+ },
+ {
+ "PublicDescription": "Unattributable Level 2 data cache access, read. This event occurs when a requestor outside the PE makes a coherency request that results in level 2 data cache read access",
+ "EventCode": "0xF2",
+ "EventName": "L2_L2D_CACHE_RD_UNATT",
+ "BriefDescription": "Unattributable Level 2 data cache access, read. This event occurs when a requestor outside the PE makes a coherency request that results in level 2 data cache read access"
+ },
+ {
+ "PublicDescription": "Unattributable Level 3 data cache access. This event occurs when a requestor outside the PE makes a coherency request that results in level 3 data cache read access",
+ "EventCode": "0xF3",
+ "EventName": "L2_L3D_CACHE_UNATT",
+ "BriefDescription": "Unattributable Level 3 data cache access. This event occurs when a requestor outside the PE makes a coherency request that results in level 3 data cache read access"
+ },
+ {
+ "PublicDescription": "Unattributable Level 3 data cache access, read. This event occurs when a requestor outside the PE makes a coherency request that results in level 3 data cache read access",
+ "EventCode": "0xF4",
+ "EventName": "L2_L3D_CACHE_RD_UNATT",
+ "BriefDescription": "Unattributable Level 3 data cache access, read. This event occurs when a requestor outside the PE makes a coherency request that results in level 3 data cache read access"
+ },
+ {
+ "PublicDescription": "Unattributable Level 3 data or unified cache allocation without refill. This event occurs when a requestor outside the PE makes a coherency request that results in level 3 cache allocate without refill",
+ "EventCode": "0xF5",
+ "EventName": "L2_L3D_CACHE_ALLOC_UNATT",
+ "BriefDescription": "Unattributable Level 3 data or unified cache allocation without refill. This event occurs when a requestor outside the PE makes a coherency request that results in level 3 cache allocate without refill"
+ },
+ {
+ "PublicDescription": "Unattributable Level 3 data or unified cache refill. This event occurs when a requestor outside the PE makes a coherency request that results in level 3 cache refill",
+ "EventCode": "0xF6",
+ "EventName": "L2_L3D_CACHE_REFILL_UNATT",
+ "BriefDescription": "Unattributable Level 3 data or unified cache refill. This event occurs when a requestor outside the PE makes a coherency request that results in level 3 cache refill"
+ },
+ {
+ "PublicDescription": "Level 2 cache stash dropped. This event counts on each stash request received from the interconnect or ACP, that is targeting L2 and gets dropped due to lack of buffer space to hold the request. L2 and L3 cache events (L2D_CACHE*, L3D_CACHE*) The behavior of these events depends on the configuration of the core. If the private L2 cache is present, the L2D_CACHE* events count the activity in the private L2 cache, and the L3D_CACHE* events count the activity in the DSU L3 cache (if present). If the private L2 cache is not present but the DSU L3 cache is present, the L2D_CACHE* events count activity in the DSU L3 cache and the L3D_CACHE* events do not count. The L2D_CACHE_WB, L2D_CACHE_WR and L2D_CACHE_REFILL_WR events do not count in this configuration. If neither the private L2 cache nor the DSU L3 cache are present, neither the L2D_CACHE* or L3D_CACHE* events will count",
+ "EventCode": "0xF7",
+ "EventName": "L2D_CACHE_STASH_DROPPED",
+ "BriefDescription": "Level 2 cache stash dropped. This event counts on each stash request received from the interconnect or ACP, that is targeting L2 and gets dropped due to lack of buffer space to hold the request. L2 and L3 cache events (L2D_CACHE*, L3D_CACHE*) The behavior of these events depends on the configuration of the core. If the private L2 cache is present, the L2D_CACHE* events count the activity in the private L2 cache, and the L3D_CACHE* events count the activity in the DSU L3 cache (if present). If the private L2 cache is not present but the DSU L3 cache is present, the L2D_CACHE* events count activity in the DSU L3 cache and the L3D_CACHE* events do not count. The L2D_CACHE_WB, L2D_CACHE_WR and L2D_CACHE_REFILL_WR events do not count in this configuration. If neither the private L2 cache nor the DSU L3 cache are present, neither the L2D_CACHE* or L3D_CACHE* events will count"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/dpu.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/dpu.json
new file mode 100644
index 000000000000..b8e402a91bdd
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/dpu.json
@@ -0,0 +1,32 @@
+[
+ {
+ "PublicDescription": "Instruction retired, indirect branch, mispredicted",
+ "EventCode": "0xE9",
+ "EventName": "DPU_BR_IND_MIS",
+ "BriefDescription": "Instruction retired, indirect branch, mispredicted"
+ },
+ {
+ "PublicDescription": "Instruction retired, conditional branch, mispredicted",
+ "EventCode": "0xEA",
+ "EventName": "DPU_BR_COND_MIS",
+ "BriefDescription": "Instruction retired, conditional branch, mispredicted"
+ },
+ {
+ "PublicDescription": "Memory error (any type) from IFU",
+ "EventCode": "0xEB",
+ "EventName": "DPU_MEM_ERR_IFU",
+ "BriefDescription": "Memory error (any type) from IFU"
+ },
+ {
+ "PublicDescription": "Memory error (any type) from DCU",
+ "EventCode": "0xEC",
+ "EventName": "DPU_MEM_ERR_DCU",
+ "BriefDescription": "Memory error (any type) from DCU"
+ },
+ {
+ "PublicDescription": "Memory error (any type) from TLB",
+ "EventCode": "0xED",
+ "EventName": "DPU_MEM_ERR_TLB",
+ "BriefDescription": "Memory error (any type) from TLB"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/exception.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/exception.json
new file mode 100644
index 000000000000..27c3fe9c831a
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/exception.json
@@ -0,0 +1,14 @@
+[
+ {
+ "ArchStdEvent": "EXC_TAKEN"
+ },
+ {
+ "ArchStdEvent": "MEMORY_ERROR"
+ },
+ {
+ "ArchStdEvent": "EXC_IRQ"
+ },
+ {
+ "ArchStdEvent": "EXC_FIQ"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/ifu.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/ifu.json
new file mode 100644
index 000000000000..13178c5dca14
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/ifu.json
@@ -0,0 +1,122 @@
+[
+ {
+ "PublicDescription": "I-Cache miss on an access from the prefetch block",
+ "EventCode": "0xD0",
+ "EventName": "IFU_IC_MISS_WAIT",
+ "BriefDescription": "I-Cache miss on an access from the prefetch block"
+ },
+ {
+ "PublicDescription": "Counts the cycles spent on a request for Level 2 TLB lookup after a Level 1l ITLB miss",
+ "EventCode": "0xD1",
+ "EventName": "IFU_IUTLB_MISS_WAIT",
+ "BriefDescription": "Counts the cycles spent on a request for Level 2 TLB lookup after a Level 1l ITLB miss"
+ },
+ {
+ "PublicDescription": "Micro-predictor conditional/direction mispredict, with respect to. if3/if4 predictor",
+ "EventCode": "0xD2",
+ "EventName": "IFU_MICRO_COND_MISPRED",
+ "BriefDescription": "Micro-predictor conditional/direction mispredict, with respect to. if3/if4 predictor"
+ },
+ {
+ "PublicDescription": "Micro-predictor address mispredict, with respect to if3/if4 predictor",
+ "EventCode": "0xD3",
+ "EventName": "IFU_MICRO_CADDR_MISPRED",
+ "BriefDescription": "Micro-predictor address mispredict, with respect to if3/if4 predictor"
+ },
+ {
+ "PublicDescription": "Micro-predictor hit with immediate redirect",
+ "EventCode": "0xD4",
+ "EventName": "IFU_MICRO_HIT",
+ "BriefDescription": "Micro-predictor hit with immediate redirect"
+ },
+ {
+ "PublicDescription": "Micro-predictor negative cache hit",
+ "EventCode": "0xD6",
+ "EventName": "IFU_MICRO_NEG_HIT",
+ "BriefDescription": "Micro-predictor negative cache hit"
+ },
+ {
+ "PublicDescription": "Micro-predictor correction",
+ "EventCode": "0xD7",
+ "EventName": "IFU_MICRO_CORRECTION",
+ "BriefDescription": "Micro-predictor correction"
+ },
+ {
+ "PublicDescription": "A 2nd instruction could have been pushed but was not because it was nonsequential",
+ "EventCode": "0xD8",
+ "EventName": "IFU_MICRO_NO_INSTR1",
+ "BriefDescription": "A 2nd instruction could have been pushed but was not because it was nonsequential"
+ },
+ {
+ "PublicDescription": "Micro-predictor miss",
+ "EventCode": "0xD9",
+ "EventName": "IFU_MICRO_NO_PRED",
+ "BriefDescription": "Micro-predictor miss"
+ },
+ {
+ "PublicDescription": "Thread flushed due to TLB miss",
+ "EventCode": "0xDA",
+ "EventName": "IFU_FLUSHED_TLB_MISS",
+ "BriefDescription": "Thread flushed due to TLB miss"
+ },
+ {
+ "PublicDescription": "Thread flushed due to reasons other than TLB miss",
+ "EventCode": "0xDB",
+ "EventName": "IFU_FLUSHED_EXCL_TLB_MISS",
+ "BriefDescription": "Thread flushed due to reasons other than TLB miss"
+ },
+ {
+ "PublicDescription": "This thread and the other thread both ready for scheduling in if0",
+ "EventCode": "0xDC",
+ "EventName": "IFU_ALL_THRDS_RDY",
+ "BriefDescription": "This thread and the other thread both ready for scheduling in if0"
+ },
+ {
+ "PublicDescription": "This thread was arbitrated when the other thread was also ready for scheduling",
+ "EventCode": "0xDD",
+ "EventName": "IFU_WIN_ARB_OTHER_RDY",
+ "BriefDescription": "This thread was arbitrated when the other thread was also ready for scheduling"
+ },
+ {
+ "PublicDescription": "This thread was arbitrated when the other thread was also active, but not necessarily ready. For example, waiting for I-Cache or TLB",
+ "EventCode": "0xDE",
+ "EventName": "IFU_WIN_ARB_OTHER_ACT",
+ "BriefDescription": "This thread was arbitrated when the other thread was also active, but not necessarily ready. For example, waiting for I-Cache or TLB"
+ },
+ {
+ "PublicDescription": "This thread was not arbitrated because it was not ready for scheduling. For example, due to a cache miss or TLB miss",
+ "EventCode": "0xDF",
+ "EventName": "IFU_NOT_RDY_FOR_ARB",
+ "BriefDescription": "This thread was not arbitrated because it was not ready for scheduling. For example, due to a cache miss or TLB miss"
+ },
+ {
+ "PublicDescription": "The thread moved from an active state to an inactive state (long-term sleep state, causing deallocation of some resources)",
+ "EventCode": "0xE0",
+ "EventName": "IFU_GOTO_IDLE",
+ "BriefDescription": "The thread moved from an active state to an inactive state (long-term sleep state, causing deallocation of some resources)"
+ },
+ {
+ "PublicDescription": "I-Cache lookup under miss from other thread",
+ "EventCode": "0xE1",
+ "EventName": "IFU_IC_LOOKUP_UNDER_MISS",
+ "BriefDescription": "I-Cache lookup under miss from other thread"
+ },
+ {
+ "PublicDescription": "I-Cache miss under miss from other thread",
+ "EventCode": "0xE2",
+ "EventName": "IFU_IC_MISS_UNDER_MISS",
+ "BriefDescription": "I-Cache miss under miss from other thread"
+ },
+ {
+ "PublicDescription": "This thread pushed an instruction into the IQ",
+ "EventCode": "0xE3",
+ "EventName": "IFU_INSTR_PUSHED",
+ "BriefDescription": "This thread pushed an instruction into the IQ"
+ },
+ {
+ "PublicDescription": "I-Cache Speculative line fill",
+ "EventCode": "0xE4",
+ "EventName": "IFU_IC_LF_SP",
+ "BriefDescription": "I-Cache Speculative line fill"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/instruction.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/instruction.json
new file mode 100644
index 000000000000..2e0d60779dce
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/instruction.json
@@ -0,0 +1,71 @@
+[
+ {
+ "ArchStdEvent": "SW_INCR"
+ },
+ {
+ "ArchStdEvent": "LD_RETIRED"
+ },
+ {
+ "ArchStdEvent": "ST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "EXC_RETURN"
+ },
+ {
+ "ArchStdEvent": "CID_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "PC_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_IMMED_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_SPEC"
+ },
+ {
+ "ArchStdEvent": "TTBR_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_MIS_PRED_RETIRED"
+ },
+ {
+ "ArchStdEvent": "LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "LDST_SPEC"
+ },
+ {
+ "ArchStdEvent": "DP_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SPEC"
+ },
+ {
+ "ArchStdEvent": "VFP_SPEC"
+ },
+ {
+ "ArchStdEvent": "CRYPTO_SPEC"
+ },
+ {
+ "ArchStdEvent": "ISB_SPEC"
+ },
+ {
+ "PublicDescription": "Instruction retired, conditional branch",
+ "EventCode": "0xE8",
+ "EventName": "DPU_BR_COND_RETIRED",
+ "BriefDescription": "Instruction retired, conditional branch"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/memory.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/memory.json
new file mode 100644
index 000000000000..18d527f7fad4
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/memory.json
@@ -0,0 +1,35 @@
+[
+ {
+ "ArchStdEvent": "MEM_ACCESS"
+ },
+ {
+ "ArchStdEvent": "REMOTE_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_WR"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_LDST_SPEC"
+ },
+ {
+ "PublicDescription": "External memory request",
+ "EventCode": "0xC1",
+ "EventName": "BIU_EXT_MEM_REQ",
+ "BriefDescription": "External memory request"
+ },
+ {
+ "PublicDescription": "External memory request to non-cacheable memory",
+ "EventCode": "0xC2",
+ "EventName": "BIU_EXT_MEM_REQ_NC",
+ "BriefDescription": "External memory request to non-cacheable memory"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/pipeline.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/pipeline.json
new file mode 100644
index 000000000000..eeac798d403a
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a65/pipeline.json
@@ -0,0 +1,8 @@
+[
+ {
+ "ArchStdEvent": "STALL_FRONTEND"
+ },
+ {
+ "ArchStdEvent": "STALL_BACKEND"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/branch.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/branch.json
new file mode 100644
index 000000000000..2f2d137f5f55
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/branch.json
@@ -0,0 +1,17 @@
+[
+ {
+ "ArchStdEvent": "BR_MIS_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_IMMED_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_SPEC"
+ },
+ {
+ "ArchStdEvent": "BR_INDIRECT_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/bus.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/bus.json
new file mode 100644
index 000000000000..579c1c993d17
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/bus.json
@@ -0,0 +1,20 @@
+[
+ {
+ "ArchStdEvent": "CPU_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS"
+ },
+ {
+ "ArchStdEvent": "BUS_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_WR"
+ },
+ {
+ "ArchStdEvent": "CNT_CYCLES"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/cache.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/cache.json
new file mode 100644
index 000000000000..0141f749bff3
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/cache.json
@@ -0,0 +1,155 @@
+[
+ {
+ "ArchStdEvent": "L1I_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_ALLOCATE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_ALLOCATE"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB"
+ },
+ {
+ "ArchStdEvent": "DTLB_WALK"
+ },
+ {
+ "ArchStdEvent": "ITLB_WALK"
+ },
+ {
+ "ArchStdEvent": "LL_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "LL_CACHE_MISS_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_LMISS_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_INNER"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL_OUTER"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB_VICTIM"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB_CLEAN"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_INVAL"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB_VICTIM"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB_CLEAN"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_INVAL"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB_REFILL_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB_REFILL_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB_WR"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE_LMISS"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_LMISS_RD"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_LMISS_RD"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/exception.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/exception.json
new file mode 100644
index 000000000000..344a2d552ad5
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/exception.json
@@ -0,0 +1,47 @@
+[
+ {
+ "ArchStdEvent": "EXC_TAKEN"
+ },
+ {
+ "ArchStdEvent": "MEMORY_ERROR"
+ },
+ {
+ "ArchStdEvent": "EXC_UNDEF"
+ },
+ {
+ "ArchStdEvent": "EXC_SVC"
+ },
+ {
+ "ArchStdEvent": "EXC_PABORT"
+ },
+ {
+ "ArchStdEvent": "EXC_DABORT"
+ },
+ {
+ "ArchStdEvent": "EXC_IRQ"
+ },
+ {
+ "ArchStdEvent": "EXC_FIQ"
+ },
+ {
+ "ArchStdEvent": "EXC_SMC"
+ },
+ {
+ "ArchStdEvent": "EXC_HVC"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_PABORT"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_DABORT"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_OTHER"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_IRQ"
+ },
+ {
+ "ArchStdEvent": "EXC_TRAP_FIQ"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/instruction.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/instruction.json
new file mode 100644
index 000000000000..964f47c6b099
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/instruction.json
@@ -0,0 +1,134 @@
+[
+ {
+ "ArchStdEvent": "SW_INCR"
+ },
+ {
+ "ArchStdEvent": "INST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "EXC_RETURN"
+ },
+ {
+ "ArchStdEvent": "CID_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_SPEC"
+ },
+ {
+ "ArchStdEvent": "TTBR_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_MIS_PRED_RETIRED"
+ },
+ {
+ "ArchStdEvent": "OP_RETIRED"
+ },
+ {
+ "ArchStdEvent": "OP_SPEC"
+ },
+ {
+ "ArchStdEvent": "LDREX_SPEC"
+ },
+ {
+ "ArchStdEvent": "STREX_PASS_SPEC"
+ },
+ {
+ "ArchStdEvent": "STREX_FAIL_SPEC"
+ },
+ {
+ "ArchStdEvent": "STREX_SPEC"
+ },
+ {
+ "ArchStdEvent": "LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "DP_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SPEC"
+ },
+ {
+ "ArchStdEvent": "VFP_SPEC"
+ },
+ {
+ "ArchStdEvent": "PC_WRITE_SPEC"
+ },
+ {
+ "ArchStdEvent": "CRYPTO_SPEC"
+ },
+ {
+ "ArchStdEvent": "ISB_SPEC"
+ },
+ {
+ "ArchStdEvent": "DSB_SPEC"
+ },
+ {
+ "ArchStdEvent": "DMB_SPEC"
+ },
+ {
+ "ArchStdEvent": "RC_LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "RC_ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_INST_SPEC"
+ },
+ {
+ "ArchStdEvent": "SVE_INST_SPEC"
+ },
+ {
+ "ArchStdEvent": "FP_HP_SPEC"
+ },
+ {
+ "ArchStdEvent": "FP_SP_SPEC"
+ },
+ {
+ "ArchStdEvent": "FP_DP_SPEC"
+ },
+ {
+ "ArchStdEvent": "SVE_PRED_SPEC"
+ },
+ {
+ "ArchStdEvent": "SVE_PRED_EMPTY_SPEC"
+ },
+ {
+ "ArchStdEvent": "SVE_PRED_FULL_SPEC"
+ },
+ {
+ "ArchStdEvent": "SVE_PRED_PARTIAL_SPEC"
+ },
+ {
+ "ArchStdEvent": "SVE_PRED_NOT_FULL_SPEC"
+ },
+ {
+ "ArchStdEvent": "SVE_LDFF_SPEC"
+ },
+ {
+ "ArchStdEvent": "SVE_LDFF_FAULT_SPEC"
+ },
+ {
+ "ArchStdEvent": "FP_SCALE_OPS_SPEC"
+ },
+ {
+ "ArchStdEvent": "FP_FIXED_OPS_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SVE_INT8_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SVE_INT16_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SVE_INT32_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SVE_INT64_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/memory.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/memory.json
new file mode 100644
index 000000000000..7b2b21ac150f
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/memory.json
@@ -0,0 +1,41 @@
+[
+ {
+ "ArchStdEvent": "MEM_ACCESS"
+ },
+ {
+ "ArchStdEvent": "REMOTE_ACCESS"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_WR"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_LDST_SPEC"
+ },
+ {
+ "ArchStdEvent": "LDST_ALIGN_LAT"
+ },
+ {
+ "ArchStdEvent": "LD_ALIGN_LAT"
+ },
+ {
+ "ArchStdEvent": "ST_ALIGN_LAT"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_CHECKED"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_CHECKED_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_CHECKED_WR"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/pipeline.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/pipeline.json
new file mode 100644
index 000000000000..f9fae15f7555
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/pipeline.json
@@ -0,0 +1,23 @@
+[
+ {
+ "ArchStdEvent": "STALL_FRONTEND"
+ },
+ {
+ "ArchStdEvent": "STALL_BACKEND"
+ },
+ {
+ "ArchStdEvent": "STALL"
+ },
+ {
+ "ArchStdEvent": "STALL_SLOT_BACKEND"
+ },
+ {
+ "ArchStdEvent": "STALL_SLOT_FRONTEND"
+ },
+ {
+ "ArchStdEvent": "STALL_SLOT"
+ },
+ {
+ "ArchStdEvent": "STALL_BACKEND_MEM"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/trace.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/trace.json
new file mode 100644
index 000000000000..3116135c59e2
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a710/trace.json
@@ -0,0 +1,29 @@
+[
+ {
+ "ArchStdEvent": "TRB_WRAP"
+ },
+ {
+ "ArchStdEvent": "TRCEXTOUT0"
+ },
+ {
+ "ArchStdEvent": "TRCEXTOUT1"
+ },
+ {
+ "ArchStdEvent": "TRCEXTOUT2"
+ },
+ {
+ "ArchStdEvent": "TRCEXTOUT3"
+ },
+ {
+ "ArchStdEvent": "CTI_TRIGOUT4"
+ },
+ {
+ "ArchStdEvent": "CTI_TRIGOUT5"
+ },
+ {
+ "ArchStdEvent": "CTI_TRIGOUT6"
+ },
+ {
+ "ArchStdEvent": "CTI_TRIGOUT7"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/branch.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/branch.json
new file mode 100644
index 000000000000..ece201718284
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/branch.json
@@ -0,0 +1,11 @@
+[
+ {
+ "ArchStdEvent": "BR_MIS_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_INDIRECT_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/bus.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/bus.json
new file mode 100644
index 000000000000..103bb2535775
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/bus.json
@@ -0,0 +1,23 @@
+[
+ {
+ "ArchStdEvent": "CPU_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS"
+ },
+ {
+ "ArchStdEvent": "BUS_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_SHARED"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_NOT_SHARED"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_NORMAL"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_PERIPH"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/cache.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/cache.json
new file mode 100644
index 000000000000..b9b3d3fb07b2
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/cache.json
@@ -0,0 +1,107 @@
+[
+ {
+ "ArchStdEvent": "L1I_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB_VICTIM"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB_CLEAN"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_INVAL"
+ },
+ {
+ "PublicDescription": "Number of ways read in the instruction cache - Tag RAM",
+ "EventCode": "0xC2",
+ "EventName": "I_TAG_RAM_RD",
+ "BriefDescription": "Number of ways read in the instruction cache - Tag RAM"
+ },
+ {
+ "PublicDescription": "Number of ways read in the instruction cache - Data RAM",
+ "EventCode": "0xC3",
+ "EventName": "I_DATA_RAM_RD",
+ "BriefDescription": "Number of ways read in the instruction cache - Data RAM"
+ },
+ {
+ "PublicDescription": "Number of ways read in the instruction BTAC RAM",
+ "EventCode": "0xC4",
+ "EventName": "I_BTAC_RAM_RD",
+ "BriefDescription": "Number of ways read in the instruction BTAC RAM"
+ },
+ {
+ "PublicDescription": "Level 1 PLD TLB refill",
+ "EventCode": "0xE7",
+ "EventName": "PLD_UTLB_REFILL",
+ "BriefDescription": "Level 1 PLD TLB refill"
+ },
+ {
+ "PublicDescription": "Level 1 CP15 TLB refill",
+ "EventCode": "0xE8",
+ "EventName": "CP15_UTLB_REFILL",
+ "BriefDescription": "Level 1 CP15 TLB refill"
+ },
+ {
+ "PublicDescription": "Level 1 TLB flush",
+ "EventCode": "0xE9",
+ "EventName": "UTLB_FLUSH",
+ "BriefDescription": "Level 1 TLB flush"
+ },
+ {
+ "PublicDescription": "Level 2 TLB access",
+ "EventCode": "0xEA",
+ "EventName": "TLB_ACCESS",
+ "BriefDescription": "Level 2 TLB access"
+ },
+ {
+ "PublicDescription": "Level 2 TLB miss",
+ "EventCode": "0xEB",
+ "EventName": "TLB_MISS",
+ "BriefDescription": "Level 2 TLB miss"
+ },
+ {
+ "PublicDescription": "Data cache hit in itself due to VIPT aliasing",
+ "EventCode": "0xEC",
+ "EventName": "DCACHE_SELF_HIT_VIPT",
+ "BriefDescription": "Data cache hit in itself due to VIPT aliasing"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/etm.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/etm.json
new file mode 100644
index 000000000000..fce852e82369
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/etm.json
@@ -0,0 +1,14 @@
+[
+ {
+ "PublicDescription": "ETM trace unit output 0",
+ "EventCode": "0xDE",
+ "EventName": "ETM_EXT_OUT0",
+ "BriefDescription": "ETM trace unit output 0"
+ },
+ {
+ "PublicDescription": "ETM trace unit output 1",
+ "EventCode": "0xDF",
+ "EventName": "ETM_EXT_OUT1",
+ "BriefDescription": "ETM trace unit output 1"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/exception.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/exception.json
new file mode 100644
index 000000000000..b77f1228873d
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/exception.json
@@ -0,0 +1,14 @@
+[
+ {
+ "ArchStdEvent": "EXC_TAKEN"
+ },
+ {
+ "ArchStdEvent": "EXC_HVC"
+ },
+ {
+ "PublicDescription": "Number of Traps to hypervisor",
+ "EventCode": "0xDC",
+ "EventName": "EXC_TRAP_HYP",
+ "BriefDescription": "Number of Traps to hypervisor"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/instruction.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/instruction.json
new file mode 100644
index 000000000000..91a7863ddc9a
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/instruction.json
@@ -0,0 +1,65 @@
+[
+ {
+ "ArchStdEvent": "SW_INCR"
+ },
+ {
+ "ArchStdEvent": "INST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "EXC_RETURN"
+ },
+ {
+ "ArchStdEvent": "CID_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "PC_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_IMMED_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_SPEC"
+ },
+ {
+ "ArchStdEvent": "TTBR_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "LDREX_SPEC"
+ },
+ {
+ "ArchStdEvent": "STREX_FAIL_SPEC"
+ },
+ {
+ "ArchStdEvent": "LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "LDST_SPEC"
+ },
+ {
+ "ArchStdEvent": "DP_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SPEC"
+ },
+ {
+ "ArchStdEvent": "VFP_SPEC"
+ },
+ {
+ "ArchStdEvent": "CRYPTO_SPEC"
+ },
+ {
+ "ArchStdEvent": "ISB_SPEC"
+ },
+ {
+ "ArchStdEvent": "DSB_SPEC"
+ },
+ {
+ "ArchStdEvent": "DMB_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/memory.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/memory.json
new file mode 100644
index 000000000000..34e9cab7f0b9
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/memory.json
@@ -0,0 +1,14 @@
+[
+ {
+ "ArchStdEvent": "MEM_ACCESS"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_WR"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_LDST_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/mmu.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/mmu.json
new file mode 100644
index 000000000000..b85c9cc81f23
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/mmu.json
@@ -0,0 +1,44 @@
+[
+ {
+ "PublicDescription": "Duration of a translation table walk handled by the MMU",
+ "EventCode": "0xE0",
+ "EventName": "MMU_PTW",
+ "BriefDescription": "Duration of a translation table walk handled by the MMU"
+ },
+ {
+ "PublicDescription": "Duration of a Stage 1 translation table walk handled by the MMU",
+ "EventCode": "0xE1",
+ "EventName": "MMU_PTW_ST1",
+ "BriefDescription": "Duration of a Stage 1 translation table walk handled by the MMU"
+ },
+ {
+ "PublicDescription": "Duration of a Stage 2 translation table walk handled by the MMU",
+ "EventCode": "0xE2",
+ "EventName": "MMU_PTW_ST2",
+ "BriefDescription": "Duration of a Stage 2 translation table walk handled by the MMU"
+ },
+ {
+ "PublicDescription": "Duration of a translation table walk requested by the LSU",
+ "EventCode": "0xE3",
+ "EventName": "MMU_PTW_LSU",
+ "BriefDescription": "Duration of a translation table walk requested by the LSU"
+ },
+ {
+ "PublicDescription": "Duration of a translation table walk requested by the Instruction Side",
+ "EventCode": "0xE4",
+ "EventName": "MMU_PTW_ISIDE",
+ "BriefDescription": "Duration of a translation table walk requested by the Instruction Side"
+ },
+ {
+ "PublicDescription": "Duration of a translation table walk requested by a Preload instruction or Prefetch request",
+ "EventCode": "0xE5",
+ "EventName": "MMU_PTW_PLD",
+ "BriefDescription": "Duration of a translation table walk requested by a Preload instruction or Prefetch request"
+ },
+ {
+ "PublicDescription": "Duration of a translation table walk requested by a CP15 operation (maintenance by MVA and VA to PA operations)",
+ "EventCode": "0xE6",
+ "EventName": "MMU_PTW_CP15",
+ "BriefDescription": "Duration of a translation table walk requested by a CP15 operation (maintenance by MVA and VA to PA operations)"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/pipeline.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/pipeline.json
new file mode 100644
index 000000000000..1730969e49f7
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a73/pipeline.json
@@ -0,0 +1,38 @@
+[
+ {
+ "PublicDescription": "A linefill caused an instruction side stall",
+ "EventCode": "0xC0",
+ "EventName": "LF_STALL",
+ "BriefDescription": "A linefill caused an instruction side stall"
+ },
+ {
+ "PublicDescription": "A translation table walk caused an instruction side stall",
+ "EventCode": "0xC1",
+ "EventName": "PTW_STALL",
+ "BriefDescription": "A translation table walk caused an instruction side stall"
+ },
+ {
+ "PublicDescription": "Duration for which all slots in the Load-Store Unit are busy",
+ "EventCode": "0xD3",
+ "EventName": "D_LSU_SLOT_FULL",
+ "BriefDescription": "Duration for which all slots in the Load-Store Unit are busy"
+ },
+ {
+ "PublicDescription": "Duration for which all slots in the load-store issue queue are busy",
+ "EventCode": "0xD8",
+ "EventName": "LS_IQ_FULL",
+ "BriefDescription": "Duration for which all slots in the load-store issue queue are busy"
+ },
+ {
+ "PublicDescription": "Duration for which all slots in the data processing issue queue are busy",
+ "EventCode": "0xD9",
+ "EventName": "DP_IQ_FULL",
+ "BriefDescription": "Duration for which all slots in the data processing issue queue are busy"
+ },
+ {
+ "PublicDescription": "Duration for which all slots in the Data Engine issue queue are busy",
+ "EventCode": "0xDA",
+ "EventName": "DE_IQ_FULL",
+ "BriefDescription": "Duration for which all slots in the Data Engine issue queue are busy"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/branch.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/branch.json
new file mode 100644
index 000000000000..ece201718284
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/branch.json
@@ -0,0 +1,11 @@
+[
+ {
+ "ArchStdEvent": "BR_MIS_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_PRED"
+ },
+ {
+ "ArchStdEvent": "BR_INDIRECT_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/bus.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/bus.json
new file mode 100644
index 000000000000..75d850b781ac
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/bus.json
@@ -0,0 +1,17 @@
+[
+ {
+ "ArchStdEvent": "CPU_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS"
+ },
+ {
+ "ArchStdEvent": "BUS_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_WR"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/cache.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/cache.json
new file mode 100644
index 000000000000..7efa09800a51
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/cache.json
@@ -0,0 +1,164 @@
+[
+ {
+ "ArchStdEvent": "L1I_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L1I_CACHE"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_ALLOCATE"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_ALLOCATE"
+ },
+ {
+ "ArchStdEvent": "L1D_TLB"
+ },
+ {
+ "ArchStdEvent": "L1I_TLB"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_ALLOCATE"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_REFILL"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB_REFILL"
+ },
+ {
+ "ArchStdEvent": "L2D_TLB"
+ },
+ {
+ "ArchStdEvent": "L2I_TLB"
+ },
+ {
+ "ArchStdEvent": "DTLB_WALK"
+ },
+ {
+ "ArchStdEvent": "ITLB_WALK"
+ },
+ {
+ "ArchStdEvent": "LL_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "LL_CACHE_MISS_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB_VICTIM"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_WB_CLEAN"
+ },
+ {
+ "ArchStdEvent": "L1D_CACHE_INVAL"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WR"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB_VICTIM"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_WB_CLEAN"
+ },
+ {
+ "ArchStdEvent": "L2D_CACHE_INVAL"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_RD"
+ },
+ {
+ "ArchStdEvent": "L3D_CACHE_REFILL_RD"
+ },
+ {
+ "PublicDescription": "Number of ways read in the instruction cache - Tag RAM",
+ "EventCode": "0xC2",
+ "EventName": "I_TAG_RAM_RD",
+ "BriefDescription": "Number of ways read in the instruction cache - Tag RAM"
+ },
+ {
+ "PublicDescription": "Number of ways read in the instruction cache - Data RAM",
+ "EventCode": "0xC3",
+ "EventName": "I_DATA_RAM_RD",
+ "BriefDescription": "Number of ways read in the instruction cache - Data RAM"
+ },
+ {
+ "PublicDescription": "Number of ways read in the instruction BTAC RAM",
+ "EventCode": "0xC4",
+ "EventName": "I_BTAC_RAM_RD",
+ "BriefDescription": "Number of ways read in the instruction BTAC RAM"
+ },
+ {
+ "PublicDescription": "Level 1 PLD TLB refill",
+ "EventCode": "0xE7",
+ "EventName": "L1PLD_TLB_REFILL",
+ "BriefDescription": "Level 1 PLD TLB refill"
+ },
+ {
+ "PublicDescription": "Level 2 preload and MMU prefetcher TLB access. This event only counts software and hardware prefetches at Level 2",
+ "EventCode": "0xE8",
+ "EventName": "L2PLD_TLB",
+ "BriefDescription": "Level 2 preload and MMU prefetcher TLB access. This event only counts software and hardware prefetches at Level 2"
+ },
+ {
+ "PublicDescription": "Level 1 TLB flush",
+ "EventCode": "0xE9",
+ "EventName": "UTLB_FLUSH",
+ "BriefDescription": "Level 1 TLB flush"
+ },
+ {
+ "PublicDescription": "Level 2 TLB access",
+ "EventCode": "0xEA",
+ "EventName": "TLB_ACCESS",
+ "BriefDescription": "Level 2 TLB access"
+ },
+ {
+ "PublicDescription": "Level 1 preload TLB access. This event only counts software and hardware prefetches at Level 1. This event counts all accesses to the preload data micro TLB, that is L1 prefetcher and preload instructions. This event does not take into account whether the MMU is enabled or not",
+ "EventCode": "0xEB",
+ "EventName": "L1PLD_TLB",
+ "BriefDescription": "Level 1 preload TLB access. This event only counts software and hardware prefetches at Level 1. This event counts all accesses to the preload data micro TLB, that is L1 prefetcher and preload instructions. This event does not take into account whether the MMU is enabled or not"
+ },
+ {
+ "PublicDescription": "Prefetch access to unified TLB that caused a page table walk. This event counts software and hardware prefetches",
+ "EventCode": "0xEC",
+ "EventName": "PLDTLB_WALK",
+ "BriefDescription": "Prefetch access to unified TLB that caused a page table walk. This event counts software and hardware prefetches"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/etm.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/etm.json
new file mode 100644
index 000000000000..fce852e82369
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/etm.json
@@ -0,0 +1,14 @@
+[
+ {
+ "PublicDescription": "ETM trace unit output 0",
+ "EventCode": "0xDE",
+ "EventName": "ETM_EXT_OUT0",
+ "BriefDescription": "ETM trace unit output 0"
+ },
+ {
+ "PublicDescription": "ETM trace unit output 1",
+ "EventCode": "0xDF",
+ "EventName": "ETM_EXT_OUT1",
+ "BriefDescription": "ETM trace unit output 1"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/exception.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/exception.json
new file mode 100644
index 000000000000..5b04d01de703
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/exception.json
@@ -0,0 +1,17 @@
+[
+ {
+ "ArchStdEvent": "EXC_TAKEN"
+ },
+ {
+ "ArchStdEvent": "EXC_UNDEF"
+ },
+ {
+ "ArchStdEvent": "EXC_HVC"
+ },
+ {
+ "PublicDescription": "Number of traps to hypervisor. This event counts the number of exception traps taken to EL2, excluding HVC instructions. This event is set every time that an exception is executed because of a decoded trap to the hypervisor. CCFAIL exceptions and traps caused by HVC instructions are excluded. This event is not counted when it is accessible from Non-secure EL0 or EL1",
+ "EventCode": "0xDC",
+ "EventName": "EXC_TRAP_HYP",
+ "BriefDescription": "Number of traps to hypervisor. This event counts the number of exception traps taken to EL2, excluding HVC instructions. This event is set every time that an exception is executed because of a decoded trap to the hypervisor. CCFAIL exceptions and traps caused by HVC instructions are excluded. This event is not counted when it is accessible from Non-secure EL0 or EL1"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/instruction.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/instruction.json
new file mode 100644
index 000000000000..930ce8a259f3
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/instruction.json
@@ -0,0 +1,74 @@
+[
+ {
+ "ArchStdEvent": "SW_INCR"
+ },
+ {
+ "ArchStdEvent": "INST_RETIRED"
+ },
+ {
+ "ArchStdEvent": "EXC_RETURN"
+ },
+ {
+ "ArchStdEvent": "CID_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "PC_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_IMMED_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_RETURN_RETIRED"
+ },
+ {
+ "ArchStdEvent": "INST_SPEC"
+ },
+ {
+ "ArchStdEvent": "TTBR_WRITE_RETIRED"
+ },
+ {
+ "ArchStdEvent": "BR_RETIRED"
+ },
+ {
+ "ArchStdEvent": "LDREX_SPEC"
+ },
+ {
+ "ArchStdEvent": "STREX_PASS_SPEC"
+ },
+ {
+ "ArchStdEvent": "STREX_FAIL_SPEC"
+ },
+ {
+ "ArchStdEvent": "STREX_SPEC"
+ },
+ {
+ "ArchStdEvent": "LD_SPEC"
+ },
+ {
+ "ArchStdEvent": "ST_SPEC"
+ },
+ {
+ "ArchStdEvent": "LDST_SPEC"
+ },
+ {
+ "ArchStdEvent": "DP_SPEC"
+ },
+ {
+ "ArchStdEvent": "ASE_SPEC"
+ },
+ {
+ "ArchStdEvent": "VFP_SPEC"
+ },
+ {
+ "ArchStdEvent": "CRYPTO_SPEC"
+ },
+ {
+ "ArchStdEvent": "ISB_SPEC"
+ },
+ {
+ "ArchStdEvent": "DSB_SPEC"
+ },
+ {
+ "ArchStdEvent": "DMB_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/memory.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/memory.json
new file mode 100644
index 000000000000..929fc545470f
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/memory.json
@@ -0,0 +1,17 @@
+[
+ {
+ "ArchStdEvent": "MEM_ACCESS"
+ },
+ {
+ "ArchStdEvent": "REMOTE_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "MEM_ACCESS_WR"
+ },
+ {
+ "ArchStdEvent": "UNALIGNED_LDST_SPEC"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/mmu.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/mmu.json
new file mode 100644
index 000000000000..0e63e68bc8cb
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/mmu.json
@@ -0,0 +1,44 @@
+[
+ {
+ "PublicDescription": "Duration of a translation table walk handled by the MMU",
+ "EventCode": "0xE0",
+ "EventName": "MMU_PTW",
+ "BriefDescription": "Duration of a translation table walk handled by the MMU"
+ },
+ {
+ "PublicDescription": "Duration of a Stage 1 translation table walk handled by the MMU. This event is not counted when it is accessible from Non-secure EL0 or EL1",
+ "EventCode": "0xE1",
+ "EventName": "MMU_PTW_ST1",
+ "BriefDescription": "Duration of a Stage 1 translation table walk handled by the MMU. This event is not counted when it is accessible from Non-secure EL0 or EL1"
+ },
+ {
+ "PublicDescription": "Duration of a Stage 2 translation table walk handled by the MMU. This event is not counted when it is accessible from Non-secure EL0 or EL1",
+ "EventCode": "0xE2",
+ "EventName": "MMU_PTW_ST2",
+ "BriefDescription": "Duration of a Stage 2 translation table walk handled by the MMU. This event is not counted when it is accessible from Non-secure EL0 or EL1"
+ },
+ {
+ "PublicDescription": "Duration of a translation table walk requested by the LSU",
+ "EventCode": "0xE3",
+ "EventName": "MMU_PTW_LSU",
+ "BriefDescription": "Duration of a translation table walk requested by the LSU"
+ },
+ {
+ "PublicDescription": "Duration of a translation table walk requested by the instruction side",
+ "EventCode": "0xE4",
+ "EventName": "MMU_PTW_ISIDE",
+ "BriefDescription": "Duration of a translation table walk requested by the instruction side"
+ },
+ {
+ "PublicDescription": "Duration of a translation table walk requested by a Preload instruction or Prefetch request",
+ "EventCode": "0xE5",
+ "EventName": "MMU_PTW_PLD",
+ "BriefDescription": "Duration of a translation table walk requested by a Preload instruction or Prefetch request"
+ },
+ {
+ "PublicDescription": "Duration of a translation table walk requested by an address translation operation",
+ "EventCode": "0xE6",
+ "EventName": "MMU_PTW_CP15",
+ "BriefDescription": "Duration of a translation table walk requested by an address translation operation"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/pipeline.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/pipeline.json
new file mode 100644
index 000000000000..0f8f50823cf1
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a75/pipeline.json
@@ -0,0 +1,44 @@
+[
+ {
+ "ArchStdEvent": "STALL_FRONTEND"
+ },
+ {
+ "ArchStdEvent": "STALL_BACKEND"
+ },
+ {
+ "PublicDescription": "A linefill caused an instruction side stall",
+ "EventCode": "0xC0",
+ "EventName": "LF_STALL",
+ "BriefDescription": "A linefill caused an instruction side stall"
+ },
+ {
+ "PublicDescription": "A translation table walk caused an instruction side stall",
+ "EventCode": "0xC1",
+ "EventName": "PTW_STALL",
+ "BriefDescription": "A translation table walk caused an instruction side stall"
+ },
+ {
+ "PublicDescription": "Duration for which all slots in the Load-Store Unit (LSU) are busy",
+ "EventCode": "0xD3",
+ "EventName": "D_LSU_SLOT_FULL",
+ "BriefDescription": "Duration for which all slots in the Load-Store Unit (LSU) are busy"
+ },
+ {
+ "PublicDescription": "Duration for which all slots in the load-store issue queue are busy. This event counts the cycles where all slots in the LS IQs are full with micro-operations waiting for issuing, and the dispatch stage is not empty",
+ "EventCode": "0xD8",
+ "EventName": "LS_IQ_FULL",
+ "BriefDescription": "Duration for which all slots in the load-store issue queue are busy. This event counts the cycles where all slots in the LS IQs are full with micro-operations waiting for issuing, and the dispatch stage is not empty"
+ },
+ {
+ "PublicDescription": "Duration for which all slots in the data processing issue queue are busy. This event counts the cycles where all slots in the DP0 and DP1 IQs are full with micro-operations waiting for issuing, and the despatch stage is not empty",
+ "EventCode": "0xD9",
+ "EventName": "DP_IQ_FULL",
+ "BriefDescription": "Duration for which all slots in the data processing issue queue are busy. This event counts the cycles where all slots in the DP0 and DP1 IQs are full with micro-operations waiting for issuing, and the despatch stage is not empty"
+ },
+ {
+ "PublicDescription": "Duration for which all slots in the data engine issue queue are busy. This event is set every time that the data engine rename has at least one valid instruction, excluding No Operations (NOPs), that cannot move to the issue stage because accpt_instr is LOW",
+ "EventCode": "0xDA",
+ "EventName": "DE_IQ_FULL",
+ "BriefDescription": "Duration for which all slots in the data engine issue queue are busy. This event is set every time that the data engine rename has at least one valid instruction, excluding No Operations (NOPs), that cannot move to the issue stage because accpt_instr is LOW"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/branch.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/branch.json
new file mode 100644
index 000000000000..db68de188390
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/branch.json
@@ -0,0 +1,10 @@
+[
+ {
+ "PublicDescription": "This event counts any predictable branch instruction which is mispredicted either due to dynamic misprediction or because the MMU is off and the branches are statically predicted not taken",
+ "ArchStdEvent": "BR_MIS_PRED"
+ },
+ {
+ "PublicDescription": "This event counts all predictable branches.",
+ "ArchStdEvent": "BR_PRED"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/bus.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/bus.json
new file mode 100644
index 000000000000..e0875d3a685d
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/bus.json
@@ -0,0 +1,21 @@
+[
+ {
+ "PublicDescription": "The number of core clock cycles",
+ "ArchStdEvent": "CPU_CYCLES",
+ "BriefDescription": "The number of core clock cycles."
+ },
+ {
+ "PublicDescription": "This event counts for every beat of data transferred over the data channels between the core and the SCU. If both read and write data beats are transferred on a given cycle, this event is counted twice on that cycle. This event counts the sum of BUS_ACCESS_RD and BUS_ACCESS_WR.",
+ "ArchStdEvent": "BUS_ACCESS"
+ },
+ {
+ "PublicDescription": "This event duplicates CPU_CYCLES.",
+ "ArchStdEvent": "BUS_CYCLES"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_RD"
+ },
+ {
+ "ArchStdEvent": "BUS_ACCESS_WR"
+ }
+]
diff --git a/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/cache.json b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/cache.json
new file mode 100644
index 000000000000..fc448c2d5ea4
--- /dev/null
+++ b/lib/libpmc/pmu-events/arch/arm64/arm/cortex-a76-n1/cache.json
@@ -0,0 +1,169 @@
+[
+ {
+ "PublicDescription": "This event counts any instruction fetch which misses in the cache.",
+ "ArchStdEvent": "L1I_CACHE_REFILL"
+ },
+ {
+ "PublicDescription": "This event counts any refill of the instruction L1 TLB from the L2 TLB. This includes refills that result in a translation fault.",
+ "ArchStdEvent": "L1I_TLB_REFILL"
+ },
+ {
+ "PublicDescription": "This event counts any load or store operation or page table walk access which causes data to be read from outside the L1, including accesses which do not allocate into L1.",
+ "ArchStdEvent": "L1D_CACHE_REFILL"
+ },
+ {
+ "PublicDescription": "This event counts any load or store operation or page table walk access which looks up in the L1 data cache. In particular, any access which could count the L1D_CACHE_REFILL event causes this event to count.",
+ "ArchStdEvent": "L1D_CACHE"
+ },
+ {
+ "PublicDescription": "This event counts any refill of the data L1 TLB from the L2 TLB. This includes refills that result in a translation fault.",
+ "ArchStdEvent": "L1D_TLB_REFILL"
+ },
+ {
+ "PublicDescription": "Level 1 instruction cache access or Level 0 Macro-op cache access. This event counts any instruction fetch which accesses the L1 instruction cache or L0 Macro-op cache.",
+ "ArchStdEvent": "L1I_CACHE"
+ },
+ {
+ "PublicDescription": "This event counts any write-back of data from the L1 data cache to L2 or L3. This counts both victim line evictions and snoops, including cache maintenance operations.",
+ "ArchStdEvent": "L1D_CACHE_WB"
+ },
+ {
+ "PublicDescription": "This event counts any transaction from L1 which looks up in the L2 cache, and any write-back from the L1 to the L2. Snoops from outside the core and cache maintenance operations are not counted.",
+ "ArchStdEvent": "L2D_CACHE"
+ },
+ {
+ "PublicDescription": "L2 data cache refill. This event counts any cacheable transaction from L1 which causes data to be read from outside the core. L2 refills caused by stashes into L2 should not be counted",
+ "ArchStdEvent": "L2D_CACHE_REFILL"
+ },
+ {
+ "PublicDescription": "This event counts any write-back of data from the L2 cache to outside the core. This includes snoops to the L2 which return data, regardless of whether they cause an invalidation. Invalidations from the L2 which do not write data outside of the core and snoops which return data from the L1 are not counted",
+ "ArchStdEvent": "L2D_CACHE_WB"
+ },
+ {
+ "PublicDescription": "This event counts any full cache line write into the L2 cache which does not cause a linefill, including write-backs from L1 to L2 and full-line writes which do not allocate into L1.",
+ "ArchStdEvent": "L2D_CACHE_ALLOCATE"
+ },
+ {
+ "PublicDescription": "This event counts any load or store operation which accesses the data L1 TLB. If both a load and a store are executed on a cycle, this event counts twice. This event counts regardless of whether the MMU is enabled.",
+ "ArchStdEvent": "L1D_TLB",
+ "BriefDescription": "Level 1 data TLB access."
+ },
+ {
+ "PublicDescription": "This event counts any instruction fetch which accesses the instruction L1 TLB.This event counts regardless of whether the MMU is enabled.",
+ "ArchStdEvent": "L1I_TLB",
+ "BriefDescription": "Level 1 instruction TLB access"
+ },
+ {
+ "PublicDescription": "This event counts any full cache line write into the L3 cache which does not cause a linefill, including write-backs from L2 to L3 and full-line writes which do not allocate into L2",
+ "ArchStdEvent": "L3D_CACHE_ALLOCATE"