Split XDR into separate kernel module. Make krpc depend on xdr.

Reviewed by:	rmacklem
Differential Revision:	https://reviews.freebsd.org/D24408
This commit is contained in:
glebius 2020-04-17 06:04:20 +00:00
parent f8b1190578
commit d1bbca2209
7 changed files with 40 additions and 14 deletions

View File

@ -4983,9 +4983,9 @@ xen/xenbus/xenbusb.c optional xenhvm
xen/xenbus/xenbusb_front.c optional xenhvm
xen/xenbus/xenbusb_back.c optional xenhvm
xen/xenmem/xenmem_if.m optional xenhvm
xdr/xdr.c optional krpc | nfslockd | nfscl | nfsd
xdr/xdr_array.c optional krpc | nfslockd | nfscl | nfsd
xdr/xdr_mbuf.c optional krpc | nfslockd | nfscl | nfsd
xdr/xdr_mem.c optional krpc | nfslockd | nfscl | nfsd
xdr/xdr_reference.c optional krpc | nfslockd | nfscl | nfsd
xdr/xdr_sizeof.c optional krpc | nfslockd | nfscl | nfsd
xdr/xdr.c optional xdr | krpc | nfslockd | nfscl | nfsd
xdr/xdr_array.c optional xdr | krpc | nfslockd | nfscl | nfsd
xdr/xdr_mbuf.c optional xdr | krpc | nfslockd | nfscl | nfsd
xdr/xdr_mem.c optional xdr | krpc | nfslockd | nfscl | nfsd
xdr/xdr_reference.c optional xdr | krpc | nfslockd | nfscl | nfsd
xdr/xdr_sizeof.c optional xdr | krpc | nfslockd | nfscl | nfsd

View File

@ -469,6 +469,7 @@ TCP_RFC7413_MAX_KEYS opt_inet.h
TCP_RFC7413_MAX_PSKS opt_inet.h
TCP_SIGNATURE opt_ipsec.h
VLAN_ARRAY opt_vlan.h
XDR
XBONEHACK
#

View File

@ -385,6 +385,7 @@ SUBDIR= \
${_wpi} \
${_wpifw} \
${_x86bios} \
xdr \
xl \
xz \
zlib

View File

@ -1,6 +1,6 @@
# $FreeBSD$
.PATH: ${SRCTOP}/sys/rpc ${SRCTOP}/sys/xdr
.PATH: ${SRCTOP}/sys/rpc
KMOD= krpc
SRCS= auth_none.c \
auth_unix.c \
@ -23,13 +23,6 @@ SRCS= auth_none.c \
svc_generic.c \
svc_vc.c \
SRCS+= xdr.c \
xdr_array.c \
xdr_mbuf.c \
xdr_mem.c \
xdr_reference.c \
xdr_sizeof.c
SRCS+= opt_inet6.h
.include <bsd.kmod.mk>

12
sys/modules/xdr/Makefile Normal file
View File

@ -0,0 +1,12 @@
# $FreeBSD$
.PATH: ${SRCTOP}/sys/xdr
KMOD= xdr
SRCS= xdr.c \
xdr_array.c \
xdr_mbuf.c \
xdr_mem.c \
xdr_reference.c \
xdr_sizeof.c
.include <bsd.kmod.mk>

View File

@ -882,3 +882,4 @@ DECLARE_MODULE(krpc, krpc_mod, SI_SUB_VFS, SI_ORDER_ANY);
/* So that loader and kldload(2) can find us, wherever we are.. */
MODULE_VERSION(krpc, 1);
MODULE_DEPEND(krpc, xdr, 1, 1, 1);

View File

@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <rpc/rpc.h>
#include <rpc/rpc_com.h>
@ -836,3 +837,20 @@ xdr_u_longlong_t(XDR *xdrs, u_longlong_t *ullp)
*/
return (xdr_uint64_t(xdrs, (uint64_t *)ullp));
}
/*
* Kernel module glue
*/
static int
xdr_modevent(module_t mod, int type, void *data)
{
return (0);
}
static moduledata_t xdr_mod = {
"xdr",
xdr_modevent,
NULL,
};
DECLARE_MODULE(xdr, xdr_mod, SI_SUB_VFS, SI_ORDER_ANY);
MODULE_VERSION(xdr, 1);