The branch stable/12 has been updated by delphij:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=254a1740cde85300587fcf4e3ad3b91453fa5d09

commit 254a1740cde85300587fcf4e3ad3b91453fa5d09
Author:     Xin LI <[email protected]>
AuthorDate: 2019-08-25 17:13:00 +0000
Commit:     Xin LI <[email protected]>
CommitDate: 2022-04-10 04:16:24 +0000

    Unify zlib instances into one.
    
    This is a cumulative update that consists 14 commits on main by
    Yoshihiro Ota and myself to stable/12:
    
    Remove gzip'ed a.out support.
    
    (cherry picked from commit d4565741c6b4b256bd30aea8eb74e8a267cf6b60)
    
    Delete unneeded #include <sys/inflate.h> from sys/mips.
    
    (cherry picked from commit 880c6c1b06d203fd6b628d313b5b2658fb7135cb)
    
    cryptodeflate: Drop z_stream zbuf.state->dummy from SDT probe.
    
    (cherry picked from commit a49818787d7cff34b9ea9878e37c1c1ba221f081)
    
    Remove kgzip and kgzldr.
    
    (cherry picked from commit 5e86bd6073a2fb107318691aaa27b7e19bd45c24)
    
    Separate kernel crc32() implementation to its own header (gsb_crc32.h) and
    rename the source to gsb_crc32.c.
    
    (cherry picked from commit f89d2072795407d7c3afff865b988e021c1451a2)
    
    Allow Kernel to link in both legacy libkern/zlib and new sys/contrib/zlib.
    
    (cherry picked from commit 0ed1d6fb00b8f22c82c3f9054c6dd16eb12469d2)
    
    if_mxge: update zlib version 1.0.4 to 1.2.12.
    
    (cherry picked from commit 1dbf944a91cfccba2c18fa273f69985cd15a5081)
    
    Expose zlib's utility functions in Z_SOLO library when building kernel.
    This allows kernel code to reuse zlib's implementation.
    
    (cherry picked from commit a15cb219c6f2b8ed16179c2fce882a2ff327b753)
    
    Update geom_uzip to use new zlib.
    
    (cherry picked from commit 2b0cabbdaeac61bdb07909cb0ec995aba36e06b0)
    
    Update bxe(4) to use new zlib.
    
    (cherry picked from commit 92e9c0608bf161df04d14160084da2d50bcad30e)
    
    Convert DDB_CTF to use newer version of ZLIB.
    
    (cherry picked from commit 22bbc4b24270ec55c267a5b4ca4530991c3da408)
    
    Convert ng_deflate to use new zlib.
    
    (cherry picked from commit 34ff55b662d62adea206cb2b77bb064110f68e6d)
    
    GZIO: Update to use zlib 1.2.12.
    
    (cherry picked from commit 4e8671dd78cc77b31c598e83354fa6722acd4e3f)
    
    Remove zlib 1.0.4 from kernel.
    
    (cherry picked from commit 21aae72489aba9f1711c51672b3003cf8d54965d)
    
    PR:             205822
    PR:             229763
