Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Switch module solaris to native XDR.



details:   https://anonhg.NetBSD.org/src/rev/452ef786a4fa
branches:  trunk
changeset: 451807:452ef786a4fa
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed Jun 05 16:28:06 2019 +0000

description:
Switch module solaris to native XDR.

diffstat:

 external/cddl/osnet/dist/uts/common/rpc/types.h     |  132 ---
 external/cddl/osnet/dist/uts/common/rpc/xdr.c       |  676 --------------------
 external/cddl/osnet/dist/uts/common/rpc/xdr.h       |  652 -------------------
 external/cddl/osnet/dist/uts/common/rpc/xdr_array.c |  114 ---
 external/cddl/osnet/dist/uts/common/rpc/xdr_mem.c   |  208 ------
 sys/modules/solaris/Makefile.solmod                 |    4 +-
 6 files changed, 2 insertions(+), 1784 deletions(-)

diffs (truncated from 1820 to 300 lines):

diff -r 10381d5ff452 -r 452ef786a4fa external/cddl/osnet/dist/uts/common/rpc/types.h
--- a/external/cddl/osnet/dist/uts/common/rpc/types.h   Wed Jun 05 16:25:43 2019 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-/*
- * Portions of this source code were derived from Berkeley
- * 4.3 BSD under license from the Regents of the University of
- * California.
- */
-
-#ifndef _RPC_TYPES_H
-#define        _RPC_TYPES_H
-
-#pragma ident  "%Z%%M% %I%     %E% SMI"
-
-/*
- * Rpc additions to <sys/types.h>
- */
-#include <sys/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef int bool_t;
-typedef int enum_t;
-
-#if defined(_LP64) || defined(_I32LPx)
-typedef        uint32_t rpcprog_t;
-typedef        uint32_t rpcvers_t;
-typedef        uint32_t rpcproc_t;
-typedef uint32_t rpcprot_t;
-typedef uint32_t rpcport_t;
-typedef int32_t rpc_inline_t;
-#else
-typedef        unsigned long rpcprog_t;
-typedef        unsigned long rpcvers_t;
-typedef        unsigned long rpcproc_t;
-typedef unsigned long rpcprot_t;
-typedef unsigned long rpcport_t;
-typedef long rpc_inline_t;
-#endif
-
-
-#define        __dontcare__    -1
-
-#ifndef        FALSE
-#define        FALSE   (0)
-#endif
-
-#ifndef        TRUE
-#define        TRUE    (1)
-#endif
-
-#ifndef        NULL
-#define        NULL    0
-#endif
-
-#ifndef        _KERNEL
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define        mem_alloc(bsize)        malloc(bsize)
-#define        mem_free(ptr, bsize)    free(ptr)
-#else
-#include <sys/kmem.h>          /* XXX */
-
-#define        mem_alloc(bsize)        kmem_alloc(bsize, KM_SLEEP)
-#define        mem_free(ptr, bsize)    kmem_free(ptr, bsize)
-
-extern const char *rpc_tpiprim2name(uint_t prim);
-extern const char *rpc_tpierr2name(uint_t err);
-
-#if defined(DEBUG) && !defined(RPCDEBUG)
-#define        RPCDEBUG
-#endif
-
-#ifdef RPCDEBUG
-extern uint_t  rpclog;
-
-#define        RPCLOG(A, B, C) \
-       ((void)((rpclog) && (rpclog & (A)) && (printf((B), (C)), TRUE)))
-#define        RPCLOG0(A, B)   \
-       ((void)((rpclog) && (rpclog & (A)) && (printf(B), TRUE)))
-#else
-#define                RPCLOG(A, B, C)
-#define                RPCLOG0(A, B)
-#endif
-
-#endif
-
-/* messaging stuff. */
-#ifndef _KERNEL
-#ifdef __STDC__
-extern const char __nsl_dom[];
-#else
-extern char __nsl_dom[];
-#endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <sys/time.h>
-
-#endif /* _RPC_TYPES_H */
diff -r 10381d5ff452 -r 452ef786a4fa external/cddl/osnet/dist/uts/common/rpc/xdr.c
--- a/external/cddl/osnet/dist/uts/common/rpc/xdr.c     Wed Jun 05 16:25:43 2019 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,676 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*     Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T     */
-/*       All Rights Reserved   */
-
-/*
- * Portions of this source code were derived from Berkeley 4.3 BSD
- * under license from the Regents of the University of California.
- */
-
-/*
- * xdr.c, generic XDR routines implementation.
- * These are the "generic" xdr routines used to serialize and de-serialize
- * most common data items.  See xdr.h for more info on the interface to
- * xdr.
- */
-
-#include <sys/param.h>
-#include <sys/cmn_err.h>
-#include <sys/types.h>
-#include <sys/systm.h>
-
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <sys/isa_defs.h>
-
-#ifdef __NetBSD__
-__weak_alias(_solaris_xdr_int32_t,_solaris_xdr_int)
-__weak_alias(_solaris_xdr_uint32_t,_solaris_xdr_u_int)
-__weak_alias(_solaris_xdr_int64_t,_solaris_xdr_longlong_t)
-__weak_alias(_solaris_xdr_uint64_t,_solaris_xdr_u_longlong_t)
-#else
-#pragma weak xdr_int32_t = xdr_int
-#pragma weak xdr_uint32_t = xdr_u_int
-#pragma weak xdr_int64_t = xdr_longlong_t
-#pragma weak xdr_uint64_t = xdr_u_longlong_t
-#endif
-
-#if !defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
-#error "Exactly one of _BIG_ENDIAN or _LITTLE_ENDIAN must be defined"
-#elif defined(_BIG_ENDIAN) && defined(_LITTLE_ENDIAN)
-#error "Only one of _BIG_ENDIAN or _LITTLE_ENDIAN may be defined"
-#endif
-
-/*
- * constants specific to the xdr "protocol"
- */
-#define        XDR_FALSE       ((int32_t)0)
-#define        XDR_TRUE        ((int32_t)1)
-#define        LASTUNSIGNED    ((uint_t)0-1)
-
-/*
- * for unit alignment
- */
-static char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 };
-
-/*
- * Free a data structure using XDR
- * Not a filter, but a convenient utility nonetheless
- */
-void
-xdr_free(xdrproc_t proc, char *objp)
-{
-       XDR x;
-
-       x.x_op = XDR_FREE;
-       (*proc)(&x, objp);
-}
-
-/*
- * XDR nothing
- */
-bool_t
-xdr_void(void)
-{
-       return (TRUE);
-}
-
-/*
- * XDR integers
- *
- * PSARC 2003/523 Contract Private Interface
- * xdr_int
- * Changes must be reviewed by Solaris File Sharing
- * Changes must be communicated to contract-2003-523%sun.com@localhost
- */
-bool_t
-xdr_int(XDR *xdrs, int *ip)
-{
-       if (xdrs->x_op == XDR_ENCODE)
-               return (XDR_PUTINT32(xdrs, ip));
-
-       if (xdrs->x_op == XDR_DECODE)
-               return (XDR_GETINT32(xdrs, ip));
-
-       if (xdrs->x_op == XDR_FREE)
-               return (TRUE);
-
-       return (FALSE);
-}
-
-/*
- * XDR unsigned integers
- *
- * PSARC 2003/523 Contract Private Interface
- * xdr_u_int
- * Changes must be reviewed by Solaris File Sharing
- * Changes must be communicated to contract-2003-523%sun.com@localhost
- */
-bool_t
-xdr_u_int(XDR *xdrs, uint_t *up)
-{
-       if (xdrs->x_op == XDR_ENCODE)
-               return (XDR_PUTINT32(xdrs, (int32_t *)up));
-
-       if (xdrs->x_op == XDR_DECODE)
-               return (XDR_GETINT32(xdrs, (int32_t *)up));
-
-       if (xdrs->x_op == XDR_FREE)
-               return (TRUE);
-
-       return (FALSE);
-}
-
-
-#if defined(_ILP32)
-/*
- * xdr_long and xdr_u_long for binary compatability on ILP32 kernels.
- *
- * No prototypes since new code should not be using these interfaces.
- */
-bool_t
-xdr_long(XDR *xdrs, long *ip)
-{
-       return (xdr_int(xdrs, (int *)ip));
-}
-



Home | Main Index | Thread Index | Old Index