Commit Graph

279495 Commits

Author SHA1 Message Date
skrll
0386a306a4 Trailing whitespace 2020-08-13 07:14:04 +00:00
rillig
d07abf40f3 make(1): convert Buf_AddByte to inline function
This lets the compiler decide whether to actually inline the code (which
it does).  It also provides better type safety and avoids a few
underscores and parentheses in the code.
2020-08-13 04:25:09 +00:00
rillig
5ad3310e3a make(1): remove type alias Byte = char
This alias was only actually used in very few places, and changing it to
unsigned char or any other type would not be possible without generating
lots of compile-time errors.  Therefore there was no abstraction, only
unnecessary complexity.
2020-08-13 04:12:13 +00:00
rillig
fb8f93f536 make(1): follow naming conventions for multiple-inclusion guards
This avoids undefined behavior.
2020-08-13 03:54:57 +00:00
rillig
d4d42bc70a make(1): clean up debug logging in dir.c
In C90, the variadic macro argument __VA_ARGS__ is not known, therefore
fall back to the forms listing the number of actual printf arguments.
2020-08-13 03:33:56 +00:00
rillig
4ff1f1ac37 make(1): avoid negated conditions in DirExpandCurly 2020-08-13 03:07:49 +00:00
rillig
ef9eb65a77 make(1): clean up DirExpandCurly
Now that nested curly braces work as expected and are covered by unit
tests, the debug log is no longer necessary.
2020-08-13 03:00:44 +00:00
rillig
022d5c4ff0 make(1): use enum instead of #define for cached_stats 2020-08-13 02:53:15 +00:00
mrg
802242f985 set _OUTDIRBASE depending on $0, and then set _OUTDIR based on this.
now you can copy mknative-gcc to mknative-gcc.old without edit.
2020-08-13 01:52:37 +00:00
christos
267b66ed56 - document -d
- add -r (reverse)
- const, size_t, emalloc, EXIT_FOO
2020-08-12 23:23:04 +00:00
rillig
6616932c4a make(1): remove unnecessary UNCONST from arch.c
Somewhere in the refactorings of the last month, the parameter types of
the Arch functions had their constness fixed, therefore the UNCONST is
no longer necessary.
2020-08-12 19:36:14 +00:00
rillig
5a58c0c483 make(1): enable -Wcast-qual for var.c again
When it became disabled 9 years ago, there were 15 instances of UNCONST
in the code.  These have been removed in the latest cleanup sessions.

Tested with GCC 5 from NetBSD 8 and GCC 10 from pkgsrc.
2020-08-12 19:21:05 +00:00
rillig
872a77026d make(1): prepare var.c for WARNS=6
I'm unhappy with the (unsigned) casts for the enum constants, but there
is no way around that since the base type of enums is int by definition,
and there is no way in C90 to explicitly specify the base type of an
enum type.

The (size_t) casts on the pointer differences are another pain point,
but for these as well, C90 does not have a ready-made solution.  A
possible workaround would be an inline function ptr_diff that returns
size_t instead of ptrdiff_t, but that would make the code look even more
bloated than with the casts.

The remaining casts to (char), (int) and (time_t) look so suspicious
that it's easy enough to stumble upon them, as soon as someone finds the
time to fix these properly by adding a function ParseInt or
ParseSeconds.
2020-08-12 19:14:38 +00:00
rillig
eab1dadca4 make(1): replace redundant NULL tests with assertions 2020-08-12 18:53:59 +00:00
rillig
6910f1eeb2 make(1): allow optional compilation with GCC 10, use gcov from GCC 2020-08-12 18:48:36 +00:00
rillig
ee1eefc8ec make(1): remove unnecessary test from bmake_strndup
The passed memory is never NULL.
2020-08-12 18:47:21 +00:00
skrll
243e94f8fd Whack-a-mole 2020-08-12 18:30:46 +00:00
skrll
0a3d29f4ed Part IV of ad's performance improvements for aarch64
- Implement pmap_growkernel(), and update kernel pmap's stats with atomics.