---
 ObsoleteFiles.inc                                  |    8 +
 lib/libufs/Makefile                                |    3 +-
 share/man/man4/mxge.4                              |    3 +-
 stand/i386/Makefile                                |    4 -
 stand/i386/kgzldr/Makefile                         |   20 -
 stand/i386/kgzldr/Makefile.depend                  |   12 -
 stand/i386/kgzldr/boot.c                           |  129 -
 stand/i386/kgzldr/crt.s                            |   83 -
 stand/i386/kgzldr/kgzldr.h                         |   41 -
 stand/i386/kgzldr/lib.c                            |   88 -
 stand/i386/kgzldr/sio.s                            |   44 -
 stand/i386/kgzldr/start.s                          |   45 -
 stand/libsa/crc32_libkern.c                        |    2 +-
 sys/amd64/conf/NOTES                               |    1 -
 sys/arm/arm/elf_trampoline.c                       |  557 --
 .../opensolaris/uts/common/fs/zfs/zfs_ioctl.c      |    1 +
 .../contrib/opensolaris/uts/common/zmod/adler32.c  |  149 -
 .../contrib/opensolaris/uts/common/zmod/crc32.h    |  443 --
 .../contrib/opensolaris/uts/common/zmod/deflate.c  | 1742 -------
 .../contrib/opensolaris/uts/common/zmod/deflate.h  |  331 --
 .../contrib/opensolaris/uts/common/zmod/inffast.c  |  320 --
 .../contrib/opensolaris/uts/common/zmod/inffast.h  |   13 -
 .../contrib/opensolaris/uts/common/zmod/inffixed.h |   96 -
 .../contrib/opensolaris/uts/common/zmod/inflate.c  | 1395 -----
 .../contrib/opensolaris/uts/common/zmod/inflate.h  |  117 -
 .../contrib/opensolaris/uts/common/zmod/inftrees.c |  331 --
 .../contrib/opensolaris/uts/common/zmod/inftrees.h |   57 -
 .../uts/common/zmod/opensolaris_crc32.c            |  428 --
 .../contrib/opensolaris/uts/common/zmod/trees.c    | 1219 -----
 .../contrib/opensolaris/uts/common/zmod/zconf.h    |  117 -
 .../contrib/opensolaris/uts/common/zmod/zlib.h     | 1359 -----
 .../contrib/opensolaris/uts/common/zmod/zmod.c     |   46 +-
 .../opensolaris/uts/common/zmod/zmod_subr.c        |   66 -
 .../contrib/opensolaris/uts/common/zmod/zutil.c    |  324 --
 .../contrib/opensolaris/uts/common/zmod/zutil.h    |  274 -
 sys/conf/NOTES                                     |    2 +
 sys/conf/files                                     |   41 +-
 sys/conf/files.amd64                               |    1 -
 sys/conf/files.i386                                |    1 -
 sys/contrib/zlib/deflate.c                         |    6 +-
 sys/contrib/zlib/infback.c                         |    4 +-
 sys/contrib/zlib/inflate.c                         |    4 +-
 sys/contrib/zlib/zconf.h                           |   15 +-
 sys/contrib/zlib/zlib.h                            |    5 +-
 sys/contrib/zlib/zutil.h                           |    2 +-
 sys/dev/bxe/bxe.h                                  |    2 +-
 sys/dev/iscsi/icl_soft.c                           |    1 +
 sys/dev/iscsi_initiator/isc_subr.c                 |    1 +
 sys/dev/liquidio/lio_bsd.h                         |    1 +
 sys/dev/mxge/if_mxge.c                             |   23 +-
 sys/dev/usb/net/if_cdce.c                          |    1 +
 sys/dev/usb/net/if_cdceem.c                        |    1 +
 sys/dev/zlib/zcalloc.c                             |   39 +
 sys/dev/zlib/zcalloc.h                             |   14 +
 sys/dev/zlib/zlib_mod.c                            |   53 +
 sys/fs/ext2fs/ext2_csum.c                          |    1 +
 sys/fs/nandfs/nandfs_segment.c                     |    1 +
 sys/fs/nandfs/nandfs_subr.c                        |    1 +
 sys/fs/nandfs/nandfs_vfsops.c                      |    1 +
 sys/geom/part/g_part_bsd64.c                       |    1 +
 sys/geom/part/g_part_gpt.c                         |    1 +
 sys/geom/raid/md_ddf.c                             |    1 +
 sys/geom/uzip/g_uzip_zlib.c                        |   35 +-
 sys/i386/conf/NOTES                                |    1 -
 sys/kern/imgact_gzip.c                             |  394 --
 sys/kern/kern_ctf.c                                |   18 +-
 sys/kern/link_elf.c                                |    4 -
 sys/kern/link_elf_obj.c                            |    2 +-
 sys/kern/subr_compressor.c                         |    9 +-
 sys/kern/subr_inflate.c                            | 1084 ----
 sys/libkern/{crc32.c => gsb_crc32.c}               |    1 +
 sys/libkern/x86/crc32_sse42.c                      |    9 +-
 sys/libkern/zlib.c                                 | 5414 --------------------
 sys/mips/mips/elf_trampoline.c                     |    1 -
 sys/modules/geom/geom_uzip/Makefile                |    2 +-
 sys/modules/zfs/Makefile                           |    9 -
 sys/modules/zlib/Makefile                          |   19 +-
 sys/netgraph/ng_deflate.c                          |   97 +-
 sys/netinet/libalias/alias_sctp.c                  |    1 +
 sys/netinet/sctp_crc32.c                           |    1 +
 sys/netpfil/pf/pf.c                                |    1 +
 sys/opencrypto/cryptodeflate.c                     |   97 +-
 sys/opencrypto/deflate.h                           |    4 -
 sys/sys/gsb_crc32.h                                |   47 +
 sys/sys/inflate.h                                  |   53 -
 sys/sys/libkern.h                                  |   33 -
 sys/sys/zlib.h                                     | 1020 ----
 sys/sys/zutil.h                                    |  228 -
 sys/ufs/ffs/ffs_alloc.c                            |    1 +
 sys/ufs/ffs/ffs_snapshot.c                         |    1 +
 sys/ufs/ffs/ffs_subr.c                             |    1 +
 sys/ufs/ffs/ffs_vfsops.c                           |    1 +
 targets/pseudo/userland/Makefile.depend            |    1 -
 targets/pseudo/userland/misc/Makefile.depend       |    2 +-
 tests/sys/kern/Makefile                            |    1 -
 tests/sys/kern/libkern_crc32.c                     |    7 +-
 usr.sbin/Makefile.amd64                            |    1 -
 usr.sbin/Makefile.i386                             |    1 -
 usr.sbin/kgzip/Makefile                            |    9 -
 usr.sbin/kgzip/Makefile.depend                     |   15 -
 usr.sbin/kgzip/aouthdr.c                           |   81 -
 usr.sbin/kgzip/aouthdr.h                           |   61 -
 usr.sbin/kgzip/elfhdr.c                            |  166 -
 usr.sbin/kgzip/elfhdr.h                            |   86 -
 usr.sbin/kgzip/kgz.h                               |   59 -
 usr.sbin/kgzip/kgzcmp.c                            |  239 -
 usr.sbin/kgzip/kgzip.8                             |  156 -
 usr.sbin/kgzip/kgzip.c                             |  178 -
 usr.sbin/kgzip/kgzip.h                             |   53 -
 usr.sbin/kgzip/kgzld.c                             |  103 -
 usr.sbin/kgzip/xio.c                               |  123 -
 111 files changed, 423 insertions(+), 19599 deletions(-)

diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 77b01eda7e41..cdef52ad23eb 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -38,6 +38,14 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20220410: zlib 1.0.4 removed from kernel
+OLD_FILES+=/usr/include/sys/zlib.h
+OLD_FILES+=/usr/include/sys/zutil.h
+# 20220410: Remove obsolete kgzip and support files
+OLD_FILES+=usr/sbin/kgzip
+OLD_FILES+=usr/lib/kgzldr.o
+OLD_FILES+=usr/share/man/man8/kgzip.8.gz
+
 # 20211222: new clang import which bumps version from 12.0.1 to 13.0.0
 OLD_FILES+=usr/lib/clang/12.0.1/include/cuda_wrappers/algorithm
 OLD_FILES+=usr/lib/clang/12.0.1/include/cuda_wrappers/complex
diff --git a/lib/libufs/Makefile b/lib/libufs/Makefile
index 16487bebc957..78b656579ec7 100644
--- a/lib/libufs/Makefile
+++ b/lib/libufs/Makefile
@@ -5,7 +5,8 @@ LIB=    ufs
 SHLIBDIR?= /lib
 SHLIB_MAJOR=   6
 
-SRCS=  block.c cgroup.c crc32.c inode.c sblock.c type.c ffs_subr.c ffs_tables.c
+SRCS=  block.c cgroup.c gsb_crc32.c inode.c sblock.c type.c ffs_subr.c
+SRCS+= ffs_tables.c
 INCS=  libufs.h
 
 MAN=   bread.3 cgread.3 libufs.3 sbread.3 ufs_disk_close.3
