MirBSD/cvs 1006224src/kern/c Makefile.inc, src/kern/c/i386 strchr.S ffs.S

   whitespace and minor nitpicks
VersionDeltaFile
1.2+2-2src/kern/c/i386/strchr.S
1.42+2-2src/kern/c/Makefile.inc
1.11+2-1src/kern/include/mbsdint.h
1.3+1-1src/kern/c/i386/ffs.S
+7-64 files

MirBSD/cvs 1006224src/kern/include mbsdint.h

   • review use of k32/K32
     ‣ the type is guaranteed to be of at least unsigned int rank
       so it will not default-promote to a signed type
     ‣ append U suffix to arith other-arguments
     ‣ use mbiMKror ipv old BAFHror (now gone)
     ‣ review uses of K32 macro (truncating cast to k32=u_int)
       vs. cast (to u_int) or mask
   • (while here) streamline BAFHFinish macro structure
   • introduce K32_HM and K32_FM and use in KUA_HM/KUA_FM for !lksh
     and stop adding casts to the mask definitions, mbi macros do that anyway
   • space before tab, that is crap
   • optimise build time: run mbi ctasserts only for some compiles
   • but do check it explicitly in Build.sh, abort early if failing
   • Build.sh: fix wording; check idstring in “final link succeeds?” as well
   • mbsdint.h: fix masked rotation macros: take mask bitwidth, not type’s
VersionDeltaFile
1.10+5-7src/kern/include/mbsdint.h
+5-71 files

MirBSD/cvs 1006222src/kern/include mbsdint.h

   if uintptr_t is present (intptr_t is useless), check it as well

   just like ptrdiff_t (and ssize_t), we check mutual same-sizedness with
   size_t, to provide for code using a really common Unix standard assumption
   including for portability to C89 which doesn’t have this type
VersionDeltaFile
1.9+13-0src/kern/include/mbsdint.h
+13-01 files

MirBSD/cvs 1006220src/kern/c mirtime.c, src/kern/include mbsdint.h

   another mbsdint.h overhaul making things even less readable and more safer
   • more casts
   • write all unsigned constants with a trailing U (macros’ users, too)
   • more checks, even some more things that C guarantees
     ‣ this ensures that char has at least eight bits as a side effect
       though the rest of this should be fine with 7
   • add 0UL to all unsigned arithmetic operands so ut==u_char no longer
     promotes to int (0U might have been enough plus this is inconsistent
     but we cannot just write 0ULL either, let’s just hope compilers DTRT)
   • some signed definitions for symmetry (that mostly just cast, but for
     arith ops also add 0, to ensure not being abused as lvalue with += etc.)
   • very lengthy and too verbose rewrite of the other macros using these
     new arithmetic ops primitives… I’m shy of making something generate these
   • restructuring of comments and macro ordering, hopefully makes more sense
   • rename existing mbiCASadd, mbiCASsub, mbiCASmul to mbiCAP* where the
     right-hand operand is positive or 0
   • fix overflow checks in mbiCAUmul and mbiCAPmul
   • readd mbiCAS{add,sub,mul} with more contrived checks to allow negatives
   • redo rotate and shift to read more easily (and new arith ops ofc)

    [8 lines not shown]
VersionDeltaFile
1.8+323-124src/kern/include/mbsdint.h
1.15+13-13src/kern/c/mirtime.c
+336-1372 files

MirBSD/cvs 1006219src/kern/include mbsdint.h

   reword this masking *again*

   (I’m also pretty sure this adds *another* necessary cast… gah!)
VersionDeltaFile
1.7+2-2src/kern/include/mbsdint.h
+2-21 files

MirBSD/cvs 1006219src/kern/include mbsdint.h

   • implement divrem for unsigned variable manual 2’s complement values
     and use that in mksh’s nōn-lksh arithmetics
   • implement comparison operaters (and use it), so we get that much closer
     to the necessary goal of signed-less (except lksh temporarily) operation
   • shorten the macro names and make sure all have a masking pendant and
     all masker do that for input as well
   • overhaul rotation/shift to get expressions, not statement blocks, expanded
   • mksh: deprecate kul (before it’s really used much) and ksl (will be used
     by lksh only, and only in as little arith code as possible, everything
     else can and will be done in unsigned, also for one’s complement and
     sign-and-magnitude safety), we shall only have an unsigned arithmetic
     type, which will be ulong at first but may later be uint if exactly
     32 bits, for mksh nōn-lksh only, for simplicity (rid of masking)
   • recheck and improve masking
   • split VZU2U off VZM2U; the former takes a fullmask unsigned type on
     input, the latter applies halfmask to magnitude value, for consistency
     and reusability (mbiMA_VZM2U pretty much stays the same, mbiA_VZM2U
     is renamed mbiA_VZU2U and mbiA_VZM2U is added and mbiMA_VZU2U can now
     just mbiMM-wrap mbiA_VZU2U)

    [7 lines not shown]