- Then, pmap_kenter_pa() and pmap_kremove() no longer need to allocate
  memory nor take pm_lock, because they only modify L3 PTEs.

- Then, pm_lock and pp_lock can be adaptive mutexes at IPL_NONE which are
  cheaper than spin mutexes.

- Take the pmap's lock in pmap_extract() if not the kernel's pmap, otherwise
  pmap_extract() might see inconsistent state.
2020-08-12 13:36:36 +00:00
skrll
739b4cc834 Part III of ad's performance improvements for aarch64
- Assembly language stubs for mutex_enter() and mutex_exit().
2020-08-12 13:28:46 +00:00
skrll
9f2441fc32 Part II of ad's aarch64 performance improvements (cpu_switch.S bugs are
all mine)

- Use tpidr_el1 to hold curlwp and not curcpu, because curlwp is accessed
  much more often by MI code.  It also makes curlwp preemption safe and
  allows aarch64_curlwp() to be a const function (curcpu must be volatile).

- Make ASTs operate per-LWP rather than per-CPU, otherwise sometimes LWPs
  can see spurious ASTs (which doesn't cause a problem, it just means some
  time may be wasted).

- Use plain stores to set/clear ASTs.  Make sure ASTs are always set on the
  same CPU as the target LWP, and delivered via IPI if posted from a remote
  CPU so that they are resolved quickly.

- Add some cache line padding to struct cpu_info, to match x86.

- Add a memory barrier in a couple of places where ci_curlwp is set.  This
  is needed whenever an LWP that is resuming on the CPU could hold an
  adaptive mutex.  The barrier needs to drain the CPU's store buffer, so
  that the update to ci_curlwp becomes globally visible before the LWP can
  resume and call mutex_exit().  By my reading of the ARM docs it looks like
  the instruction I used will do the right thing, but I'm not 100% sure.
2020-08-12 13:19:35 +00:00
skrll
e16659bb50 Part I of ad@'s performance improvements for aarch64
- Remove memory barriers from the atomic ops.  I don't understand why those
  are there.  Is it some architectural thing, or for a CPU bug, or just
  over-caution maybe?  They're not needed for correctness.

- Have unlikely conditional branches go forwards to help the static branch
  predictor.
2020-08-12 12:59:57 +00:00
jmcneill
54695ccbd8 Add CEC clock 2020-08-12 10:21:00 +00:00
msaitoh
38bc295884 Fix checking return value of atomic_cas_uint().
This change fixes a bug that extra delay() is called only once even if
atomic_cas_uint() isn't failed or delay() isn't called when atomic_cas_uint()
failed.

The reason of this bug was that I simply converted FreeBSD' atomic_cmpset_int()
to atomic_cas_uint(). The return value's semantics is different.
2020-08-12 09:13:46 +00:00
skrll
97e085086c No need for MIPS_EBASE_CPUNUM now that asm.h supports __BITS 2020-08-12 08:57:03 +00:00
skrll
a294f34ae4 Provide assmebler versions of BITS(3) macros. These are only good for
32 bit masks
2020-08-12 08:56:37 +00:00
mrg
5e4a6425f4 mknative-gcc is for GCC 8.4.
mknative-gcc.old is supposed to be for GCC 7, but is the GCC 6
version.  update it and mark it for GCC 7.5.
2020-08-12 08:53:20 +00:00
skrll
9b5aba56ba Don't include mips/asm.h from a C file 2020-08-12 07:37:39 +00:00
mrg
2d54d631d9 20200811:
GCC updates may require cleaning the objdir.
2020-08-12 06:48:50 +00:00
mrg
f3b893878b delete this file; it needs to be newer than the .l file or
else sys.mk will attempt to write it to the source tree,
which may be r/o and fail.

XXX may cause updates builds to fail because a file listed
in .depend won't exist anymore.
2020-08-12 06:42:53 +00:00
rillig
0fc5d0f74a make(1): in bmake_strndup, only scan the relevant part of the string
Just in case the given str is not really a string.