diff --git a/share/man/man4/mxge.4 b/share/man/man4/mxge.4
index 3e54062fd212..675ee1473ac3 100644
--- a/share/man/man4/mxge.4
+++ b/share/man/man4/mxge.4
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 13, 2008
+.Dd August 2, 2019
 .Dt MXGE 4
 .Os
 .Sh NAME
@@ -43,6 +43,7 @@ place the following lines in your
 kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "device firmware"
+.Cd "device zlib"
 .Cd "device mxge"
 .Ed
 .Pp
diff --git a/stand/i386/Makefile b/stand/i386/Makefile
index 2b628d408d1e..9aa33462f309 100644
--- a/stand/i386/Makefile
+++ b/stand/i386/Makefile
@@ -21,10 +21,6 @@ SUBDIR.yes+= loader_simp
 # special boot programs, 'self-extracting boot2+loader'
 SUBDIR.yes+=   pxeldr
 
-.if ${MACHINE_CPUARCH} == "i386"
-SUBDIR.yes+=   kgzldr
-.endif
-
 SUBDIR.${MK_LOADER_ZFS}+=      zfsboot gptzfsboot
 
 SUBDIR_DEPEND_pxeldr+= loader_${LOADER_DEFAULT_INTERP}
diff --git a/stand/i386/kgzldr/Makefile b/stand/i386/kgzldr/Makefile
deleted file mode 100644
index 281f1c9f1ba0..000000000000
--- a/stand/i386/kgzldr/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.init.mk>
-
-PROG=  kgzldr.o
-STRIP=
-BINMODE=${LIBMODE}
-BINDIR=        ${LIBDIR}
-
-SRCS=  start.s boot.c subr_inflate.c lib.c crt.s sio.s
-CFLAGS=        -Os
-CFLAGS+=-DKZIP
-NO_SHARED=
-LDFLAGS+=-Wl,-r
-.PATH: ${SYSDIR}/kern
-
-BOOT_COMCONSOLE_PORT?= 0x3f8
-AFLAGS+=--defsym SIO_PRT=${BOOT_COMCONSOLE_PORT}
-
-.include <bsd.prog.mk>
diff --git a/stand/i386/kgzldr/Makefile.depend 
b/stand/i386/kgzldr/Makefile.depend
deleted file mode 100644
index 79506ce16b79..000000000000
--- a/stand/i386/kgzldr/Makefile.depend
+++ /dev/null
@@ -1,12 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
-       include \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-.endif
diff --git a/stand/i386/kgzldr/boot.c b/stand/i386/kgzldr/boot.c
deleted file mode 100644
index 45ed2ee62e16..000000000000
--- a/stand/i386/kgzldr/boot.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*-
- * Copyright (c) 1999 Global Technology Associates, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/reboot.h>
-#include <sys/inflate.h>
-
-#include "kgzldr.h"
-
-#define KGZ_HEAD   0xa          /* leading bytes to ignore */
-#define KGZ_TAIL   0x8          /* trailing bytes to ignore */
-
-#define E_FMT  1               /* Error: Invalid format */
-#define E_MEM  2               /* Error: Out of memory */
-
-struct kgz_hdr {
-    char       ident[4];       /* identification */
-    uint32_t   dload;          /* decoded image load address */
-    uint32_t   dsize;          /* decoded image size */
-    uint32_t   isize;          /* image size in memory */
-    uint32_t   entry;          /* program entry point */
-    uint32_t   nsize;          /* encoded image size */
-};
-extern struct kgz_hdr kgz;     /* header */
-extern uint8_t kgz_ndata[];    /* encoded image */
-
-static const char *const msg[] = {
-    "done",
-    "invalid format",
-    "out of memory"
-};
-
-static const u_char *ip;        /* input pointer */
-static u_char *op;              /* output pointer */
-
-static struct inflate infl;    /* inflate() parameters */
-
-static int decode(void);
-static int input(void *);
-static int output(void *, u_char *, u_long);
-
-/*
- * Uncompress and boot a kernel.
- */
-int
-boot(int howto)
-{
-    int err;
-
-    kgz_con = howto & RB_SERIAL ? KGZ_SIO : KGZ_CRT;
-    putstr("Uncompressing ... ");
-    err = decode();
-    putstr(msg[err]);
-    putstr("\n");
-    if (err) {
-        putstr("System halted");
-       for (;;)
-           ;
-    }
-    return err;
-}
-
-/*
- * Interface with inflate() to uncompress the data.
- */
-static int
-decode(void)
-{
-    static u_char slide[GZ_WSIZE];
-    int err;
-
-    ip = kgz_ndata + KGZ_HEAD;
-    op = (u_char *)kgz.dload;
-    infl.gz_input = input;
-    infl.gz_output = output;
-    infl.gz_slide = slide;
-    err = inflate(&infl);
-    return err ? err == 3 ? E_MEM : E_FMT : 0;
-}
-
-/*
- * Read a byte.
- */
-static int
-input(void *dummy)
-{
-    if ((size_t)(ip - kgz_ndata) + KGZ_TAIL > kgz.nsize)
-        return GZ_EOF;
-    return *ip++;
-}
-
-/*
- * Write some bytes.
- */
-static int
-output(void *dummy, u_char * ptr, u_long len)
-{
-    if (op - (u_char *)kgz.dload + len > kgz.dsize)
-        return -1;
-    while (len--)
-        *op++ = *ptr++;
-    return 0;
-}
diff --git a/stand/i386/kgzldr/crt.s b/stand/i386/kgzldr/crt.s
deleted file mode 100644
index cfb479fd2d84..000000000000
--- a/stand/i386/kgzldr/crt.s
+++ /dev/null
@@ -1,83 +0,0 @@
-#
-# Copyright (c) 1999 Global Technology Associates, Inc.
-# 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.
-#
-#      From: btx.s 1.10 1999/02/25 16:27:41 rnordier
-# $FreeBSD$
-#
-
-# Screen defaults and assumptions.
-
-               .set SCR_MAT,0x7                # Mode/attribute
-               .set SCR_COL,0x50               # Columns per row
-               .set SCR_ROW,0x19               # Rows per screen
-
-# BIOS Data Area locations.
-
-               .set BDA_SCR,0x449              # Video mode
-               .set BDA_POS,0x450              # Cursor position
-
-               .globl crt_putchr
-
-# void crt_putchr(int c)
-
-crt_putchr:    movb 0x4(%esp,1),%al            # Get character
-               pusha                           # Save
-               xorl %ecx,%ecx                  # Zero for loops
-               movb $SCR_MAT,%ah               # Mode/attribute
-               movl $BDA_POS,%ebx              # BDA pointer
-               movw (%ebx),%dx                 # Cursor position
-               movl $0xb8000,%edi              # Regen buffer (color)
-               cmpb %ah,BDA_SCR-BDA_POS(%ebx)  # Mono mode?
-               jne crt_putchr.1                # No
-               xorw %di,%di                    # Regen buffer (mono)
-crt_putchr.1:  cmpb $0xa,%al                   # New line?
-               je crt_putchr.2                 # Yes
-               xchgl %eax,%ecx                 # Save char
-               movb $SCR_COL,%al               # Columns per row
-               mulb %dh                        #  * row position
-               addb %dl,%al                    #  + column
-               adcb $0x0,%ah                   #  position
-               shll %eax                       #  * 2
-               xchgl %eax,%ecx                 # Swap char, offset
-               movw %ax,(%edi,%ecx,1)          # Write attr:char
-               incl %edx                       # Bump cursor
-               cmpb $SCR_COL,%dl               # Beyond row?
-               jb crt_putchr.3                 # No
-crt_putchr.2:  xorb %dl,%dl                    # Zero column
-               incb %dh                        # Bump row
-crt_putchr.3:  cmpb $SCR_ROW,%dh               # Beyond screen?
-               jb crt_putchr.4                 # No
-               leal 2*SCR_COL(%edi),%esi       # New top line
-               movw $(SCR_ROW-1)*SCR_COL/2,%cx # Words to move
-               rep                             # Scroll
-               movsl                           #  screen
-               movb $' ',%al                   # Space
-               movb $SCR_COL,%cl               # Columns to clear
-               rep                             # Clear
-               stosw                           #  line
-               movb $SCR_ROW-1,%dh             # Bottom line
-crt_putchr.4:  movw %dx,(%ebx)                 # Update position
-               popa                            # Restore
-               ret                             # To caller
diff --git a/stand/i386/kgzldr/kgzldr.h b/stand/i386/kgzldr/kgzldr.h
deleted file mode 100644
index 5cd5b44b6005..000000000000
--- a/stand/i386/kgzldr/kgzldr.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 1999 Global Technology Associates, Inc.
- * 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$
- */
-
-#define KGZ_CRT         0x1            /* Video console */
-#define KGZ_SIO  0x2           /* Serial console */
-
-extern int kgz_con;
-
-int boot(int);
-
-unsigned char *kzipmalloc(int);
-void kzipfree(void *);
-void putstr(const char *);
-
-void crt_putchr(int);
-void sio_putchr(int);
diff --git a/stand/i386/kgzldr/lib.c b/stand/i386/kgzldr/lib.c
deleted file mode 100644
index 538875b510e5..000000000000
--- a/stand/i386/kgzldr/lib.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * Copyright (c) 1999 Global Technology Associates, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <stddef.h>
-
-#include "kgzldr.h"
-
-#define MEMSIZ  0x8000         /* Memory pool size */
-
-int kgz_con;                   /* Console control */
-
-static size_t memtot;          /* Memory allocated: bytes */
-static u_int memcnt;           /* Memory allocated: blocks */
-
-/*
- * Library functions required by inflate().
- */
-
-/*
- * Allocate memory block.
- */
-unsigned char *
-kzipmalloc(int size)
-{
-    static u_char mem[MEMSIZ];
-    void *ptr;
-
-    if (memtot + size > MEMSIZ)
-        return NULL;
-    ptr = mem + memtot;
-    memtot += size;
-    memcnt++;
-    return ptr;
-}
-
-/*
- * Free allocated memory block.
- */
-void
-kzipfree(void *ptr)
-{
-    memcnt--;
-    if (!memcnt)
-        memtot = 0;
-}
-
-/*
- * Write a string to the console.
- */
-void
-putstr(const char *str)
-{
-    int c;
-
-    while ((c = *str++)) {
-        if (kgz_con & KGZ_CRT)
-            crt_putchr(c);
-        if (kgz_con & KGZ_SIO)
-            sio_putchr(c);
-    }
-}
diff --git a/stand/i386/kgzldr/sio.s b/stand/i386/kgzldr/sio.s
deleted file mode 100644
index ff174eb0b71b..000000000000
--- a/stand/i386/kgzldr/sio.s
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright (c) 1999 Global Technology Associates, Inc.
-# 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.
-#
-#      From: sio.s 1.3 1999/01/10 14:48:03 rnordier
-# $FreeBSD$
-#
-
-               .globl sio_putchr
-
-# void sio_putchr(int c)
-
-sio_putchr:    movw $SIO_PRT+0x5,%dx           # Line status reg
-               xor %ecx,%ecx                   # Timeout
-               movb $0x40,%ch                  #  counter
-sio_putchr.1:  inb %dx,%al                     # Transmitter
-               testb $0x20,%al                 #  buffer empty?
-               loopz sio_putchr.1              # No
-               jz sio_putchr.2                 # If timeout
-               movb 0x4(%esp,1),%al            # Get character
-               subb $0x5,%dl                   # Transmitter hold reg
-               outb %al,%dx                    # Write character
-sio_putchr.2:  ret                             # To caller
diff --git a/stand/i386/kgzldr/start.s b/stand/i386/kgzldr/start.s
deleted file mode 100644
index 550fa526d946..000000000000
--- a/stand/i386/kgzldr/start.s
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# Copyright (c) 1999 Global Technology Associates, Inc.
-# 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$
-#
-
-               .set entry,0x10                 # kgz.entry
-
-               .globl _start
-
-# C startup code for kgzldr.
-
-_start:                cld                             # String ops inc
-               movl $_edata,%edi               # Start of bss
-               movl $_end,%ecx                 # Compute
-               subl %edi,%ecx                  #  size
-               xorl %eax,%eax                  # Zero
-               rep                             # Clear
-               stosb                           #  bss
-               pushl 0x4(%esp)                 # Pass howto flags
-               call boot                       # Call C code
-               popl %ecx                       # Clear stack
-               jmp *kgz+entry                  # To loaded code
diff --git a/stand/libsa/crc32_libkern.c b/stand/libsa/crc32_libkern.c
index 995815294d58..d2bd738d4c20 100644
--- a/stand/libsa/crc32_libkern.c
+++ b/stand/libsa/crc32_libkern.c
@@ -1,3 +1,3 @@
 /* $FreeBSD$ */
 