VersionDeltaFile
1.6+75-53src/kern/include/mbsdint.h
+75-531 files

MirBSD/cvs 1006216src/kern/include mbsdint.h

   mbiCAUmul needs (ut) cast for intermediate values, too
VersionDeltaFile
1.5+3-3src/kern/include/mbsdint.h
+3-31 files

MirBSD/cvs 1006216src/kern/c mirtime.c

   forgotten to finish conversion to <syskern/mbsdint.h>
VersionDeltaFile
1.14+23-77src/kern/c/mirtime.c
+23-771 files

MirBSD/cvs 1006216src/kern/include mbsdint.h

   • safer ways to check lim_MIN
   • sign-and-magnitude and one’s-complement warning comments when appropriate
     ‣ add VZM2U/U2VZ/U2M which are safe if using o̲n̲l̲y̲ unsigned variables
     ‣ note mbiVASdivrem isn’t (we’d need mbiVAUdivrem, which can only now be
       constructed from VZM2U/U2VZ/U2M)
   • don’t inline S2VZ/U2VZ into the other macros, keeps structure better
   • explicitly cast SM/HM/FM into (ut) where necessary (or (st), but we
     only ever mask unsigned (as it should be))
   • fix mbiMA_S2M to cast to unsigned before masking (ouch! we need to cast
     after basically all ops as integer promotions could kick in otherwise!)
   • note that SM (semantically, say SHRT_MAX) == HM (USHRT_MAX >> 1)
     (which CTAs check, btw)
   • cast between ops for mbiVAU{sh,ro}{l,r} (as necessary and perhaps one
     too much, but never not enough!)
VersionDeltaFile
1.4+42-23src/kern/include/mbsdint.h
+42-231 files

MirBSD/cvs 1006211src/kern/include mbsdint.h

   https://twitter.com/thingskatedid/status/1293779581074202624 is scary
VersionDeltaFile
1.3+2-1src/kern/include/mbsdint.h
+2-11 files

MirBSD/cvs 1006211src/share/man/man9 style.9

   • rename bool/true/false/tobool to Wahr/Ja/Nee/isWahr¹
     cf. <Pine.BSM.4.64L.2202191951440.13654 at herc.mirbsd.org> on both
     miros-discuss@ and miros-mksh@ for the backgrounds (tl;dr: ISO C… again)
   • give matching advice in style(9)
   • remove useless (void) casts, as style(9) says (nōn-useless ones are
     spelt SHIKATANAI these days anyway)
   • drop MKSH_A_PURE; I’m not sure I knœw where it applies, plus there’s
     a __const__ attribute, too, one invites that the other is also applied
   • correct an ord() MKC_DEBG=cpp assert

   ① C99 reserves 'is'+lowercase-letter, even if <ctype.h> is not included…
VersionDeltaFile
1.38+11-0src/share/man/man9/style.9
+11-01 files