The POSIX 2018 documentation on strndup does not specify as clearly as
possible whether s has to be a string or whether raw memory is
acceptable as well.  It only indirectly calls the s parameter of strndup
a string.
2020-08-12 03:27:29 +00:00
rillig
6abaf3bbe5 make(1): make Dir_MakeFlags simpler
This avoids unnecessary string allocations, especially for long lists.

There is no unit test to cover this code.  Since this is an obscure,
undocumented part of make, I wasn't able to come up with a unit test.
Therefore I resorted to write a separate testing program to verify the
expected results.

$ cat <<'EOF' >dir_test.c
#include <stdio.h>

#include "make.h"
#include "dir.h"

int main(int argc, char **argv)
{
    int i;
    Lst lst;
    char *flags;

    lst = Lst_Init(FALSE);
    for (i = 1; i < argc; i++)
    	Dir_AddDir(lst, argv[i]);
    flags = Dir_MakeFlags("-I", lst);

    printf("%s\n", flags);
    free(flags);
    return 0;
}
EOF

# Needs some trivial patches to Makefile and main.c
$ make PROG=dir_test EXTRA_SRCS=dir_test.c EXTRA_CPPFLAGS=-DNO_MAIN \
       COPTS.main.c=-Wno-unused-function NOMAN=1

$ ./dir_test a b c

$ mkdir a b c
$ ./dir_test a b c
 -Ia -Ib -Ic
$ rmdir a b c
2020-08-12 03:05:57 +00:00
skrll
28c2c643ec Improve a comment 2020-08-11 19:46:56 +00:00
rillig
f271e31bca make(1): replace snprintf/malloc in ReadMakefile with str_concat3 2020-08-11 18:52:03 +00:00
rillig
431c892530 make(1): convert Suff.flags from #define to enum
This increases debugging support since the debugger can now display
symbolic names instead of an integer bit mask.
2020-08-11 18:44:52 +00:00
rillig
499d5689cb make(1): add str_concat4 to make the other code simpler
There's no need for arch.c to call strlen when there is a high-level API
for the same purpose.
2020-08-11 18:41:46 +00:00
maxv
57f445a8f5 Micro-optimize: use pushq instead of pushw. To avoid LCP stalls and
unaligned stack accesses.
2020-08-11 15:48:42 +00:00
maxv
cccc70bfe0 sync 2020-08-11 15:35:17 +00:00
maxv
6ba5a95520 Improve the CPUID emulation on nvmm-intel:
- Limit the highest extended leaf.
 - Limit 0x00000007 to ECX=0, for future-proofness.