-#include "../../sys/libkern/crc32.c"
+#include "../../sys/libkern/gsb_crc32.c"
diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES
index abf4397787cd..d0f3e5ad6b1c 100644
--- a/sys/amd64/conf/NOTES
+++ b/sys/amd64/conf/NOTES
@@ -127,7 +127,6 @@ device              nvram           # Access to rtc cmos 
via /dev/nvram
 device         speaker         #Play IBM BASIC-style noises out your speaker
 hint.speaker.0.at="isa"
 hint.speaker.0.port="0x61"
-device         gzip            #Exec gzipped a.out's.  REQUIRES COMPAT_AOUT!
 
 
 #####################################################################
diff --git a/sys/arm/arm/elf_trampoline.c b/sys/arm/arm/elf_trampoline.c
deleted file mode 100644
index ea33ba82dd6e..000000000000
--- a/sys/arm/arm/elf_trampoline.c
+++ /dev/null
@@ -1,557 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
- * Copyright (c) 2005 Olivier Houchard.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Since we are compiled outside of the normal kernel build process, we
- * need to include opt_global.h manually.
- */
-#include "opt_global.h"
-#include "opt_kernname.h"
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-#include <machine/asm.h>
-#include <sys/param.h>
-#include <sys/elf32.h>
-#include <sys/inflate.h>
-#include <machine/elf.h>
-#include <machine/pte-v4.h>
-#include <machine/cpufunc.h>
-#include <machine/armreg.h>
-#include <machine/cpu.h>
-#include <machine/vmparam.h>   /* For KERNVIRTADDR */
-
-#if __ARM_ARCH >= 6
-#error "elf_trampline is not supported on ARMv6/v7 platforms"
-#endif
-extern char kernel_start[];
-extern char kernel_end[];
-
-extern void *_end;
-
-void _start(void);
-void __start(void);
-void __startC(unsigned r0, unsigned r1, unsigned r2, unsigned r3);
-
-extern void do_call(void *, void *, void *, int);
-
-#define GZ_HEAD        0xa
-
-#if defined(CPU_ARM9E)
-#define cpu_idcache_wbinv_all  armv5_ec_idcache_wbinv_all
-extern void armv5_ec_idcache_wbinv_all(void);
-#endif
-#if defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY)
-#define cpu_l2cache_wbinv_all  sheeva_l2cache_wbinv_all
-extern void sheeva_l2cache_wbinv_all(void);
-#else
-#define cpu_l2cache_wbinv_all()
-#endif
-
-/*
- * Boot parameters
- */
-static struct arm_boot_params s_boot_params;
-
-static __inline void *
-memcpy(void *dst, const void *src, int len)
-{
-       const char *s = src;
-       char *d = dst;
-
-       while (len) {
-               if (0 && len >= 4 && !((vm_offset_t)d & 3) &&
-                   !((vm_offset_t)s & 3)) {
-                       *(uint32_t *)d = *(uint32_t *)s;
-                       s += 4;
-                       d += 4;
-                       len -= 4;
-               } else {
-                       *d++ = *s++;
-                       len--;
-               }
-       }
-       return (dst);
-}
-
-static __inline void
-bzero(void *addr, int count)
-{
-       char *tmp = (char *)addr;
-
-       while (count > 0) {
-               if (count >= 4 && !((vm_offset_t)tmp & 3)) {
-                       *(uint32_t *)tmp = 0;
-                       tmp += 4;
-                       count -= 4;
-               } else {
-                       *tmp = 0;
-                       tmp++;
-                       count--;
-               }
-       }
-}
-
-void
-_startC(unsigned r0, unsigned r1, unsigned r2, unsigned r3)
-{
-       int tmp1;
-       unsigned int sp = ((unsigned int)&_end & ~3) + 4;
-       unsigned int pc, kernphysaddr;
-
-       s_boot_params.abp_r0 = r0;
-       s_boot_params.abp_r1 = r1;
-       s_boot_params.abp_r2 = r2;
-       s_boot_params.abp_r3 = r3;
-        
-       /*
-        * Figure out the physical address the kernel was loaded at.  This
-        * assumes the entry point (this code right here) is in the first page,
-        * which will always be the case for this trampoline code.
-        */
-       __asm __volatile("mov %0, pc\n"
-           : "=r" (pc));
-       kernphysaddr = pc & ~PAGE_MASK;
-
-#if defined(FLASHADDR) && defined(PHYSADDR) && defined(LOADERRAMADDR)
-       if ((FLASHADDR > LOADERRAMADDR && pc >= FLASHADDR) ||
-           (FLASHADDR < LOADERRAMADDR && pc < LOADERRAMADDR)) {
-               /*
-                * We're running from flash, so just copy the whole thing
-                * from flash to memory.
-                * This is far from optimal, we could do the relocation or
-                * the unzipping directly from flash to memory to avoid this
-                * needless copy, but it would require to know the flash
-                * physical address.
-                */
-               unsigned int target_addr;
-               unsigned int tmp_sp;
-               uint32_t src_addr = (uint32_t)&_start - PHYSADDR + FLASHADDR
-                   + (pc - FLASHADDR - ((uint32_t)&_startC - PHYSADDR)) & 
0xfffff000;
-
-               target_addr = (unsigned int)&_start - PHYSADDR + LOADERRAMADDR;
-               tmp_sp = target_addr + 0x100000 +
-                   (unsigned int)&_end - (unsigned int)&_start;
-               memcpy((char *)target_addr, (char *)src_addr,
-                   (unsigned int)&_end - (unsigned int)&_start);
-               /* Temporary set the sp and jump to the new location. */
-               __asm __volatile(
-                   "mov sp, %1\n"
-                   "mov r0, %2\n"
-                   "mov r1, %3\n"
-                   "mov r2, %4\n"
-                   "mov r3, %5\n"
-                   "mov pc, %0\n"
-                   : : "r" (target_addr), "r" (tmp_sp),
-                   "r" (s_boot_params.abp_r0), "r" (s_boot_params.abp_r1),
-                   "r" (s_boot_params.abp_r2), "r" (s_boot_params.abp_r3)
-                   : "r0", "r1", "r2", "r3");
-
-       }
-#endif
-#ifdef KZIP
-       sp += KERNSIZE + 0x100;
-       sp &= ~(L1_TABLE_SIZE - 1);
-       sp += 2 * L1_TABLE_SIZE;
-#endif
-       sp += 1024 * 1024; /* Should be enough for a stack */
-
-       __asm __volatile("adr %0, 2f\n"
-                        "bic %0, %0, #0xff000000\n"
-                        "and %1, %1, #0xff000000\n"
-                        "orr %0, %0, %1\n"
-                        "mrc p15, 0, %1, c1, c0, 0\n" /* CP15_SCTLR(%1)*/
-                        "bic %1, %1, #1\n" /* Disable MMU */
-                        "orr %1, %1, #(4 | 8)\n" /* Add DC enable,
-                                                    WBUF enable */
-                        "orr %1, %1, #0x1000\n" /* Add IC enable */
-                        "orr %1, %1, #(0x800)\n" /* BPRD enable */
-
*** 20556 LINES SKIPPED ***

Reply via email to