MirBSD/cvs 100620Esrc/sbin/sysctl sysctl.c, src/usr.bin/ftp main.c

   restrict @(#) in source to __SCCSID macro, what(1) -s shows the first only

   also some __COPYRIGHT shuffling, while here
VersionDeltaFile
1.6+4-6src/usr.bin/who/who.c
1.5+4-6src/usr.bin/uuencode/uuencode.c
1.7+4-6src/usr.bin/uudecode/uudecode.c
1.8+4-4src/sbin/sysctl/sysctl.c
1.8+4-4src/usr.sbin/config/main.c
1.12+4-4src/usr.bin/ftp/main.c
+24-3048 files not shown
+172-18054 files

MirBSD/cvs 10061F7src/lib/libc/time localtime.c

   validate the leap seconds received from the TZif file
VersionDeltaFile
1.22+44-10src/lib/libc/time/localtime.c
+44-101 files

MirBSD/cvs 10061F7src/sys/sys syslog.h, src/usr.sbin/syslogd syslogd.c privsep.c

   constify (and __CRAZY-clean while here)
VersionDeltaFile
1.2+290-167src/usr.sbin/syslogd/syslogd.c
1.2+83-58src/usr.sbin/syslogd/privsep.c
1.4+13-15src/usr.sbin/syslogd/ttymsg.c
1.2+16-3src/usr.sbin/syslogd/ringbuf.c
1.2+9-4src/usr.sbin/syslogd/syslogd.h
1.4+5-6src/sys/sys/syslog.h
+416-2536 files

MirBSD/cvs 10061F3src/kern/include mbsdint.h

   cannot use mbiTYPE_ISF in a CTA, but introduce mbiCTA_TYPE_NOTF:
   we *can* CTA that a type isn’t floating point (by adding a test
   that either uses the -1 array size as in CTA(!ISF) or fails to
   compile (like ISF e.g. in newer GCCs)); use that instead, it’ll
   be sufficient, for this anyway
VersionDeltaFile
1.2+8-4src/kern/include/mbsdint.h
+8-41 files

MirBSD/cvs 10061F2contrib/hosted/tg/code/xchat-randex main.c, src/kern/c arc4random_roundhash.c

   switch all remaining instances to latest BAFH1-0

   BAFH0-1 now is therefore gone
VersionDeltaFile
1.20+20-58contrib/hosted/tg/code/xchat-randex/main.c
1.21+21-18src/sys/arch/i386/i386/locore.s
1.16+12-7src/sys/crypto/randcore.c
1.17+7-7src/lib/libc/crypt/arc4random_base.c
1.11+4-4src/kern/c/arc4random_roundhash.c
+64-945 files

MirBSD/cvs 10061F2src/kern/include mirhash.h

   • rename the _reg versions to suffixless now _mem are gone
   • sync the two implementations again, mirhash.h is now always BAFH1-0,
     no longer BAFH0-1
VersionDeltaFile
1.14+38-85src/kern/include/mirhash.h
+38-851 files

MirBSD/cvs 10061F2src/kern/c mirtime.c, src/kern/include mbsdint.h Makefile

   add new <syskern/mbsdint.h>, symlinked to mksh/mbsdint.h

   this draws out all of the recent work in both mksh and mirtime for UB-free
   number arithmetics: type and limit and bitmask checks (extending to 279 bits)
   and compile-time assertions for many types; checking arithmetics, completed;
   manual-twos-complement arithmetics both full-width and (new!) masking;
   mbiHUGE_* to offer whatever integer is widest; etc.

   changes nothing for mirtime, but mksh gets to advance the old→new arithmetics
   move (shift/rotate and divrem already, mostly, done)
VersionDeltaFile
1.1+378-0src/kern/include/mbsdint.h
1.12+36-41src/kern/c/mirtime.c
1.8+1-1src/kern/include/Makefile
+415-423 files

MirBSD/cvs 10061F2src/share/doc/legal LICENCE-CC0 1stREAD

   add system-wide copy of CC0 and document its applicable sections
VersionDeltaFile
1.1+121-0src/share/doc/legal/LICENCE-CC0
1.11+8-1src/share/doc/legal/1stREAD
1.11+1-1src/share/doc/legal/Makefile
+130-23 files

MirBSD/cvs 10061EFcontrib/hosted/tg/historic assotest

   switch to period for keep-trailing-newlines-in-comsub tmp char

   cf. <Pine.BSM.4.64L.2201250615030.33 at herc.mirbsd.org> on klibc at zytor.com
VersionDeltaFile
1.5+1-1contrib/hosted/tg/historic/assotest
+1-11 files

MirBSD/cvs 10061EFsrc/sys/arch/sparc/conf RAMDISK FLOPPY

   sync
VersionDeltaFile
1.22+17-16src/sys/arch/sparc/conf/RAMDISK
1.17+14-13src/sys/arch/sparc/conf/FLOPPY
+31-292 files

MirBSD/cvs 10061EFsrc/sys/arch/sparc/conf GENERIC, src/sys/arch/sparc/sparc cpu.c

   • cpu.c: add comments about SPARC versions supported by the implementations
     on these IU chips (hope I’ve got all right)
   • conf/GENERIC: disable sun4c as well as (already had) sun4, they all come
     with v7 CPUs
   • while here, disable Sun 4/100-only SCSI controller, enable com(4) on PCMCIA
   • disable sun4c-specific devices
VersionDeltaFile
1.32+17-16src/sys/arch/sparc/conf/GENERIC
1.6+15-10src/sys/arch/sparc/sparc/cpu.c
+32-262 files

MirBSD/cvs 10061EFsrc/kern/c Makefile.inc, src/kern/c/sparc Makefile.inc

   exclude .{,u}{mul,div,rem} and their v8 fixup if building for v8 anyway:
   GCC should not generate calls to them (tested), if it does fix your CFLAGS
   ⇒ no need to carry around even the fixed v8 versions at all…
VersionDeltaFile
1.5+19-10src/sys/arch/sparc/sparc/cpu.c
1.2+7-6src/libexec/ld.so/sparc/archdep.h
1.11+4-0src/libexec/ld.so/loader.c
1.19+4-0src/kern/c/sparc/Makefile.inc
1.41+4-0src/kern/c/Makefile.inc
1.7+3-0src/libexec/ld.so/sparc/rtld_machine.c
+41-162 files not shown
+43-178 files

MirBSD/cvs 10061EFgcc/gcc/config/i386 mirbsd.h, gcc/gcc/config/sparc mirbsd.h sparc.h

   • ensure sparc mgcc passes -Av8 if building with -mcpu=v8
     (gas currently defaults to sparclite due to a bug in older porting)
   • rearrange one .h block (cosmetic/diffy)
   • delete deprecated sparc -mv8/… (use -mcpu=v8/…) which should have
     been deleted in GCC 2.9, according to the comments… (this makes
     the spec much easier, plus it’s more reliable)
VersionDeltaFile
1.7+17-5gcc/gcc/config/sparc/mirbsd.h
1.11+5-5gcc/gcc/config/i386/mirbsd.h
1.4+2-0gcc/gcc/config/sparc/sparc.h
+24-103 files

MirBSD/cvs 10061EFsrc/etc/etc.sparc make.cfg.md

   add _SPARCV7COMPAT (default no, set to yes if changing default CFLAGS)

   this will be used to exclude v7-only SRCS on make level;
   use __sparc_v8__ on cpp level (.c, .S; nothing for .s?)
VersionDeltaFile
1.8+1-0src/etc/etc.sparc/make.cfg.md
+1-01 files

MirBSD/cvs 10061EEsrc/libexec/ld.so ssp.c Makefile, src/libexec/ld.so/i386 rtld_machine.c

   retire the _dl_strsep hack, too; constify some data
VersionDeltaFile
1.6+3-3src/libexec/ld.so/sparc/rtld_machine.c
1.7+3-3src/libexec/ld.so/i386/rtld_machine.c
1.5+2-2src/libexec/ld.so/ssp.c
1.15+2-2src/libexec/ld.so/Makefile
1.3+2-2src/libexec/ld.so/dl_prebind.c
1.10+2-2src/libexec/ld.so/loader.c
+14-146 files

MirBSD/cvs 10061EEsrc/libexec/ld.so Makefile

   properly hide the symbols made local by the version script
VersionDeltaFile
1.14+2-2src/libexec/ld.so/Makefile
+2-21 files

MirBSD/cvs 10061EEsrc/kern/c/sparc v8muldivrem.S divrem.m4, src/libexec/ld.so/sparc ldasm.S

   • factor out _{,u}{mul,div,rem}replace from kernel and ld.so (identical)
     to kern/c/sparc/ as v8muldivrem.S (KkSRCS)
   • add v8muldivrem.S to libmdsup (for ld.so)
   • remove mul and umul from sparc locore.s as identicals are in ckern
   • harmonise .{,u}{mul,div,rem} entry point handling
VersionDeltaFile
1.16+0-387src/sys/arch/sparc/sparc/locore.s
1.3+40-102src/libexec/ld.so/sparc/ldasm.S
1.1+88-0src/kern/c/sparc/v8muldivrem.S
1.3+7-10src/kern/c/sparc/divrem.m4
1.2+7-5src/kern/c/sparc/mul.S
1.2+7-5src/kern/c/sparc/umul.S
+149-5092 files not shown
+157-5148 files

MirBSD/cvs 10061EEsrc/libexec/ld.so/i386 ldasm.S

   • .text and .p2align, not .section ".text"[sic!] or .align[sic!]
     (.align can be .p2align or .balign depending on the assembler)
   • RCSID into .section .comment
VersionDeltaFile
1.4+11-9src/libexec/ld.so/i386/ldasm.S
+11-91 files

MirBSD/cvs 10061EEsrc/libexec/ld.so/sparc Makefile.inc

   this can probably go away
VersionDeltaFile
1.5+1-1src/libexec/ld.so/sparc/Makefile.inc
+1-11 files