2020-08-11 15:31:51 +00:00
maxv
cdb3ed2a3d Improve emulation of MSR_IA32_ARCH_CAPABILITIES: publish only the *_NO
bits. Initially they were the only ones there, but Intel then added other
bits we aren't interested in, and they must be filtered out.
2020-08-11 15:27:46 +00:00
maxv
f4588bfb74 Hide OSPKE. NFC since the host never uses PKU, but still. 2020-08-11 15:23:10 +00:00
christos
c9979bce58 new openldap.h 2020-08-11 13:19:15 +00:00
christos
ad41e17ca5 new openldap 2020-08-11 13:18:04 +00:00
christos
956cbeb4ba merge conflicts 2020-08-11 13:15:33 +00:00
christos
255afcfe79 OpenLDAP 2.4.50 Release (2020/04/28)
Fixed client benign typos (ITS#8890)
    Fixed libldap type cast (ITS#9175)
    Fixed libldap retry loop in ldap_int_tls_connect (ITS#8650)
    Fixed libldap_r race on Windows mutex initialization (ITS#9181)
    Fixed liblunicode memory leak (ITS#9198)
    Fixed slapd benign typos (ITS#8890)
    Fixed slapd to limit depth of nested filters (ITS#9202)
    Fixed slapd-mdb memory leak in dnSuperiorMatch (ITS#9214)
    Fixed slapo-pcache database initialization (ITS#9182)
    Fixed slapo-ppolicy callback (ITS#9171)
    Build
	Fix olcDatabaseDummy initialization for windows (ITS#7074)
	Fix detection for ws2tcpip.h for windows (ITS#8383)
	Fix back-mdb types for windows (ITS#7878)
    Contrib
	Update ldapc++ config.guess and config.sub to support newer
	    architectures (ITS#7855)
	Added pw-argon2 module (ITS#9233, ITS#8575, ITS#9203, ITS#9206)
    Documentation
	slapd-ldap(5) - Clarify idassert-authzfrom behavior (ITS#9003)
	slapd-meta(5) - Remove client-pr option (ITS#8683)
	slapdinex(8) - Fix truncate option information for back-mdb (ITS#9230)

OpenLDAP 2.4.49 Release (2020/01/30)
    Added slapd-monitor database entry count for slapd-mdb (ITS#9154)
    Fixed client tools to not add controls on cancel/abandon (ITS#9145)
    Fixed client tools SyncInfo message to be LDIF compliant (ITS#8116)
    Fixed libldap to correctly free sb (ITS#9081, ITS#8755)
    Fixed libldap descriptor leak if ldaps fails (ITS#9147)
    Fixed libldap remove unnecessary global mutex for GnuTLS (ITS#9069)
    Fixed slapd syntax evaluation of preferredDeliveryMethod (ITS#9067)
    Fixed slapd to relax domainScope control check (ITS#9100)
    Fixed slapd to have cleaner error handling during connection setup
	 (ITS#9112)
    Fixed slapd data check when processing cancel exop (ITS#9124)
    Fixed slapd attribute description processing (ITS#9128)
    Fixed slapd-ldap to set oldctrls correctly (ITS#9076)
    Fixed slapd-mdb to honor unchecked limit with alias deref (ITS#7657)
    Fixed slapd-mdb missing final commit with slapindex (ITS#9095)
    Fixed slapd-mdb drop attr mappings added in an aborted txn (ITS#9091)
    Fixed slapd-mdb nosync FLAG configuration handling (ITS#9150)
    Fixed slapd-monitor global operation counter reporting (ITS#9119)
    Fixed slapo-ppolicy when used with slapauth (ITS#8629)
    Fixed slapo-ppolicy to add a missed normalised copy of pwdChangedTime
	(ITS#9126)
    Fixed slapo-syncprov fix sessionlog init (ITS#9146)
    Fixed slapo-unique loop termination (ITS#9077)
    Build Environment
	Fix mkdep to honor TMPDIR if set (ITS#9062)
	Remove ICU library detection (ITS#9144)
	Update config.guess and config.sub to support newer architectures
	    (ITS#7855)
	Disable ITS8521 regression test as it is no longer valid (ITS#9015)
    Documentation
	admin24 - Fix inconsistent whitespace in replication section (ITS#9153)
	slapd-config(5)/slapd.conf(5) - Fix missing bold tag for keyword
	    (ITS#9063)
	slapd-ldap(5) - Document "tls none" option (ITS#9071)
	slapo-ppolicy(5) - Correctly document pwdGraceAuthnLimit (ITS#9065)
2020-08-11 13:12:00 +00:00
uwe
7dbbb5b019 DEV_VERBOSE_DEFINE - use MODULE_CLASS_DRIVER to match the definition.
Catch up with previous to unbreak autoloading of verbose modules.
PR kern/55535

CVS: ----------------------------------------------------------------------
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?
2020-08-11 12:10:10 +00:00
mrg
1956332deb update GCC 7 version to nb4 20200810, and fix the unknown GCC version
error assignment from "=?" to "?=" so it works as designed.
2020-08-11 09:51:57 +00:00
mrg
a05ac97e64 merge GCC 7.5.0 into gcc.old. .. just in time to be obsolete? :) 2020-08-11 08:45:54 +00:00
skrll
46de5abef9 s/pmaphist/maphist/ 2020-08-11 07:03:33 +00:00
skrll
221a897233 s/pmaphist/maphist/ for now 2020-08-11 06:54:14 +00:00
skrll
a9bc40de8f More UVMHIST_LOG. Remove some commented output printfs. 2020-08-11 06:09:44 +00:00